/* StoryQuest · 全站视觉 v2「清亮冒险」
   原则：干净白卡 + 靛紫渐变主色 + 珊瑚点缀；线性 SVG 图标（不用 emoji 当图标）；
   交互丝滑：按压回弹、悬浮上浮、视图淡入。变量名保持 v1 不变，妈妈端/教师端自动跟随。 */
:root {
  --bg: #F4F6FE;
  --card: #FFFFFF;
  --ink: #1D2340;
  --muted: #7B84A8;
  --line: #E5E9F8;
  --navy: #1D2340;
  --primary: #5B5FE8;
  --primary-2: #8B5CF6;
  --grad: linear-gradient(135deg, #5B5FE8, #8B5CF6);
  --orange: #FF6B4A;        /* 点缀色（珊瑚），变量名沿用 v1 */
  --orange-dark: #E5522F;
  --gold: #C7D2FE;          /* v1 的金黄系整体换成柔靛系 */
  --gold-soft: #EEF1FF;
  --gold-line: #D8DEFA;
  --amber-ink: #4653C5;
  --green: #17A34A;
  --green-soft: #E7F7EE;
  --green-line: #BFE8CF;
  --red: #EF4444;
  --shadow-sm: 0 1px 3px rgba(29, 35, 64, .06);
  --shadow-md: 0 6px 20px rgba(29, 35, 64, .09);
  --ease: cubic-bezier(.2, .8, .3, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background:
    radial-gradient(640px 320px at 8% -4%, rgba(139, 92, 246, .08), transparent 60%),
    radial-gradient(640px 320px at 96% 0%, rgba(91, 95, 232, .07), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: -apple-system, "SF Pro SC", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1240px; margin: 0 auto; padding: 24px 20px 48px; }
.loading { padding: 60px 0; text-align: center; color: var(--muted); }

svg.i { width: 20px; height: 20px; flex: none; vertical-align: -4px; }
button svg.i, .chip svg.i { width: 16px; height: 16px; vertical-align: -3px; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.96); } 60% { transform: scale(1.02); } 100% { transform: none; } }
.center > * { animation: fadeUp .28s var(--ease) both; }

/* 顶部 */
.top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.top .date { font-size: 13px; color: var(--muted); font-weight: 600; letter-spacing: .2px; }
.top h1 { margin: 2px 0 0; font-size: 30px; font-weight: 800; letter-spacing: -.3px; }
.top h1 .n { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.top .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.top-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* 布局：左菜单 · 中内容 · 右提示 */
.shell { display: grid; grid-template-columns: 172px minmax(0, 1fr) 312px; gap: 18px; align-items: start; }
.main { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.center { min-width: 0; }
.aside { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 16px; }

/* 左侧菜单 */
.nav { display: flex; flex-direction: column; gap: 6px; position: sticky; top: 16px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 14px;
  border: 1px solid transparent; border-radius: 14px; background: transparent;
  font-size: 14.5px; font-weight: 700; color: #525B7F; text-align: left;
  transition: background .18s var(--ease), color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease);
}
.nav-item .ic { display: inline-flex; width: 22px; justify-content: center; }
.nav-item:hover { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.nav-item:active { transform: scale(.97); }
.nav-item.on {
  background: var(--grad); color: #fff;
  box-shadow: 0 6px 16px rgba(91, 95, 232, .32);
}
.nav-days { margin-top: 12px; text-align: center; font-size: 12px; color: var(--muted); line-height: 1.5; }
.nav-days b { font-size: 24px; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; display: block; }

/* 卡片 */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.card.active { border-color: #C9CFF5; box-shadow: var(--shadow-md); }
.card-head { display: flex; align-items: center; gap: 14px; padding: 16px 20px; cursor: pointer; border-radius: 20px; transition: background .18s var(--ease); }
.card-head:hover { background: #FAFBFF; }
.card-head .num {
  width: 36px; height: 36px; border-radius: 12px; flex: none;
  background: var(--grad);
  color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px;
  box-shadow: 0 4px 10px rgba(91, 95, 232, .3);
}
.card.done .card-head .num { background: var(--green-soft); box-shadow: none; color: var(--green); }
.card-head .t { flex: 1; min-width: 0; }
.card-head .t b { font-size: 16px; font-weight: 800; }
.card-head .t small { display: block; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.card-body { padding: 0 20px 20px; display: flex; flex-direction: column; gap: 12px; animation: fadeUp .22s var(--ease) both; }
.card.done .card-head .t b { color: #7E8AA6; }

/* 按钮 */
button { font: inherit; cursor: pointer; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px; border: none; border-radius: 14px;
  background: var(--grad); color: #fff; font-size: 15px; font-weight: 800; letter-spacing: .2px;
  box-shadow: 0 6px 16px rgba(91, 95, 232, .32);
  transition: transform .15s var(--ease), box-shadow .15s var(--ease), filter .15s var(--ease);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 9px 22px rgba(91, 95, 232, .38); filter: brightness(1.05); }
.btn:active { transform: scale(.97); box-shadow: 0 3px 10px rgba(91, 95, 232, .3); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; filter: none; }
.ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 0 16px; border: 1.5px solid #DCE1F6; border-radius: 12px;
  background: #fff; color: #3C4568; font-size: 14px; font-weight: 600;
  transition: border-color .15s var(--ease), background .15s var(--ease), transform .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease);
}
.ghost:hover { border-color: var(--primary); color: var(--primary); background: #FBFBFF; }
.ghost:active { transform: scale(.97); }
.ghost.sel { border-color: var(--primary); background: var(--gold-soft); color: var(--amber-ink); font-weight: 800; box-shadow: inset 0 0 0 .5px var(--primary); }
.ghost.rec { border-color: var(--red); color: var(--red); }
.golden {
  display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 0 16px;
  border: none; border-radius: 999px; background: #fff;
  color: var(--amber-ink); font-size: 13px; font-weight: 800;
  box-shadow: var(--shadow-sm), inset 0 0 0 1.5px var(--gold-line);
  transition: transform .15s var(--ease), box-shadow .15s var(--ease);
}
.golden:hover { transform: translateY(-1px); box-shadow: var(--shadow-md), inset 0 0 0 1.5px var(--gold); }
.golden:active { transform: scale(.97); }

/* 小件 */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--gold-soft); border: 1px solid var(--gold-line); color: var(--amber-ink); }
.chip.plain { background: #F3F5FC; border-color: var(--line); color: var(--muted); }
.chip.ok { background: var(--green-soft); border-color: var(--green-line); color: var(--green); }
.chip.now { background: var(--grad); border-color: transparent; color: #fff; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .3; } }

/* 词的成长阶段：彩色圆点代替 emoji */
.sdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #AAB3D6; flex: none; }
.sdot.new, .sdot.seed { background: #AAB3D6; }
.sdot.learning { background: #22C55E; }
.sdot.booster { background: #F59E0B; }
.sdot.awaiting { background: #8B5CF6; }
.sdot.mastered { background: var(--orange); }

.box { background: #F8F9FF; border: 1px dashed var(--gold-line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.notice { background: var(--green-soft); border: 1px solid var(--green-line); border-radius: 12px; padding: 10px 14px; font-size: 13.5px; color: #1F6B45; }
.steps { display: flex; flex-direction: column; gap: 12px; }
.step { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.step .no { width: 22px; font-size: 13px; color: var(--muted); flex: none; }
.step .lbl { flex: 1; min-width: 160px; font-size: 14px; }
.step .lbl small { display: block; font-size: 12px; color: var(--muted); }
.feedback { font-size: 14px; font-weight: 700; }
.feedback.good { color: var(--green); }
.feedback.soft { color: var(--amber-ink); }

/* 书 */
.bookrow { display: flex; align-items: center; gap: 14px; }
.bookrow img { width: 56px; height: 70px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.bookrow .bt b { font-size: 15px; font-weight: 800; }
.bookrow .bt small { display: block; font-size: 12px; color: var(--muted); }
.attribution { font-size: 11px; color: #A9B0CC; }

/* 热身大卡 */
.wordcard { text-align: center; padding: 10px 0 4px; }
.wordcard .w { font-size: 36px; font-weight: 800; letter-spacing: .5px; }
.wordcard .m { font-size: 14px; color: var(--muted); margin-top: 2px; }
.opts { display: flex; gap: 10px; flex-wrap: wrap; }
.opts .ghost { flex: 1 1 100px; min-height: 48px; font-size: 15px; font-weight: 700; }
.progress { font-size: 12.5px; color: var(--muted); }

/* 精读条带 */
.strip { display: flex; gap: 6px; flex-wrap: wrap; }
.strip .chip.today { background: var(--grad); border-color: transparent; color: #fff; }

/* 侧栏 */
.echo { background: linear-gradient(140deg, #F4F1FF, #EFF5FF); border-color: #E2E3FB; }
.echo .from { font-size: 12.5px; color: var(--primary); font-weight: 800; display: flex; align-items: center; gap: 6px; }
.echo .txt { font-size: 14.5px; font-weight: 600; }
.echo .meta { font-size: 12px; color: var(--muted); }
.aside .card { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.aside h3 { margin: 0; font-size: 13px; color: var(--muted); font-weight: 800; letter-spacing: .3px; }
.garden { display: flex; flex-wrap: wrap; gap: 6px; }

/* 全部完成 */
.banner { background: linear-gradient(135deg, #EDFBF2, #EFF8FF); border: 1px solid #CBEBD8; border-radius: 18px; padding: 16px 20px; animation: pop .35s var(--ease); }
.banner b { color: #1F6B45; font-size: 16px; }
.banner div { font-size: 13.5px; color: #3E7257; }

.footer { margin-top: 28px; text-align: center; font-size: 12px; color: #A9B0CC; }

/* 听了什么 */
.listen-sheet { padding: 14px 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.listen-sheet .cap { min-width: 170px; }
.listen-sheet .cap b { font-size: 15px; }
.listen-sheet .cap small { display: block; font-size: 12px; color: var(--muted); }

/* 读书器 */
.reader { position: fixed; inset: 0; background: rgba(23, 26, 54, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 18px; z-index: 50; }
.reader.hidden { display: none; }
.reader-inner { background: #fff; border-radius: 24px; max-width: 760px; width: 100%; max-height: 94vh; overflow: auto; padding: 22px 24px; border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(23, 26, 54, .25); animation: fadeUp .25s var(--ease); }
.reader-inner img { width: 100%; border-radius: 14px; border: 1px solid var(--line); }
.reader-text { font-size: 20px; line-height: 1.8; margin: 12px 0 4px; }
.reader-text mark { background: var(--gold); color: var(--ink); padding: 0 4px; border-radius: 5px; }
.reader-zh { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.reader-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.reader-gloss { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* 休息日 */
.resthero { text-align: center; padding: 34px 20px; }
.resthero .moon { font-size: 40px; color: var(--primary); }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: rgba(29, 35, 64, .92); backdrop-filter: blur(8px); color: #fff; padding: 11px 20px; border-radius: 14px; font-size: 14px; z-index: 99; box-shadow: var(--shadow-md); animation: fadeUp .22s var(--ease); }
.toast.hidden { display: none; }
.hidden { display: none !important; }

/* 单词本 */
.wgroup { padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.wgroup h3 { margin: 0; font-size: 15px; }
.wgroup h3 .n { color: var(--primary); }
.wlist { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.wrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.wrow:last-child { border-bottom: 0; }
.wrow .wt { flex: 1; min-width: 140px; display: flex; align-items: center; gap: 8px; }
.wrow .wt b { font-size: 15px; }
.wrow .wt small { display: block; font-size: 12px; color: var(--muted); }

/* 作品墙 */
.awform { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.awform input:not([type="file"]) {
  flex: 1 1 180px; min-height: 44px; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 0 12px; font: inherit; background: #fff;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.awform input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(91, 95, 232, .14); }
.aimaker { background: linear-gradient(140deg, #F4F1FF, #EEF6FF); border-color: #E2E3FB; }
.aimk-head { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 800; color: var(--amber-ink); }
.aiprog { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--amber-ink); font-weight: 600; }
.aiprog .bar { flex: 1; height: 6px; border-radius: 99px; background: #E3E6FB; overflow: hidden; position: relative; }
.aiprog .bar::after { content: ""; position: absolute; inset: 0; width: 40%; border-radius: 99px; background: var(--grad); animation: slide 1.1s var(--ease) infinite; }
@keyframes slide { from { transform: translateX(-110%); } to { transform: translateX(280%); } }
.awgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.awcard { overflow: hidden; display: flex; flex-direction: column; transition: transform .18s var(--ease), box-shadow .18s var(--ease); }
.awcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.awcard img { width: 100%; height: 150px; object-fit: cover; display: block; }
.awcard .awpdf { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; height: 150px; background: #F3F5FC; text-decoration: none; color: #525B7F; }
.awcard .awpdf svg.i { width: 36px; height: 36px; }
.awcard .awpdf span { font-size: 13px; font-weight: 700; }
.awcard .awt { padding: 10px 12px; }
.awcard .awt b { font-size: 14px; }
.awcard .awt small { display: block; font-size: 12px; color: var(--muted); }
.aibook { width: 100%; height: 150px; border: none; padding: 14px; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; text-align: left; background: var(--grad); color: #fff; cursor: pointer; }
.aibook .bt { font-size: 17px; font-weight: 800; line-height: 1.35; letter-spacing: .2px; }
.aibook .bp { font-size: 12px; opacity: .9; display: flex; align-items: center; gap: 6px; }

/* 新闻角 */
.newsrow { padding: 14px 18px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; transition: transform .18s var(--ease), box-shadow .18s var(--ease); }
.newsrow:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.newsrow .wt { flex: 1; min-width: 180px; }
.newsrow .wt b { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.newsrow .wt small { display: block; font-size: 12px; color: var(--muted); }

/* 学习足迹 */
.fgrid { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 4px; }
.fcol { display: flex; flex-direction: column; gap: 4px; }
.fcol.flabels { margin-right: 4px; }
.fmonth { height: 16px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.flab { width: 18px; height: 18px; font-size: 10.5px; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.fcell { width: 18px; height: 18px; border-radius: 5px; background: #EAEDFB; display: inline-block; flex: none; transition: transform .12s var(--ease); }
.fcell:hover { transform: scale(1.25); }
.fcell.f- { background: transparent; }
.fcell.f1 { background: #C7D2FE; }
.fcell.f2 { background: #93A5F6; }
.fcell.f3 { background: #6271E8; }
.fcell.f4 { background: #4653C5; }
.flegend { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }

input:focus-visible, button:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid rgba(91, 95, 232, .35); outline-offset: 1px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 1080px) {
  .shell { grid-template-columns: 158px minmax(0, 1fr); }
  .aside { grid-column: 1 / -1; position: static; flex-direction: row; flex-wrap: wrap; }
  .aside .card { flex: 1 1 260px; }
}
@media (max-width: 720px) {
  .wrap { padding: 16px 16px 40px; }
  .top h1 { font-size: 25px; }
  .shell { display: flex; flex-direction: column; }
  .nav { position: static; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .nav-item { min-height: 42px; flex: none; background: #fff; box-shadow: var(--shadow-sm); }
  .nav-item.on { background: var(--grad); box-shadow: 0 6px 16px rgba(91, 95, 232, .32); }
  .nav-days { display: none; }
  .aside { flex-direction: column; }
}
