/* =========================================================
   教之篮 · 养娃日记 App 设计系统
   风格：竹篮绿 + 藤编暖黄 / 温和可信 / 移动优先
   ========================================================= */

:root {
  --bg: #fbf8f2;
  --surface: #ffffff;
  --surface-2: #f6f2e9;
  --ink: #22302a;
  --ink-2: #606f67;
  --ink-3: #97a29b;
  --line: #e4ded1;
  --brand: #2f6b4f;
  --brand-2: #438a66;
  --brand-soft: #e6f0e9;
  --amber: #cf8a37;
  --amber-soft: #fbeedc;
  --gold: #c19a2b;
  --rose: #c4695c;
  --rose-soft: #fbeae7;
  --radius: 20px;
  --radius-lg: 26px;
  --shadow-sm: 0 1px 3px rgba(52, 44, 32, 0.06), 0 6px 16px -12px rgba(52, 44, 32, 0.28);
  --shadow: 0 20px 40px -26px rgba(36, 48, 42, 0.45);
  --shadow-lg: 0 40px 80px -40px rgba(30, 45, 38, 0.55);
  /* 不依赖任何外部字体服务：直接用户系统里现成的中文字体。
     （国内访问 fonts.googleapis.com 基本不通，会让首屏卡住并报 ERR_ADDRESS_UNREACHABLE） */
  --font: system-ui, -apple-system, "PingFang SC", "HarmonyOS Sans SC", "MiSans",
          "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
  --font-display: "Songti SC", "SimSun", "Source Han Serif SC", "Noto Serif CJK SC",
                  "STSong", "Songti TC", serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

/* hidden 一定要真的隐藏：.btn / .card 这些自带的 display 会盖掉 [hidden] 的默认规则，
   历史上就出现过「本该隐藏的按钮一直显示」（例如日记页的「看更早的记录」）。 */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 敬师灯（首页最上方：三支蜡烛 + 至圣先师像 + 一句话） ---------- */
.candle-card {
  /* 三层竖排：① 蜡烛 + 孔子像（底边对齐）② 一句话 ③ 状态与点火按钮。
     用 align-items:center 让左右留白天然对称 */
  display: flex; flex-direction: column; align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: linear-gradient(180deg, #FFFDF8, #F8F3E8);
  border-color: #E7DCC4;
}
.candle-row { display: flex; align-items: flex-end; justify-content: center; gap: 12px; width: 100%; }
.candle-side { position: relative; display: flex; gap: 9px; align-items: flex-end; flex: none; padding-bottom: 9px; }
.candle { position: relative; width: 17px; height: 84px; }
/* 每支下面的小铜盘 + 一条共用的底座托盘（像这样摆一排，才像供桌上的烛台） */
.candle .holder {
  position: absolute; bottom: -6px; left: -3px; width: 23px; height: 8px; border-radius: 50%;
  background: linear-gradient(180deg, #B9607F, #8E3B5E);
  box-shadow: inset 0 -1px 2px rgba(60, 15, 35, .45), 0 1px 2px rgba(60, 15, 35, .3);
}
.candle-tray {
  position: absolute; left: -5px; right: -5px; bottom: 0; height: 9px; border-radius: 5px;
  background: linear-gradient(180deg, #A94C6E, #8E3B5E 70%, #6E2946);
  box-shadow: 0 2px 5px -2px rgba(70, 20, 45, .5), inset 0 1px 0 rgba(255, 255, 255, .45);
}
.candle .wax {
  position: absolute; bottom: 0; left: 0; width: 100%; height: 64px;
  border-radius: 7px 7px 4px 4px;
  background: linear-gradient(180deg, #FFF3DA, #EBD6A8 60%, #D9BE86);
  box-shadow: inset -3px 0 6px rgba(120, 90, 30, .12), 0 2px 4px rgba(120, 90, 30, .12);
}
.candle .flame {
  position: absolute; bottom: 62px; left: 50%; width: 12px; height: 20px; margin-left: -6px;
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  background: radial-gradient(circle at 50% 72%, #FFF6C9 0 22%, #FFC65C 45%, #FF8A1E 78%, rgba(255, 120, 20, .25) 100%);
  box-shadow: 0 0 18px 6px rgba(255, 168, 46, .38), 0 0 42px 14px rgba(255, 168, 46, .18);
  transform-origin: 50% 100%;
  animation: candle-flicker 1.5s ease-in-out infinite;
}
.candle .flame::after {
  content: ""; position: absolute; left: 50%; bottom: 1px; width: 4px; height: 7px; margin-left: -2px;
  border-radius: 50%; background: rgba(255, 255, 255, .85);
}
.candle .smoke { display: none; }
.candle.off .flame { display: none; }
.candle.off .smoke {
  display: block; position: absolute; bottom: 62px; left: 50%; width: 3px; height: 26px; margin-left: -1.5px;
  border-radius: 3px; background: linear-gradient(180deg, rgba(160, 170, 160, 0), rgba(150, 160, 150, .5), rgba(160, 170, 160, 0));
  animation: candle-smoke 3.4s ease-in-out infinite;
}
.candle.off .wax { filter: grayscale(.7) brightness(.94); }
@keyframes candle-flicker {
  0%, 100% { transform: scale(1, 1) rotate(0deg); opacity: 1; }
  25% { transform: scale(.94, 1.06) rotate(-1.5deg); opacity: .95; }
  50% { transform: scale(1.05, .95) rotate(1.2deg); opacity: 1; }
  75% { transform: scale(.97, 1.03) rotate(-.8deg); opacity: .97; }
}
@keyframes candle-smoke {
  0% { transform: translateY(0) scaleX(1); opacity: 0; }
  30% { opacity: .5; }
  100% { transform: translateY(-26px) scaleX(1.6); opacity: 0; }
}
.kongzi-frame {
  /* 横构图：宽度取卡片的一小半多一点，高度按原图比例走；底边与蜡烛底盘对齐 */
  width: 58%; max-width: 250px; overflow: hidden;
  border-radius: 12px; border: 1px solid #E4D7BC; background: #F2E7CF;
  box-shadow: 0 10px 24px -18px rgba(90, 70, 30, .55);
}
.kongzi-frame img { width: 100%; height: auto; display: block; }
.kongzi-line {
  margin: 4px 0 0; font-family: var(--font-display);
  font-size: 18px; font-weight: 800; letter-spacing: .04em;
  color: var(--ink);
}
.candle-side-info { width: 100%; text-align: center; }
.candle-side-info .btn { width: 100%; }
.candle-side-info #candle-state { color: var(--ink-2); }
@media (max-width: 380px) {
  .candle-card { gap: 7px; padding: 10px 12px; }
  .candle-row { gap: 10px; }
  .candle { height: 70px; width: 15px; }
  .candle .wax { height: 52px; }
  .candle .flame, .candle.off .smoke { bottom: 50px; }
  .kongzi-frame { width: 56%; }
  .kongzi-line { font-size: 16.5px; }
}

/* 藤编底纹 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(45deg, rgba(47, 107, 79, 0.045) 0 2px, transparent 2px 14px),
    repeating-linear-gradient(-45deg, rgba(207, 138, 55, 0.05) 0 2px, transparent 2px 14px),
    radial-gradient(40rem 30rem at 8% -6%, rgba(47, 107, 79, 0.10), transparent 62%),
    radial-gradient(36rem 26rem at 96% 4%, rgba(207, 138, 55, 0.12), transparent 60%);
}

/* ---------- App 外框 ---------- */
.app {
  position: relative;
  z-index: 1;
  max-width: 468px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  /* 底部留出的空间要跟着「安全区」一起长：iPhone 的小横条会把底栏顶高约 34px，
     只写固定值的话，页面最后一条内容会被底栏压住（2026-10-14 修）。 */
  padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
}
@media (min-width: 1024px) {
  body { padding: 28px 0 40px; }
  .app {
    min-height: calc(100vh - 68px);
    border-radius: 34px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
  }
}

.px { padding-left: 18px; padding-right: 18px; }
.stack > * + * { margin-top: var(--gap, 16px); }

/* ---------- 顶栏 ---------- */
.appbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(251, 248, 242, 0.86);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, background-color 0.25s ease;
  /* iPhone 刘海 / 灵动岛：顶栏要让开状态栏那一条。
     没写 viewport-fit=cover 的设备上 env() 等于 0，这行完全没影响（2026-10-14 加）。 */
  padding-top: env(safe-area-inset-top, 0px);
}
/* 没有顶栏的页面（登录、条款、说明页等）：由外层让开状态栏（:has 不支持时自动忽略，不影响其它设备） */
.app:not(:has(.appbar)) { padding-top: env(safe-area-inset-top, 0px); }
.appbar.is-stuck { border-bottom-color: var(--line); background: rgba(251, 248, 242, 0.96); }
.appbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 16px;
}
.brand {
  order: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  flex: 0 0 auto;
  text-decoration: none;
  color: inherit;
}
.brand-logo { width: 38px; height: 38px; flex: none; }
/* 「教之篮」和「养娃日记」永远在同一行（基线对齐），窄屏靠下面的媒体查询一起缩 */
.brand > span { display: inline-flex; align-items: baseline; white-space: nowrap; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 17px; line-height: 1.15; }
/* 「养娃日记」：字号比原来大一点、颜色深一点、字重加半档，并且和「教之篮」之间空出一格 */
.brand-sub {
  margin-left: 7px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink-2);
}
/* 顶栏那颗「积分」和「消息」：不换行，窄屏时一起变小，避免挤成两行 */
.brand-name, .brand-sub { white-space: nowrap; }
.appbar .appbar-points {
  order: 2;
  flex: 0 0 auto;
  height: 32px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 13px;
  line-height: 1.15;
  white-space: nowrap;
}
.appbar .appbar-msg { order: 3; flex: 0 0 auto; padding: 7px 10px; font-size: 13px; line-height: 1.15; white-space: nowrap; }
.appbar .appbar-back {
  order: 4;
  flex: 0 0 auto;
  height: 32px;
  padding: 0 9px;
  gap: 3px;
  border-radius: 11px;
  font-size: 13px;
  white-space: nowrap;
}
.appbar .appbar-back-arrow { font-size: 18px; line-height: 1; margin-top: -2px; }
.global-back {
  position: fixed;
  z-index: 60;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  left: 14px;
  height: 38px;
  padding: 0 13px;
  border-radius: 13px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 5px 18px rgba(36, 52, 43, .14);
  backdrop-filter: blur(10px);
}
.global-back--inline {
  position: relative;
  top: auto;
  left: auto;
  z-index: 1;
  margin: 12px 18px 0;
  box-shadow: none;
}
/* 常见手机宽度（≤420px）放不下「· 种子」和「消息」几个字：只留数字，顶栏始终一行 */
@media (max-width: 600px) {
  body.has-global-back .appbar-inner { gap: 4px; padding-left: 10px; padding-right: 10px; }
}
@media (max-width: 640px) {
  body.has-global-back .appbar-msg { display: none; }
}
@media (max-width: 420px) {
  .appbar-level, .appbar-msg-text { display: none; }
}
@media (max-width: 380px) {
  .appbar-inner { gap: 5px; }
  .appbar .appbar-points { height: 30px; padding: 3px 7px; font-size: 12px; }
  .appbar .appbar-msg { padding: 6px 8px; font-size: 12px; }
  body.has-global-back .brand-sub { display: none; }
  .appbar .appbar-back { width: 32px; height: 32px; padding: 0; justify-content: center; }
  .appbar-back-text { display: none; }
  .brand-logo { width: 32px; height: 32px; }
  .brand-name { font-size: 16px; }
  .brand-sub { font-size: 12px; margin-left: 5px; }
}
@media (max-width: 344px) {
  .appbar .appbar-points, .appbar .appbar-msg { padding: 4px 5px; }
  .brand { gap: 7px; }
  .brand-logo { width: 30px; height: 30px; }
  .brand-name { font-size: 15.5px; }
  .brand-sub { font-size: 12px; margin-left: 4px; letter-spacing: 0.02em; }
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}
.icon-btn:hover { background: #fff; }
.icon-btn:active { transform: scale(0.96); }

/* ---------- 底部 Tab ---------- */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 45;
  margin: 0 auto;
  max-width: 468px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  display: grid;
  /* 2026-10-14：底部加了「父训厅 / 母仪堂」，7 格；间距与留白同步收紧，
     七项在 360px 的窄屏上也不挤（每格约 50px，标签是 3 个字）。 */
  grid-template-columns: repeat(7, 1fr);
  padding: 8px 3px calc(8px + env(safe-area-inset-bottom, 0px));
}
@media (min-width: 1024px) {
  .tabbar { border-radius: 0 0 34px 34px; bottom: 40px; }
}
.tab {
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 4px 0;
  font-size: 12px;
  color: var(--ink-3);
  text-decoration: none;
  border-radius: 12px;
  transition: color 0.2s ease, background-color 0.2s ease;
}
.tab svg { width: 21px; height: 21px; }
.tab:hover { color: var(--brand-2); }
.tab[aria-current="page"] { color: var(--brand); font-weight: 600; }
.tab[aria-current="page"] svg { transform: translateY(-1px); }
.tab--cta { position: relative; }
.tab--cta svg {
  width: 38px; height: 38px; padding: 8px;
  border-radius: 14px; background: var(--brand); color: #fff;
  box-shadow: 0 10px 20px -12px rgba(47, 107, 79, 0.9);
  transition: transform 0.25s ease, background-color 0.25s ease;
}
.tab--cta:hover svg { transform: translateY(-2px) rotate(-3deg); background: var(--brand-2); }

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 18px; }
.card-tint { background: linear-gradient(180deg, #fff, #fdfaf4); }

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
/* 「全部公告 →」这类小链接：用上下内边距把可点高度做到 37px，
   同时用负外边距抵消，视觉位置与原来一模一样（手指点得准，版面不变） */
.section-title > a {
  padding: 8px 2px;
  margin: -8px 0;
}
.h-display { font-family: var(--font-display); font-weight: 700; }
.h1 { font-size: 27px; line-height: 1.3; margin: 0; }
/* 首页问候语：常见手机尽量一行；长姓名或 360px 以下自然换行，避免右侧被截断。 */
.greet-title { font-size: clamp(17px, 4.9vw, 22px); line-height: 1.35; text-wrap: balance; }
.greet-tail { white-space: nowrap; }
.h2 { font-size: 18px; line-height: 1.4; margin: 0; }
.h3 { font-size: 15.5px; line-height: 1.5; margin: 0; }
/* 规划报告里的「诊断证据表」等 Markdown 表格 */
.md-table { width: 100%; border-collapse: collapse; margin: 10px 0 12px; font-size: 12.5px; line-height: 1.65; }
.md-table th, .md-table td { border: 1px solid var(--line); padding: 7px 8px; text-align: left; vertical-align: top; }
.md-table th { background: #F4F0E7; font-weight: 700; }
.muted { color: var(--ink-2); }
.tiny { font-size: 12.5px; color: var(--ink-3); }
.label { font-size: 13px; color: var(--ink-2); letter-spacing: 0.02em; margin-bottom: 6px; display: block; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.25s ease, background-color 0.25s ease, color 0.25s ease;
}
.btn:active { transform: translateY(1px) scale(0.995); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 12px 24px -16px rgba(47, 107, 79, 1); }
.btn-primary:hover { background: #275b43; }
.btn-amber { background: var(--amber); color: #fff; box-shadow: 0 12px 24px -16px rgba(207, 138, 55, 1); }
.btn-amber:hover { background: #bd7a2c; }
.btn-ghost { background: rgba(255, 255, 255, 0.85); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: #fff; }
.btn-soft { background: var(--brand-soft); color: var(--brand); }
.btn-danger { background: #fff; border-color: #e8cbc6; color: #a04b3f; }
.btn-danger:hover { background: var(--rose-soft); }
.btn-block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; box-shadow: none; }
/* 页脚等文字链接也留出足够的触控高度，避免手机上一条细线点不中。 */
a.tiny { display: inline-flex; align-items: center; min-height: 32px; }

/* ---------- 表单 ---------- */
.field { display: block; margin-bottom: 14px; }
.input, .select, .textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
/* 地区名可能很长（如「塔什库尔干塔吉克自治县」），用省略号收尾而不是硬裁切 */
.select { text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
.textarea { min-height: 112px; resize: vertical; line-height: 1.75; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 4px rgba(67, 138, 102, 0.14);
}
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.radio-row { display: flex; gap: 10px; }
.radio-box {
  flex: 1;
  position: relative;
}
.radio-box input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.radio-box span {
  display: block;
  text-align: center;
  padding: 10px 0;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 14.5px;
  transition: all 0.2s ease;
}
.radio-box input:checked + span {
  border-color: var(--brand-2);
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  font-size: 13.5px;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.2s ease;
}
.chip:hover { background: #fff; color: var(--ink); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff8ef; font-weight: 500; }

/* ---------- 徽标 / 标签 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--surface-2);
  color: var(--ink-2);
}
.tag--brand { background: var(--brand-soft); color: var(--brand); }
.tag--amber { background: var(--amber-soft); color: #a4661f; }

/* AI 结果统一折叠：最新结果默认展开，读完后收起并记住状态。 */
.jzl-read-shell { margin-top: 10px; }
.jzl-read-shell > summary {
  cursor: pointer;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdf8;
  font-size: 14px;
  line-height: 1.6;
}
.jzl-read-shell[open] > summary { border-radius: 12px 12px 0 0; }
.jzl-read-fold-body { padding-top: 8px; }

/* 口语搭子：每篇文章和它的对话合并为一条默认折叠记录，最新一条排在最上面。 */
.oe-history-section { margin-bottom: 16px; }
.oe-history-list { display: grid; gap: 10px; }
.oe-history-item { margin: 0; overflow: hidden; }
.oe-history-summary {
  position: relative;
  display: block;
  padding: 12px 38px 12px 14px;
  cursor: pointer;
  list-style: none;
}
.oe-history-summary::-webkit-details-marker { display: none; }
.oe-history-summary::after {
  content: "›";
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%) rotate(90deg);
  color: var(--brand);
  font-size: 22px;
  line-height: 1;
  transition: transform .2s ease;
}
.oe-history-item[open] > .oe-history-summary { border-bottom: 1px dashed var(--line); }
.oe-history-item[open] > .oe-history-summary::after { transform: translateY(-50%) rotate(-90deg); }
.oe-history-line { display: flex; align-items: center; gap: 7px; min-width: 0; }
.oe-history-line b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oe-history-meta {
  display: block;
  margin-top: 6px;
  color: var(--ink-3);
  font-size: 12.5px;
  line-height: 1.5;
}
.oe-history-preview {
  display: block;
  margin: 5px 0 0;
  overflow: hidden;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.6;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.oe-history-body { padding: 14px; }
.oe-session-article { padding: 2px 0 14px; border-bottom: 1px dashed var(--line); }
.oe-session-text { margin: 12px 0 0; font-size: 15px; line-height: 1.95; white-space: pre-wrap; }
.oe-session-chat { padding-top: 14px; }

.scenario-stage { margin-top: 10px; }
.scenario-visual {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  background: #f7faf7;
  border: 1px solid var(--line);
  overflow-x: auto;
}
.scenario-svg { display: block; width: 100%; max-width: 360px; height: auto; margin: 0 auto; }
.scenario-flow { display: flex; align-items: stretch; gap: 7px; min-width: max-content; }
.scenario-node {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 92px;
  padding: 9px 10px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #cfe3d6;
  color: var(--brand);
  font-size: 13px;
  line-height: 1.5;
}
.scenario-node small { display: block; margin-top: 3px; color: var(--ink-3); font-size: 11px; }
.scenario-arrow { align-self: center; color: var(--brand); font-size: 20px; }
.scenario-bars { display: grid; gap: 10px; }
.scenario-bar-row { display: grid; grid-template-columns: 58px minmax(80px, 1fr) 40px; align-items: center; gap: 7px; font-size: 13px; }
.scenario-bar-row > div { height: 10px; background: #e3ebe5; border-radius: 6px; overflow: hidden; }
.scenario-bar-row i { display: block; height: 100%; background: var(--brand); border-radius: 6px; }
.scenario-bar-row b { text-align: right; }
.scenario-bar-row small { grid-column: 1 / -1; color: var(--ink-3); font-size: 11px; }

.ca-options { display: grid; gap: 8px; margin-top: 11px; }
.ca-option {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  font: inherit;
  line-height: 1.65;
  cursor: pointer;
}
.ca-option > span {
  display: inline-flex;
  flex: 0 0 26px;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 800;
}
.ca-option > em { margin-left: auto; color: var(--brand); font-size: 11px; font-style: normal; white-space: nowrap; }
.ca-option.is-best { border-color: var(--brand); background: #eef7f0; }
.ca-option.is-wrong { border-color: #e3c98c; background: #fff7e5; }
.ca-options.revealed .ca-option { cursor: default; }
.ca-steps { display: grid; gap: 9px; margin-top: 11px; }
.ca-step { display: flex; gap: 10px; padding: 10px 12px; border-radius: 11px; background: #fff; border: 1px solid var(--line); }
.ca-step > span { flex: 0 0 25px; height: 25px; border-radius: 50%; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }
.ca-step p { margin: 4px 0 0; font-size: 13.5px; line-height: 1.8; }

.ca-history-body { margin-top: 8px; }
@media (max-width: 540px) {
  .ca-option { padding: 10px; }
  .ca-option > em { align-self: flex-start; }
}
.tag--rose { background: var(--rose-soft); color: #a04b3f; }

/* ---------- 头像 ---------- */
.avatar {
  width: 42px; height: 42px;
  flex: none;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  background: var(--brand-soft);
  color: var(--brand);
}
.avatar--amber { background: var(--amber-soft); color: #a4661f; }
.avatar--rose { background: var(--rose-soft); color: #a04b3f; }
.avatar--ink { background: #e9ebe8; color: #4c5850; }
.avatar-sm { width: 34px; height: 34px; border-radius: 12px; font-size: 14px; }

/* ---------- 列表行 ---------- */
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  transition: background-color 0.2s ease;
}
.row:last-child { border-bottom: 0; }
.row:hover { background: #fdfbf6; }
.row-main { flex: 1; min-width: 0; }
.chev { color: var(--ink-3); flex: none; }

/* ---------- 数据 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 10px;
  text-align: center;
}
.stat-num { font-family: var(--font-display); font-weight: 700; font-size: 22px; line-height: 1.2; }
.stat-label { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

/* ---------- 页脚（备案号） ---------- */
.site-foot {
  padding: 6px 18px 18px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-3);
}
.site-foot a { color: var(--ink-3); text-decoration: none; }
.site-foot a:hover { color: var(--brand); text-decoration: underline; }

/* ---------- 进度 ---------- */
.bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-2), var(--brand));
  transition: width 0.9s cubic-bezier(.2,.7,.3,1);
}

.ladder { display: flex; align-items: flex-end; gap: 6px; }
.ladder-step {
  flex: 1;
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-3);
}
.ladder-bar {
  width: 100%;
  border-radius: 10px 10px 6px 6px;
  background: var(--surface-2);
  transition: background-color 0.3s ease, transform 0.3s ease;
}
.ladder-step.is-done .ladder-bar { background: linear-gradient(180deg, #6fae8c, var(--brand)); }
.ladder-step.is-now .ladder-bar { background: linear-gradient(180deg, #e8b366, var(--amber)); transform: translateY(-3px); }
.ladder-step.is-now { color: var(--amber); font-weight: 600; }
.ladder-step.is-done { color: var(--brand); }
/* 半达成：分数够了但场次还不够（斜纹提示） */
.ladder-step.is-partial .ladder-bar {
  background: repeating-linear-gradient(45deg, #e8b366 0 6px, #f6dfba 6px 12px);
}
.ladder-step.is-partial { color: var(--amber); }
.ladder-cap { font-size: 11px; line-height: 1.35; color: var(--ink-3); }
.ladder-step.is-done .ladder-cap { color: var(--brand); }
.ladder-step.is-now .ladder-cap, .ladder-step.is-partial .ladder-cap { color: var(--amber); }
.ladder-note {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--ink-3); margin-top: 10px;
}
.ladder-note i {
  width: 14px; height: 9px; border-radius: 3px; display: inline-block;
}

/* ---------- 对话气泡 ---------- */
.bubble {
  border-radius: 18px;
  padding: 14px 16px;
  font-size: 14.5px;
  line-height: 1.85;
}
.bubble--user {
  background: var(--brand);
  color: #fff;
  border-bottom-right-radius: 6px;
  margin-left: 40px;
}
.bubble--ai {
  background: #fff;
  border: 1px solid var(--line);
  border-bottom-left-radius: 6px;
  margin-right: 24px;
}
.bubble--ai h4 {
  font-family: var(--font-display);
  font-size: 15px;
  margin: 14px 0 4px;
  color: var(--brand);
}
.bubble--ai ul { margin: 6px 0; padding-left: 18px; }
.bubble--ai li { margin-bottom: 4px; }

/* ---------- 空态 / 提示 ---------- */
.empty {
  text-align: center;
  padding: 36px 20px;
  color: var(--ink-3);
}
.notice-lock {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--amber-soft);
  color: #8a5615;
  font-size: 13.5px;
  line-height: 1.6;
}

/* ---------- Toast / 弹层 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 108px;
  transform: translate(-50%, 16px);
  z-index: 80;
  background: rgba(34, 48, 42, 0.94);
  color: #f7f4ee;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s ease;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

.sheet {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  align-items: flex-end;
  justify-content: center;
  background: rgba(30, 38, 34, 0.42);
  backdrop-filter: blur(3px);
}
.sheet.is-open { display: flex; }
.sheet-panel {
  width: 100%;
  max-width: 468px;
  max-height: 84vh;
  overflow: auto;
  background: var(--bg);
  border-radius: 26px 26px 0 0;
  padding: 20px 18px calc(24px + env(safe-area-inset-bottom, 0px));
  animation: sheet-up 0.32s cubic-bezier(.2,.7,.3,1);
}
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-grip { width: 42px; height: 4px; border-radius: 999px; background: var(--line); margin: 0 auto 14px; }

/* ---------- 动画 ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s cubic-bezier(.2,.7,.3,1); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- 桌面演示用说明 ---------- */
.desk-note { display: none; }
@media (min-width: 1024px) {
  .desk-note {
    display: block;
    position: fixed;
    left: 40px;
    top: 50%;
    transform: translateY(-50%);
    width: 260px;
    z-index: 1;
  }
}
/* ===== 安全提示条（危机 / 就医 / 敏感）=====
   这三类是后端固定插入的，不依赖大模型，所以样式必须显眼、打印也看得清 */
.safety-banner {
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.8;
}
.safety-banner--crisis {
  background: #FFEFEF;
  border: 1px solid #E9A8A8;
  color: #8A1F1F;
}
.safety-banner--medical {
  background: #FFF6E5;
  border: 1px solid #E8D9AE;
  color: #7A5A12;
}
.safety-banner--sensitive {
  background: #F3F8F4;
  border: 1px solid #CFE3D6;
  color: #2C5443;
}
.safety-banner ul { margin: 0 0 8px; padding-left: 20px; }

/* ===== 时间轴（日记回看）===== */
.timeline-month {
  font-size: 12.5px;
  color: var(--ink-3);
  margin: 14px 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.timeline-month::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ===== 打印成长报告 ===== */
@media print {
  .appbar, [data-tabbar], .toolbar, .chips, nav, .global-back, .appbar-back { display: none !important; }
  body { background: #fff; }
  .card { break-inside: avoid; box-shadow: none; border: 1px solid #ddd; }
}
.ai-mark {
  margin: 0 0 12px;
  padding: 9px 12px;
  border-radius: 12px;
  background: #EEF3F9;
  border: 1px solid #D7E2F0;
  color: #33506E;
  font-size: 12.5px;
  line-height: 1.6;
}
.ai-page-disclosure {
  margin: 8px 18px 24px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  text-align: center;
  line-height: 1.75;
}

/* 家长活动中心 · 家长申请折叠面板（父训厅 / 母仪堂共用） */
.base-application-entry > summary { list-style: none; }
.base-application-entry > summary::-webkit-details-marker { display: none; }
.base-application-entry[open] .base-application-chevron { transform: rotate(90deg); }
.base-application-chevron {
  display: inline-block; color: var(--ink-3); font-size: 22px;
  transition: transform .18s ease;
}

/* 英语老师页 · 英语口才研学营折叠申请 */
#english-speech-camp-entry > summary { list-style: none; }
#english-speech-camp-entry > summary::-webkit-details-marker { display: none; }
#english-speech-camp-entry[open] .speech-camp-chevron { transform: rotate(90deg); }
.speech-camp-chevron {
  display:inline-block;
  flex:0 0 auto;
  color:var(--ink-3);
  font-size:22px;
  transition:transform .18s ease;
}
.base-directory-entry > summary { list-style: none; }
.base-directory-entry > summary::-webkit-details-marker { display: none; }
.base-directory-entry[open] .base-directory-chevron { transform: rotate(90deg); }
.base-directory-chevron {
  display: inline-block; color: var(--ink-3); font-size: 22px;
  transition: transform .18s ease;
}
.ai-feedback {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px dashed var(--line);
  color: var(--ink-3);
  font-size: 12px;
}
.ai-feedback button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-2);
  min-height: 32px;
  padding: 6px 10px;
  font-size: 13px;
  font: inherit;
  cursor: pointer;
}
.ai-feedback button:hover { border-color: var(--brand); color: var(--brand); }
/* 引用溯源：正文里的专家姓名链接 + 末尾的出处清单 */
.ref-link { color: var(--brand); text-decoration: none; border-bottom: 1px dashed rgba(47, 107, 79, .45); }
.ref-link:hover { border-bottom-style: solid; }
.ref-box { margin-top: 14px; padding: 14px; background: #F7FAF7; border-color: #DCE8DF; }

/* ---------- 学习闭环 ---------- */
.learn-head {
  padding: 16px;
  border: 1px solid #cfe3d6;
  border-radius: 18px;
  background: linear-gradient(135deg, #fffdf8, #eaf5ed);
}
.learn-head-top, .learn-row-between {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.learn-head-note { margin: 8px 0 0; line-height: 1.8; }
.learn-student-line { margin: 12px 0 0; font-size: 17px; line-height: 1.8; color: var(--brand); }
.learn-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 13px; }
.learn-metric {
  min-width: 0;
  padding: 10px 8px;
  border: 1px solid rgba(47, 107, 79, .14);
  border-radius: 12px;
  background: rgba(255, 255, 255, .72);
}
.learn-metric b { display: block; font-size: 19px; color: var(--brand); line-height: 1.25; }
.learn-metric span, .learn-metric small { display: block; margin-top: 2px; color: var(--ink-3); font-size: 11.5px; line-height: 1.35; }
.learn-tabs { margin: 13px 0 0; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
.learn-tabs .chip, .pg-tabs .chip { flex: 0 0 auto; white-space: nowrap; }
.learn-panel { margin-top: 12px; }
.learn-msg { min-height: 18px; margin: 8px 0 0; color: var(--ink-3); }
.learn-plan-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.learn-progress { height: 7px; margin-top: 10px; overflow: hidden; border-radius: 99px; background: #e8eee9; }
.learn-progress i { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.learn-question { margin-top: 12px; }
.learn-q-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 13px; }
.learn-prompt { margin: 14px 0 12px; font-size: 17px; line-height: 1.9; color: var(--ink); }
.learn-options { display: grid; gap: 8px; }
.learn-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-size: 15px;
  line-height: 1.7;
  cursor: pointer;
}
.learn-option:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.learn-option input { margin-top: 4px; flex: none; }
.learn-question-actions { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.learn-result {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.8;
}
.learn-result p { margin: 4px 0; }
.learn-result.is-correct { border-color: #bad8c3; background: #eef8f1; }
.learn-result.is-wrong { border-color: #e6cf9d; background: #fff8e8; }
.learn-hint { color: #7d5a15; }
.learn-error-types { margin-top: 12px; }
.learn-error-types > p { margin: 0 0 6px; }
.learn-complete, .learn-score { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.learn-complete > span {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  color: #fff;
  background: var(--brand);
  font-size: 24px;
}
.learn-complete p, .learn-score p { margin: 3px 0 0; }
.learn-list { margin-top: 14px; }
.learn-list > h2, .learn-list > .section-title { margin-bottom: 8px; }
.learn-history { margin-top: 9px; }
.learn-history > summary { cursor: pointer; list-style: none; }
.learn-history > summary::-webkit-details-marker { display: none; }
.learn-history > summary .tiny { display: block; margin-top: 3px; color: var(--ink-3); }
.learn-mastery { margin-top: 9px; }
.learn-mastery .learn-row-between { align-items: center; }
.learn-score { justify-content: center; flex-wrap: wrap; }
.learn-score > b { font-size: 54px; color: var(--brand); line-height: 1; }
.learn-score > span { font-size: 18px; color: var(--brand); }
.learn-score > p { flex-basis: 100%; margin: 0; text-align: center; }
.learn-timer { padding: 7px 12px; border-radius: 10px; color: #fff; background: var(--brand); font-variant-numeric: tabular-nums; font-weight: 800; }
.learn-exam-q { margin-top: 9px; }
.learn-teacher-sheet { margin-top: 12px; font-size: 13px; line-height: 1.75; }
.learn-teacher-sheet h3 { margin: 0; font-size: 18px; }
.learn-teacher-sheet h4 { margin: 12px 0 5px; }
.learn-teacher-sheet table { width: 100%; border-collapse: collapse; font-size: 12px; }
.learn-teacher-sheet th, .learn-teacher-sheet td { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: left; }

@media (max-width: 420px) {
  .learn-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media print {
  body[data-page="learning"] .appbar,
  body[data-page="learning"] .tabbar,
  body[data-page="learning"] .learn-tabs,
  body[data-page="learning"] .no-print { display: none !important; }
  body[data-page="learning"] .app { padding: 0 !important; }
  body[data-page="learning"] #learning-root { padding: 0 !important; }
  body[data-page="learning"] .learn-head { display: none !important; }
  body[data-page="learning"] .learn-panel:not(:last-child) { display: none !important; }
  @page { size: A4; margin: 14mm; }
}

/* ---------- 家长能力练场 ---------- */
.pg-hero {
  padding: 16px;
  border: 1px solid #d7e4da;
  border-radius: 18px;
  background: linear-gradient(140deg, #fffdf8, #eaf5ed);
}
.pg-hero h1 { margin: 4px 0 0; }
.pg-hero > .tiny { margin: 7px 0 0; line-height: 1.8; }
.pg-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.pg-stats > div {
  padding: 9px 7px;
  border: 1px solid rgba(47, 107, 79, .14);
  border-radius: 11px;
  background: rgba(255, 255, 255, .74);
}
.pg-stats b { display: block; color: var(--brand); font-size: 20px; }
.pg-stats span { display: block; margin-top: 2px; color: var(--ink-3); font-size: 11.5px; line-height: 1.35; }
.pg-tabs { margin-top: 13px; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
.pg-panel { margin-top: 12px; }
.pg-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.pg-script, .pg-action {
  margin-top: 12px;
  padding: 13px;
  border-radius: 13px;
}
.pg-script { color: #fff; background: var(--brand); }
.pg-script .tiny { color: #d6e7dc; margin: 0 0 5px; }
.pg-script p:last-child { margin: 0; font-size: 18px; line-height: 1.75; }
.pg-action { background: #fff8e8; border: 1px solid #ead5a6; }
.pg-action .tiny { margin: 0 0 5px; color: #85601a; }
.pg-action p:last-child { margin: 0; font-size: 16px; line-height: 1.85; }
.pg-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.pg-msg { min-height: 18px; margin: 8px 0 0; color: var(--ink-3); }
.pg-review-block { margin-top: 12px; padding: 11px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.pg-review-block p { margin: 4px 0 0; font-size: 14px; line-height: 1.8; }
.pg-share { margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--brand-soft); }
.pg-share p { margin: 0 0 6px; }
.pg-share .btn { margin-top: 7px; }
.pg-chat { min-height: 70px; margin-top: 12px; padding: 10px; border-radius: 12px; background: #f8faf7; }
.pg-turn { max-width: 88%; margin-top: 8px; padding: 9px 11px; border-radius: 12px; }
.pg-turn:first-child { margin-top: 0; }
.pg-turn span { display: block; margin-bottom: 3px; font-size: 11px; color: var(--ink-3); }
.pg-turn p { margin: 0; font-size: 14px; line-height: 1.75; }
.pg-turn.is-parent { margin-left: auto; background: var(--brand); color: #fff; }
.pg-turn.is-parent span { color: #d9e9df; }
.pg-turn.is-child { background: #fff; border: 1px solid var(--line); }
.pg-turn.is-coach { max-width: 100%; background: #fff8e8; border: 1px solid #ead5a6; }
.pg-agenda { margin-top: 13px; padding-top: 12px; border-top: 1px dashed var(--line); }
.pg-agenda h3 { margin: 0; font-size: 16px; }
.pg-agenda ol { margin: 8px 0 12px; padding-left: 20px; font-size: 14px; line-height: 1.85; }
.pg-evidence { margin-top: 12px; }
.pg-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.pg-badge {
  padding: 8px 10px;
  border: 1px solid #cfe3d6;
  border-radius: 11px;
  background: #eef7f0;
}
.pg-badge b, .pg-badge span { display: block; }
.pg-badge b { color: var(--brand); font-size: 13px; }
.pg-badge span { margin-top: 2px; color: var(--ink-3); font-size: 11.5px; }
.pg-review-history { margin-top: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pg-review-history > summary { cursor: pointer; }
.pg-review-history > summary span { display: block; margin-top: 3px; color: var(--ink-3); }
.pg-share-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.pg-share-row p { margin: 3px 0 0; }

@media (max-width: 420px) {
  .pg-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pg-actions .btn { flex: 1 1 120px; }
}
