/* === 安心 - 心理健康平台 === */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #6c5ce7;
  --primary-light: #a29bfe;
  --primary-dark: #5a4bd1;
  --accent: #fd79a8;
  --bg: #f8f9fe;
  --card: #ffffff;
  --text: #2d3436;
  --text-light: #636e72;
  --border: #e8e8f0;
  --success: #00b894;
  --warning: #fdcb6e;
  --danger: #e17055;
  --radius: 16px;
  --shadow: 0 2px 20px rgba(108,92,231,0.08);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* === Navbar === */
.navbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.navbar .container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  height: 60px;
  gap: 8px;
}
.navbar .logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  margin-right: 24px;
  white-space: nowrap;
}
.navbar .logo:hover { color: var(--primary-dark); }
.navbar .nav-links {
  display: flex;
  gap: 4px;
  flex: 1;
}
.navbar .nav-links a {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-light);
  transition: all 0.2s;
  white-space: nowrap;
}
.navbar .nav-links a:hover,
.navbar .nav-links a.active {
  background: var(--bg);
  color: var(--primary);
}
.navbar .nav-right {
  display: flex;
  gap: 8px;
  align-items: center;
}
.navbar .nav-right a {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
}

/* === Hero Section === */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #a29bfe 50%, #74b9ff 100%);
  padding: 80px 24px;
  text-align: center;
  color: white;
}
.hero-content { max-width: 700px; margin: 0 auto; }
.hero-title { font-size: 42px; font-weight: 800; margin-bottom: 16px; line-height: 1.2; }
.hero-subtitle { font-size: 18px; opacity: 0.9; margin-bottom: 32px; line-height: 1.5; }
.hero-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* === Buttons === */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 12px 28px; border-radius: 12px; font-size: 15px;
  font-weight: 600; border: none; cursor: pointer;
  transition: all 0.2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary.btn-lg { padding: 14px 36px; font-size: 16px; }
.btn-primary.btn-block { width: 100%; justify-content: center; }
.btn-outline { background: transparent; border: 2px solid; }
.btn-outline.btn-lg { padding: 14px 36px; font-size: 16px; }
.btn-outline.btn-block { width: 100%; justify-content: center; }
.hero .btn-outline { border-color: rgba(255,255,255,0.8); color: white; }
.hero .btn-outline:hover { background: rgba(255,255,255,0.15); }

