/* ===== 设计系统变量 ===== */
/* 默认「学堂经典」：参考小墨诗词岛 — 墨绿 · 陶红 · 金 */
:root {
  --green: #285d4c;
  --green-light: #e6f0e9;
  --green-dark: #183f33;
  --orange: #df6337;
  --orange-light: #f8e9e2;
  --gold: #efbd58;
  --gold-light: #fff2cf;
  --ink: #22302b;
  --muted: #58655f;
  --paper: #fffdf7;
  --cream: #f7f1e3;
  --line: #d9d0bd;
  --white: #ffffff;
  --success: #245343;
  --error: #9d3c22;
  --seal: #285d4c;
  --cinnabar: #df6337;
  --ink-soft: #3d4d46;
  --hero-glow: rgba(239,189,88,.28);
  --hero-from: #203f36;
  --hero-to: #183f33;
  --hero-chip-bg: rgba(255,253,247,.86);
  --hero-chip-border: rgba(40,93,76,.16);
  --panel-tint: rgba(40,93,76,.08);
  --panel-from: #f4f8f5;
  --panel-to: #e8f1ea;
  --panel-scroll: #9dcdb4;
  --footer-bg: #203f36;
  --talk-bg: #edf0f5;
  --talk-accent: #6d8eae;
  --focus-ring: rgba(239,189,88,.55);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --font-scale: 1;
  --font-body: "Noto Sans SC","Microsoft YaHei","PingFang SC",system-ui,sans-serif;
  --font-kai: "STKaiti","KaiTi","KaiTi_GB2312","AR PL UKai CN",serif;
  --transition: 0.25s cubic-bezier(0.4,0,0.2,1);
}

/* 浅宣纸：保留现有阅读配色，可在「我的装扮」免费切换 */
[data-decoration="xuan"] {
  --green: #9a5c48;
  --green-light: #f7f1e6;
  --green-dark: #7a4638;
  --orange: #c57a4a;
  --orange-light: #f8eee3;
  --gold: #c9a86a;
  --gold-light: #f8f1de;
  --ink: #43392f;
  --muted: #8a7d70;
  --paper: #fbf7ee;
  --cream: #f4ead9;
  --line: #eadfcb;
  --white: #fffdf8;
  --success: #4a8a62;
  --error: #c24b42;
  --seal: #9a5c48;
  --cinnabar: #c57a4a;
  --ink-soft: #62584c;
  --hero-glow: rgba(201,168,106,.18);
  --hero-from: #f8f1e3;
  --hero-to: #f3e8d4;
  --hero-chip-bg: rgba(255,253,248,.78);
  --hero-chip-border: rgba(154,92,72,.16);
  --panel-tint: rgba(154,92,72,.06);
  --panel-from: #fbf6ea;
  --panel-to: #f3e8d4;
  --panel-scroll: #d7c6aa;
  --footer-bg: #efe4d0;
  --talk-bg: #efe8dc;
  --talk-accent: #8a7358;
  --focus-ring: rgba(201,168,106,.45);
}

/* 积分商城：桃李春风 */
[data-decoration="blossom"] {
  --green: #286454;
  --green-light: #eef6f1;
  --green-dark: #1a4638;
  --orange: #b84f68;
  --orange-light: #f8e1e7;
  --gold: #d29b2f;
  --gold-light: #f7eccf;
  --ink: #2f3432;
  --muted: #6f7a74;
  --paper: #faf7f4;
  --cream: #f3ebe4;
  --line: #e4d9d2;
  --white: #fffcfa;
  --seal: #b84f68;
  --cinnabar: #b84f68;
  --ink-soft: #55605a;
  --hero-glow: rgba(184,79,104,.16);
  --hero-from: #f7eef1;
  --hero-to: #eef5f0;
  --hero-chip-bg: rgba(255,252,250,.82);
  --hero-chip-border: rgba(40,100,84,.14);
  --panel-tint: rgba(184,79,104,.07);
  --panel-from: #faf4f2;
  --panel-to: #eef5f0;
  --panel-scroll: #d2b8be;
  --footer-bg: #efe6e4;
  --talk-bg: #f3ebe8;
  --talk-accent: #8a5a66;
  --focus-ring: rgba(210,155,47,.45);
}

/* 积分商城：青花雅韵 */
[data-decoration="bluewhite"] {
  --green: #245c70;
  --green-light: #e6eef1;
  --green-dark: #163a46;
  --orange: #b45a2c;
  --orange-light: #f5e5df;
  --gold: #c99a2e;
  --gold-light: #f4ead0;
  --ink: #24343a;
  --muted: #667880;
  --paper: #f6f8f9;
  --cream: #e9eef1;
  --line: #d5dee3;
  --white: #ffffff;
  --seal: #245c70;
  --cinnabar: #b45a2c;
  --ink-soft: #4a5d66;
  --hero-glow: rgba(36,92,112,.16);
  --hero-from: #eaf2f5;
  --hero-to: #e1ebf0;
  --hero-chip-bg: rgba(255,255,255,.82);
  --hero-chip-border: rgba(36,92,112,.16);
  --panel-tint: rgba(36,92,112,.07);
  --panel-from: #f2f7f9;
  --panel-to: #e4eef2;
  --panel-scroll: #a9c0ca;
  --footer-bg: #e2ebef;
  --talk-bg: #e8eef2;
  --talk-accent: #5a7a8a;
  --focus-ring: rgba(201,154,46,.45);
}

