/* =============================================================
   小芽 · 界面样式
   依 unslop（Damir Sokolovsky, CC BY 4.0）的方向逐层收敛：
   单一暖中性 ramp / 单一苔绿 accent / 4px 网格 / 三种文字角色 /
   统一 18px-1.5 线性图标 / 无渐变无发光无 emoji 徽章 / 一种缓动曲线
   ============================================================= */

:root {
  /* 暖中性 ramp：背景、卡片、抬升、发丝线 */
  --bg:        #f7f5f0;
  --surface:   #ffffff;
  --sidebar:   #fbfaf7;
  --raised:    #f1eee8;
  --line:      rgba(31, 27, 22, .085);
  --line-2:    rgba(31, 27, 22, .055);
  --text:      #1f1b16;
  --text-2:    #5e554a;
  --text-3:    #8a847a;
  --accent:    #1f6f52;
  --accent-2:  #2c8a68;
  --accent-soft:#eaf2ec;
  --pos:       #16794f;
  --neg:       #b4433f;
  --neg-soft:  #f7ecea;
  --warn:      #a06a1c;
  --warn-soft: #f8f0e0;

  --r-sm: 6px;
  --r-ctl: 9px;
  --r-card: 14px;
  --r-panel: 18px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.muted { color: var(--text-3); font-size: 12px; }
button, input, select { font-family: inherit; }
button { cursor: pointer; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* 统一图标：一个尺寸、一个描边、随文字角色取色 */
.ico, .i, .i[class] {
  display: inline-block;
  width: 18px; height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -.15em;
}
.i:not(svg) { width: 18px; height: 18px; }
.ico.lg, .i.lg { width: 26px; height: 26px; stroke-width: 1.4; }
.dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--dot, var(--accent)); flex: none;
}
.brand-glyph {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent); flex: none;
}
.brand-glyph .ico { width: 20px; height: 20px; }

