/* =========================================================================
   趣探演示学习工作台 — 视觉系统
   三层材质：木框（导航/边框）· 草地（内容底）· 奶油卡（信息层）
   ========================================================================= */

:root {
  /* 木 */
  --wood-900: #33200f;
  --wood-800: #4a2c16;
  --wood-700: #5f3a1e;
  --wood-600: #7a4c28;
  --wood-500: #95603a;
  --wood-400: #b57d4d;
  --wood-300: #d3a273;

  /* 草 */
  --grass-700: #4f7d22;
  --grass-600: #67a02c;
  --grass-500: #7cb63a;
  --grass-400: #92cb46;
  --grass-300: #a9da5e;

  /* 天 */
  --sky-500: #46bde3;
  --sky-400: #6fd3ee;
  --sky-300: #a7e7f8;
  --sky-200: #d3f4fd;

  /* 奶油纸 */
  --cream-100: #fffdf4;
  --cream-200: #fdf7e0;
  --cream-300: #f7ebc4;
  --cream-400: #ecd899;

  /* 墨 */
  --ink-900: #33200f;
  --ink-800: #4a2c16;
  --ink-700: #63401f;
  --ink-500: #8a6640;
  --ink-300: #b79a76;

  /* 强调 */
  --sun-500: #f5b301;
  --sun-400: #ffcf3f;
  --sun-300: #ffe08a;
  --red-600: #b8331d;
  --red-500: #e2452c;
  --red-400: #f4735c;
  --green-700: #2f6b1d;
  --green-600: #3d8428;
  --green-500: #57ab3c;
  --green-400: #7ac65a;
  --blue-600: #2f79b5;
  --blue-500: #3f92d2;
  --blue-400: #6fb6e8;
  --purple-600: #7b3fbb;
  --purple-500: #9b51e0;
  --pink-500: #e06fb0;

  /* 尺度 */
  --r-xs: 8px;
  --r-sm: 11px;
  --r-md: 15px;
  --r-lg: 20px;
  --r-xl: 26px;

  --tap: 44px;
  --page-pad: 14px;

  --font-display: "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;

  --shadow-card: 0 4px 0 rgba(51, 32, 15, .32), 0 12px 22px rgba(51, 32, 15, .16);
  --shadow-soft: 0 2px 0 rgba(51, 32, 15, .22), 0 6px 12px rgba(51, 32, 15, .10);

  /* 纹理 */
  --tex-wood:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .07) 0 2px, rgba(255, 255, 255, .015) 2px 5px, transparent 5px 11px),
    repeating-linear-gradient(1.5deg, rgba(255, 255, 255, .045) 0 3px, transparent 3px 13px);
  --tex-grass:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .045) 0 2px, transparent 2px 9px),
    radial-gradient(120% 60% at 50% 0%, rgba(255, 255, 255, .22), transparent 60%);
  --tex-paper:
    repeating-linear-gradient(0deg, rgba(122, 76, 40, .035) 0 1px, transparent 1px 4px),
    radial-gradient(140% 90% at 10% 0%, rgba(255, 255, 255, .75), transparent 55%);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overscroll-behavior: none;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-900);
  background:
    radial-gradient(120% 80% at 50% 0%, #2f4a1c 0%, #1d2f11 55%, #16240d 100%),
    var(--wood-900);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}

/* 桌面背景上的草地光斑 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(40% 30% at 15% 20%, rgba(146, 203, 70, .14), transparent 70%),
    radial-gradient(45% 35% at 85% 75%, rgba(111, 211, 238, .10), transparent 70%);
}

h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed; left: 12px; top: -80px; z-index: 200;
  padding: 10px 16px; border-radius: var(--r-sm);
  background: var(--cream-100); color: var(--ink-900);
  font-weight: 700; text-decoration: none;
  transition: top .18s ease;
}
.skip-link:focus { top: 12px; }

/* 生图角色立绘：统一按容器铺满 */
.sprite-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
  box-shadow: 0 0 0 6px rgba(63, 146, 210, .85);
}

/* ================================ 外壳 ================================ */

.app-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 0;
}

.app {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  background: var(--wood-700);
  isolation: isolate;
}

/* 桌面：居中成一扇「木窗」 */
@media (min-width: 900px) {
  .app-shell { padding: 18px; }
  .app {
    max-width: 1380px;
    height: calc(100dvh - 36px);
    border-radius: var(--r-xl);
    border: 4px solid var(--wood-900);
    box-shadow:
      0 0 0 6px rgba(181, 125, 77, .35),
      0 30px 60px rgba(0, 0, 0, .5);
  }
}

/* ================================ 顶栏 ================================ */

.topbar {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  background:
    var(--tex-wood),
    linear-gradient(180deg, var(--wood-600), var(--wood-700));
  border-bottom: 3px solid var(--wood-900);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16);
  flex: 0 0 auto;
}

.sq-btn {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 12px;
  border: 2.5px solid var(--wood-900);
  background: linear-gradient(180deg, #ffe8a3, var(--sun-400));
  color: var(--wood-900);
  box-shadow: 0 3px 0 var(--wood-900), inset 0 2px 0 rgba(255, 255, 255, .7);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.sq-btn--brown {
  background: linear-gradient(180deg, var(--wood-400), var(--wood-600));
  color: var(--cream-200);
}
.sq-btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--wood-900); }
.sq-btn:hover { filter: brightness(1.05); }
.sq-btn__glyph { font-size: 19px; line-height: 1; }

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  font-family: var(--font-display);
  font-size: clamp(15px, 4.1vw, 22px);
  font-weight: 400;
  letter-spacing: .4px;
  color: #ffe9ab;
  text-shadow: 0 2px 0 var(--wood-900), 0 0 12px rgba(255, 207, 63, .35);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand__sun {
  display: inline-grid;
  place-items: center;
  width: 26px; height: 26px;
  flex: 0 0 auto;
  filter: drop-shadow(0 2px 0 rgba(51, 32, 15, .5));
}
.brand__sun svg { width: 100%; height: 100%; }
.brand__text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.parent-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  border: 2.5px solid var(--wood-900);
  background: linear-gradient(180deg, var(--blue-400), var(--blue-600));
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .5px;
  box-shadow: 0 3px 0 var(--wood-900), inset 0 2px 0 rgba(255, 255, 255, .4);
  transition: transform .12s ease, box-shadow .12s ease;
  white-space: nowrap;
}
.parent-btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--wood-900); }
.parent-btn.is-parent {
  background: linear-gradient(180deg, var(--green-400), var(--green-600));
}
.parent-btn__label { display: inline; }

@media (max-width: 430px) {
  .parent-btn { padding: 0 9px; }
  .parent-btn__label { display: none; }
  .sq-btn { width: 40px; height: 40px; }
  .topbar { gap: 6px; padding: 8px; }
}

/* ============================== 状态木牌 ============================== */

.statusbar {
  display: flex;
  gap: 6px;
  padding: 7px 9px;
  overflow-x: auto;
  scrollbar-width: none;
  background:
    var(--tex-wood),
    linear-gradient(180deg, var(--wood-800), var(--wood-900));
  border-bottom: 2px solid #24150a;
  flex: 0 0 auto;
}
.statusbar::-webkit-scrollbar { display: none; }

