/* ==========================================================
   守护青春 · 青少年反暴力教育平台  样式表
   主色：蓝绿 #2EB6A6  辅助：暖橙 #FF8C42
   字体使用系统字体栈，零外链依赖，离线可用
   ========================================================== */

/* ---------- 全局变量 ---------- */
:root {
  --teal: #2EB6A6;
  --teal-dark: #23907f;
  --teal-light: #e6f7f4;
  --orange: #FF8C42;
  --orange-dark: #f0721f;
  --orange-light: #fff1e6;
  --red: #E8534B;
  --red-light: #fdecea;
  --yellow: #F5B841;
  --ink: #2b3a42;
  --ink-soft: #5a6b73;
  --line: #e4ecea;
  --bg: #f6faf9;
  --white: #ffffff;
  --shadow-sm: 0 2px 8px rgba(46, 182, 166, 0.08);
  --shadow-md: 0 8px 24px rgba(43, 58, 66, 0.10);
  --shadow-lg: 0 14px 40px rgba(43, 58, 66, 0.16);
  --radius: 16px;
  --radius-lg: 24px;
  --nav-h: 64px;
}

/* ---------- 基础重置 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
               "Source Han Sans SC", "Noto Sans CJK SC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; font-size: 1rem; }
a { text-decoration: none; color: inherit; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---------- 通用按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, opacity .18s ease;
  white-space: nowrap;
  user-select: none;
}
.btn:active { transform: scale(0.96); }
.btn-primary { background: var(--teal); color: #fff; box-shadow: 0 6px 16px rgba(46,182,166,.35); }
.btn-primary:hover { background: var(--teal-dark); transform: translateY(-2px); }
.btn-warm { background: var(--orange); color: #fff; box-shadow: 0 6px 16px rgba(255,140,66,.35); }
.btn-warm:hover { background: var(--orange-dark); transform: translateY(-2px); }
.btn-outline { background: rgba(255,255,255,.9); color: var(--teal-dark); border: 2px solid var(--teal); }
.btn-outline:hover { background: var(--teal); color: #fff; transform: translateY(-2px); }
.btn-ghost { background: var(--teal-light); color: var(--teal-dark); }
.btn-ghost:hover { background: #d5f0eb; transform: translateY(-2px); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #d43f38; transform: translateY(-2px); }
.btn-lg { padding: 14px 34px; font-size: 1.08rem; }
.btn-sm { padding: 6px 14px; font-size: 0.85rem; }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none !important; }

/* loading 旋转点 */
.btn.loading { pointer-events: none; color: transparent !important; position: relative; }
.btn.loading::after {
  content: "";
  position: absolute;
  width: 18px; height: 18px;
  border: 3px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 导航栏 ---------- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  height: 100%;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.logo { display: flex; align-items: center; gap: 8px; margin-right: auto; }
.logo-icon { font-size: 1.7rem; }
.logo-text {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--teal-dark);
  line-height: 1.1;
  display: flex;
  flex-direction: column;
}
.logo-text small { font-size: .68rem; font-weight: 600; color: var(--ink-soft); letter-spacing: 2px; }

.nav-menu { display: flex; gap: 4px; }
.nav-link {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: .95rem;
  font-weight: 600;
  color: var(--ink-soft);
  transition: all .18s ease;
}
.nav-link:hover { color: var(--teal-dark); background: var(--teal-light); }
.nav-link.active { color: #fff; background: var(--teal); }

.nav-user {
  display: flex; align-items: center; gap: 8px;
  background: var(--teal-light);
  padding: 6px 14px 6px 8px;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--teal-dark);
}
.user-avatar {
  width: 30px; height: 30px;
  background: #fff;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 1rem;
}

