/* ==========================================================================
   课后铃 · 孩子端（安卓平板横屏 / 演示用 Web 孪生）
   设计方向：Playful 但不幼稚 —— 深色书桌表面 + 单一暖橙强调 + 衬线大数字。
   孩子端不使用任何表单控件、不出现广告位色彩的蓝紫，只在「该做事」时亮橙。
   与 prototype/index.html 的孩子端共用同一套 token，保证原型与实现同源。
   ========================================================================== */

:root {
  --surface-child: #17130e;
  --surface-child-2: #221b13;
  --brand: #e9622e;
  --brand-soft: #f0865a;
  --brand-deep: #b8431a;
  --done: #2fb08c;
  --warn: #f2b441;
  --alert: #c9453b;
  --night: #4a5a6b;
  --ink: #f5efe4;
  --ink-mut: #a99c89;
  --line: rgba(245, 239, 228, 0.14);

  --display: "Fraunces", "Noto Serif SC", "Songti SC", "SimSun", serif;
  --body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;

  --s1: 4px;  --s2: 8px;  --s3: 16px; --s4: 24px; --s5: 40px; --s6: 64px;
  --r-s: 8px; --r-m: 14px; --r-l: 26px;
  --sh-1: 0 2px 8px rgba(0, 0, 0, 0.3);
  --sh-2: 0 8px 28px rgba(0, 0, 0, 0.38);
  --sh-3: 0 24px 64px rgba(0, 0, 0, 0.52);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --d-f: 160ms; --d-b: 320ms; --d-s: 640ms;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: var(--surface-child);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0.01em;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
/* 氛围层：书桌上的暖光 + 颗粒，不用纯色平铺 */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(62rem 40rem at 14% -18%, rgba(233, 98, 46, 0.2), transparent 62%),
    radial-gradient(48rem 34rem at 92% 6%, rgba(47, 176, 140, 0.09), transparent 58%),
    radial-gradient(40rem 30rem at 46% 112%, rgba(242, 180, 65, 0.08), transparent 60%);
}
body::after {
  content: "";
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.tnum { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.noscript { position: relative; z-index: 5; padding: var(--s4); }

/* ---------- 顶栏 ---------- */
.topbar {
  position: relative; z-index: 3; flex: none;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px var(--s4); border-bottom: 1px solid var(--line);
  font-size: 13px; color: var(--ink-mut);
}
.topbar__id { display: flex; align-items: center; gap: 10px; }
.topbar__id b { font-family: var(--display); font-weight: 600; font-size: 15px; color: var(--ink); letter-spacing: 0.01em; }
.topbar__right { display: flex; align-items: center; gap: var(--s3); }
#wallClock { font-family: var(--display); font-weight: 900; font-size: 19px; color: var(--ink); letter-spacing: 0.02em; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 3px rgba(242, 180, 65, 0.16); transition: background var(--d-b), box-shadow var(--d-b); }
.dot.on { background: var(--done); box-shadow: 0 0 0 3px rgba(47, 176, 140, 0.18); }
.dot.off { background: var(--alert); box-shadow: 0 0 0 3px rgba(201, 69, 59, 0.2); }

.icobtn {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 44px; padding: 0 14px; border-radius: 999px;
  background: none; border: 1px solid var(--line); color: var(--ink-mut);
  font-family: var(--body); font-size: 12.5px; cursor: pointer;
  transition: color var(--d-f) var(--ease), border-color var(--d-f) var(--ease), background var(--d-f) var(--ease);
}
.icobtn:hover { color: var(--ink); border-color: rgba(245, 239, 228, 0.3); }
.icobtn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.icobtn[aria-pressed="true"] { color: var(--warn); border-color: rgba(242, 180, 65, 0.5); background: rgba(242, 180, 65, 0.09); }
.icobtn[aria-pressed="true"] #muteWave { opacity: 0.25; }

/* ---------- 舞台 ---------- */
.stage { position: relative; z-index: 2; flex: 1; min-height: 0; }
.screen {
  position: absolute; inset: 0; display: none;
  padding: var(--s4) var(--s5); flex-direction: column;
}
.screen.sel { display: flex; }
.screen--center { align-items: center; justify-content: center; text-align: center; gap: var(--s3); }

/* ---------- 今日主板 ---------- */
.board { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 0.85fr); gap: var(--s4); width: 100%; height: 100%; min-height: 0; }
.board__left { min-width: 0; display: flex; flex-direction: column; gap: var(--s2); }
.board__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); }
.board__head h2 { font-family: var(--display); font-weight: 900; font-size: clamp(22px, 2.6vw, 34px); margin: 0; letter-spacing: -0.02em; }
.board__head span { font-size: 12.5px; color: var(--ink-mut); letter-spacing: 0.14em; }