@media (max-width: 899px) {
  .statusbar {
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 26px), transparent 100%);
    mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 26px), transparent 100%);
  }
}

.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  height: 30px;
  padding: 0 7px 0 5px;
  border-radius: 9px;
  border: 2px solid #2a1808;
  background: linear-gradient(180deg, #fff6d6, var(--cream-300));
  color: var(--ink-800);
  font-size: 12px;
  font-weight: 700;
  box-shadow: inset 0 1.5px 0 #fff, 0 2px 0 rgba(0, 0, 0, .35);
  white-space: nowrap;
}
.stat-chip__icon {
  display: grid; place-items: center;
  width: 20px; height: 20px;
  border-radius: 6px;
  background: rgba(122, 76, 40, .12);
  font-size: 12px;
}
.stat-chip__label { color: var(--ink-500); font-weight: 600; }
.stat-chip__value { color: var(--ink-900); font-variant-numeric: tabular-nums; }
.stat-chip--sun { background: linear-gradient(180deg, #fff3bd, var(--sun-400)); }
.stat-chip--danger { background: linear-gradient(180deg, #ffd9cf, #ffb3a0); }
.stat-chip--danger .stat-chip__value { color: var(--red-600); }

@media (min-width: 900px) {
  .statusbar { gap: 10px; padding: 8px 14px; }
  .stat-chip { height: 34px; font-size: 13.5px; padding-right: 10px; }
}

/* =============================== 日期条 =============================== */

.datebar {
  display: flex;
  justify-content: center;
  padding: 6px 10px;
  background: linear-gradient(180deg, var(--wood-800), var(--wood-700));
  border-bottom: 3px solid var(--wood-900);
  flex: 0 0 auto;
}
.datebar__pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fffaea, var(--cream-300));
  border: 2px solid #6b4522;
  color: var(--ink-700);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .5px;
  box-shadow: inset 0 1px 0 #fff;
  font-variant-numeric: tabular-nums;
}

/* ============================== 工作区 ============================== */

.workspace {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  background: var(--wood-700);
}

/* ------------------------------- 侧栏 ------------------------------- */

.rail {
  flex: 0 0 66px;
  width: 66px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 6px 16px;
  background:
    var(--tex-wood),
    linear-gradient(180deg, var(--wood-600), var(--wood-800));
  border-right: 3px solid var(--wood-900);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .25) transparent;
  -webkit-mask-image: linear-gradient(180deg, #000 0, #000 calc(100% - 24px), transparent 100%);
  mask-image: linear-gradient(180deg, #000 0, #000 calc(100% - 24px), transparent 100%);
}
.rail::-webkit-scrollbar { width: 4px; }
.rail::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .22); border-radius: 4px; }

.rail__group { margin-top: 10px; }
.rail__group:first-child { margin-top: 0; }

.rail__label {
  display: block;
  margin: 0 0 5px 3px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.4px;
  color: rgba(255, 236, 200, .5);
  text-transform: uppercase;
}

.rail__item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
  min-height: var(--tap);
  margin-bottom: 4px;
  padding: 5px 2px;
  border-radius: 12px;
  border: 2px solid transparent;
  background: transparent;
  color: rgba(255, 243, 219, .88);
  text-decoration: none;
  transition: background .15s ease, transform .12s ease, color .15s ease;
}
.rail__item:hover { background: rgba(255, 255, 255, .1); }

.rail__icon {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  flex: 0 0 auto;
  border: 0;
  background: none;
  font-size: 15px;
  line-height: 1;
  filter: drop-shadow(0 2px 1px rgba(0, 0, 0, .35));
}
.nav-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}
.nav-img--title {
  width: 30px; height: 30px;
  filter: drop-shadow(0 2px 0 rgba(51, 32, 15, .35));
}
.nav-img--subject { width: 100%; height: 100%; }

.rail__item.is-active .rail__icon { filter: none; }
.rail__name {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1px;
  writing-mode: vertical-rl;
  text-orientation: upright;
  line-height: 1.05;
  max-height: 74px;
}
.rail__count {
  position: absolute;
  top: 3px; right: 5px;
  min-width: 17px; height: 17px;
  padding: 0 3px;
  border-radius: 999px;
  background: var(--red-500);
  border: 1.5px solid #4a1a10;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 14px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.rail__count.is-done { background: var(--green-500); border-color: #244712; }

.rail__item.is-active {
  background: linear-gradient(180deg, #ffeaa9, var(--sun-400));
  border-color: var(--wood-900);
  color: var(--ink-900);
  box-shadow: 0 3px 0 rgba(51, 32, 15, .55), inset 0 2px 0 #fff;
}
.rail__item.is-active .rail__icon {
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, .55));
}
.rail__item:active { transform: scale(.97); }

/* 手机端：不叠角标，用底部细进度条示意 */
@media (max-width: 767px) {
  .rail__count { display: none; }
}
.rail__bar {
  display: none;
  width: 38px;
  height: 3px;
  margin-top: 3px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .38);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, .35);
  overflow: hidden;
}
.rail__bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
}
@media (max-width: 767px) {
  .rail__bar { display: block; }
}

@media (min-width: 768px) {
  .rail { flex-basis: 156px; width: 156px; padding: 10px 9px 18px; }
  .rail__item {
    flex-direction: row;
    justify-content: flex-start;
    gap: 9px;
    padding: 7px 9px;
    min-height: 46px;
  }
  .rail__name {
    writing-mode: horizontal-tb;
    font-size: 13.5px;
    letter-spacing: .5px;
    max-height: none;
  }
  .rail__count { position: static; margin-left: auto; }
  .rail__label { font-size: 10px; margin-left: 6px; }
}

@media (min-width: 1100px) {
  .rail { flex-basis: 186px; width: 186px; }
  .rail__name { font-size: 14.5px; }
}

/* ------------------------------ 主屏 ------------------------------- */

.screen {
  flex: 1 1 auto;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background:
    var(--tex-grass),
    linear-gradient(180deg, var(--grass-400) 0%, var(--grass-500) 40%, var(--grass-600) 100%);
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(51, 32, 15, .35) transparent;
}
.screen::-webkit-scrollbar { width: 8px; }
.screen::-webkit-scrollbar-thumb {
  background: rgba(51, 32, 15, .3);
  border-radius: 8px;
}

.page { min-height: 100%; display: flex; flex-direction: column; }

/* 天空页头 */
.page-head {
  position: relative;
  padding: 13px var(--page-pad) 15px;
  background:
    radial-gradient(90% 120% at 85% -20%, rgba(255, 255, 255, .85), transparent 55%),
    linear-gradient(180deg, var(--sky-400) 0%, var(--sky-300) 70%, #cdf1fb 100%);
  border-bottom: 3px solid rgba(51, 32, 15, .55);
  box-shadow: inset 0 -8px 18px rgba(51, 32, 15, .08);
  overflow: hidden;
}
/* 云 */
.page-head::before,
.page-head::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, .4);
  filter: blur(2px);
  pointer-events: none;
}
.page-head::before { width: 92px; height: 26px; top: 14px; right: 12%; }
.page-head::after { width: 62px; height: 18px; top: 34px; right: 4%; opacity: .7; }