/* ===== 暗色主题（明暗开关） ===== */
[data-theme="dark"] {
  --green: #9dcdb4;
  --green-light: #1a352c;
  --green-dark: #0f241d;
  --orange: #e07856;
  --orange-light: #3a2418;
  --gold: #f3cb79;
  --gold-light: #2a2410;
  --ink: #e2eee9;
  --muted: #8aa098;
  --paper: #15211c;
  --cream: #1c2a25;
  --line: #2a3a34;
  --white: #1d2a25;
  --seal: #9dcdb4;
  --cinnabar: #e07856;
  --ink-soft: #c2d4cc;
  --hero-glow: rgba(243,203,121,.14);
  --hero-from: #1a2621;
  --hero-to: #15211c;
  --hero-chip-bg: rgba(29,42,37,.88);
  --hero-chip-border: rgba(157,205,180,.28);
  --panel-tint: rgba(157,205,180,.10);
  --panel-from: #1e2c27;
  --panel-to: #16241e;
  --panel-scroll: #3d5348;
  --footer-bg: #12201b;
  --talk-bg: #1e282c;
  --talk-accent: #7a96a8;
  --focus-ring: rgba(243,203,121,.45);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
}
[data-theme="dark"][data-decoration="xuan"] {
  --green: #e0b089;
  --green-light: #2a231c;
  --green-dark: #16110e;
  --orange: #e39a6a;
  --orange-light: #3a2a1e;
  --gold: #e4c56a;
  --gold-light: #2c2516;
  --ink: #f2eadc;
  --muted: #b8ab97;
  --paper: #1a1612;
  --cream: #241e18;
  --line: #3d342a;
  --white: #221c17;
  --seal: #e0b089;
  --cinnabar: #e39a6a;
  --ink-soft: #d2c4ae;
  --hero-glow: rgba(228,197,106,.12);
  --hero-from: #221c16;
  --hero-to: #1a1612;
  --hero-chip-bg: rgba(34,28,23,.88);
  --hero-chip-border: rgba(224,176,137,.24);
  --panel-tint: rgba(224,176,137,.08);
  --panel-from: #2a231c;
  --panel-to: #1c1814;
  --panel-scroll: #5a4c3c;
  --footer-bg: #241e18;
  --talk-bg: #2a241e;
  --talk-accent: #a89078;
}
[data-theme="dark"][data-decoration="blossom"] {
  --green: #6db39a;
  --green-light: #24322c;
  --green-dark: #14201c;
  --orange: #e08aa0;
  --orange-light: #3a242c;
  --gold: #e0b45a;
  --gold-light: #2c2414;
  --seal: #e08aa0;
  --cinnabar: #e08aa0;
  --paper: #1a1818;
  --cream: #242020;
  --line: #352e2e;
  --white: #221e1e;
  --ink: #efe6e4;
  --muted: #b0a4a4;
  --ink-soft: #d2c4c2;
  --hero-from: #241e20;
  --hero-to: #1c1819;
  --panel-from: #2a2224;
  --panel-to: #1e191a;
  --footer-bg: #1c1818;
  --talk-bg: #262022;
  --talk-accent: #c0909c;
  --panel-scroll: #5a4248;
}
[data-theme="dark"][data-decoration="bluewhite"] {
  --green: #6aa8bc;
  --green-light: #1c2a30;
  --green-dark: #102028;
  --orange: #d88860;
  --orange-light: #3a2a22;
  --gold: #e0bc5a;
  --gold-light: #2a2414;
  --seal: #6aa8bc;
  --cinnabar: #d88860;
  --paper: #151a1d;
  --cream: #1e262a;
  --line: #2c373c;
  --white: #1c2326;
  --ink: #e4ecef;
  --muted: #96a6ae;
  --ink-soft: #c2d0d6;
  --hero-from: #1a2428;
  --hero-to: #151d21;
  --panel-from: #1e2a30;
  --panel-to: #162024;
  --footer-bg: #12181b;
  --talk-bg: #1e282c;
  --talk-accent: #7a9cac;
  --panel-scroll: #3e5660;
}

/* ===== 基础重置 ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
}
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ===== 顶栏 ===== */
.topbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; justify-content: space-between; align-items: center;
  height: 72px; padding: 0 max(4vw,24px);
  background: var(--footer-bg);
  color: var(--ink);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-icon {
  display: grid; place-items: center;
  width: 42px; height: 42px;
  background: var(--gold); color: var(--green-dark);
  font: 700 24px var(--font-kai);
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 0 rgba(0,0,0,.18);
}
.brand-name { font: 700 20px var(--font-kai); letter-spacing: 2px; color: inherit; }
.header-tools { display: flex; align-items: center; gap: 16px; }
.font-tools { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; }
.font-tools button {
  border: 1px solid var(--line); border-radius: 6px;
  padding: 6px 10px; font-weight: 700; color: inherit;
  background: rgba(255,255,255,.35); transition: var(--transition);
}
.font-tools button:hover { background: rgba(255,255,255,.6); }
.progress {
  position: relative; width: 180px; height: 30px;
  background: rgba(0,0,0,.22); border-radius: 20px; overflow: hidden;
}
.progress > span {
  position: absolute; inset: 0 auto 0 0;
  background: linear-gradient(90deg, var(--green), var(--gold));
  transition: width 0.4s ease; border-radius: 20px;
}
.progress b {
  position: relative; z-index: 2;
  display: block; text-align: center; line-height: 30px;
  font-size: 13px; font-weight: 700; color: #fffef8;
}
.icon-btn {
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  color: inherit; transition: var(--transition);
}
.icon-btn:hover { background: rgba(255,255,255,.18); }
.account-chip {
  display: flex; align-items: center; gap: 8px; min-height: 38px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: rgba(255,255,255,.35); padding: 6px 10px; color: inherit; font-size: 13px; font-weight: 800;
}
.account-chip svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.account-chip:hover { background: rgba(255,255,255,.55); }
.account-chip b { border-left: 1px solid var(--line); padding-left: 8px; color: var(--green); }

/* ===== Hero 区 ===== */
.hero {
  display: grid; grid-template-columns: minmax(0,1.15fr) minmax(280px,0.85fr);
  gap: 36px; align-items: end;
  padding: 52px max(6vw,32px) 44px;
  background:
    radial-gradient(circle at 12% 16%, var(--hero-glow), transparent 36%),
    linear-gradient(180deg, var(--hero-from) 0%, var(--hero-to) 100%);
  color: var(--ink);
}
.hero-label { display: block; font-size: 13px; letter-spacing: 3px; font-weight: 800; color: var(--green); margin-bottom: 14px; }
.hero-title { font: 800 clamp(32px,4.6vw,58px)/1.18 var(--font-kai); margin-bottom: 16px; max-width: 14em; }
.hero-title em { color: var(--orange); font-style: normal; }
.hero-desc { font-size: calc(16px * var(--font-scale)); line-height: 1.85; max-width: 640px; color: var(--muted); }
.hero-steps { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.hero-steps span {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 999px;
  background: var(--hero-chip-bg); border: 1px solid var(--hero-chip-border);
  font-size: 13px; font-weight: 800;
}
.hero-steps span::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--gold);
}

.hero-search {
  background: var(--white); color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px;
  box-shadow: var(--shadow-md);
}
.hero-search label { display: block; font-size: 14px; font-weight: 800; color: var(--green); margin-bottom: 10px; }
.hero-search-hint { color: var(--muted); font-size: 12px; line-height: 1.6; margin-top: 10px; }
.library-search-box { display: flex; gap: 8px; }
.library-search-box input {
  flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--white); padding: 14px 16px;
  font-size: calc(16px * var(--font-scale)); outline: none;
}
.library-search-box input:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--gold-light); }
.library-search-box button {
  flex: 0 0 auto; background: var(--green); color: #fff;
  border-radius: var(--radius-sm); padding: 0 18px; font-weight: 800;
}

/* ===== 通用区块 ===== */
.studio, .picker {
  max-width: 1480px; margin: 0 auto;
  padding: 36px max(4vw,28px) 48px;
}
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; }
.section-head > div { min-width: 0; }
.section-head h2 { font: 700 clamp(26px,3vw,36px) var(--font-kai); }
.section-lead { color: var(--muted); font-size: calc(14px * var(--font-scale)); margin-top: 6px; line-height: 1.6; }