.timeline { flex: 1; min-height: 0; overflow-y: auto; padding-right: 6px; scrollbar-width: thin; scrollbar-color: rgba(245, 239, 228, 0.2) transparent; }
.timeline::-webkit-scrollbar { width: 5px; }
.timeline::-webkit-scrollbar-thumb { background: rgba(245, 239, 228, 0.2); border-radius: 9px; }
.row {
  display: flex; align-items: center; gap: 12px;
  min-height: 52px; padding: 8px 12px; margin-bottom: 4px;
  border: 1px solid transparent; border-radius: var(--r-m);
  transition: background var(--d-b) var(--ease), border-color var(--d-b) var(--ease), opacity var(--d-b);
}
.row__t { font-family: var(--display); font-size: 14px; width: 48px; flex: none; color: var(--ink-mut); }
.row__k { width: 4px; align-self: stretch; border-radius: 3px; background: var(--line); flex: none; }
.row__n { flex: 1; min-width: 0; }
.row__n b { display: block; font-weight: 500; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__n small { display: block; font-size: 11.5px; color: var(--ink-mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row.past { opacity: 0.42; }
.row.now { background: rgba(233, 98, 46, 0.13); border-color: rgba(233, 98, 46, 0.42); }
.row.now .row__k { background: var(--brand); box-shadow: 0 0 10px rgba(233, 98, 46, 0.7); }
.row.next .row__k { background: var(--warn); }
.row.k-study .row__k { background: var(--brand); }
.row.k-break .row__k { background: var(--done); }
.row.k-life .row__k { background: var(--warn); }
.row.k-free  .row__k { background: transparent; border: 1px dashed rgba(245, 239, 228, 0.28); }
.row.k-silent .row__k { background: var(--night); }
.row__s { flex: none; font-size: 11.5px; letter-spacing: 0.1em; color: var(--ink-mut); }
.row__s.ok { color: var(--done); }
.row__s.late { color: var(--warn); }
.row__s.miss { color: var(--alert); }

/* 看板打卡：只出现在「接下来那一项」上，其它行没有入口 */
.row__btn {
  flex: none; margin-left: var(--s2); padding: 7px 13px;
  font: inherit; font-size: 12.5px; letter-spacing: 0.02em;
  border-radius: 999px; cursor: pointer; color: var(--ink);
  border: 1px solid rgba(233, 98, 46, 0.55); background: rgba(233, 98, 46, 0.18);
  transition: background var(--d-b) var(--ease), border-color var(--d-b) var(--ease);
}
.row__btn:hover { background: rgba(233, 98, 46, 0.3); }
.row__btn:active { transform: translateY(1px); }
.row__btn--quiet { border-color: var(--line); background: transparent; color: var(--ink-mut); }
.row__btn--quiet:hover { background: rgba(245, 239, 228, 0.09); }
.row__btn--confirm, .cardbtn--confirm {
  border-color: var(--warn); background: rgba(242, 180, 65, 0.22); color: var(--ink);
}

/* 右侧「接下来」卡片底部的大按钮：大屏上孩子更容易看到 */
.nextcard__act { margin-top: var(--s3); }
.cardbtn {
  width: 100%; padding: 13px 16px; font: inherit; font-size: 15px;
  border-radius: var(--r-m); cursor: pointer; color: var(--ink);
  border: 1px solid rgba(233, 98, 46, 0.55); background: rgba(233, 98, 46, 0.22);
  transition: background var(--d-b) var(--ease);
}
.cardbtn:hover { background: rgba(233, 98, 46, 0.34); }
.cardbtn:active { transform: translateY(1px); }
.cardbtn--quiet { border-color: var(--line); background: transparent; color: var(--ink-mut); }

/* 右侧：下一件大事 + 日食钟 */
.board__right { display: flex; flex-direction: column; gap: var(--s3); min-width: 0; }
.nextcard {
  position: relative; overflow: hidden; flex: 1;
  border-radius: var(--r-l); border: 1px solid var(--line); padding: var(--s4);
  background: linear-gradient(150deg, rgba(34, 27, 19, 0.95), rgba(23, 19, 14, 0.9));
  box-shadow: var(--sh-2); display: flex; flex-direction: column;
}
.nextcard::after {
  content: ""; position: absolute; width: 300px; height: 300px; right: -110px; top: -110px;
  border-radius: 50%; background: radial-gradient(circle, rgba(233, 98, 46, 0.2), transparent 68%);
  pointer-events: none;
}
.label { font-size: 11px; letter-spacing: 0.26em; color: var(--ink-mut); text-transform: uppercase; }
.nextcard h3 { font-family: var(--display); font-weight: 900; font-size: clamp(24px, 3vw, 40px); margin: var(--s3) 0 var(--s2); line-height: 1.14; letter-spacing: -0.02em; }
.nextcard .sub { font-size: 14px; color: var(--ink-mut); max-width: 30ch; }
.nextcard .foot { margin-top: auto; padding-top: var(--s4); display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); font-size: 12px; color: var(--ink-mut); }
.chip--brand { color: var(--brand-soft); border-color: rgba(233, 98, 46, 0.4); background: rgba(233, 98, 46, 0.1); }
.chip--done { color: var(--done); border-color: rgba(47, 176, 140, 0.4); background: rgba(47, 176, 140, 0.1); }

/* ---------- 日食钟 ---------- */
.eclipse { position: relative; width: var(--ec, clamp(200px, 26vh, 320px)); aspect-ratio: 1; flex: none; }
.eclipse--sm { --ec: 92px; }
.eclipse--sm .eclipse__num { font-size: 17px; }
.eclipse--sm .eclipse__pct, .eclipse--sm .eclipse__ticks { display: none; }
.eclipse__disc {
  position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #ffe3b8, var(--brand-soft) 52%, var(--brand-deep));
  box-shadow: 0 0 70px rgba(233, 98, 46, calc(0.2 + var(--heat, 0) * 0.42));
  transition: box-shadow var(--d-s) var(--ease), background var(--d-s) var(--ease);
}
.eclipse__bite {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, var(--surface-child) 0 var(--sweep, 0deg), transparent var(--sweep, 0deg));
  transition: background 240ms linear;
}
.eclipse__ticks { position: absolute; inset: 0; }
.eclipse__ticks i {
  position: absolute; left: calc(50% - 1px); top: 0; width: 2px; height: 50%;
  transform-origin: bottom center; border-radius: 2px;
  background: linear-gradient(to bottom, rgba(245, 239, 228, 0.26) 0 8%, transparent 8%);
}
.eclipse__ticks i.hit { background: linear-gradient(to bottom, rgba(255, 236, 200, 0.95) 0 8%, transparent 8%); }
.eclipse__read { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.eclipse__read > div { background: rgba(20, 16, 11, 0.66); backdrop-filter: blur(3px); border: 1px solid var(--line); border-radius: 12px; padding: 0.18em 0.55em 0.24em; }
.eclipse__num { font-family: var(--display); font-weight: 900; font-size: clamp(34px, 5.6vh, 62px); letter-spacing: -0.04em; line-height: 1.04; color: #fff3e2; display: flex; }
.eclipse__num .c { color: rgba(255, 214, 170, 0.75); min-width: 0.3em; text-align: center; }
.eclipse__pct { font-size: 11.5px; letter-spacing: 0.16em; color: rgba(255, 236, 214, 0.72); margin-top: 5px; }
.eclipse.warn .eclipse__disc { background: radial-gradient(circle at 34% 30%, #ffe9c4, var(--warn) 54%, #b8801a); }
.eclipse.hot .eclipse__disc { background: radial-gradient(circle at 34% 30%, #ffce9e, var(--alert) 56%, #7e2117); }
.eclipse.soft .eclipse__disc { background: radial-gradient(circle at 34% 30%, #b9f0dc, var(--done) 56%, #1b7358); }
.eclipse.cool .eclipse__disc { background: radial-gradient(circle at 34% 30%, #cfe0ee, var(--night) 56%, #26313b); }
@media (prefers-reduced-motion: no-preference) {
  .eclipse.hot { animation: heat 1.1s var(--ease) infinite; }
  @keyframes heat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.012); } }
}

/* ---------- 全屏提醒 ---------- */
.ring {
  position: absolute; inset: 0; z-index: 6; display: none;
  flex-direction: column; align-items: center; justify-content: center; gap: var(--s3);
  text-align: center; padding: var(--s4);
  background: radial-gradient(64rem 38rem at 50% 38%, rgba(233, 98, 46, 0.32), transparent 66%), var(--surface-child);
}
.ring.sel { display: flex; }
@media (prefers-reduced-motion: no-preference) {
  .ring.sel { animation: ringIn var(--d-s) var(--ease); }
  @keyframes ringIn { from { opacity: 0; transform: scale(1.035); } to { opacity: 1; transform: none; } }
}
.ring .when { font-size: 12px; letter-spacing: 0.32em; color: var(--brand-soft); }
.ring h2 { font-family: var(--display); font-weight: 900; font-size: clamp(30px, 5vw, 58px); margin: 0; letter-spacing: -0.02em; line-height: 1.12; max-width: 20ch; }
.ring .how { font-size: 15px; color: var(--ink-mut); max-width: 36ch; }
.ring .echo { font-family: var(--display); font-size: 17px; color: #ffe3c0; min-height: 1.6em; }

.bigbtn {
  margin-top: var(--s3); min-width: 250px; min-height: 68px;
  padding: 18px 46px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--brand); color: #fff;
  font-family: var(--display); font-weight: 600; font-size: 21px; letter-spacing: 0.02em;
  box-shadow: 0 10px 34px rgba(233, 98, 46, 0.44);
  transition: transform var(--d-f) var(--ease), background var(--d-f) var(--ease), box-shadow var(--d-f);
}
.bigbtn:hover { transform: translateY(-2px) scale(1.015); background: var(--brand-deep); }
.bigbtn:active { transform: translateY(0) scale(0.99); }
.bigbtn:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }
.bigbtn--quiet { background: none; color: var(--ink-mut); border: 1px solid var(--line); box-shadow: none; font-size: 15px; min-width: 0; min-height: 48px; padding: 12px 24px; }
.bigbtn--quiet:hover { color: var(--ink); border-color: rgba(245, 239, 228, 0.32); background: rgba(245, 239, 228, 0.05); }

/* ---------- 执行中 ---------- */
.running { align-items: center; justify-content: center; gap: var(--s4); }
.running__head { text-align: center; }
.running__head h3 { font-family: var(--display); font-weight: 900; font-size: clamp(20px, 2.6vw, 32px); margin: 8px 0 0; letter-spacing: -0.02em; }
.running__head p { margin: 6px 0 0; font-size: 13.5px; color: var(--ink-mut); }
.acts { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.acts .icobtn { font-size: 13.5px; padding: 0 18px; }
.acts .icobtn--go { color: #0f2a22; background: var(--done); border-color: transparent; font-weight: 500; }
.acts .icobtn--go:hover { background: #37c49d; color: #0f2a22; }

/* ---------- 结算 / 自由 / 静音 ---------- */
.donecard { max-width: 620px; display: flex; flex-direction: column; align-items: center; gap: var(--s3); }
.donecard h2 { font-family: var(--display); font-weight: 900; font-size: clamp(26px, 4vw, 44px); margin: 0; letter-spacing: -0.02em; }
.donecard p { margin: 0; color: var(--ink-mut); font-size: 15px; }
.banknum { font-family: var(--display); font-weight: 900; font-size: clamp(44px, 8vw, 92px); line-height: 1; color: var(--done); letter-spacing: -0.04em; }
.freecard, .silentcard {
  width: min(720px, 100%); padding: var(--s6) var(--s5);
  border: 1px dashed var(--line); border-radius: var(--r-l); text-align: center;
}
.freecard h2, .silentcard h2 { font-family: var(--display); font-weight: 900; font-size: clamp(28px, 4.4vw, 52px); margin: 0 0 var(--s2); letter-spacing: -0.02em; }
.freecard p, .silentcard p { margin: 0; color: var(--ink-mut); font-size: 15px; max-width: 34ch; margin-inline: auto; }
.silentcard { border-style: solid; border-color: rgba(74, 90, 107, 0.5); background: linear-gradient(160deg, rgba(38, 49, 59, 0.6), rgba(23, 19, 14, 0.4)); }
.rulelist { list-style: none; margin: var(--s4) 0 0; padding: 0; display: flex; gap: var(--s3); flex-wrap: wrap; justify-content: center; font-size: 13px; color: var(--ink-mut); }
.rulelist li { display: flex; align-items: center; gap: 7px; }
.rulelist i { width: 5px; height: 5px; border-radius: 50%; background: var(--brand); display: inline-block; }

/* ---------- 配对 ---------- */
.pair { align-items: center; justify-content: center; gap: var(--s4); }
.pair h2 { font-family: var(--display); font-weight: 900; font-size: clamp(24px, 3.4vw, 40px); margin: 0; letter-spacing: -0.02em; }
.pair p { margin: 0; color: var(--ink-mut); max-width: 38ch; }
.pinbox { display: flex; gap: 10px; }
.pinbox input {
  width: 56px; height: 68px; text-align: center;
  font-family: var(--display); font-weight: 900; font-size: 30px; text-transform: uppercase;
  color: var(--ink); background: var(--surface-child-2);
  border: 1px solid var(--line); border-radius: var(--r-m); caret-color: var(--brand);
  transition: border-color var(--d-f) var(--ease), box-shadow var(--d-f) var(--ease);
}
.pinbox input:focus-visible { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(233, 98, 46, 0.22); }
.pairerr { min-height: 1.4em; font-size: 13.5px; color: var(--alert); }

/* ---------- 横幅 ---------- */
.banner {
  position: fixed; z-index: 8; left: 50%; bottom: var(--s4); transform: translate(-50%, 24px);
  display: flex; align-items: center; gap: 12px;
  max-width: min(720px, 92vw); padding: 12px 18px;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(34, 27, 19, 0.94); backdrop-filter: blur(8px);
  box-shadow: var(--sh-2); font-size: 14px;
  opacity: 0; pointer-events: none;
  transition: opacity var(--d-b) var(--ease), transform var(--d-b) var(--ease);
}
.banner.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.banner.warn { border-color: rgba(242, 180, 65, 0.5); color: #ffe6b8; }
.banner.err { border-color: rgba(201, 69, 59, 0.55); color: #ffcfc9; }
.banner button { background: none; border: 1px solid var(--line); color: inherit; border-radius: 999px; padding: 5px 13px; font-size: 12.5px; cursor: pointer; min-height: 34px; }
.banner button:hover { border-color: var(--brand); color: var(--brand-soft); }

/* ---------- 断网水印：让演示者一眼看出「现在是离线在跑」 ---------- */
.offlinetag {
  position: fixed; z-index: 7; right: var(--s4); bottom: var(--s4);
  display: none; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px; font-size: 12.5px;
  border: 1px solid rgba(242, 180, 65, 0.45); background: rgba(242, 180, 65, 0.12); color: #ffe0a8;
}
.offlinetag.show { display: inline-flex; }

@media (max-width: 900px) {
  .board { grid-template-columns: minmax(0, 1fr); }
  .board__right { flex-direction: row; align-items: center; }
  .nextcard { flex: 1; }
  .screen { padding: var(--s3); }
}