/* 汉堡按钮 */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}
.hamburger span {
  width: 24px; height: 3px;
  background: var(--teal-dark);
  border-radius: 2px;
  transition: transform .25s ease, opacity .25s ease;
}
.hamburger.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ---------- 区块通用 ---------- */
.page-section {
  display: none;
  min-height: 100vh;
  padding: calc(var(--nav-h) + 40px) 0 60px;
  animation: fadeUp .45s ease;
}
.page-section.active { display: block; }
.section-alt { background: linear-gradient(180deg, #eef8f6 0%, var(--bg) 100%); }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.section-head { text-align: center; margin-bottom: 36px; }
.section-title {
  font-size: clamp(1.5rem, 3.5vw, 2.1rem);
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 10px;
}
.section-desc { color: var(--ink-soft); font-size: 1rem; max-width: 640px; margin: 0 auto; }

/* ---------- Banner ---------- */
#section-home {
  padding: 0;
  position: relative;
  overflow: hidden;
  display: none;
  background: linear-gradient(135deg, #2EB6A6 0%, #3fc7b0 45%, #7ddcf0 100%);
}
#section-home.active { display: flex; align-items: center; justify-content: center; }

.banner { min-height: 100vh; }
.banner-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: #fff;
  padding: 100px 20px 60px;
  max-width: 820px;
}
.banner-badge {
  display: inline-block;
  background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.45);
  padding: 6px 18px;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 600;
  margin-bottom: 22px;
  backdrop-filter: blur(4px);
}
.banner-title {
  font-size: clamp(2.1rem, 6vw, 3.6rem);
  font-weight: 900;
  letter-spacing: 4px;
  text-shadow: 0 4px 18px rgba(0,0,0,.12);
  margin-bottom: 18px;
}
.banner-subtitle {
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  opacity: .95;
  margin-bottom: 34px;
}
.banner-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 48px; }

.banner-stats {
  display: flex;
  justify-content: center;
  gap: clamp(20px, 6vw, 56px);
  flex-wrap: wrap;
}
.stat-item { display: flex; flex-direction: column; }
.stat-item strong { font-size: 1.8rem; font-weight: 900; }
.stat-item span { font-size: .88rem; opacity: .9; }

/* 装饰气泡 */
.bubble {
  position: absolute;
  font-size: 2.2rem;
  opacity: .5;
  animation: floaty 6s ease-in-out infinite;
  z-index: 1;
}
.b1 { top: 18%; left: 8%; animation-delay: 0s; }
.b2 { top: 28%; right: 10%; animation-delay: 1.4s; font-size: 2.8rem; }
.b3 { bottom: 20%; left: 14%; animation-delay: 2.6s; font-size: 2.6rem; }
.b4 { bottom: 30%; right: 16%; animation-delay: .8s; }
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50% { transform: translateY(-22px) rotate(6deg); }
}

/* ---------- 模块1：科普学习 ---------- */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
}
.topic-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform .22s ease, box-shadow .22s ease;
  cursor: pointer;
  border: 1px solid var(--line);
}
.topic-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.topic-card-head {
  padding: 22px 22px 18px;
  display: flex;
  gap: 14px;
  align-items: center;
}
.topic-icon {
  width: 54px; height: 54px;
  border-radius: 14px;
  display: grid; place-items: center;
  font-size: 1.7rem;
  flex-shrink: 0;
}
.topic-card h3 { font-size: 1.12rem; font-weight: 800; color: var(--ink); }
.topic-card .topic-sub { font-size: .85rem; color: var(--ink-soft); margin-top: 2px; }
.topic-arrow {
  margin-left: auto;
  color: var(--teal);
  transition: transform .25s ease;
  font-size: 1.2rem;
  font-weight: 700;
}
.topic-card.open .topic-arrow { transform: rotate(180deg); }

.topic-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s ease;
}
.topic-card.open .topic-body { max-height: 2600px; }
.topic-body-inner { padding: 0 22px 22px; border-top: 1px dashed var(--line); }
.topic-body-inner p { margin: 14px 0; font-size: .95rem; color: var(--ink); }
.topic-body-inner h4 {
  margin: 18px 0 8px;
  font-size: .98rem;
  color: var(--teal-dark);
  display: flex; align-items: center; gap: 6px;
}
.scene-box {
  background: var(--orange-light);
  border-left: 4px solid var(--orange);
  border-radius: 0 12px 12px 0;
  padding: 12px 16px;
  margin: 12px 0;
  font-size: .92rem;
}
.scene-box strong { color: var(--orange-dark); }