/* ---------------------------------------------------------------- 通用控件 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: var(--r-ctl);
  background: var(--surface); color: var(--text);
  font-size: 13px; font-weight: 500; white-space: nowrap;
  transition: background .16s var(--ease), border-color .16s var(--ease),
              color .16s var(--ease), transform .16s var(--ease);
}
.btn:hover { background: var(--raised); border-color: rgba(31,27,22,.16); }
.btn:active { transform: scale(.98); }
.btn .ico { width: 16px; height: 16px; }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.primary:hover { background: #185f46; border-color: #185f46; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--raised); }
.btn.danger { color: var(--neg); border-color: rgba(180,67,63,.28); }
.btn.danger:hover { background: var(--neg-soft); border-color: rgba(180,67,63,.45); }
.btn.sm { height: 30px; padding: 0 12px; font-size: 12px; }
.btn.sm .ico { width: 14px; height: 14px; }

.input {
  width: 100%; height: 36px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--r-ctl);
  background: var(--surface); color: var(--text); font-size: 13px;
  outline: none; transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31,111,82,.1); }
.input::placeholder { color: var(--text-3); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%); background-position: calc(100% - 16px) 15px, calc(100% - 11px) 15px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.file-input { padding: 6px 10px; height: auto; }
textarea.input { height: auto; padding: 10px 12px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); }
.pad { padding: 20px; }
.card.empty { padding: 48px 20px; text-align: center; color: var(--text-3); }
.sec-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; color: var(--text); margin: 0 0 16px;
}
.sec-title .ico { width: 16px; height: 16px; color: var(--text-3); }
.sec-title small { margin-left: auto; font-size: 12px; font-weight: 400; color: var(--text-3); }
.sec-title + .sec-title { margin-top: 28px; }

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 8px; border-radius: var(--r-sm);
  background: var(--raised); color: var(--text-2);
  font-size: 11px; font-weight: 400; white-space: nowrap;
}
.tag.g { background: var(--accent-soft); color: var(--accent); }
.tag.p { background: #eef0f6; color: #4c5876; }
.tag.a { background: var(--warn-soft); color: var(--warn); }
.tag.r { background: var(--neg-soft); color: var(--neg); }
.pill {
  display: inline-flex; align-items: center; height: 28px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--text-2); font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.code-inline { font-family: var(--mono); font-size: 11px; color: var(--text-2); background: var(--raised); padding: 2px 6px; border-radius: 4px; }
.code-box { font-family: var(--mono); font-size: 12px; background: var(--raised); border-radius: var(--r-ctl); padding: 12px; overflow: auto; }

.grid { display: grid; gap: 16px; }
.grid.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.g21 { grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); }

/* ---------------------------------------------------------------- 弹窗 / toast */
.modal-mask {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(24, 20, 16, .42);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  backdrop-filter: blur(3px);
  animation: fade .2s var(--ease);
}
.modal {
  width: min(480px, 100%); max-height: min(88vh, 900px); display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-panel); box-shadow: 0 8px 24px rgba(31,27,22,.1);
  animation: rise .3s var(--ease);
}
.modal.wide { width: min(680px, 100%); }
.modal-head { display: flex; align-items: flex-start; gap: 16px; padding: 20px 24px 16px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0 0 4px; font-size: 17px; font-weight: 600; }
.modal-head p { margin: 0; font-size: 12px; color: var(--text-3); }
.modal-head .x { margin-left: auto; }
.x { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text-3); }
.x:hover { background: var(--raised); color: var(--text); }
.x .ico { width: 17px; height: 17px; }
.modal-body { padding: 20px 24px; overflow-y: auto; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--line); }
.toast {
  position: fixed; z-index: 120; left: 50%; bottom: 32px; transform: translate(-50%, 12px);
  background: var(--text); color: #fff; padding: 10px 18px; border-radius: var(--r-ctl);
  font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid.tight { gap: 10px 12px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field > span { font-size: 12px; color: var(--text-2); }
.field em, .rights-title em { color: var(--neg); font-style: normal; }
.check-line { display: flex; align-items: flex-start; gap: 10px; margin-top: 14px; font-size: 12px; color: var(--text-2); line-height: 1.6; }
.check-line input { margin-top: 2px; accent-color: var(--accent); }

/* ---------------------------------------------------------------- 登录 */
.auth-layer { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--bg); }
.auth-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 28px; box-shadow: 0 8px 24px rgba(31,27,22,.06); }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.auth-brand b { display: block; font-size: 18px; font-weight: 600; letter-spacing: .01em; }
.auth-brand small { display: block; font-size: 12px; color: var(--text-3); margin-top: 2px; }
.auth-tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.auth-tabs button { border: 0; background: none; padding: 0 0 12px; font-size: 13px; color: var(--text-3); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.auth-tabs button.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form .btn { width: 100%; margin-top: 6px; }
.auth-err { font-size: 12px; color: var(--neg); background: var(--neg-soft); padding: 8px 12px; border-radius: var(--r-sm); }
.auth-demo { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-3); }
.auth-demo b { color: var(--text-2); font-weight: 500; font-family: var(--mono); font-size: 11px; }
.auth-note { display: flex; gap: 10px; margin-top: 20px; padding: 12px; background: var(--raised); border-radius: var(--r-ctl); font-size: 11px; line-height: 1.6; color: var(--text-2); }
.auth-note .ico { width: 15px; height: 15px; color: var(--text-3); margin-top: 1px; }

/* ---------------------------------------------------------------- 家长端 · 外壳 */
.parent { display: flex; height: 100vh; overflow: hidden; }
.sidebar { width: 248px; flex: none; background: var(--sidebar); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 24px 16px 16px; }
.logo { display: flex; align-items: center; gap: 12px; padding: 0 8px 28px; }
.logo > div { font-size: 16px; font-weight: 600; letter-spacing: .01em; }
.logo small { display: block; font-size: 11px; font-weight: 400; color: var(--text-3); margin-top: 2px; letter-spacing: .02em; }
.nav-label { padding: 0 12px 8px; font-size: 11px; color: var(--text-3); letter-spacing: .06em; }
#nav { display: flex; flex-direction: column; gap: 2px; }
#nav button {
  display: flex; align-items: center; gap: 10px; height: 36px; width: 100%;
  padding: 0 12px; border: 0; border-radius: var(--r-ctl);
  background: transparent; color: var(--text-2); font-size: 13px; text-align: left;
  transition: background .14s var(--ease), color .14s var(--ease);
}
#nav button .ico { width: 17px; height: 17px; color: var(--text-3); }
#nav button:hover { background: var(--raised); color: var(--text); }
#nav button.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
#nav button.active .ico { color: var(--accent); }
.sidebar-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.safe-tip { display: flex; gap: 10px; padding: 12px; background: var(--raised); border-radius: var(--r-ctl); }
.safe-tip .ico { width: 16px; height: 16px; color: var(--text-3); margin-top: 1px; }
.safe-tip b { display: block; font-size: 12px; font-weight: 600; }
.safe-tip small { display: block; font-size: 11px; color: var(--text-3); margin-top: 3px; line-height: 1.5; }
.back-kids { display: flex; align-items: center; gap: 8px; width: 100%; height: 34px; margin-top: 12px; padding: 0 12px; border: 0; background: none; color: var(--text-3); font-size: 12px; border-radius: var(--r-ctl); }
.back-kids:hover { background: var(--raised); color: var(--text); }
.back-kids .ico { width: 15px; height: 15px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 64px; flex: none; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 32px; background: var(--surface); border-bottom: 1px solid var(--line); }
.crumb { font-size: 16px; font-weight: 600; }
.topsub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.pages { flex: 1; overflow-y: auto; padding: 28px 32px 48px; }
.page { display: none; max-width: 1480px; }
.page.active { display: block; animation: rise .32s var(--ease); }