.studio-grid {
  display: grid; grid-template-columns: minmax(0,1.4fr) minmax(280px,0.7fr); gap: 18px;
  align-items: start;
}
.studio-results, .studio-card, .generate-panel {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.studio-results { padding: 20px; min-height: 360px; }
.studio-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 14px; }
.studio-head h2 { font: 800 22px var(--font-kai); color: var(--green); }
.studio-head p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.studio-count { color: var(--muted); font-size: 12px; font-weight: 800; white-space: nowrap; }
.library-results { display: grid; gap: 8px; max-height: 430px; overflow: auto; }
.library-empty, .library-empty-state { color: var(--muted); font-size: 13px; line-height: 1.7; padding: 18px 8px; }
.library-empty-state { text-align: center; border: 1px dashed var(--line); border-radius: 10px; background: var(--paper); }
.library-empty-state b { display: block; font: 800 18px var(--font-kai); color: var(--ink); margin-bottom: 6px; }
.library-result {
  width: 100%; text-align: left; border: 1px solid var(--line); border-radius: 10px;
  background: var(--paper); padding: 12px 14px;
}
.library-result:hover { border-color: var(--green); background: var(--green-light); }
.library-result.active { border-color: var(--green); background: var(--green-light); box-shadow: inset 0 0 0 1px var(--green); }
.library-result strong { display: block; font: 800 17px var(--font-kai); color: var(--green); }
.library-result span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.library-result p { color: var(--ink); font-size: 13px; margin-top: 6px; line-height: 1.55; overflow-wrap: anywhere; }
.library-result small { display: block; color: var(--orange); font-size: 12px; font-weight: 800; margin-top: 6px; }
.library-result.ready small { color: var(--green); }
.library-result .open-hint { display: block; color: var(--muted); font-size: 11px; font-weight: 700; margin-top: 4px; }
.studio-card { padding: 22px; min-height: 280px; background:
  linear-gradient(180deg, var(--white), var(--green-light)); }