/* 小测试 */
.mini-quiz {
  margin-top: 18px;
  background: var(--teal-light);
  border-radius: 14px;
  padding: 16px;
}
.mini-quiz-title { font-weight: 800; color: var(--teal-dark); margin-bottom: 10px; font-size: .95rem; }
.quiz-option {
  display: block;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 10px 14px;
  margin: 8px 0;
  font-size: .92rem;
  transition: all .15s ease;
  color: var(--ink);
}
.quiz-option:hover { border-color: var(--teal); }
.quiz-option.correct { border-color: var(--teal); background: var(--teal-light); font-weight: 700; }
.quiz-option.wrong { border-color: var(--red); background: var(--red-light); }
.quiz-option:disabled { cursor: default; }
.quiz-feedback {
  margin-top: 10px;
  font-size: .9rem;
  font-weight: 600;
  min-height: 1.4em;
}
.quiz-feedback.good { color: var(--teal-dark); }
.quiz-feedback.bad { color: var(--red); }

/* ---------- 模块2：案例警示 ---------- */
.timeline { position: relative; padding-left: 8px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 26px; top: 8px; bottom: 8px;
  width: 3px;
  background: linear-gradient(180deg, var(--red), var(--yellow));
  border-radius: 2px;
  opacity: .5;
}
.case-item {
  position: relative;
  margin: 0 0 28px 56px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
  border-top: 4px solid var(--red);
  overflow: hidden;
}
.case-item::before {
  content: "⚠️";
  position: absolute;
  left: -56px;
  top: 18px;
  width: 44px; height: 44px;
  background: var(--red-light);
  border: 3px solid #fff;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 1.1rem;
  box-shadow: var(--shadow-sm);
}
.case-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 18px 20px 12px;
}
.case-tag {
  background: var(--ink);
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 999px;
  letter-spacing: 1px;
}
.case-head h3 { font-size: 1.1rem; font-weight: 800; }
.case-body { padding: 0 20px 18px; font-size: .94rem; }
.case-row { display: flex; gap: 10px; margin: 10px 0; }
.case-row .case-label {
  flex-shrink: 0;
  font-weight: 800;
  width: 84px;
  color: var(--ink-soft);
}
.case-row.law .case-label { color: var(--red); }
.case-warn {
  background: #fbf6e9;
  border: 1px dashed var(--yellow);
  border-radius: 12px;
  padding: 12px 16px;
  margin-top: 12px;
  font-size: .92rem;
}
.case-warn strong { color: #b98410; }

.cases-cta {
  text-align: center;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 30px 24px;
  margin-top: 10px;
}
.cases-cta p { font-size: 1.05rem; margin-bottom: 16px; }
.cases-cta strong { color: var(--orange-dark); }

/* ---------- 模块3：行为自测 ---------- */
.quiz-box {
  max-width: 720px;
  margin: 0 auto;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: clamp(22px, 4vw, 40px);
}
.quiz-start { text-align: center; padding: 20px 0; }
.quiz-start .big-icon { font-size: 3.4rem; margin-bottom: 14px; }
.quiz-start h3 { font-size: 1.4rem; margin-bottom: 12px; }
.quiz-start p { color: var(--ink-soft); margin-bottom: 24px; }
.quiz-dim-tags { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 26px; }
.dim-tag {
  background: var(--teal-light);
  color: var(--teal-dark);
  font-size: .85rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 999px;
}

/* 进度条 */
.progress-bar {
  height: 10px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), #6fd3c6);
  border-radius: 999px;
  transition: width .35s ease;
}
.progress-text { font-size: .85rem; color: var(--ink-soft); text-align: right; margin-bottom: 24px; }