/* ---------------------------------------------------------------- 统计卡（只有数字） */
.stat { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 20px; min-height: 112px; }
.stat .lab { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-2); }
.stat .lab .ico { width: 15px; height: 15px; color: var(--text-3); }
.stat .val { margin-top: 12px; font-size: 30px; font-weight: 500; line-height: 1; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.stat .val small { font-size: 13px; font-weight: 400; color: var(--text-2); letter-spacing: 0; }
.stat .sub { margin-top: 8px; font-size: 11px; color: var(--text-3); }
.stat.hl .val { color: var(--accent); }
.stat .spark { display: none; }

/* ---------------------------------------------------------------- 概览 */
.advice { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.advice:last-child { border-bottom: 0; padding-bottom: 0; }
.advice:first-child { padding-top: 0; }
.advice .ai { width: 30px; height: 30px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: var(--r-sm); background: var(--raised); color: var(--text-3); }
.advice .ai .ico { width: 16px; height: 16px; }
.advice .ai.p { background: var(--accent-soft); color: var(--accent); }
.advice h4 { margin: 0 0 4px; font-size: 13px; font-weight: 600; }
.advice p { margin: 0; font-size: 12px; color: var(--text-2); line-height: 1.6; }
.advice .act { margin-top: 10px; }
.timeline { display: flex; flex-direction: column; }
.tl-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.tl-item:last-child { border-bottom: 0; }
.tl-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }
.tl-txt { flex: 1; min-width: 0; font-size: 12px; color: var(--text); }
.tl-txt small { display: block; font-size: 11px; color: var(--text-3); }
.tl-time { font-family: var(--mono); font-size: 11px; color: var(--text-3); white-space: nowrap; }
.mini-list { display: flex; flex-direction: column; }
.mini-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.mini-row:last-child { border-bottom: 0; }
.mr-ico { width: 28px; height: 28px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: var(--r-sm); background: var(--raised); color: var(--text-3); }
.mr-ico .ico { width: 15px; height: 15px; }
.mr-main { flex: 1; min-width: 0; font-size: 12px; }
.mr-sub { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.mini-row > b { font-size: 16px; font-weight: 500; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- 资源库 */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.chips { display: flex; gap: 4px; padding: 3px; background: var(--raised); border-radius: var(--r-ctl); }
.chip { height: 28px; padding: 0 12px; border: 0; background: transparent; color: var(--text-2); font-size: 12px; border-radius: var(--r-sm); }
.chip.active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(31,27,22,.06); }
.toolbar .input { width: 168px; }
.toolbar #libSearch { width: 200px; }
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 16px; }
.vcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; display: flex; flex-direction: column; }
.vthumb { position: relative; height: 132px; display: flex; align-items: center; justify-content: center; background: var(--raised); overflow: hidden; }
.vthumb::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--thumb, var(--accent)); }
.vthumb .thumb-ico { width: 44px; height: 44px; color: var(--thumb, var(--accent)); opacity: .55; }
.vthumb .thumb-ico .ico { width: 44px; height: 44px; stroke-width: 1.2; }
.vthumb .st, .vthumb .dur { position: absolute; bottom: 8px; font-size: 10px; padding: 3px 7px; border-radius: 4px; background: rgba(255,255,255,.9); color: var(--text-2); }
.vthumb .st { left: 12px; }
.vthumb .dur { right: 12px; font-family: var(--mono); }
.vbody { padding: 16px; display: flex; flex-direction: column; flex: 1; gap: 8px; }
.vbody h4 { margin: 0; font-size: 14px; font-weight: 600; }
.vmeta { display: flex; gap: 6px; flex-wrap: wrap; }
.vfoot { display: flex; gap: 8px; margin-top: auto; padding-top: 12px; }
.e-ico { width: 34px; height: 34px; margin: 0 auto 12px; color: var(--text-3); }
.e-ico .ico { width: 34px; height: 34px; }