.btn-next, .btn-prev { padding: 10px 20px; border-radius: 10px; font-size: 14px; }
.btn-next { background: var(--primary); color: white; }
.btn-prev { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-restart { background: var(--bg); color: var(--text-light); border: 1px solid var(--border); padding: 8px 16px; border-radius: 8px; font-size: 13px; }
.btn-submit { background: var(--primary); color: white; padding: 12px 32px; border-radius: 12px; font-size: 15px; font-weight: 600; border: none; cursor: pointer; }
.btn-save { background: var(--primary); color: white; padding: 10px 24px; border-radius: 10px; font-size: 14px; border: none; cursor: pointer; }
.btn-add { background: var(--success); color: white; padding: 8px 16px; border-radius: 8px; font-size: 13px; border: none; cursor: pointer; }

/* === Sections === */
.section { padding: 64px 24px; }
.section:nth-child(even) { background: var(--card); }
.container { max-width: 1200px; margin: 0 auto; }
.container.result-page { max-width: 800px; }

/* === Section Titles === */
.section-title { text-align: center; font-size: 28px; font-weight: 700; margin-bottom: 40px; color: var(--text); }

/* === Service Cards === */
.services { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.service-card {
  background: var(--card); border-radius: var(--radius); padding: 32px 24px;
  text-align: center; box-shadow: var(--shadow); transition: all 0.3s;
  border: 1px solid var(--border);
}
.service-card:hover { transform: translateY(-4px); box-shadow: 0 8px 30px rgba(108,92,231,0.12); }
.service-card .icon { font-size: 40px; margin-bottom: 16px; display: block; }
.service-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.service-card p { font-size: 14px; color: var(--text-light); margin-bottom: 16px; line-height: 1.5; }
.service-card .link { color: var(--primary); font-weight: 600; font-size: 14px; }

/* === Testimonials === */
.testimonials { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.testimonial-card {
  background: var(--card); border-radius: var(--radius); padding: 24px;
  border: 1px solid var(--border);
}
.testimonial-card .text { font-size: 14px; color: var(--text-light); margin-bottom: 16px; font-style: italic; line-height: 1.6; }
.testimonial-card .author { font-size: 13px; font-weight: 600; color: var(--text); }

/* === CTA Section === */
.cta {
  text-align: center; padding: 80px 24px;
  background: linear-gradient(135deg, var(--primary), #6c5ce7);
  color: white;
}
.cta h2 { font-size: 32px; font-weight: 700; margin-bottom: 12px; }
.cta p { font-size: 16px; opacity: 0.9; margin-bottom: 24px; }
.cta .btn-outline { border-color: white; color: white; }

/* === Footer === */
.footer { background: #2d3436; color: #b2bec3; padding: 48px 24px 24px; }
.footer .container { max-width: 1200px; margin: 0 auto; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; margin-bottom: 32px; }
.footer h4 { color: white; font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.footer p { font-size: 13px; line-height: 1.6; }
.footer ul { list-style: none; }
.footer ul li { margin-bottom: 8px; }
.footer ul li a { color: #b2bec3; font-size: 13px; }
.footer ul li a:hover { color: white; }

/* === Auth Pages === */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f8f9fe, #e8e8f0);
  padding: 24px;
}
.auth-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 40px 32px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 4px 30px rgba(0,0,0,0.06);
}
.auth-header { text-align: center; margin-bottom: 32px; }
.auth-header .auth-icon { font-size: 48px; margin-bottom: 12px; display: block; }
.auth-header h1 { font-size: 24px; font-weight: 700; }
.auth-header p { font-size: 14px; color: var(--text-light); margin-top: 4px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-footer { text-align: center; margin-top: 24px; font-size: 14px; color: var(--text-light); }

/* === Forms === */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 14px; font-weight: 500; color: var(--text); }
.form-group input, .form-group select, .form-group textarea {
  padding: 12px 16px; border-radius: 10px; border: 1px solid var(--border);
  font-size: 14px; background: var(--bg); transition: all 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(108,92,231,0.1);
}

/* === Alert === */
.alert { padding: 12px 16px; border-radius: 10px; font-size: 14px; margin-bottom: 16px; }
.alert-error { background: #ffeaa7; color: #d63031; border: 1px solid #fdcb6e; }

/* === MBTI Test === */
.mbti-page { max-width: 700px; margin: 40px auto; padding: 0 24px; }
.mbti-question {
  background: var(--card); border-radius: var(--radius); padding: 32px;
  box-shadow: var(--shadow); text-align: center;
}
.mbti-question .progress { font-size: 14px; color: var(--text-light); margin-bottom: 24px; }
.mbti-question h2 { font-size: 20px; font-weight: 600; margin-bottom: 32px; line-height: 1.4; }
.mbti-options { display: flex; flex-direction: column; gap: 12px; }
.mbti-options button {
  padding: 16px 24px; border-radius: 12px; border: 2px solid var(--border);
  background: var(--card); font-size: 15px; cursor: pointer;
  transition: all 0.2s;
}
.mbti-options button:hover { border-color: var(--primary); background: #f0edff; }
.mbti-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }

/* === Bazi === */
.bazi-container { max-width: 700px; margin: 40px auto; padding: 0 24px; }
.bazi-intro { text-align: center; margin-bottom: 32px; }
.bazi-intro h2 { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.bazi-intro p { font-size: 14px; color: var(--text-light); }
.bazi-form {
  background: var(--card); border-radius: var(--radius); padding: 32px;
  box-shadow: var(--shadow);
}
.bazi-form .form-group { margin-bottom: 16px; }
.bazi-table { width: 100%; border-collapse: collapse; margin-top: 24px; }
.bazi-table th, .bazi-table td { padding: 10px 12px; border: 1px solid var(--border); text-align: center; font-size: 14px; }
.bazi-table th { background: var(--bg); font-weight: 600; }
.stem-cell { font-weight: 700; color: var(--primary); }
.branch-cell { color: var(--accent); }

/* === SCL-90 Test === */
.test-intro { max-width: 700px; margin: 40px auto; padding: 0 24px; text-align: center; }
.test-intro h2 { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.test-intro p { font-size: 14px; color: var(--text-light); margin-bottom: 24px; }

/* === Result Page === */
.result-page { padding: 40px 24px; }
.result-card {
  background: var(--card); border-radius: var(--radius); padding: 32px;
  box-shadow: var(--shadow); margin-bottom: 24px;
}
.result-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.dimension-chart { display: flex; flex-direction: column; gap: 12px; }
.dim-item { display: flex; align-items: center; gap: 12px; }
.dim-label { font-size: 13px; width: 100px; flex-shrink: 0; text-align: right; }
.dim-bar { flex: 1; height: 24px; background: var(--bg); border-radius: 12px; overflow: hidden; }
.dim-bar-fill { height: 100%; background: linear-gradient(90deg, var(--primary-light), var(--primary)); border-radius: 12px; transition: width 1s ease; }
.dim-value { font-size: 13px; width: 40px; text-align: left; font-weight: 600; }

/* === Diary Page === */
.diary-page { max-width: 700px; margin: 40px auto; padding: 0 24px; }
.diary-header { text-align: center; margin-bottom: 32px; }
.diary-quote {
  background: var(--card); border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow); text-align: center; font-style: italic;
  color: var(--text-light); margin-bottom: 24px;
}
.diary-icon { font-size: 36px; margin-bottom: 8px; display: block; }

/* === About === */
.about.section { padding: 64px 24px; }
.about-content { max-width: 700px; margin: 0 auto; text-align: center; }
.about-content p { font-size: 15px; color: var(--text-light); line-height: 1.7; margin-bottom: 16px; }
.about-stats { display: flex; justify-content: center; gap: 48px; margin-top: 32px; }

/* === Admin === */
.admin-layout { display: flex; min-height: calc(100vh - 60px); }
.admin-sidebar { width: 220px; background: var(--card); border-right: 1px solid var(--border); padding: 24px 16px; }
.admin-sidebar a { display: block; padding: 10px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 4px; }
.admin-sidebar a:hover, .admin-sidebar a.active { background: var(--bg); color: var(--primary); }
.admin-main { flex: 1; padding: 24px; overflow-x: auto; }
.admin-main h2 { font-size: 20px; font-weight: 700; margin-bottom: 16px; }

/* === Tables === */
.data-table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; }
.data-table th { background: var(--bg); padding: 12px 16px; text-align: left; font-size: 13px; font-weight: 600; color: var(--text-light); }
.data-table td { padding: 12px 16px; border-top: 1px solid var(--border); font-size: 14px; }

/* === Misc === */
.chart-box { background: var(--card); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.chart-row { display: flex; gap: 24px; margin-bottom: 24px; flex-wrap: wrap; }
.count { font-size: 24px; font-weight: 700; color: var(--primary); }
.del-btn { background: none; border: none; color: var(--danger); cursor: pointer; padding: 4px 8px; border-radius: 4px; font-size: 13px; }
.del-btn:hover { background: #ffeaa7; }

/* === Back to Top === */
.back-to-top {
  position: fixed; bottom: 24px; right: 24px; width: 44px; height: 44px;
  border-radius: 50%; background: var(--primary); color: white; border: none;
  font-size: 20px; cursor: pointer; box-shadow: 0 4px 12px rgba(108,92,231,0.3);
  display: flex; align-items: center; justify-content: center; z-index: 99;
  transition: all 0.2s;
}
.back-to-top:hover { transform: translateY(-2px); }

/* === Responsive === */
@media (max-width: 768px) {
  .navbar .container { flex-wrap: wrap; height: auto; padding: 12px 0; }
  .navbar .logo { margin-right: auto; }
  .navbar .nav-links { order: 3; width: 100%; overflow-x: auto; padding: 8px 0; }
  .hero-title { font-size: 28px; }
  .hero { padding: 48px 24px; }
  .section { padding: 40px 24px; }
  .services { grid-template-columns: 1fr; }
  .testimonials { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; display: flex; overflow-x: auto; padding: 12px 16px; }
  .admin-sidebar a { white-space: nowrap; }
  .daYun-table { overflow-x: auto; }
}