.quiz-question {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 8px;
}
.quiz-dim-label { font-size: .82rem; color: var(--orange-dark); font-weight: 700; margin-bottom: 16px; }
.scale-options { display: flex; flex-direction: column; gap: 10px; }
.scale-option {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: .96rem;
  transition: all .15s ease;
  text-align: left;
  width: 100%;
}
.scale-option:hover { border-color: var(--teal); background: var(--teal-light); }
.scale-option.selected { border-color: var(--teal); background: var(--teal-light); font-weight: 700; }
.scale-dot {
  width: 22px; height: 22px;
  border: 2px solid var(--line);
  border-radius: 50%;
  flex-shrink: 0;
  display: grid; place-items: center;
  font-size: .7rem;
  color: transparent;
}
.scale-option.selected .scale-dot { border-color: var(--teal); background: var(--teal); color: #fff; }
.quiz-nav { display: flex; justify-content: space-between; margin-top: 26px; gap: 12px; }

/* 结果页 */
.quiz-result { text-align: center; }
.result-score-ring {
  width: 150px; height: 150px;
  margin: 6px auto 18px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 2rem; font-weight: 900;
  color: #fff;
  position: relative;
}
.result-level {
  display: inline-block;
  padding: 6px 22px;
  border-radius: 999px;
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 14px;
}
.level-low { background: var(--teal-light); color: var(--teal-dark); }
.level-mid { background: var(--orange-light); color: var(--orange-dark); }
.level-high { background: var(--red-light); color: var(--red); animation: pulseRed 1.6s ease-in-out infinite; }
@keyframes pulseRed { 0%,100% { box-shadow: 0 0 0 0 rgba(232,83,75,.35); } 50% { box-shadow: 0 0 0 10px rgba(232,83,75,0); } }
.result-advice {
  text-align: left;
  background: var(--bg);
  border-radius: 14px;
  padding: 16px 20px;
  margin: 18px 0;
  font-size: .95rem;
}
.result-advice li { margin: 8px 0 8px 1.2em; }
.result-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* 历史记录 */
.history-block { margin-top: 34px; }
.history-block h4 { font-size: 1.05rem; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.history-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 10px;
  font-size: .92rem;
  flex-wrap: wrap;
}
.history-item .h-date { color: var(--ink-soft); }
.history-item .h-badge { font-weight: 800; padding: 3px 12px; border-radius: 999px; font-size: .82rem; }
.history-empty { color: var(--ink-soft); text-align: center; padding: 16px; font-size: .92rem; }
.history-clear { margin-top: 8px; }

/* ---------- 模块4：线上咨询 ---------- */
.chat-window {
  max-width: 760px;
  margin: 0 auto;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: linear-gradient(135deg, var(--teal), #43c4b2);
  color: #fff;
}
.chat-avatar {
  width: 44px; height: 44px;
  background: rgba(255,255,255,.25);
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 1.5rem;
}
.chat-meta { display: flex; flex-direction: column; line-height: 1.3; margin-right: auto; }
.chat-meta strong { font-size: 1rem; }
.chat-status { font-size: .78rem; opacity: .9; }

.chat-body {
  height: 380px;
  overflow-y: auto;
  padding: 20px;
  background:
    radial-gradient(circle at 20% 10%, #f0f9f7 0, transparent 40%),
    radial-gradient(circle at 85% 80%, #fff7f0 0, transparent 40%),
    #fafcfb;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.msg { display: flex; gap: 10px; max-width: 82%; animation: msgIn .3s ease; }
@keyframes msgIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.msg.bot .msg-avatar { background: var(--teal-light); }
.msg.me .msg-avatar { background: var(--orange-light); }
.msg-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: .95rem;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: var(--shadow-sm);
}
.msg.bot .msg-bubble { background: #fff; border-top-left-radius: 4px; }
.msg.me .msg-bubble { background: var(--teal); color: #fff; border-top-right-radius: 4px; }
.msg-time { font-size: .72rem; color: var(--ink-soft); margin-top: 4px; }
.msg.me .msg-time { text-align: right; }

/* 打字中指示 */
.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing span {
  width: 8px; height: 8px;
  background: var(--teal);
  border-radius: 50%;
  opacity: .5;
  animation: typing 1.2s infinite;
}
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes typing { 0%,60%,100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-6px); opacity: 1; } }

.chat-quick {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  overflow-x: auto;
  border-top: 1px solid var(--line);
  background: #fff;
}
.quick-btn {
  flex-shrink: 0;
  background: var(--teal-light);
  color: var(--teal-dark);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: .86rem;
  font-weight: 600;
  transition: all .15s ease;
}
.quick-btn:hover { background: var(--teal); color: #fff; }

.chat-input-bar {
  display: flex;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.chat-input-bar input {
  flex: 1;
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 10px 18px;
  outline: none;
  transition: border-color .15s ease;
}
.chat-input-bar input:focus { border-color: var(--teal); }
.chat-tip { text-align: center; font-size: .82rem; color: var(--ink-soft); margin-top: 14px; }

/* ---------- 模块5：互动留言 ---------- */
.post-form {
  max-width: 760px;
  margin: 0 auto 30px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  border: 1px solid var(--line);
}
.post-form-row { display: flex; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.post-form-row input, .post-form-row select {
  padding: 10px 16px;
  border: 2px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: #fff;
  color: var(--ink);
}
.post-form-row input { flex: 1; min-width: 200px; }
.post-form-row input:focus, .post-form textarea:focus, .post-form-row select:focus { border-color: var(--teal); }
.post-form textarea {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px;
  resize: vertical;
  outline: none;
  line-height: 1.6;
}
.post-form-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.word-count { font-size: .82rem; color: var(--ink-soft); }

.message-list { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.message-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
  padding: 18px 20px;
  transition: transform .2s ease, box-shadow .2s ease;
}
.message-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.message-card.official { border-left: 5px solid var(--teal); background: linear-gradient(90deg, var(--teal-light) 0%, #fff 30%); }
.msg-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.msg-avatar-sm {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 1.15rem;
  background: var(--orange-light);
  flex-shrink: 0;
}
.message-card.official .msg-avatar-sm { background: var(--teal-light); }
.msg-nick { font-weight: 800; font-size: .95rem; }
.msg-tag {
  font-size: .76rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--teal-light);
  color: var(--teal-dark);
}
.msg-tag.求助 { background: var(--orange-light); color: var(--orange-dark); }
.msg-tag.倾诉 { background: #eef3fb; color: #3a72b8; }
.msg-tag.分享 { background: #eafaf1; color: #1e9e5a; }
.msg-tag.建议 { background: #f3eefc; color: #7a4fd0; }
.msg-date { margin-left: auto; font-size: .78rem; color: var(--ink-soft); }
.msg-content { font-size: .96rem; margin-bottom: 12px; word-break: break-word; }
.msg-actions { display: flex; gap: 14px; align-items: center; }
.msg-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .86rem;
  color: var(--ink-soft);
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  transition: all .15s ease;
}
.msg-action:hover { background: var(--teal-light); color: var(--teal-dark); }
.msg-action.liked { color: var(--red); }

/* 回复列表 + 回复表单 */
.reply-list { margin: 12px 0 0 20px; padding-left: 16px; border-left: 3px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.reply-item { font-size: .9rem; }
.reply-item .r-nick { font-weight: 800; color: var(--teal-dark); }
.reply-item.official .r-nick { color: var(--orange-dark); }
.reply-item .r-time { font-size: .75rem; color: var(--ink-soft); margin-left: 8px; }
.reply-form { display: flex; gap: 8px; margin-top: 10px; margin-left: 20px; }
.reply-form input {
  flex: 1;
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: .88rem;
  outline: none;
}
.reply-form input:focus { border-color: var(--teal); }

/* ---------- 页脚 ---------- */
.footer {
  background: #243b44;
  color: #cfe0dc;
  padding: 44px 0 28px;
  margin-top: 40px;
}
.footer-hotline h3 { color: #fff; font-size: 1.15rem; margin-bottom: 18px; text-align: center; }
.hotline-items {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}
.hotline-card {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--radius);
  padding: 16px 26px;
  text-align: center;
  min-width: 170px;
}
.hotline-card strong {
  display: block;
  font-size: 1.5rem;
  color: var(--orange);
  margin-bottom: 6px;
  letter-spacing: 1px;
}
.hotline-card span { font-size: .83rem; line-height: 1.6; }
.footer-copy { text-align: center; font-size: .83rem; opacity: .75; border-top: 1px solid rgba(255,255,255,.12); padding-top: 20px; }
.footer-copy p { margin: 4px 0; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(30, 50, 55, .5);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}
.modal-mask.show { display: flex; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 520px;
  width: 100%;
  max-height: 86vh;
  overflow-y: auto;
  padding: 30px 28px;
  position: relative;
  animation: popIn .3s cubic-bezier(.2,.9,.4,1.2);
}
@keyframes popIn { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-close {
  position: absolute;
  top: 12px; right: 16px;
  font-size: 1.6rem;
  color: var(--ink-soft);
  line-height: 1;
  padding: 4px 8px;
  border-radius: 8px;
}
.modal-close:hover { background: var(--bg); }
.modal-content { text-align: center; }
.modal-content h3 { font-size: 1.3rem; margin-bottom: 14px; }
.modal-content p { font-size: .96rem; margin: 10px 0; text-align: left; }
.modal-icon { font-size: 3rem; margin-bottom: 10px; }
.modal-hotline {
  background: var(--red-light);
  border-radius: 14px;
  padding: 16px;
  margin: 14px 0;
  text-align: left;
}
.modal-hotline div { margin: 6px 0; font-size: .95rem; }
.modal-hotline strong { color: var(--red); font-size: 1.1rem; }
.modal-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }

/* ---------- Toast 提示 ---------- */
.toast-wrap {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: rgba(43, 58, 66, .94);
  color: #fff;
  padding: 11px 24px;
  border-radius: 999px;
  font-size: .92rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  animation: toastIn .3s ease;
}
.toast.success { background: var(--teal); }
.toast.error { background: var(--red); }
.toast.warn { background: var(--orange-dark); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- 响应式：小屏桌面（6个导航项防溢出） ---------- */
@media (max-width: 1020px) and (min-width: 861px) {
  .nav-link { padding: 8px 9px; font-size: .88rem; }
  .nav-user { padding: 6px 10px 6px 6px; }
  .logo-text { font-size: 1.05rem; }
}

/* ---------- 响应式：平板/手机 ---------- */
@media (max-width: 860px) {
  .hamburger { display: flex; }
  .nav-user { display: none; }

  .nav-menu {
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    background: #fff;
    flex-direction: column;
    padding: 12px 20px 20px;
    gap: 6px;
    box-shadow: var(--shadow-md);
    border-bottom: 1px solid var(--line);
    transform: translateY(-130%);
    transition: transform .3s ease;
  }
  .nav-menu.open { transform: translateY(0); }
  .nav-link { padding: 13px 16px; font-size: 1.02rem; }

  /* 时间线在手机上左缩进减小 */
  .timeline::before { left: 16px; }
  .case-item { margin-left: 42px; }
  .case-item::before { left: -42px; width: 36px; height: 36px; font-size: .95rem; }

  .chat-body { height: 320px; }
  .msg { max-width: 90%; }
}

@media (max-width: 520px) {
  .banner-stats { gap: 18px; }
  .stat-item strong { font-size: 1.4rem; }
  .case-row { flex-direction: column; gap: 2px; }
  .case-row .case-label { width: auto; }
  .post-form-row { flex-direction: column; }
  .post-form-row input, .post-form-row select { width: 100%; }
  .hotline-card { min-width: 140px; padding: 14px 16px; }
}

/* ==========================================================
   模块6：九型人格（科普区 + 在线自测区）
   ========================================================== */

/* 页面内锚点按钮 */
.eg-anchor-pills {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.eg-pill {
  background: #fff;
  border: 2px solid var(--teal);
  color: var(--teal-dark);
  border-radius: 999px;
  padding: 9px 22px;
  font-weight: 700;
  font-size: .92rem;
  transition: all .18s ease;
}
.eg-pill:hover {
  background: var(--teal);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* 分区小标题（同时作为锚点目标，预留固定导航高度） */
.eg-sub-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 38px 0 18px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 12px;
  scroll-margin-top: calc(var(--nav-h) + 24px);
}
.eg-sub-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- 三大能量中心（三栏卡片） ---------- */
.eg-centers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.eg-center-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px 20px 20px;
  text-align: center;
  transition: transform .22s ease, box-shadow .22s ease;
}
.eg-center-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.eg-center-band { height: 6px; border-radius: 999px; margin-bottom: 16px; }
.eg-center-icon { font-size: 2.3rem; line-height: 1; }
.eg-center-card h4 { font-size: 1.1rem; margin: 8px 0 2px; }
.eg-center-en {
  font-size: .72rem;
  color: var(--ink-soft);
  letter-spacing: 2px;
  margin-bottom: 12px;
}
.eg-center-nums { display: flex; justify-content: center; gap: 8px; margin-bottom: 12px; }
.eg-num-badge {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 800;
  font-size: .95rem;
  color: #fff;
}
.eg-center-core {
  background: var(--bg);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: .85rem;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.eg-center-core b { color: var(--ink); }
.eg-center-desc { font-size: .85rem; color: var(--ink-soft); }

/* ---------- 九种人格卡片（三行三列网格） ---------- */
.eg-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.eg-type-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
  padding: 20px;
  transition: transform .22s ease, box-shadow .22s ease;
}
.eg-type-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.eg-type-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.eg-type-num {
  width: 46px; height: 46px;
  border-radius: 14px;
  flex-shrink: 0;
  display: grid; place-items: center;
  font-weight: 900;
  font-size: 1.2rem;
  color: #fff;
}
.eg-type-head h4 { font-size: 1.06rem; }
.eg-type-row {
  display: flex;
  gap: 8px;
  font-size: .88rem;
  margin: 8px 0;
  line-height: 1.65;
  align-items: flex-start;
}
.eg-type-row .k {
  flex-shrink: 0;
  font-weight: 700;
  color: var(--teal-dark);
  background: var(--teal-light);
  border-radius: 8px;
  padding: 1px 9px;
  font-size: .78rem;
  margin-top: 2px;
}
.eg-type-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.eg-type-tag {
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: .78rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
}

/* ---------- 在线自测 ---------- */
.eg-question-wrap { animation: fadeUp .35s ease; }
.eg-options { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.eg-option {
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 16px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  min-height: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all .15s ease;
}
.eg-option:hover { border-color: var(--teal); background: var(--teal-light); transform: translateY(-2px); }
.eg-option.selected {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
  box-shadow: 0 6px 16px rgba(46, 182, 166, .3);
}
.eg-opt-emoji { font-size: 1.5rem; }

/* 结果卡片 */
.eg-result { animation: fadeUp .4s ease; }
.eg-result-type {
  width: 96px; height: 96px;
  margin: 4px auto 14px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: #fff;
  font-size: 2.4rem;
  font-weight: 900;
  box-shadow: var(--shadow-md);
}
.eg-result-name { font-size: 1.5rem; font-weight: 900; margin-bottom: 4px; }
.eg-result-center { color: var(--ink-soft); font-size: .92rem; margin-bottom: 12px; }
.eg-wing-badge {
  display: inline-block;
  padding: 5px 18px;
  border-radius: 999px;
  background: var(--orange-light);
  color: var(--orange-dark);
  font-weight: 800;
  font-size: .92rem;
}
.eg-wing-badge.plain { background: var(--teal-light); color: var(--teal-dark); }
.eg-wing-note {
  font-size: .9rem;
  color: var(--ink-soft);
  text-align: left;
  background: var(--bg);
  border-radius: 12px;
  padding: 10px 14px;
  margin: 12px 0 0;
}
.eg-result-rows {
  text-align: left;
  margin: 14px 0;
  background: var(--bg);
  border-radius: 14px;
  padding: 14px 18px;
}
.eg-score-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 4px 0 20px;
}
.eg-score-chip {
  background: var(--bg);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: .78rem;
  color: var(--ink-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 52px;
}
.eg-score-chip b { font-size: 1.05rem; color: var(--ink); }
.eg-score-chip.top { background: var(--teal); color: rgba(255,255,255,.85); }
.eg-score-chip.top b { color: #fff; }

/* ---------- 九型模块响应式：移动端单列 ---------- */
@media (max-width: 860px) {
  .eg-centers, .eg-types { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .eg-option { min-height: 56px; padding: 14px 10px; font-size: 1rem; }
  .eg-pill { padding: 8px 16px; font-size: .86rem; }
}