/* ---------------------------------------------------------------- 策略 */
.weight-row { display: grid; grid-template-columns: 160px 1fr 48px; align-items: center; gap: 16px; padding: 9px 0; }
.wlab { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.wlab .dot { width: 7px; height: 7px; }
.weight-row input[type=range] { width: 100%; accent-color: var(--accent); height: 4px; }
.wval { text-align: right; font-family: var(--mono); font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.queue-item { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 12px; }
.queue-item:last-child { border-bottom: 0; }
.queue-item > span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qi { width: 22px; height: 22px; flex: none; display: flex; align-items: center; justify-content: center; background: var(--raised); border-radius: var(--r-sm); font-family: var(--mono); font-size: 11px; color: var(--text-2); }
.qs { font-family: var(--mono); color: var(--text-3); }
.formula { font-family: var(--mono); font-size: 11px; line-height: 1.9; color: var(--text-2); background: var(--raised); border-radius: var(--r-ctl); padding: 16px; }
.formula b { color: var(--text); font-weight: 600; }
.formula em { font-style: normal; color: var(--accent); }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.setting-row:last-of-type { border-bottom: 0; }
.sl { font-size: 13px; }
.ss { font-size: 11px; color: var(--text-3); margin-top: 3px; }
.sr { width: 148px; flex: none; }
.sr .input { height: 34px; }

/* ---------------------------------------------------------------- 图表 */
.chartbox { padding: 20px; }
.chart { display: block; width: 100%; height: auto; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: center; margin-top: 8px; font-size: 11px; color: var(--text-2); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.mastery { display: flex; flex-direction: column; gap: 12px; }
.mrow { display: grid; grid-template-columns: 116px 1fr 44px; align-items: center; gap: 12px; font-size: 12px; }
.mrow > span { display: flex; align-items: center; gap: 7px; }
.mrow .dot { width: 7px; height: 7px; }
.mbar { height: 6px; background: var(--raised); border-radius: 3px; overflow: hidden; }
.mbar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.mrow b { text-align: right; font-family: var(--mono); font-weight: 500; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- 互享 / 合规 */
.share-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.share-item:last-child { border-bottom: 0; }
.si { width: 34px; height: 34px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: var(--r-sm); background: var(--raised); color: var(--text-3); }
.si .ico { width: 17px; height: 17px; }
.sc { flex: 1; min-width: 0; }
.sc h4 { margin: 0 0 3px; font-size: 13px; font-weight: 600; }
.sc p { margin: 0; font-size: 11px; color: var(--text-3); }
.share-card { background: var(--raised); border-radius: var(--r-ctl); padding: 16px; font-size: 12px; }
.rules { display: flex; flex-direction: column; gap: 14px; }
.rule b { display: block; font-size: 12px; font-weight: 600; margin-bottom: 3px; }
.rule span { font-size: 12px; color: var(--text-2); line-height: 1.6; }
.notice-hero { display: flex; gap: 16px; align-items: flex-start; padding: 20px; margin-bottom: 20px; background: var(--accent-soft); border: 1px solid rgba(31,111,82,.14); border-radius: var(--r-card); }
.notice-hero .nh { width: 38px; height: 38px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--surface); color: var(--accent); }
.notice-hero .nh .ico { width: 20px; height: 20px; }
.notice-hero h3 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.notice-hero p { margin: 0; font-size: 12px; line-height: 1.7; color: var(--text-2); }
.checklist { display: flex; flex-direction: column; gap: 10px; }
.cl { display: flex; gap: 10px; font-size: 12px; line-height: 1.6; color: var(--text-2); }
.cl i { flex: none; width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-style: normal; font-size: 11px; }
.cl .ico { width: 13px; height: 13px; }
.cl.good i { background: var(--accent-soft); color: var(--accent); }
.cl.bad i { background: var(--neg-soft); color: var(--neg); }
.cl b { font-weight: 600; color: var(--text); }
.tb { width: 100%; border-collapse: collapse; font-size: 11px; }
.tb th { text-align: left; padding: 8px 10px; color: var(--text-3); font-weight: 500; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tb td { padding: 10px; border-bottom: 1px solid var(--line-2); color: var(--text-2); }
.disclaimer { margin-top: 20px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--raised); font-size: 11px; line-height: 1.8; color: var(--text-2); }

/* ---------------------------------------------------------------- 上传 / 权利声明 */
.rights-box { margin-top: 20px; padding: 18px; background: var(--raised); border-radius: var(--r-ctl); }
.rights-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; margin-bottom: 14px; }
.rights-title .ico { width: 16px; height: 16px; color: var(--text-3); }
.rights-title em { font-size: 11px; font-weight: 400; color: var(--text-3); }
.rights-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.rights-opts label { display: flex; gap: 10px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-ctl); cursor: pointer; }
.rights-opts label:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.rights-opts input { margin-top: 2px; accent-color: var(--accent); }
.rights-opts b { display: block; font-size: 12px; font-weight: 600; }
.rights-opts small { display: block; font-size: 11px; color: var(--text-3); margin-top: 3px; line-height: 1.5; }
.rights-note { margin-top: 14px; font-size: 11px; line-height: 1.7; color: var(--text-3); }
.upload-hint { font-size: 11px; color: var(--text-3); }

/* ---------------------------------------------------------------- 门禁 */
.gate-modal { padding: 28px; }
.gate-modal h2 { margin: 14px 0 6px; font-size: 18px; font-weight: 600; }
.gate-modal p { margin: 0 0 20px; font-size: 12px; color: var(--text-2); }
.gate-ico { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 11px; background: var(--accent-soft); color: var(--accent); }
.gate-ico .ico { width: 22px; height: 22px; }
.gate-quiz { font-size: 12px; color: var(--text-2); margin-bottom: 8px; }
.gate-err { margin-top: 10px; font-size: 12px; color: var(--neg); }
.gate-modal .modal-actions { padding: 20px 0 0; border: 0; }
.gate-note { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 11px; line-height: 1.7; color: var(--text-3); }
.gate-note b { font-family: var(--mono); color: var(--text-2); }

/* ---------------------------------------------------------------- 更新弹窗 */
.update-modal { padding: 24px; }
.update-head { display: flex; align-items: center; gap: 14px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.update-glyph { width: 42px; height: 42px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.update-glyph .ico { width: 22px; height: 22px; }
.update-head h2 { margin: 0 0 3px; font-size: 17px; font-weight: 600; }
.update-head p { margin: 0; font-size: 12px; color: var(--text-3); font-family: var(--mono); }
.update-label { margin: 18px 0 10px; font-size: 11px; color: var(--text-3); }
.changelog { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; max-height: 240px; overflow-y: auto; }
.changelog li { display: flex; gap: 10px; font-size: 12px; line-height: 1.6; color: var(--text-2); }
.changelog li .ico { width: 14px; height: 14px; color: var(--accent); margin-top: 3px; }
.update-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.update-foot .modal-actions { padding: 0; border: 0; }
.update-card { display: flex; align-items: center; gap: 12px; }
.update-card .uc-txt { flex: 1; min-width: 0; }
.update-card .uc-txt b { display: block; font-size: 13px; font-weight: 600; }
.update-card .uc-txt small { display: block; font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* =================================================================
   儿童端：深色沉浸式，独立变量，与家长端共用同一套图标与缓动
   ================================================================= */
.kids {
  --k-bg: #0e1116; --k-surface: #171b23; --k-line: rgba(255,255,255,.1);
  --k-text: #f2f3f5; --k-text-2: #aab2c0; --k-text-3: #78818f;
  position: fixed; inset: 0; z-index: 10; overflow: auto;
  background: var(--k-bg); color: var(--k-text);
}
.kids-glow { display: none; }
.kids-wrap { min-height: 100%; display: flex; align-items: center; justify-content: center; gap: 72px; padding: 32px; }
.phone {
  position: relative; width: min(390px, 100%); height: min(780px, calc(100vh - 64px));
  flex: none; overflow: hidden; border-radius: 28px; background: #0b0d12;
  border: 1px solid rgba(255,255,255,.08); box-shadow: 0 24px 64px rgba(0,0,0,.5);
  transition: width .35s var(--ease), height .35s var(--ease);
}
.kids-wrap.wide .phone { width: min(960px, 92vw); height: min(540px, calc(100vh - 64px)); }
.stage { position: absolute; inset: 0; }
.video { position: absolute; inset: 0; background: #0b0d12; transition: transform .42s var(--ease); overflow: hidden; }
.video.no-anim { transition: none; }
.video .media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #0b0d12; }
.video.landscape .media { object-fit: contain; }
/* 去掉旧版装饰层：发光球、漂浮 emoji、渐变幕布 */
.sky, .orb, .orb.a, .orb.b, .orb.c, .orb.d, .fly, .fly.f1, .fly.f2, .fly.f3, .play-badge { display: none !important; }
.scene { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; pointer-events: none; }
.scene-emoji { width: 76px; height: 76px; display: flex; align-items: center; justify-content: center; color: var(--scene, #7bd389); opacity: .5; }
.scene-emoji .ico { width: 76px; height: 76px; stroke-width: 1.1; }
.scene-title { font-size: 20px; font-weight: 500; letter-spacing: .01em; }
.scene-sub { font-size: 12px; color: var(--k-text-3); }
.scene-check { position: absolute; top: 96px; left: 20px; display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--k-text-2); background: rgba(12,15,20,.55); padding: 5px 10px; border-radius: 6px; }
.scene-check .ico { width: 13px; height: 13px; color: #7bd389; }

.kids-top { position: absolute; top: 0; left: 0; right: 0; z-index: 4; display: flex; align-items: center; gap: 12px; padding: 16px 18px; background: linear-gradient(to bottom, rgba(8,10,14,.8), transparent); }
.brand { display: flex; align-items: center; gap: 7px; font-size: 15px; font-weight: 600; }
.brand .ico { width: 18px; height: 18px; color: #7bd389; }
.kids-domain { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--k-text-2); }
.kids-domain .dot { width: 6px; height: 6px; }
.kids-time { font-size: 11px; color: var(--k-text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.btn-rotate { position: absolute; z-index: 6; top: 60px; right: 16px; display: none; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 1px solid rgba(255,255,255,.16); border-radius: 8px; background: rgba(12,15,20,.6); color: #fff; font-size: 11px; }
.btn-rotate.show { display: inline-flex; }
.btn-rotate .ico { width: 14px; height: 14px; }

.kids-side { position: absolute; z-index: 4; right: 12px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 16px; }
.side-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 56px; height: 56px; border: 0; border-radius: 16px; background: rgba(12,15,20,.4); color: #fff; transition: background .16s var(--ease), transform .16s var(--ease); }
.side-btn:active { transform: scale(.94); }
.side-btn .ico, .side-ico .ico { width: 22px; height: 22px; }
.side-ico { display: inline-flex; }
.side-btn small { font-size: 10px; color: var(--k-text-2); }
.side-btn.on { background: rgba(31,111,82,.85); }
.side-btn.on small { color: #fff; }

.kids-bottom { position: absolute; z-index: 4; left: 0; right: 76px; bottom: 0; padding: 0 18px 18px; background: linear-gradient(to top, rgba(8,10,14,.92), rgba(8,10,14,.55) 60%, transparent); }
.knowledge { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; color: #e8e2b8; margin-bottom: 8px; }
.kn-ico { display: inline-flex; }
.knowledge .ico, .kn-ico .ico { width: 14px; height: 14px; }
.video-title { font-size: 20px; font-weight: 500; line-height: 1.3; }
.video-meta { font-size: 11px; color: var(--k-text-2); margin-top: 4px; }
.progress { height: 2px; margin: 14px 0 10px; background: rgba(255,255,255,.16); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: #fff; transition: width .3s linear; }
.kids-nav { display: flex; gap: 8px; }
.kids-nav button { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 12px; border: 1px solid rgba(255,255,255,.16); border-radius: 8px; background: rgba(12,15,20,.45); color: #fff; font-size: 11px; }
.kids-nav button .ico { width: 13px; height: 13px; }
.swipe-hint { margin-top: 10px; font-size: 10px; color: var(--k-text-3); }
.parent-entry { position: absolute; z-index: 6; top: 14px; right: 16px; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,.14); border-radius: 10px; background: rgba(12,15,20,.55); color: #fff; }
.parent-entry .ico { width: 17px; height: 17px; }
.kids-wrap.wide .kids-bottom { right: 92px; }
.kids-wrap.wide .kids-side { right: 16px; }

.rest-lock { position: absolute; inset: 0; z-index: 12; display: flex; align-items: center; justify-content: center; background: rgba(8,10,14,.94); padding: 24px; }
.rest-card { width: min(320px, 100%); padding: 28px 24px; border-radius: 20px; background: var(--k-surface); border: 1px solid var(--k-line); text-align: center; }
.rest-ico, .rest-emoji { width: 46px; height: 46px; margin: 0 auto 16px; display: flex; align-items: center; justify-content: center; border-radius: 14px; background: rgba(255,255,255,.06); color: #cfd6e2; }
.rest-ico .ico { width: 26px; height: 26px; }
.rest-card h2 { margin: 0 0 10px; font-size: 18px; font-weight: 500; }
.rest-card p { margin: 0 0 20px; font-size: 12px; line-height: 1.7; color: var(--k-text-2); }
.rest-card small { display: block; margin-top: 16px; font-size: 10px; color: var(--k-text-3); line-height: 1.6; }
.rest-actions { display: flex; gap: 8px; justify-content: center; }
.rest-lock .btn.primary { background: #f2f3f5; color: #14171d; border-color: #f2f3f5; }
.rest-lock .btn.ghost { color: #f2f3f5; border-color: rgba(255,255,255,.2); }

.kids-aside { width: min(360px, 100%); color: var(--k-text); }
.aside-label, .aside-badge { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; color: var(--k-text-2); padding: 6px 12px; border: 1px solid var(--k-line); border-radius: 999px; }
.kids-aside h1 { margin: 24px 0 16px; font-size: 36px; line-height: 1.18; font-weight: 500; letter-spacing: -.02em; }
.kids-aside > p { margin: 0 0 28px; font-size: 13px; line-height: 1.8; color: var(--k-text-2); }
.aside-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 20px 0; border-top: 1px solid var(--k-line); border-bottom: 1px solid var(--k-line); }
.aside-stats b { display: block; font-size: 26px; font-weight: 500; font-variant-numeric: tabular-nums; }
.aside-stats span { font-size: 11px; color: var(--k-text-3); }
.aside-feats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 24px 0; font-size: 12px; color: var(--k-text-2); }
.aside-feats span { display: flex; align-items: center; gap: 7px; }
.aside-feats .ico { width: 14px; height: 14px; color: #7bd389; }
.aside-btn { display: inline-flex; align-items: center; gap: 9px; height: 42px; padding: 0 20px; border: 1px solid rgba(255,255,255,.18); border-radius: 10px; background: transparent; color: var(--k-text); font-size: 13px; font-weight: 500; }
.aside-btn:hover { background: rgba(255,255,255,.06); }
.aside-btn .ico { width: 16px; height: 16px; }
.aside-note { margin-top: 20px; font-size: 11px; color: var(--k-text-3); }

/* ---------------------------------------------------------------- 响应式 */
@media (max-width: 1180px) {
  .kids-aside { display: none; }
  .grid.g21 { grid-template-columns: 1fr; }
  .grid.g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .sidebar { width: 72px; padding: 20px 10px; }
  .logo { padding: 0 8px 24px; }
  .logo > div, .nav-label, #nav button span, .safe-tip div, .back-kids { display: none; }
  #nav button { justify-content: center; padding: 0; }
  .safe-tip { justify-content: center; padding: 10px; }
  .topbar { padding: 0 20px; }
  .pages { padding: 20px; }
  .grid.g2, .grid.g4 { grid-template-columns: 1fr; }
  .form-grid, .rights-opts { grid-template-columns: 1fr; }
  .kids-wrap { padding: 0; }
  .phone { width: 100vw; height: 100vh; border-radius: 0; border: 0; }
  .kids-wrap.wide .phone { width: 100vw; height: 100vh; }
}
@media (max-width: 560px) {
  .toolbar .input, .toolbar #libSearch { width: 100%; }
  .update-foot { flex-direction: column; align-items: stretch; }
  .update-foot .modal-actions { justify-content: flex-end; }
}

/* 只有颜色/边框/透明度/位移参与过渡，一种缓动曲线 */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