.page-title {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-size: clamp(21px, 5.6vw, 30px);
  font-weight: 400;
  letter-spacing: .6px;
  color: #fff;
  text-shadow: 0 2.5px 0 rgba(51, 32, 15, .6), 0 6px 14px rgba(51, 32, 15, .25);
}
.page-title__icon { font-size: .92em; filter: drop-shadow(0 2px 0 rgba(51, 32, 15, .35)); }
.page-sub {
  position: relative;
  z-index: 1;
  margin-top: 3px;
  font-size: 13px;
  font-weight: 600;
  color: var(--wood-800);
  opacity: .78;
}

.page-body {
  flex: 1 1 auto;
  padding: var(--page-pad);
  display: flex;
  flex-direction: column;
  gap: 13px;
}

@media (min-width: 768px) {
  :root { --page-pad: 20px; }
  .page-head { padding: 18px 22px 20px; }
  .page-body { gap: 16px; }
}
@media (min-width: 1100px) {
  .page-body { padding: 22px 26px 32px; }
  .page-head { padding: 20px 28px 22px; }
}

/* ============================== 卡片 ============================== */

.card {
  position: relative;
  border-radius: var(--r-md);
  border: 3px solid var(--wood-800);
  background:
    var(--tex-paper),
    linear-gradient(180deg, var(--cream-100), var(--cream-200));
  box-shadow: var(--shadow-card), inset 0 2px 0 #fff;
  padding: 13px;
}
.card--tight { padding: 10px 12px; }
.card--sky {
  background:
    radial-gradient(80% 120% at 80% -30%, #fff, transparent 60%),
    linear-gradient(180deg, var(--sky-200), #bfeefa);
  border-color: #2c6e8c;
  box-shadow: 0 4px 0 rgba(20, 62, 80, .45), 0 12px 22px rgba(20, 62, 80, .18);
}
.card--wood {
  background:
    var(--tex-wood),
    linear-gradient(180deg, var(--wood-600), var(--wood-800));
  border-color: var(--wood-900);
  color: var(--cream-200);
}
.card--pink {
  background: linear-gradient(180deg, #ffe6f6, #ffc9ea);
  border-color: #8e2f68;
}
.card--mint {
  background: linear-gradient(180deg, #eaffd8, #cdf3ae);
  border-color: #366b1d;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 2px;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 400;
  letter-spacing: .4px;
  color: var(--cream-100);
  text-shadow: 0 2px 0 rgba(51, 32, 15, .55);
}
.section-title__icon { font-size: 18px; }
.section-title--ink { color: var(--ink-900); text-shadow: none; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

/* ============================== 按钮 ============================== */

.btn {
  --btn-top: var(--green-400);
  --btn-bottom: var(--green-600);
  --btn-edge: #244712;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: var(--tap);
  padding: 0 16px;
  border-radius: 12px;
  border: 2.5px solid var(--wood-900);
  background: linear-gradient(180deg, var(--btn-top), var(--btn-bottom));
  color: #fff;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: .6px;
  text-shadow: 0 1.5px 0 rgba(0, 0, 0, .28);
  box-shadow: 0 3.5px 0 var(--btn-edge), inset 0 2px 0 rgba(255, 255, 255, .45);
  transition: transform .12s ease, box-shadow .12s ease, filter .15s ease;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--btn-edge), inset 0 2px 0 rgba(255, 255, 255, .35); }
.btn[disabled], .btn.is-disabled {
  filter: grayscale(.65) brightness(.95);
  opacity: .68;
  cursor: not-allowed;
  transform: none;
}
.btn--block { width: 100%; }
.btn--sm { min-height: 38px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn--xs { min-height: 32px; padding: 0 9px; font-size: 12.5px; border-radius: 9px; gap: 4px; }

.btn--red { --btn-top: var(--red-400); --btn-bottom: var(--red-500); --btn-edge: #6b1a0c; }
.btn--gold { --btn-top: #ffe08a; --btn-bottom: var(--sun-500); --btn-edge: #7a5600; color: var(--wood-900); text-shadow: 0 1px 0 rgba(255, 255, 255, .45); }
.btn--blue { --btn-top: var(--blue-400); --btn-bottom: var(--blue-600); --btn-edge: #173f60; }
.btn--purple { --btn-top: #c191ef; --btn-bottom: var(--purple-600); --btn-edge: #3d1a63; }
.btn--ghost {
  --btn-top: rgba(255, 255, 255, .55);
  --btn-bottom: rgba(255, 255, 255, .18);
  --btn-edge: rgba(51, 32, 15, .35);
  color: var(--ink-900);
  text-shadow: none;
  border-color: rgba(51, 32, 15, .55);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 2px solid rgba(51, 32, 15, .45);
  background: rgba(255, 255, 255, .55);
  color: var(--ink-800);
  font-size: 15px;
  transition: transform .12s ease, background .15s ease;
}
.icon-btn:hover { background: #fff; }
.icon-btn:active { transform: scale(.94); }
.icon-btn--danger { background: rgba(226, 69, 44, .14); border-color: rgba(184, 51, 29, .55); color: var(--red-600); }

/* ============================== 进度条 ============================== */

.progress {
  position: relative;
  height: 15px;
  border-radius: 999px;
  background: #d8c9a4;
  border: 2px solid var(--wood-800);
  box-shadow: inset 0 2px 4px rgba(51, 32, 15, .3);
  overflow: hidden;
}
.progress__fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background:
    repeating-linear-gradient(115deg, rgba(255, 255, 255, .28) 0 6px, transparent 6px 14px),
    linear-gradient(90deg, var(--green-400), var(--green-600));
  transition: width .55s cubic-bezier(.2, .8, .3, 1);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .15);
}
.progress--red .progress__fill { background: linear-gradient(90deg, #ff9a86, var(--red-500)); }
.progress--pink .progress__fill { background: linear-gradient(90deg, #ff8fc4, #d4338f); }
.progress--sky .progress__fill { background: linear-gradient(90deg, var(--sky-400), var(--blue-600)); }

/* ============================== 总览 ============================== */

.prog-card { display: flex; flex-direction: column; gap: 10px; }
.prog-card__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 10px;
  flex-wrap: wrap;
}
.prog-card__label {
  font-family: var(--font-display);
  font-size: clamp(15px, 4.6vw, 18px);
  color: var(--ink-900);
  white-space: nowrap;
}
.prog-card__num {
  font-family: var(--font-display);
  font-size: clamp(19px, 5.8vw, 29px);
  color: var(--red-600);
  font-variant-numeric: tabular-nums;
  letter-spacing: .3px;
  white-space: nowrap;
}
.prog-card__num small { font-size: .58em; color: var(--ink-500); }

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}
.mini-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 8px 5px;
  border-radius: 12px;
  border: 2px solid rgba(51, 32, 15, .3);
  background: rgba(255, 255, 255, .5);
  text-align: center;
}
.mini-stat__icon { font-size: 16px; line-height: 1.2; }
.mini-stat__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 0;
}
.mini-stat__val {
  font-family: var(--font-display);
  font-size: clamp(15px, 4.4vw, 18px);
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.mini-stat__key {
  font-size: 10.5px;
  color: var(--ink-500);
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.subject-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
@media (min-width: 768px) { .subject-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; } }
@media (min-width: 1100px) { .subject-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; } }

.subject-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 11px 11px 10px;
  border-radius: var(--r-md);
  border: 3px solid var(--wood-800);
  background:
    var(--tex-paper),
    linear-gradient(180deg, var(--cream-100), var(--cream-300));
  box-shadow: var(--shadow-soft), inset 0 2px 0 #fff;
  text-decoration: none;
  color: var(--ink-900);
  transition: transform .16s ease, box-shadow .16s ease;
}
.subject-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card), inset 0 2px 0 #fff; }
.subject-card:active { transform: translateY(1px); }
.subject-card__top { display: flex; align-items: center; gap: 8px; }
.subject-card__icon {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  flex: 0 0 auto;
  font-size: 15px;
  filter: drop-shadow(0 1px 0 rgba(51, 32, 15, .18));
}
.subject-card__name {
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: .5px;
}
.subject-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-700);
}
.subject-card__zombie {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(226, 69, 44, .14);
  border: 1.5px solid rgba(184, 51, 29, .35);
  color: var(--red-600);
  font-size: 11px;
  font-weight: 800;
}
.subject-card__done { color: var(--green-700); font-weight: 800; font-variant-numeric: tabular-nums; }

/* ============================== 任务卡 ============================== */

.task-list { display: flex; flex-direction: column; gap: 10px; }

.task {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  border-radius: var(--r-md);
  border: 3px solid var(--wood-800);
  background:
    var(--tex-paper),
    linear-gradient(180deg, #fffdf4, var(--cream-200));
  box-shadow: var(--shadow-soft), inset 0 2px 0 #fff;
  transition: background .25s ease, border-color .25s ease, transform .15s ease;
}
.task.is-done {
  background: linear-gradient(180deg, #e8f9d6, #c9eeae);
  border-color: #366b1d;
}
.task__name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 400;
  letter-spacing: .2px;
  line-height: 1.35;
  color: var(--ink-900);
  word-break: break-word;
}
.task.is-done .task__name { color: #2f5c17; }
.task__desc {
  margin-top: 3px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink-500);
  word-break: break-word;
}
.task__side {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.sun-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  border: 2px solid #8a6200;
  background: linear-gradient(180deg, #fff0b0, var(--sun-400));
  color: var(--wood-900);
  font-size: 12.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 1px 0 #fff;
  white-space: nowrap;
}

.task__tools { display: flex; gap: 5px; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 21px;
  padding: 0 7px;
  border-radius: 6px;
  border: 1.5px solid rgba(51, 32, 15, .35);
  background: rgba(255, 255, 255, .7);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-700);
  white-space: nowrap;
}

@media (max-width: 420px) {
  .task { grid-template-columns: 1fr; gap: 8px; }
  .task__side { justify-content: flex-start; }
}

/* 有空状态 */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 26px 18px;
  border-radius: var(--r-md);
  border: 3px dashed rgba(51, 32, 15, .3);
  background: rgba(255, 255, 255, .18);
  text-align: center;
  color: var(--cream-100);
}
.empty__art { font-size: 34px; filter: drop-shadow(0 3px 0 rgba(51, 32, 15, .3)); }
.empty__title { font-family: var(--font-display); font-size: 18px; }
.empty__text { font-size: 13px; opacity: .85; max-width: 30ch; }

/* ============================== 商店 ============================== */

.sun-wallet {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 16px;
  border-radius: 999px;
  border: 3px solid #7a5600;
  background: linear-gradient(180deg, #fff3bd, var(--sun-400));
  color: var(--wood-900);
  font-family: var(--font-display);
  font-size: 19px;
  box-shadow: 0 4px 0 rgba(51, 32, 15, .4), inset 0 2px 0 #fff;
  font-variant-numeric: tabular-nums;
}
.sun-wallet__icon { font-size: 22px; filter: drop-shadow(0 1px 0 rgba(255, 255, 255, .6)); }

@media (max-width: 560px) {
  .sun-wallet { height: 40px; padding: 0 13px; font-size: 17px; gap: 5px; }
  .sun-wallet__label { display: none; }
  .sun-wallet__icon { font-size: 19px; }
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
@media (min-width: 768px) { .shop-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; } }
@media (min-width: 1100px) { .shop-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; } }

.plant-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 9px 11px;
  border-radius: var(--r-md);
  border: 3px solid var(--wood-800);
  background:
    radial-gradient(90% 70% at 50% 0%, #ffffff, transparent 70%),
    linear-gradient(180deg, #fdfaea, #f6e7b6);
  box-shadow: var(--shadow-soft), inset 0 2px 0 #fff;
  text-align: center;
}
.plant-card.is-locked {
  background: linear-gradient(180deg, #f2f5e4, #dfe8cf);
  border-color: #5f6647;
}
.plant-card__art {
  width: 62px; height: 62px;
  display: grid; place-items: center;
  filter: drop-shadow(0 4px 3px rgba(51, 32, 15, .22));
  transition: transform .2s ease;
}
.plant-card:hover .plant-card__art { transform: translateY(-3px) scale(1.04); }
.plant-card__art svg { width: 100%; height: 100%; }
.plant-card.is-locked .plant-card__art { filter: grayscale(1) opacity(.45); }
.plant-card__name {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: .3px;
}
.plant-card__desc {
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--ink-500);
  min-height: 31px;
}
.plant-card__price {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 2px solid #8a6200;
  background: linear-gradient(180deg, #fff0b0, var(--sun-400));
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.plant-card.is-locked .plant-card__price {
  background: #d9dcc9;
  border-color: #6d7355;
  color: #5c6247;
}
.plant-card__lock {
  position: absolute;
  top: 7px; right: 7px;
  font-size: 13px;
}
.plant-card__own {
  position: absolute;
  top: 7px; left: 7px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--green-500);
  border: 1.5px solid #244712;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

/* 奖励卡 */
.reward-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
@media (min-width: 768px) { .reward-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; } }
@media (min-width: 1100px) { .reward-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.reward-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 12px 9px;
  border-radius: var(--r-md);
  border: 3px solid #8e2f68;
  background:
    radial-gradient(90% 70% at 50% 0%, #fff, transparent 70%),
    linear-gradient(180deg, #ffe9f7, #f7c4e5);
  box-shadow: var(--shadow-soft), inset 0 2px 0 #fff;
  text-align: center;
  position: relative;
}
.reward-card:nth-child(4n+2) { border-color: #5a5f7a; background: linear-gradient(180deg, #eef1ff, #d3dbf5); }
.reward-card:nth-child(4n+3) { border-color: #2c6e8c; background: linear-gradient(180deg, #e6f8ff, #c4ecfb); }
.reward-card:nth-child(4n+4) { border-color: #7a5600; background: linear-gradient(180deg, #fff6d6, #ffe3a3); }
.reward-card__icon { font-size: 27px; line-height: 1; filter: drop-shadow(0 2px 0 rgba(51, 32, 15, .18)); }
.reward-card__name { font-family: var(--font-display); font-size: 15.5px; line-height: 1.3; }
.reward-card__desc { font-size: 11px; color: var(--ink-500); line-height: 1.35; min-height: 29px; }
.reward-card__cost { font-size: 12px; font-weight: 800; color: var(--wood-800); }
.reward-card__tools { display: flex; gap: 4px; margin-top: 1px; }

/* ============================== 花园 ============================== */

.garden-wrap {
  padding: 10px;
  border-radius: var(--r-lg);
  border: 3px solid var(--wood-900);
  background:
    var(--tex-wood),
    linear-gradient(180deg, var(--wood-600), var(--wood-800));
  box-shadow: var(--shadow-card);
}
.garden-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--cream-200);
  font-size: 12px;
  font-weight: 700;
}
.garden-bar__hint { display: inline-flex; align-items: center; gap: 5px; }

.board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  grid-template-rows: repeat(6, minmax(0, 1fr));
  gap: 2px;
  padding: 6px;
  aspect-ratio: 9 / 6;
  border-radius: 12px;
  border: 3px solid #2f4a1c;
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .06) 0 1px, transparent 1px 50%),
    linear-gradient(180deg, #8ec63f, #6aa32b);
  box-shadow: inset 0 4px 10px rgba(0, 0, 0, .2), inset 0 -2px 0 rgba(255, 255, 255, .2);
  overflow: hidden;
}
.board__cell {
  position: relative;
  border-radius: 4px;
  background: rgba(255, 255, 255, .07);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06);
}
.board__cell.is-alt { background: rgba(0, 0, 0, .05); }
.board__cell.is-target { background: rgba(255, 255, 255, .35); outline: 2px dashed rgba(255, 255, 255, .8); outline-offset: -2px; }
.board__sprite {
  position: absolute;
  inset: -20% -12%;
  display: grid;
  place-items: center;
}
.board__sprite svg { width: 100%; height: 100%; }
.board__sprite--zombie { animation: zombieSway 3.6s ease-in-out infinite; }
.board__sprite--plant { animation: plantPop .45s cubic-bezier(.2, 1.4, .4, 1) both; }

@keyframes zombieSway {
  0%, 100% { transform: translateX(0) rotate(-2deg); }
  50% { transform: translateX(-6%) rotate(2deg); }
}
@keyframes plantPop {
  0% { transform: scale(.2) translateY(30%); opacity: 0; }
  70% { transform: scale(1.12) translateY(-2%); opacity: 1; }
  100% { transform: scale(1) translateY(0); }
}

.garden-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 2px dashed rgba(255, 236, 200, .25);
  color: rgba(255, 243, 219, .85);
  font-size: 11.5px;
  font-weight: 600;
}
.garden-legend span { display: inline-flex; align-items: center; gap: 4px; }

.garden-side { display: flex; flex-direction: column; gap: 13px; }

@media (min-width: 900px) {
  .page-body--garden {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(300px, .85fr);
    gap: 18px;
    align-items: start;
  }
  .page-body--narrow { max-width: 840px; width: 100%; margin: 0 auto; }
}

.seed-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 9px;
}
.seed {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 6px;
  border-radius: 12px;
  border: 2.5px solid var(--wood-800);
  background: linear-gradient(180deg, #fffdf2, var(--cream-300));
  box-shadow: var(--shadow-soft);
  text-align: center;
}
.seed__art { width: 44px; height: 44px; }
.seed__art svg { width: 100%; height: 100%; }
.seed__name { font-family: var(--font-display); font-size: 13.5px; }
.seed__count { font-size: 11px; color: var(--ink-500); font-weight: 700; }

/* ============================== 徽章 ============================== */

.badge-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}
@media (min-width: 640px) { .badge-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .badge-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; } }

.badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 13px 9px;
  border-radius: var(--r-md);
  border: 3px solid #4b6b2e;
  background:
    radial-gradient(90% 70% at 50% 0%, #fff, transparent 70%),
    linear-gradient(180deg, #f2ffe2, #cfeeb0);
  box-shadow: var(--shadow-soft), inset 0 2px 0 #fff;
  text-align: center;
}
.badge.is-locked {
  border-color: #6d6650;
  background: linear-gradient(180deg, #f3f3e6, #dfe0cc);
  filter: saturate(.4);
}
.badge__icon {
  font-size: 30px;
  line-height: 1;
  filter: drop-shadow(0 2px 0 rgba(51, 32, 15, .2));
}
.badge__name { font-family: var(--font-display); font-size: 15px; }
.badge__desc { font-size: 11px; color: var(--ink-500); line-height: 1.35; }
.badge__state {
  margin-top: 2px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  border: 1.5px solid rgba(51, 32, 15, .3);
  background: rgba(255, 255, 255, .6);
  color: var(--ink-700);
}
.badge.is-earned .badge__state { background: var(--green-500); border-color: #244712; color: #fff; }

/* ============================== 科普 ============================== */

.tabs { display: flex; gap: 7px; flex-wrap: wrap; }
.tab {
  min-height: 40px;
  padding: 0 15px;
  border-radius: 999px;
  border: 2.5px solid var(--wood-800);
  background: linear-gradient(180deg, #fffdf2, var(--cream-300));
  color: var(--ink-800);
  font-family: var(--font-display);
  font-size: 14.5px;
  box-shadow: 0 2.5px 0 rgba(51, 32, 15, .3);
  transition: transform .12s ease, background .15s ease;
}
.tab[aria-selected="true"] {
  background: linear-gradient(180deg, var(--sun-300), var(--sun-400));
  border-color: var(--wood-900);
  box-shadow: 0 3px 0 rgba(51, 32, 15, .55), inset 0 2px 0 #fff;
  transform: translateY(-1px);
}

.knowledge-body {
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink-800);
}
.knowledge-body strong { color: var(--red-600); }
.knowledge-foot { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }

/* ============================== 设置 ============================== */

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 2px dashed rgba(51, 32, 15, .18);
}
.setting-row:last-child { border-bottom: 0; padding-bottom: 0; }
.setting-row__label { font-size: 14px; font-weight: 700; }
.setting-row__hint { font-size: 11.5px; color: var(--ink-500); font-weight: 500; }

.date-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 2.5px solid var(--wood-800);
  background: #fff;
  font-weight: 700;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 -2px 0 rgba(51, 32, 15, .08);
}
.date-btn:hover { background: #fffdf4; }

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 58px; height: 32px;
  border-radius: 999px;
  border: 2.5px solid var(--wood-900);
  background: #b9a67f;
  transition: background .2s ease;
  flex: 0 0 auto;
}
.switch::after {
  content: "";
  position: absolute;
  left: 2px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid rgba(51, 32, 15, .35);
  transition: transform .2s cubic-bezier(.2, 1.2, .4, 1);
}
.switch[aria-checked="true"] { background: var(--green-500); }
.switch[aria-checked="true"]::after { transform: translateX(25px); }

.mode-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}
.mode-card__face { font-size: 36px; }
.mode-card__title { font-family: var(--font-display); font-size: 20px; }
.mode-card__text { font-size: 12.5px; color: var(--ink-500); }

/* ============================== 指令栏 ============================== */

.cmdbar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 9px calc(8px + env(safe-area-inset-bottom));
  background:
    var(--tex-wood),
    linear-gradient(180deg, var(--wood-600), var(--wood-800));
  border-top: 3px solid var(--wood-900);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14);
  flex: 0 0 auto;
}
.cmdbar__help {
  width: 38px; height: 38px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 2.5px solid var(--wood-900);
  background: linear-gradient(180deg, var(--blue-400), var(--blue-600));
  color: #fff;
  font-weight: 800;
  font-size: 17px;
  box-shadow: 0 3px 0 #173f60, inset 0 2px 0 rgba(255, 255, 255, .4);
}
.cmdbar__help:active { transform: translateY(2px); box-shadow: 0 0 0 #173f60; }
.cmdbar__input {
  flex: 1 1 auto;
  min-width: 0;
  height: 40px;
  padding: 0 13px;
  border-radius: 10px;
  border: 2.5px solid var(--wood-900);
  background: linear-gradient(180deg, #fffdf2, var(--cream-200));
  font-size: 14px;
  box-shadow: inset 0 2px 3px rgba(51, 32, 15, .16);
}
.cmdbar__input::placeholder { color: #a58a63; }
.cmdbar__input:focus-visible { outline: 3px solid var(--sun-400); outline-offset: 1px; }
.cmdbar__go {
  flex: 0 0 auto;
  height: 40px;
  padding: 0 17px;
  border-radius: 10px;
  border: 2.5px solid var(--wood-900);
  background: linear-gradient(180deg, #ffe08a, var(--sun-500));
  color: var(--wood-900);
  font-family: var(--font-display);
  font-size: 16px;
  box-shadow: 0 3px 0 #7a5600, inset 0 2px 0 #fff;
}
.cmdbar__go:active { transform: translateY(3px); box-shadow: 0 0 0 #7a5600; }

/* ============================== 弹窗 ============================== */

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(28, 18, 9, .62);
  backdrop-filter: blur(3px);
  animation: fadeIn .18s ease;
}
.modal-root[hidden] { display: none; }
@media (min-width: 600px) {
  .modal-root { align-items: center; padding: 24px; }
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheetUp {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal {
  width: min(520px, 100%);
  max-height: 88dvh;
  display: flex;
  flex-direction: column;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  border: 3px solid var(--wood-900);
  background:
    var(--tex-paper),
    linear-gradient(180deg, var(--cream-100), var(--cream-200));
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .4);
  animation: sheetUp .24s cubic-bezier(.2, .9, .3, 1);
  overflow: hidden;
}
@media (min-width: 600px) {
  .modal { border-radius: var(--r-lg); box-shadow: 0 24px 60px rgba(0, 0, 0, .45); }
}

.modal__head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 13px 14px 11px;
  border-bottom: 3px solid var(--cream-400);
}
.modal__title {
  flex: 1;
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--ink-900);
}
.modal__close {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 2.5px solid #6b1a0c;
  background: linear-gradient(180deg, var(--red-400), var(--red-500));
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 2px 0 #6b1a0c, inset 0 1px 0 rgba(255, 255, 255, .45);
}
.modal__close:active { transform: translateY(2px); box-shadow: none; }
.modal__body {
  padding: 13px 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.modal__foot {
  display: flex;
  gap: 9px;
  padding: 11px 14px calc(13px + env(safe-area-inset-bottom));
  border-top: 2px dashed rgba(51, 32, 15, .2);
}

.field { display: flex; flex-direction: column; gap: 5px; }
.field__label { font-size: 13px; font-weight: 800; color: var(--ink-700); letter-spacing: .2px; }
.field__hint { font-size: 11.5px; color: var(--ink-500); }
.field__error { font-size: 12px; font-weight: 700; color: var(--red-600); display: none; }
.field.has-error .field__error { display: block; }
.field.has-error .input,
.field.has-error .select,
.field.has-error .textarea { border-color: var(--red-500); box-shadow: 0 0 0 3px rgba(226, 69, 44, .18); }

.input, .select, .textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 2.5px solid #8a6640;
  background: #fff;
  font-size: 15px;
  color: var(--ink-900);
  box-shadow: inset 0 2px 3px rgba(51, 32, 15, .1);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.textarea { min-height: 74px; resize: vertical; line-height: 1.55; }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(63, 146, 210, .22);
}
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%2363401f' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* 日历 */
.cal { display: flex; flex-direction: column; gap: 9px; }
.cal__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cal__month { font-family: var(--font-display); font-size: 18px; }
.cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal__dow {
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--ink-500);
  padding: 3px 0;
}
.cal__day {
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 2px solid transparent;
  background: rgba(255, 255, 255, .6);
  font-size: 13.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transition: background .15s ease, border-color .15s ease;
}
.cal__day:hover { background: #fff; border-color: var(--sun-500); }
.cal__day.is-empty { background: transparent; pointer-events: none; }
.cal__day.is-selected {
  background: linear-gradient(180deg, var(--sun-300), var(--sun-500));
  border-color: var(--wood-900);
  color: var(--wood-900);
  box-shadow: 0 2px 0 rgba(51, 32, 15, .4);
}
.cal__day.is-today { border-color: var(--blue-500); color: var(--blue-600); }

/* ============================== 提示条 ============================== */

.toast-wrap {
  position: fixed;
  left: 50%;
  bottom: calc(76px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  width: min(420px, calc(100% - 28px));
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 100%;
  padding: 10px 15px;
  border-radius: 12px;
  border: 2.5px solid var(--wood-900);
  background: linear-gradient(180deg, var(--cream-100), var(--cream-300));
  color: var(--ink-900);
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .3), inset 0 1px 0 #fff;
  animation: toastIn .22s cubic-bezier(.2, 1.2, .4, 1);
}
.toast__icon { font-size: 17px; }
.toast--ok { background: linear-gradient(180deg, #eaffd8, #c3efa2); }
.toast--warn { background: linear-gradient(180deg, #fff5d1, #ffe08a); }
.toast--err { background: linear-gradient(180deg, #ffe3dc, #ffb8a8); }
.toast.is-out { animation: toastOut .2s ease forwards; }

@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-6px); } }

/* 阳光飘字 */
.sunfly {
  position: fixed;
  z-index: 130;
  pointer-events: none;
  font-family: var(--font-display);
  font-size: 20px;
  color: #fff;
  text-shadow: 0 2px 0 #8a6200, 0 0 12px rgba(255, 207, 63, .9);
  animation: sunFly 1s cubic-bezier(.2, .8, .3, 1) forwards;
}
@keyframes sunFly {
  0% { opacity: 0; transform: translate(-50%, 0) scale(.6); }
  20% { opacity: 1; transform: translate(-50%, -14px) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%, -70px) scale(.9); }
}

/* 快捷菜单面板 */
.menu-list { display: flex; flex-direction: column; gap: 8px; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px 11px;
  border-radius: 11px;
  border: 2.5px solid rgba(51, 32, 15, .35);
  background: rgba(255, 255, 255, .7);
  font-weight: 700;
  font-size: 14.5px;
  text-align: left;
}
.menu-item:hover { background: #fff; }
.menu-item__icon { font-size: 18px; }

/* 数据管理 */
.danger-zone { border-color: #8c2b1a; }
.danger-zone .setting-row__label { color: var(--red-600); }

/* 页脚版本 */
.app-foot {
  margin-top: auto;
  padding: 12px 4px 4px;
  text-align: center;
  font-size: 11.5px;
  color: rgba(255, 255, 255, .82);
  text-shadow: 0 1px 0 rgba(51, 32, 15, .35);
}

/* 加载骨架 */
.skeleton {
  border-radius: var(--r-md);
  background: linear-gradient(90deg, rgba(255, 255, 255, .18) 25%, rgba(255, 255, 255, .34) 37%, rgba(255, 255, 255, .18) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
  height: 78px;
}
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ================= 字体：系统标准无衬线（替换卡通字体） ================= */
/* 标题靠字重与字号拉层级，不再依赖装饰性字体 */
.brand,
.page-title,
.section-title,
.modal__title,
.prog-card__label,
.prog-card__num,
.plant-card__name,
.reward-card__name,
.badge__name,
.mode-card__title,
.empty__title,
.cal__month,
.sun-wallet,
.mini-stat__val {
  font-weight: 700;
  letter-spacing: 0;
}

.brand {
  font-size: clamp(14px, 3.9vw, 20px);
  letter-spacing: .2px;
}
.page-title { letter-spacing: .2px; }
.prog-card__num { font-weight: 800; font-size: clamp(18px, 5.2vw, 26px); }
.prog-card__label { font-size: clamp(14px, 4.2vw, 17px); }

.subject-card__name,
.task__name,
.seed__name {
  font-weight: 600;
  letter-spacing: 0;
}

.btn,
.cmdbar__go,
.tab,
.menu-item,
.date-btn,
.badge__state,
.rail__name,
.rail__label,
.tag,
.plant-card__price,
.reward-card__cost,
.sun-chip {
  font-weight: 600;
  letter-spacing: 0;
}
.btn { letter-spacing: .2px; }


/* 大屏：三项指标横排，品牌标题放大 */
@media (min-width: 900px) {
  .brand { font-size: 24px; letter-spacing: .3px; }
  .mini-stat {
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 12px 16px;
    text-align: left;
  }
  .mini-stat__body { align-items: flex-start; gap: 0; }
  .mini-stat__icon { font-size: 22px; }
  .mini-stat__val { font-size: 22px; }
  .mini-stat__key { font-size: 12px; }
}

/* 动效偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .board__sprite--zombie { animation: none; }
}

/* 打印 */
@media print {
  .topbar, .statusbar, .datebar, .rail, .cmdbar, .toast-wrap { display: none; }
  .screen { overflow: visible; background: none; }
}

/* =========================================================================
   作业练习台（背单词 / 汉字 / 数学 / 科学 / 运动 / 家务）
   ========================================================================= */

.player {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  align-items: stretch;
  justify-content: center;
  background: rgba(24, 15, 7, .74);
  backdrop-filter: blur(4px);
  animation: fadeIn .18s ease;
}

.ply-panel {
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  height: 100dvh;
  background:
    var(--tex-paper),
    linear-gradient(180deg, var(--cream-100), var(--cream-200));
  border: 3px solid var(--wood-900);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
  overflow: hidden;
}
@media (min-width: 600px) {
  .player { align-items: center; padding: 24px; }
  .ply-panel {
    height: min(780px, 92dvh);
    border-radius: var(--r-lg);
  }
}

.ply-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 14px 9px;
  background: linear-gradient(180deg, var(--cream-100), var(--cream-300));
  border-bottom: 2px solid var(--cream-400);
}
.ply-head__text { flex: 1; min-width: 0; }
.ply-head__kicker {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-500);
  letter-spacing: .3px;
}
.ply-head__title {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--ink-900);
  margin-top: 1px;
}
.ply-close {
  flex: 0 0 auto;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2.5px solid #6b1a0c;
  background: linear-gradient(180deg, var(--red-400), var(--red-500));
  color: #fff;
  font-weight: 800;
  box-shadow: 0 2px 0 #6b1a0c;
}
.ply-close:active { transform: translateY(2px); box-shadow: none; }

.ply-bar {
  height: 6px;
  background: rgba(122, 76, 40, .16);
}
.ply-bar i {
  display: block;
  height: 100%;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(90deg, var(--green-400), var(--green-600));
  transition: width .35s cubic-bezier(.2, .8, .3, 1);
}

.ply-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 13px;
  -webkit-overflow-scrolling: touch;
}

.ply-foot {
  flex: 0 0 auto;
  padding: 11px 16px calc(14px + env(safe-area-inset-bottom));
  border-top: 2px dashed rgba(51, 32, 15, .2);
  background: rgba(255, 253, 242, .9);
}

.ply-hint {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-500);
  text-align: center;
}
.ply-row { display: flex; gap: 10px; }
.ply-row .btn { flex: 1; }

/* 闪卡 */
.flash {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 250px;
  padding: 22px 18px;
  border-radius: var(--r-lg);
  border: 3px solid var(--wood-800);
  background:
    radial-gradient(90% 70% at 50% 0, #fff, transparent 65%),
    linear-gradient(180deg, #fffdf6, var(--cream-300));
  box-shadow: 0 5px 0 rgba(51, 32, 15, .28), inset 0 2px 0 #fff;
  text-align: center;
  transition: transform .15s ease, box-shadow .15s ease;
  width: 100%;
  flex: 1 1 auto;
}
.flash:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(51, 32, 15, .28); }
.flash__front {
  font-size: clamp(38px, 12vw, 54px);
  font-weight: 800;
  letter-spacing: .5px;
  color: var(--ink-900);
  line-height: 1.15;
}
.flash__sub { font-size: 14px; color: var(--ink-500); font-weight: 600; }
/* 汉字用楷体，笔画更接近课本 */
.flash__front.is-hanzi {
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "Songti SC", serif;
  font-weight: 700;
}
.flash__tap { font-size: 12.5px; color: var(--ink-300); font-weight: 600; margin-top: 4px; }
.flash__back {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
  padding-top: 12px;
  border-top: 2px dashed rgba(51, 32, 15, .22);
  width: 100%;
}
.flash__cn { font-size: 22px; font-weight: 800; color: var(--green-700); }
.flash__eg { font-size: 13px; color: var(--ink-500); line-height: 1.5; }

@keyframes popIn { from { opacity: 0; transform: translateY(6px) scale(.97); } to { opacity: 1; transform: none; } }
.flash__back { animation: popIn .18s ease; }

/* 选择题 */
.quiz-ask {
  text-align: center;
  font-size: clamp(30px, 9vw, 40px);
  font-weight: 800;
  letter-spacing: .4px;
  color: var(--ink-900);
  padding: 4px 0 2px;
}
.quiz-options { display: flex; flex-direction: column; gap: 9px; }
.quiz-opt {
  min-height: 54px;
  padding: 10px 15px;
  border-radius: 13px;
  border: 2.5px solid var(--wood-800);
  background: #fff;
  color: var(--ink-900);
  font-size: 16px;
  font-weight: 600;
  text-align: left;
  box-shadow: 0 3px 0 rgba(51, 32, 15, .22);
  transition: transform .12s ease, background .15s ease, border-color .15s ease;
}
.quiz-opt:not([disabled]):hover { background: var(--cream-100); }
.quiz-opt:not([disabled]):active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(51, 32, 15, .22); }
.quiz-opt.is-right {
  background: linear-gradient(180deg, #e6fbcf, #bfe89b);
  border-color: #2f6b1d;
  box-shadow: 0 3px 0 rgba(47, 107, 29, .35);
}
.quiz-opt.is-wrong {
  background: linear-gradient(180deg, #ffe4dc, #ffc3b3);
  border-color: #8c2b1a;
}
.quiz-opt[disabled] { cursor: default; }

.quiz-tip {
  font-size: 13.5px;
  line-height: 1.6;
  padding: 10px 12px;
  border-radius: 11px;
  background: rgba(255, 255, 255, .72);
  border: 2px solid rgba(51, 32, 15, .22);
  color: var(--ink-700);
  animation: popIn .18s ease;
}
.quiz-tip.is-ok {
  background: linear-gradient(180deg, #eaffd8, #cdf3ae);
  border-color: #3d8428;
  color: var(--green-700);
  font-weight: 600;
}

/* 数学 */
.math-q {
  text-align: center;
  font-size: clamp(21px, 6vw, 26px);
  font-weight: 800;
  line-height: 1.5;
  color: var(--ink-900);
  padding: 10px 6px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .65);
  border: 2px dashed rgba(51, 32, 15, .25);
}
.math-form { display: flex; gap: 9px; align-items: stretch; }
.math-input {
  flex: 1;
  min-width: 0;
  min-height: 56px;
  padding: 0 14px;
  border-radius: 13px;
  border: 2.5px solid var(--wood-800);
  background: #fff;
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 2px 4px rgba(51, 32, 15, .12);
}
.math-input:focus { outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(63, 146, 210, .22); }

/* 科学 */
.sci-read {
  padding: 15px 15px 17px;
  border-radius: 15px;
  border: 2.5px solid rgba(51, 32, 15, .35);
  background: linear-gradient(180deg, #f4ffe6, #e2f6c9);
  font-size: 15px;
  line-height: 1.85;
  color: var(--ink-800);
}
.sci-read p::first-letter { font-size: 1.1em; }

/* 运动 */
.sport-count {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  padding: 18px 0 6px;
}
.sport-count__num {
  font-size: clamp(56px, 18vw, 76px);
  font-weight: 800;
  line-height: 1;
  color: var(--green-700);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 3px 0 rgba(255, 255, 255, .8);
}
.sport-count__unit { font-size: 16px; font-weight: 700; color: var(--ink-500); }
.sport-timer { text-align: center; font-size: 13px; color: var(--ink-500); font-weight: 600; }
.sport-timer b { color: var(--ink-900); font-variant-numeric: tabular-nums; }
.sport-btns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-top: 8px;
}
.sport-btns .btn { min-height: 62px; font-size: 18px; }
.sport-tips { text-align: center; font-size: 12.5px; color: var(--ink-500); line-height: 1.6; }

/* 家务 */
.chore-list { display: flex; flex-direction: column; gap: 8px; }
.chore-item {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 54px;
  padding: 10px 13px;
  border-radius: 13px;
  border: 2.5px solid var(--wood-800);
  background: #fff;
  text-align: left;
  box-shadow: 0 3px 0 rgba(51, 32, 15, .18);
  transition: background .18s ease, transform .12s ease;
}
.chore-item:active { transform: translateY(2px); box-shadow: none; }
.chore-item.is-done {
  background: linear-gradient(180deg, #eaffd8, #cdf3ae);
  border-color: #3d8428;
}
.chore-box {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 26px; height: 26px;
  border-radius: 8px;
  border: 2.5px solid var(--wood-800);
  background: #fff;
  font-size: 15px;
  font-weight: 800;
  color: var(--green-700);
}
.chore-item.is-done .chore-box { background: var(--green-500); color: #fff; border-color: #2f6b1d; }
.chore-text { font-size: 14.5px; font-weight: 600; line-height: 1.45; color: var(--ink-800); }
.chore-item.is-done .chore-text { color: var(--green-700); }

/* 结果 */
.result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 22px 10px 10px;
  text-align: center;
}
.result__stars {
  font-size: 44px;
  letter-spacing: 6px;
  color: var(--sun-500);
  text-shadow: 0 3px 0 rgba(138, 98, 0, .35);
  animation: popIn .3s ease;
}
.result__line { font-size: 15px; font-weight: 600; color: var(--ink-700); }
.result__sun {
  margin-top: 4px;
  padding: 7px 18px;
  border-radius: 999px;
  border: 2.5px solid #8a6200;
  background: linear-gradient(180deg, #fff0b0, var(--sun-400));
  font-size: 20px;
  font-weight: 800;
  color: var(--wood-900);
  box-shadow: 0 3px 0 rgba(138, 98, 0, .4);
}
.result__note { font-size: 13px; color: var(--ink-500); line-height: 1.6; max-width: 30ch; }

/* 退出确认 */
.ply-confirm {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(24, 15, 7, .5);
  z-index: 2;
}
.ply-confirm__box {
  width: min(340px, 100%);
  padding: 18px;
  border-radius: var(--r-lg);
  border: 3px solid var(--wood-900);
  background: linear-gradient(180deg, var(--cream-100), var(--cream-200));
  box-shadow: 0 18px 40px rgba(0, 0, 0, .4);
  text-align: center;
}
.ply-confirm__box h3 { font-size: 19px; font-weight: 800; }
.ply-confirm__box p { margin: 6px 0 14px; font-size: 13.5px; color: var(--ink-500); line-height: 1.6; }

/* 任务卡：类型标签与「开始」态 */
.task__main { min-width: 0; }
.task__tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 4px; }
.tag--kind {
  background: rgba(63, 146, 210, .14);
  border-color: rgba(47, 121, 181, .45);
  color: var(--blue-600);
}
.tag--x2 { background: #ffe0b2; border-color: #a06000; color: #7a4a00; }
.task--playable:not(.is-done) { border-color: #2f79b5; }
.task--playable:not(.is-done) .task__name { color: #235f8f; }

/* 寒假倒计时 chip */
.stat-chip--winter {
  background: linear-gradient(180deg, #e9f7ff, #c3e8fb);
  border-color: #2c6e8c;
}
.stat-chip--winter .stat-chip__value { color: #1f5670; }

/* 数学页底部提示 */
.math-help {
  margin-top: 4px;
  padding: 12px 14px;
  border-radius: 13px;
  border: 2px dashed rgba(51, 32, 15, .22);
  background: rgba(255, 255, 255, .5);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-500);
}
.math-help b { color: var(--ink-700); }
.math-help p + p { margin-top: 4px; }

/* 运动分组进度 */
.sport-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.sport-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 6px;
  border-radius: 12px;
  border: 2px solid rgba(51, 32, 15, .28);
  background: rgba(255, 255, 255, .55);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-500);
}
.sport-group i {
  display: block;
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: #d9cba6;
  box-shadow: inset 0 1px 2px rgba(51, 32, 15, .25);
}
.sport-group b { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--ink-700); }
.sport-group.is-done {
  border-color: #3d8428;
  background: linear-gradient(180deg, #eaffd8, #cdf3ae);
  color: var(--green-700);
}
.sport-group.is-done i { background: linear-gradient(90deg, var(--green-400), var(--green-600)); }