.studio-card small { display: block; color: var(--muted); font-size: 12px; font-weight: 800; }
.studio-card b { display: block; font: 800 26px var(--font-kai); color: var(--green); margin-top: 8px; overflow-wrap: anywhere; }
.studio-card p { color: var(--ink); font-size: 14px; margin-top: 8px; line-height: 1.6; }
.studio-card em { display: block; color: var(--muted); font-size: 13px; font-style: normal; margin-top: 12px; line-height: 1.7; }
.studio-card .card-note { color: var(--muted); font-size: 12px; line-height: 1.65; margin-top: 10px; }
.studio-flags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.studio-flags span {
  padding: 4px 9px; border-radius: 999px; background: var(--white);
  border: 1px solid var(--line); color: var(--green); font-size: 12px; font-weight: 800;
}
.studio-flags span.pending { color: var(--orange); }
.open-lesson-btn, .generate-lesson-btn {
  margin-top: 16px; width: 100%; border-radius: 8px; padding: 12px 12px; font-weight: 800;
}
.open-lesson-btn { background: var(--green); color: #fff; }
.generate-lesson-btn { background: var(--orange); color: #fff; }
.generate-panel { margin-top: 16px; padding: 8px 20px 18px; }
.generate-panel summary {
  cursor: pointer; list-style: none; padding: 12px 0;
  font-weight: 800; color: var(--green);
}
.generate-panel summary::-webkit-details-marker { display: none; }
.generate-panel[open] summary { border-bottom: 1px dashed var(--line); margin-bottom: 14px; }
.generate-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.generate-panel label { display: block; color: var(--muted); font-size: 13px; font-weight: 800; margin-bottom: 6px; }
.generate-panel select, .generate-panel input[type="password"] {
  width: 100%; border: 1px solid var(--line); border-radius: 6px;
  background: var(--paper); padding: 11px; outline: none;
}
.generate-panel select:focus, .generate-panel input[type="password"]:focus { border-color: var(--green); }
.generate-panel .access-status { margin-top: 14px; }
.generate-panel .inline-check { margin-top: 12px !important; }
@media (min-width: 1101px) {
  .studio-card { position: sticky; top: 88px; }
}
.inline-check {
  display: flex !important; align-items: center; gap: 8px;
  margin: 4px 0 6px !important; cursor: pointer;
}
.inline-check input { width: auto !important; flex: 0 0 auto; }
.inline-check span { color: var(--ink); font-size: 13px; font-weight: 700; }
.access-status {
  display: grid; grid-template-columns: 10px minmax(0,1fr); align-items: center; gap: 9px;
  border: 1px solid var(--line); border-radius: 7px;
  background: var(--white); padding: 9px 10px;
}
.access-status > i { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.access-status b { display: block; color: var(--ink); font-size: 13px; line-height: 1.3; }
.access-status small { display: block; text-align: left; color: var(--muted); font-size: 11px; line-height: 1.45; margin-top: 2px; }
.access-status.ready { border-color: rgba(139,74,59,.22); background: var(--white); }
.access-status.ready > i { background: var(--success); box-shadow: 0 0 0 3px rgba(39,174,96,.13); }
.access-status.missing { border-color: rgba(194,94,58,.3); background: var(--orange-light); }
.access-status.missing > i { background: var(--orange); }
.file-button {
  display: block; text-align: center;
  border: 1px solid var(--green) !important; color: var(--green);
  background: var(--white); border-radius: 6px;
  padding: 12px; font-weight: 800; font-size: calc(15px * var(--font-scale));
  transition: var(--transition); cursor: pointer;
}
.file-button:hover { background: var(--green-light); }
.file-button input { display: none; }
.analyze-btn {
  width: 100%; margin-top: 16px;
  background: var(--orange); color: #fff;
  border-radius: 6px; padding: 13px; font-weight: 800;
  font-size: calc(16px * var(--font-scale));
  box-shadow: 0 3px 0 var(--green-dark); transition: var(--transition);
}
.analyze-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 0 var(--green-dark); }
.analyze-btn:disabled { opacity: 0.6; cursor: wait; box-shadow: none; }
.ai-note { font-size: calc(13px * var(--font-scale)); color: var(--muted); line-height: 1.6; margin-top: 10px; }
.system-message {
  margin-top: 20px; border-radius: var(--radius-sm);
  padding: 14px 18px 14px 46px; font-weight: 700; line-height: 1.6; position: relative;
  font-size: calc(16px * var(--font-scale));
}
.system-message::before { position: absolute; left: 16px; top: 14px; display: grid; place-items: center; width: 22px; height: 22px; border: 2px solid currentColor; border-radius: 50%; font-size: 12px; font-weight: 950; line-height: 1; }
.system-message.success::before { content: "✓"; }
.system-message.error::before { content: "!"; }
.system-message.info::before { content: "i"; }
.system-message.success { background: var(--green-light); color: var(--green); }
.system-message.error { background: var(--orange-light); color: var(--error); }
.system-message.info { background: var(--gold-light); color: #6d5420; }

/* ===== 诗库选择区 ===== */
.library-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.library-tools button {
  border: 1px solid var(--line); background: var(--white);
  border-radius: var(--radius-sm); padding: 9px 12px;
  font-weight: 700; color: var(--green); display: flex; align-items: center; gap: 5px;
  transition: var(--transition); font-size: 14px;
}
.library-tools button:hover { background: var(--green-light); }
.library-tools label {
  border: 1px solid var(--line); background: var(--white);
  border-radius: var(--radius-sm); padding: 9px 14px; font-weight: 600; font-size: 14px;
}
.library-tools input { border: none; outline: none; background: transparent; width: 130px; margin-left: 6px; font-size: 14px; }
.picker .week-history {
  margin: 2px 0 20px;
  border: 1px solid rgba(139,74,59,0.14);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--white), var(--green-light));
  padding: 18px;
  box-shadow: var(--shadow-md);
}
.week-history-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 13px;
}
.week-history-head b { display: block; color: var(--green); font-size: 20px; font-weight: 900; }
.week-history-head p { color: var(--muted); font-size: 13px; margin-top: 3px; line-height: 1.6; }
.week-history-head button {
  border: 1px solid var(--green); color: #fff; background: var(--green);
  border-radius: var(--radius-sm); padding: 9px 13px;
  font-weight: 800; flex: 0 0 auto;
  box-shadow: 0 2px 0 rgba(15,51,39,0.18);
}
.week-history-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 10px; }
.week-day {
  min-width: 0;
  min-height: 142px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  padding: 10px;
  box-shadow: var(--shadow-sm);
}
.week-day.today { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green), var(--shadow-sm); }
.week-day header { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 9px; }
.week-day header > div { min-width: 0; }
.week-day header b { display: block; color: var(--ink); font-size: 14px; line-height: 1.2; }
.week-day header span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.week-day header em {
  display: grid; place-items: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--green-light); color: var(--green);
  font-style: normal; font-size: 12px; font-weight: 900;
  flex: 0 0 auto;
}
.week-day.today header em { background: var(--green); color: #fff; }
.week-day > div:last-child { display: grid; gap: 6px; }
.week-day button {
  width: 100%; text-align: left;
  border: 1px solid var(--line); border-radius: 7px;
  background: var(--paper); padding: 8px 9px;
  transition: var(--transition);
}
.week-day button:hover { transform: translateY(-1px); border-color: var(--green); background: var(--green-light); }
.week-day button strong {
  display: block; color: var(--green); font-size: 13px; font-weight: 900;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.week-day button span {
  display: block; color: var(--muted); font-size: 11px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 2px;
}
.week-empty {
  display: grid; place-items: center;
  min-height: 80px;
  border: 1px dashed var(--line);
  border-radius: 7px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  background: var(--paper);
}
.week-empty i {
  display: block; width: 26px; height: 26px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--white);
  margin-bottom: 6px; position: relative;
}
.week-empty i::before, .week-empty i::after {
  content: ""; position: absolute; left: 6px; right: 6px;
  height: 1px; background: var(--line);
}
.week-empty i::before { top: 9px; }
.week-empty i::after { top: 15px; }
.poem-list { display: grid; grid-template-columns: repeat(auto-fill,minmax(220px,1fr)); gap: 14px; }
.poem-list button {
  text-align: left; border: 1px solid var(--line); background: var(--white);
  min-height: 110px; border-radius: var(--radius-sm);
  padding: 14px 16px; transition: var(--transition);
  position: relative; color: var(--ink);
  display: flex; flex-direction: column; justify-content: space-between;
}
.poem-list button:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--green); }
.poem-list button.active { background: var(--green); border-color: var(--green); color: #fff; }
.poem-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.poem-card-meta { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.poem-card-meta > span { color: var(--orange); font-weight: 800; font-size: 13px; flex-shrink: 0; }
.poem-list button.active .poem-card-meta > span { color: var(--gold); }
.poem-card-meta > small { font-size: 13px; opacity: 0.7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.poem-list strong {
  display: block;
  font: 700 calc(20px * var(--font-scale)) var(--font-kai);
  margin: 10px 0 8px; line-height: 1.35;
}
.poem-card-tag {
  align-self: flex-start;
  font-size: 12px; font-weight: 700; font-style: normal;
  padding: 3px 9px; border-radius: 99px;
  background: var(--green-light); color: var(--green);
}
.poem-list button.active .poem-card-tag { background: rgba(255,255,255,0.15); color: #fff; }
.poem-list button > b {
  flex-shrink: 0;
  background: var(--gold); color: #4a3a16;
  font-size: 11px; font-weight: 800;
  padding: 3px 8px; border-radius: 10px;
}
.empty-library {
  border: 2px dashed var(--line); border-radius: var(--radius);
  text-align: center; padding: 48px 24px;
}
.empty-library b { font: 700 26px var(--font-kai); color: var(--ink); }
.empty-library p { max-width: 600px; margin: 14px auto 22px; font-size: calc(16px * var(--font-scale)); color: var(--muted); line-height: 1.8; }
.empty-library button {
  background: var(--green); color: #fff;
  border-radius: var(--radius-sm); padding: 13px 24px;
  font-weight: 800; font-size: 15px;
}

/* ===== 课程视图 ===== */
.lesson {
  display: grid; grid-template-columns: minmax(280px,380px) minmax(0,1fr); align-items: start; gap: 20px;
  max-width: 1580px; margin: 0 auto 60px; padding: 0 24px;
  overflow-x: hidden;
}
.poem-panel {
  position: sticky; top: 90px;
  display: flex; flex-direction: column;
  background:
    linear-gradient(180deg, var(--panel-tint), transparent 42px),
    linear-gradient(180deg, var(--panel-from) 0%, var(--panel-to) 100%);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 18px 16px;
  max-height: calc(100vh - 108px);
  min-height: 0;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  min-width: 0;
}
.poem-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: calc(15px * var(--font-scale)); color: var(--muted); flex: 0 0 auto; }
.poem-meta-btns { display: flex; gap: 8px; flex: 0 0 auto; }
.poem-meta button {
  color: var(--green); border: 1px solid var(--line);
  background: var(--white);
  border-radius: 6px; padding: 8px 10px; font-weight: 600;
  display: flex; align-items: center; gap: 4px;
  transition: var(--transition); font-size: 13px;
}
.poem-meta button:hover { background: var(--green-light); border-color: var(--green); }
.poem-panel h2 { font: 700 calc(28px * var(--font-scale))/1.3 var(--font-kai); margin: 14px 0 6px; text-align: center; overflow-wrap: anywhere; flex: 0 0 auto; color: var(--ink); }
.theme { font-size: calc(14px * var(--font-scale)); color: var(--seal); text-align: center; font-weight: 600; margin-bottom: 10px; overflow-wrap: anywhere; flex: 0 0 auto; }
.poem-text {
  margin: 4px 0 10px; min-height: 0; flex: 1 1 auto;
  overflow: auto; padding-right: 6px;
  overscroll-behavior: contain;
  scrollbar-color: var(--panel-scroll) transparent;
}
.poem-text p {
  display: grid; grid-template-columns: 28px minmax(0,1fr); gap: 8px; align-items: start;
  font: 600 calc(23px * var(--font-scale))/1.85 var(--font-kai);
  letter-spacing: 0.4px; margin-bottom: 8px;
}
.poem-text p > span {
  width: 28px; min-height: 22px; border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--white);
  text-align: center; font: 700 11px/20px Georgia; color: var(--muted);
  padding: 1px 0;
}
.poem-text p > b { font-weight: 600; overflow-wrap: anywhere; word-break: break-word; min-width: 0; }
.poem-panel.long-poem .poem-text p {
  font-size: calc(21px * var(--font-scale));
  line-height: 1.8;
  margin-bottom: 6px;
}
.master-btn {
  position: static; flex: 0 0 auto;
  flex-shrink: 0;
  width: 100%; margin-top: 4px;
  border: 1px solid var(--seal); color: var(--seal);
  border-radius: var(--radius-sm); padding: 12px;
  font-weight: 800; font-size: calc(16px * var(--font-scale));
  background: var(--white); transition: var(--transition);
}
.master-btn:hover { background: var(--green-light); }
.master-btn.mastered { background: var(--gold); color: var(--green-dark); border-color: var(--gold); }

/* ===== 学习面板 ===== */
.learning { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; min-width: 0; }
.scene-card {
  display: grid; grid-template-columns: minmax(220px,0.7fr) minmax(0,1.3fr);
  min-height: 280px; max-height: min(62vh, 560px);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.scene-poem {
  background: linear-gradient(135deg, var(--paper), var(--cream));
  padding: 22px 24px; display: flex; flex-direction: column; min-width: 0; min-height: 0;
}
.scene-label { align-self: flex-start; padding: 4px 11px; border-radius: 99px; background: var(--green-light); color: var(--green); font-size: 13px; font-weight: 800; letter-spacing: 1px; }
.scene-poem h3 { font: 700 calc(26px * var(--font-scale))/1.25 var(--font-kai); margin: 12px 0 4px; overflow-wrap: anywhere; }
.scene-byline { font-size: calc(15px * var(--font-scale)); color: var(--muted); margin-bottom: 12px; font-weight: 600; }
.scene-poem > div {
  min-height: 0; flex: 1 1 auto; overflow: auto; padding-right: 4px;
}
.scene-poem > div p { font: 600 calc(22px * var(--font-scale))/1.8 var(--font-kai); letter-spacing: 0.5px; margin-bottom: 6px; overflow-wrap: anywhere; word-break: break-word; }
.scene-poem small { display: block; color: var(--cinnabar); font-size: 13px; margin-top: 18px; font-weight: 600; }
.scene-card figure {
  background: var(--cream);
  min-height: 240px; min-width: 0; min-height: 0; margin: 0;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.scene-card img {
  width: 100%; height: 100%;
  object-fit: contain;
  object-position: center;
}
.scene-regenerate {
  position: absolute; right: 14px; bottom: 14px;
  background: var(--green-dark); color: #fff;
  border-radius: 6px; padding: 9px 13px;
  font-size: 13px; font-weight: 800;
  box-shadow: var(--shadow-sm);
}
.scene-empty {
  display: grid; place-content: center; text-align: center;
  width: 100%; min-height: 240px; padding: 24px;
  background: radial-gradient(circle at 50% 42%, var(--paper), var(--cream));
  color: var(--green);
}
.scene-empty b { font: 700 22px var(--font-kai); }
.scene-empty p { color: var(--muted); font-size: 14px; margin: 10px 0 20px; }
.scene-empty button {
  justify-self: center; background: var(--orange); color: #fff;
  border-radius: var(--radius-sm); padding: 12px 22px; font-weight: 800;
  box-shadow: 0 3px 0 var(--green-dark); transition: var(--transition);
}
.scene-empty button:hover { transform: translateY(-1px); }
.scene-empty button:disabled { opacity: 0.6; cursor: wait; }

/* ===== 标签页 ===== */
.tabs { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); border-bottom: 1px solid var(--line); padding: 0 12px; }
.tabs button {
  color: var(--muted); font-weight: 800; font-size: calc(16px * var(--font-scale));
  padding: 18px 8px 15px; border-bottom: 4px solid transparent;
  transition: var(--transition);
}
.tabs button > span {
  display: inline-grid; place-items: center;
  width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--line); margin-right: 6px; font-size: 13px;
}
.tabs button.active { color: var(--orange); border-color: var(--orange); }
.tabs button.active > span { border-color: var(--orange); color: var(--orange); }
.tab-content { padding: 32px 28px 40px; animation: fade 0.3s ease; min-width: 0; overflow-wrap: anywhere; }

/* ===== 背景卡片 ===== */
.content-title { margin-bottom: 24px; }
.content-title > span { display: block; color: var(--orange); font-size: 14px; font-weight: 800; letter-spacing: 1px; }
.content-title h3 { font: 700 calc(30px * var(--font-scale))/1.35 var(--font-kai); margin-top: 8px; }
.bg-card, .hook-card, .emotion-card, .talk-card {
  border-radius: var(--radius-sm); padding: 22px 24px; margin-bottom: 14px;
}
.bg-card { background: var(--cream); border-left: 5px solid var(--gold); }
.hook-card { background: var(--green-light); border-left: 5px solid var(--green); }
.emotion-card { background: var(--orange-light); border-left: 5px solid var(--orange); }
.talk-card { background: var(--talk-bg); border-left: 5px solid var(--talk-accent); }
.tab-content article > b, .reading-note > b, .parent-tip > b { display: block; font-size: calc(18px * var(--font-scale)); font-weight: 700; margin-bottom: 8px; }
.tab-content article > p, .parent-tip p { font-size: calc(17px * var(--font-scale)); line-height: 1.9; }
.next-btn {
  display: block; margin: 24px 0 0 auto;
  background: var(--orange); color: #fff;
  border-radius: var(--radius-sm); padding: 14px 22px;
  font-weight: 800; font-size: calc(16px * var(--font-scale));
  box-shadow: 0 3px 0 var(--green-dark); transition: var(--transition);
}
.next-btn:hover { transform: translateY(-1px); }

/* ===== 字词网格 ===== */
.word-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.word-grid article { border: 1px solid var(--line); background: var(--white); border-radius: var(--radius-sm); padding: 20px; }
.word-grid article > div { display: flex; align-items: baseline; gap: 16px; }
.word-grid strong { font: 700 calc(28px * var(--font-scale)) var(--font-kai); color: var(--green); }
.word-grid em { color: var(--orange); font-style: normal; font-weight: 800; font-size: calc(17px * var(--font-scale)); }
.word-grid p { font-size: calc(16px * var(--font-scale)) !important; margin: 10px 0 0 !important; line-height: 1.7 !important; }
.word-grid .word-pinyin { color: var(--gold); font-weight: 700; font-size: 14px; }
.word-grid button { background: var(--green-light); color: var(--green); border-radius: 5px; padding: 7px 10px; font-weight: 700; font-size: 13px; }
.reading-note { background: var(--green-light); color: var(--ink); border-left: 5px solid var(--seal); border-radius: var(--radius-sm); margin-top: 20px; padding: 20px 24px; }
.reading-note p { font: 600 calc(20px * var(--font-scale))/1.8 var(--font-kai); }

/* ===== 逐句解读 ===== */
.line-notes { display: grid; gap: 18px; }
.line-notes > article { border: 1px solid var(--line); background: var(--white); border-radius: var(--radius); overflow: hidden; }
.line-heading { display: flex; align-items: flex-start; gap: 14px; padding: 18px 22px; background: var(--green-light); }
.line-heading > span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--green); color: #fff; font-weight: 800; flex-shrink: 0; }
.line-heading h4 { font: 700 calc(22px * var(--font-scale))/1.4 var(--font-kai); min-width: 0; }
.line-heading p { color: var(--orange); font-weight: 800; font-size: 14px !important; margin-top: 4px !important; }
.line-notes dl { padding: 4px 22px 16px; }
.line-notes dl > div { display: grid; grid-template-columns: minmax(90px,160px) minmax(0,1fr); gap: 14px; padding: 14px 0; border-bottom: 1px dashed var(--line); }
.line-notes dl > div:last-child { border: none; }
.line-notes dt { font-weight: 800; color: var(--green); font-size: calc(15px * var(--font-scale)); overflow-wrap: anywhere; word-break: break-word; }
.line-notes dd { font-size: calc(16px * var(--font-scale)); line-height: 1.75; min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.line-heading h4, .line-heading p { overflow-wrap: anywhere; word-break: break-word; }
.tab-error { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--orange-light); color: var(--error); padding: 14px 16px; font-weight: 800; }

/* ===== 背诵闯关 ===== */
.memory-path { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); align-items: stretch; gap: 8px; margin-bottom: 22px; }
.memory-path > div { text-align: center; background: var(--green-light); border: 1px solid var(--line); padding: 16px 10px; position: relative; border-radius: var(--radius-sm); }
.memory-path span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--green); color: #fff; margin: 0 auto 8px; font-weight: 800; font-size: 13px; }
.memory-path p { font-size: calc(14px * var(--font-scale)); font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.memory-path b { display: none; }
.blank-modes { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.blank-modes button {
  border: 1px solid var(--line); background: var(--white); color: var(--green);
  border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 800;
}
.blank-modes button.active { background: var(--gold-light); border-color: var(--gold); color: #7a5d12; }
.level-buttons { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin-bottom: 16px; }
.level-buttons button { flex: 1; border: 1px solid var(--line); background: var(--white); border-radius: var(--radius-sm); padding: 12px; text-align: center; transition: var(--transition); }
.level-buttons button strong { display: block; font-size: calc(15px * var(--font-scale)); }
.level-buttons button span { display: block; font-size: 13px; color: var(--muted); margin-top: 3px; }
.level-buttons button.active { background: var(--green); color: #fff; border-color: var(--green); }
.level-buttons button.active span { color: #f3e4d0; }
.masked { border: 2px solid var(--line); border-radius: var(--radius-sm); padding: 20px 22px; min-height: 160px; max-height: min(56vh, 520px); overflow: auto; background: var(--cream); transition: var(--transition); }
.masked p { font: 600 calc(22px * var(--font-scale))/1.85 var(--font-kai); letter-spacing: 1px; overflow-wrap: anywhere; word-break: break-word; }
.masked.reveal { background: var(--green-light); border-color: var(--green); }
.recite-actions { display: flex; gap: 10px; margin-top: 16px; }
.recite-actions button { border: 1px solid var(--green); color: var(--green); background: var(--white); border-radius: 6px; padding: 12px 18px; font-weight: 800; font-size: calc(15px * var(--font-scale)); transition: var(--transition); }
.recite-actions button+button { background: var(--orange); border-color: var(--orange); color: #fff; }
.recite-actions button:hover { transform: translateY(-1px); }
.parent-tip { background: var(--gold-light); border: 1px solid #e7ce88; border-radius: var(--radius-sm); margin-top: 20px; padding: 18px 22px; }
.parent-tip p { font-size: calc(15px * var(--font-scale)) !important; line-height: 1.7; }

/* ===== 页脚 ===== */
footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 32px max(5vw,30px); background: var(--footer-bg); color: var(--ink);
  border-top: 1px solid var(--line);
}
html:not([data-decoration]) footer,
html[data-decoration="classic"] footer,
html[data-decoration="default"] footer {
  color: #e2eee9; border-top-color: #183f33;
}
html:not([data-decoration]) footer p,
html[data-decoration="classic"] footer p,
html[data-decoration="default"] footer p { color: #d4e7df; }

/* 默认墨绿主题：顶栏 / 首屏与底栏同一套深绿底浅字 */
html:not([data-decoration]) .topbar,
html[data-decoration="classic"] .topbar,
html[data-decoration="default"] .topbar {
  color: #e2eee9;
  border-bottom-color: #183f33;
}
html:not([data-decoration]) .brand-name,
html[data-decoration="classic"] .brand-name,
html[data-decoration="default"] .brand-name { color: #e2eee9; }
html:not([data-decoration]) .font-tools button,
html[data-decoration="classic"] .font-tools button,
html[data-decoration="default"] .font-tools button,
html:not([data-decoration]) .account-chip,
html[data-decoration="classic"] .account-chip,
html[data-decoration="default"] .account-chip {
  border-color: rgba(226,238,233,.28);
  background: rgba(255,255,255,.08);
  color: #e2eee9;
}
html:not([data-decoration]) .font-tools button:hover,
html[data-decoration="classic"] .font-tools button:hover,
html[data-decoration="default"] .font-tools button:hover,
html:not([data-decoration]) .account-chip:hover,
html[data-decoration="classic"] .account-chip:hover,
html[data-decoration="default"] .account-chip:hover { background: rgba(255,255,255,.16); }
html:not([data-decoration]) .icon-btn,
html[data-decoration="classic"] .icon-btn,
html[data-decoration="default"] .icon-btn { color: #e2eee9; }
html:not([data-decoration]) .icon-btn:hover,
html[data-decoration="classic"] .icon-btn:hover,
html[data-decoration="default"] .icon-btn:hover { background: rgba(255,255,255,.12); }
html:not([data-decoration]) .account-chip b,
html[data-decoration="classic"] .account-chip b,
html[data-decoration="default"] .account-chip b {
  border-left-color: rgba(226,238,233,.28);
  color: var(--gold);
}
html:not([data-decoration]) .hero,
html[data-decoration="classic"] .hero,
html[data-decoration="default"] .hero {
  background:
    radial-gradient(circle at 12% 16%, rgba(239,189,88,.18), transparent 36%),
    linear-gradient(180deg, var(--footer-bg) 0%, var(--green-dark) 100%);
  color: #e2eee9;
}
html:not([data-decoration]) .hero-label,
html[data-decoration="classic"] .hero-label,
html[data-decoration="default"] .hero-label { color: var(--gold); }
html:not([data-decoration]) .hero-title,
html[data-decoration="classic"] .hero-title,
html[data-decoration="default"] .hero-title { color: #f4faf7; }
html:not([data-decoration]) .hero-title em,
html[data-decoration="classic"] .hero-title em,
html[data-decoration="default"] .hero-title em { color: var(--gold); }
html:not([data-decoration]) .hero-desc,
html[data-decoration="classic"] .hero-desc,
html[data-decoration="default"] .hero-desc { color: #d4e7df; }
html:not([data-decoration]) .hero-steps span,
html[data-decoration="classic"] .hero-steps span,
html[data-decoration="default"] .hero-steps span {
  background: rgba(255,255,255,.08);
  border-color: rgba(226,238,233,.22);
  color: #e2eee9;
}
footer > div { display: flex; align-items: center; gap: 14px; }
footer b { font: 700 20px var(--font-kai); }
footer p { font-size: 14px; color: var(--muted); }

/* ===== 设置弹窗 ===== */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
  display: grid; place-items: center; padding: 20px;
  overflow-y: auto;
}
body.modal-open { overflow: hidden; }
.confirm-backdrop { z-index: 260; }
.confirm-modal { width: min(440px,100%); }
.confirm-modal > p { color: var(--ink); font-size: 15px; line-height: 1.8; margin: 14px 0 6px; }
.confirm-modal .modal-actions { justify-content: flex-end; }
.confirm-modal .modal-actions button { flex: 0 0 auto; min-width: 96px; }
.modal {
  background: var(--paper); border-radius: var(--radius); padding: 36px 32px 28px;
  width: min(620px,100%); max-height: 90vh; overflow-y: auto;
  position: relative; box-shadow: var(--shadow-lg);
}
.modal-close { position: absolute; top: 10px; right: 14px; font-size: 28px; color: var(--muted); }
.modal h2 { font: 700 26px var(--font-kai); margin-bottom: 8px; }
.modal > p { color: var(--muted); font-size: 14px; line-height: 1.6; margin-bottom: 24px; }
.settings-section { border-top: 1px solid var(--line); padding-top: 20px; margin-bottom: 20px; }
.settings-section h3 { font-size: 16px; font-weight: 700; margin-bottom: 12px; color: var(--green); }
.settings-section label { display: block; font-size: 13px; font-weight: 600; margin: 10px 0 4px; color: var(--muted); }
.settings-section input, .settings-section textarea, .settings-section select {
  width: 100%; border: 1px solid var(--line); border-radius: 6px;
  background: var(--white); padding: 10px 12px; font-size: 14px; outline: none;
}
.settings-section input:focus, .settings-section textarea:focus { border-color: var(--green); }
.test-btn { margin-top: 10px; padding: 8px 16px; border: 1px solid var(--green); color: var(--green); border-radius: 6px; font-weight: 700; font-size: 13px; }
.modal-actions { display: flex; gap: 12px; margin-top: 20px; }
.btn-save { flex: 1; background: var(--green); color: #fff; border-radius: var(--radius-sm); padding: 12px; font-weight: 800; }
.btn-cancel { padding: 12px 20px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-weight: 700; }

/* ===== 学习账户 ===== */
.account-modal { width: min(780px,100%); padding-top: 30px; }
.account-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 18px; padding-right: 26px; }
.account-heading span { color: var(--orange); font-size: 12px; font-weight: 900; }
.account-heading h2 { margin: 2px 0 0; }
.account-logout { border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; color: var(--muted); font-size: 13px; font-weight: 800; }
.account-tabs { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.account-tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; flex: 1; min-width: 90px; padding: 10px 12px; color: var(--muted); font-weight: 800; border-bottom: 3px solid transparent; white-space: nowrap; }
.account-tabs button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.account-tabs button.active { color: var(--green); border-bottom-color: var(--green); }
.auth-panel { max-width: 440px; }
.auth-panel label, .account-page > label { display: block; margin: 11px 0 5px; color: var(--muted); font-size: 13px; font-weight: 800; }
.auth-panel input, .account-page > input { width: 100%; border: 1px solid var(--line); border-radius: 6px; background: var(--white); padding: 11px 12px; outline: none; }
.auth-panel input:focus, .account-page > input:focus { border-color: var(--green); }
.account-primary { margin-top: 16px; border-radius: 6px; background: var(--green); color: #fff; padding: 11px 16px; font-weight: 900; }
.account-primary:disabled, .shop-buy:disabled { opacity: .55; cursor: wait; }
.account-note { margin-top: 18px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.captcha-refresh { color: var(--green); font-size: 12px; font-weight: 850; margin-left: 5px; }
.registration-closed { grid-template-columns: 38px minmax(0,1fr); gap: 12px; align-items: start; max-width: 500px; border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: var(--radius-sm); background: var(--gold-light); padding: 14px; }
.registration-closed > i { display: grid; place-items: center; width: 34px; height: 34px; border: 2px solid var(--gold); border-radius: 50%; color: #6d5420; font-style: normal; font-weight: 950; }
.registration-closed b { display: block; color: var(--ink); font-size: 14px; }
.registration-closed p { color: var(--muted); font-size: 12px; line-height: 1.6; margin-top: 3px; }
.wallet-strip { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin-bottom: 20px; }
.wallet-strip > div { border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: var(--radius-sm); padding: 12px; background: var(--white); }
.wallet-strip > div.wallet-analysis { border-left-color: var(--green); }
.wallet-strip > div.wallet-image { border-left-color: var(--orange); }
.wallet-label { display: flex; align-items: center; gap: 7px; min-width: 0; }
.wallet-label svg { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; color: var(--gold); }
.wallet-analysis .wallet-label svg { color: var(--green); }
.wallet-image .wallet-label svg { color: var(--orange); }
.wallet-strip span { display: block; color: var(--muted); font-size: 12px; font-weight: 800; white-space: nowrap; }
.wallet-strip b { display: block; color: var(--green); font-size: 24px; margin-top: 2px; }
.account-page { display: none; min-height: 220px; }
.account-page.active { display: block; }
.shop-list, .theme-list, .ledger-list { display: grid; gap: 8px; }
.shop-row, .theme-row, .ledger-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 14px; align-items: center; border-bottom: 1px solid var(--line); padding: 12px 2px; }
.shop-row h3, .theme-row h3 { font-size: 15px; color: var(--ink); }
.shop-row p, .theme-row p { color: var(--muted); font-size: 12px; margin-top: 3px; }
.shop-price { display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.shop-price b { color: var(--orange); font-size: 13px; }
.shop-buy { border: 1px solid var(--green); border-radius: 6px; color: var(--green); padding: 8px 11px; font-weight: 850; font-size: 13px; }
.theme-swatch { display: inline-block; width: 14px; height: 14px; margin-right: 7px; border-radius: 50%; vertical-align: -2px; background: linear-gradient(135deg,#285d4c 50%,#df6337 50%); }
.theme-swatch.default { background: linear-gradient(135deg,#285d4c 50%,#df6337 50%); }
.theme-swatch.xuan { background: linear-gradient(135deg,#9a5c48 50%,#c9a86a 50%); }
.theme-swatch.blossom { background: linear-gradient(135deg,#286454 50%,#b84f68 50%); }
.theme-swatch.bluewhite { background: linear-gradient(135deg,#245c70 50%,#c99a2e 50%); }
.theme-row { min-width: 0; }
.theme-row h3, .shop-row h3 { overflow-wrap: anywhere; }
.theme-row p, .shop-row p { overflow-wrap: anywhere; }
.ledger-row { grid-template-columns: minmax(0,1fr) auto; }
.ledger-row span { color: var(--muted); font-size: 12px; }
.ledger-row b { font-size: 14px; color: var(--green); }
.ledger-row b.minus { color: var(--orange); }
.account-secondary-action { background: var(--white); color: var(--green); border: 1px solid var(--green); margin-bottom: 14px; }
.account-data-actions { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 18px; }
.account-data-actions h3 { font-size: 15px; color: var(--ink); }
.account-data-actions label { display: block; margin: 14px 0 5px; color: var(--muted); font-size: 13px; font-weight: 800; }
.account-data-actions input { width: 100%; border: 1px solid var(--line); border-radius: 6px; background: var(--white); padding: 11px 12px; outline: none; }
.account-data-actions input:focus { border-color: var(--error); }
.account-danger { display: block; margin-top: 10px; border: 1px solid var(--error); border-radius: 6px; color: var(--error); padding: 10px 14px; font-weight: 850; }
.account-danger:disabled { opacity: .55; cursor: wait; }
.growth-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--green-light); overflow: hidden; }
.growth-metrics > div { padding: 12px; border-left: 1px solid var(--line); }
.growth-metrics > div:first-child { border-left: 0; }
.growth-metrics span { display: block; color: var(--muted); font-size: 11px; font-weight: 800; }
.growth-metrics b { display: block; color: var(--green); font-size: 19px; margin-top: 3px; }
.daily-goal { margin: 18px 0 22px; }
.daily-goal > div { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.daily-goal > div span { color: var(--muted); font-weight: 800; }
.daily-goal > i { display: block; height: 9px; border-radius: 5px; background: var(--cream); margin-top: 7px; overflow: hidden; }
.daily-goal > i em { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--green),var(--gold)); transition: width .3s ease; }
.growth-block { border-top: 1px solid var(--line); padding-top: 15px; margin-top: 16px; }
.growth-block h3 { color: var(--ink); font-size: 14px; margin-bottom: 10px; }
.growth-trend { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 8px; height: 124px; align-items: end; }
.trend-day { display: grid; grid-template-rows: 88px 18px; gap: 4px; min-width: 0; text-align: center; }
.trend-bar-track { display: flex; align-items: flex-end; justify-content: center; height: 88px; border-bottom: 1px solid var(--line); }
.trend-bar { display: block; width: min(24px,70%); min-height: 4px; border-radius: 4px 4px 0 0; background: var(--green); }
.trend-day.today .trend-bar { background: var(--orange); }
.trend-day small { color: var(--muted); font-size: 10px; white-space: nowrap; }
.badge-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.badge-item { display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 9px; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px; background: var(--white); }
.badge-item > i { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--gold-light); color: #6f5310; font-style: normal; font-weight: 950; }
.badge-item b { display: block; font-size: 13px; }
.badge-item small { display: block; color: var(--muted); font-size: 10px; line-height: 1.45; margin-top: 2px; }
.badge-item.locked { opacity: .56; }
.badge-item.locked > i { background: var(--cream); color: var(--muted); }
.mastered-list { display: grid; gap: 4px; }
.mastered-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: center; border-bottom: 1px solid var(--line); padding: 8px 2px; text-align: left; }
.mastered-row b { display: block; font-size: 13px; }
.mastered-row span { color: var(--muted); font-size: 11px; }
.mastered-row em { color: var(--green); font-size: 12px; font-style: normal; font-weight: 800; }

/* ===== 提示弹窗 ===== */
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
  z-index: 300; grid-template-columns: 32px minmax(0,1fr) auto 28px; align-items: center; gap: 10px;
  width: min(560px,calc(100vw - 28px)); background: var(--white); color: var(--ink);
  padding: 13px 12px 13px 14px; border: 1px solid var(--line); border-left: 5px solid var(--green); border-radius: var(--radius-sm);
  font-weight: 650; font-size: 14px; line-height: 1.55; box-shadow: 0 16px 42px rgba(43,36,28,.18);
  animation: toastIn 0.3s ease;
}
.toast > i { display: grid; place-items: center; width: 30px; height: 30px; border: 2px solid var(--green); border-radius: 50%; color: var(--green); font-style: normal; font-weight: 950; }
.toast > button { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; color: var(--muted); font-size: 22px; line-height: 1; }
.toast > button:hover { background: var(--paper); color: var(--ink); }
.toast > button.toast-action { width: auto; min-width: 72px; height: 32px; border: 1px solid currentColor; padding: 0 10px; color: var(--green); font-size: 12px; font-weight: 850; white-space: nowrap; }
.toast.warning { border-left-color: var(--gold); }
.toast.warning > i { border-color: var(--gold); color: #6d5420; }
.toast.error { border-left-color: var(--error); }
.toast.error > i { border-color: var(--error); color: var(--error); }
.toast.success { border-left-color: var(--success); }
.toast.success > i { border-color: var(--success); color: var(--success); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%,10px); } }

/* ===== 动画 ===== */
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--focus-ring); outline-offset: 2px;
}

body.member-mode .hero { padding-top: 36px; padding-bottom: 32px; }
body.member-mode .hero-desc { max-width: 560px; }

/* ===== 响应式 ===== */
@media (max-width: 1100px) {
  .hero, .studio-grid, .generate-grid { grid-template-columns: 1fr; }
  .hero-search { max-width: 640px; }
  .lesson { grid-template-columns: minmax(240px,300px) minmax(0,1fr); }
  .tabs { grid-template-columns: repeat(2,1fr); }
  .memory-path { grid-template-columns: repeat(2,1fr); }
  .scene-card { max-height: none; grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .topbar { height: auto; min-height: 64px; padding: 10px 14px; flex-wrap: wrap; gap: 8px; }
  .brand-name { display: none; }
  .header-tools { gap: 8px; }
  .account-chip span { display: none; }
  .font-tools > span { display: none; }
  .progress { width: 100px; }
  .hero { padding: 32px 16px 28px; gap: 20px; }
  .hero-title { font-size: 34px; }
  .studio, .picker { padding: 28px 14px 36px; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 14px; }
  .library-results { max-height: 320px; }
  .week-history-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .lesson { grid-template-columns: 1fr; padding: 0 12px; }
  .poem-panel { position: relative; top: 0; height: auto; max-height: none; min-height: auto; padding: 20px 18px; }
  .poem-text { max-height: 46vh; }
  .master-btn { margin-top: 12px; }
  .scene-card { grid-template-columns: 1fr; max-height: none; }
  .scene-card figure { min-height: 220px; }
  .scene-poem > div { max-height: 220px; }
  .tab-content { padding: 28px 18px 36px; }
  .word-grid { grid-template-columns: 1fr; }
  .line-notes dl > div { grid-template-columns: 1fr; }
  .memory-path { grid-template-columns: 1fr; }
  .level-buttons { grid-template-columns: repeat(3,1fr); }
  .blank-modes { justify-content: flex-start; }
  footer { flex-direction: column; align-items: flex-start; gap: 14px; }
  .account-modal { padding: 28px 18px 20px; }
  .wallet-strip { grid-template-columns: 1fr 1fr; }
  .wallet-strip > div:first-child { grid-column: 1 / -1; }
  .growth-metrics { grid-template-columns: 1fr 1fr; }
  .growth-metrics > div:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .growth-metrics > div:nth-child(4) { border-top: 1px solid var(--line); }
  .badge-list { grid-template-columns: 1fr; }
}
@media (max-width: 440px) {
  .font-tools { display: none; }
  .header-tools { flex: 1; justify-content: flex-end; }
  .poem-list { grid-template-columns: 1fr; }
  .week-history-grid { grid-template-columns: 1fr; }
  .tabs { grid-template-columns: 1fr; }
  .recite-actions { flex-direction: column; }
}
