:root {
  --bg: #eef6e8;
  --bg-2: #f7fbf2;
  --soil: #6b4f2c;
  --leaf: #2f7d4a;
  --leaf-2: #3f9a5c;
  --sun: #f0b429;
  --tomato: #e4572e;
  --sky: #d9eef7;
  --card: #ffffff;
  --text: #243126;
  --muted: #6b7a6e;
  --line: #d7e5d3;
  --shadow: 0 10px 30px rgba(47, 125, 74, 0.08);
  --radius: 22px;
  --sidebar: linear-gradient(165deg, #2f7d4a 0%, #245c3a 100%);
  --font-display: "YuanYuan", "YouYuan", "STYuanti-SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 0px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 12% 18%, rgba(240, 180, 41, 0.18), transparent 28%),
    radial-gradient(circle at 88% 8%, rgba(47, 125, 74, 0.12), transparent 26%),
    linear-gradient(180deg, var(--sky), var(--bg) 40%, var(--bg-2));
  padding-top: var(--safe-top);
}
button, .btn, a, input, label { -webkit-tap-highlight-color: transparent; }

a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-display); margin: 0 0 .4rem; font-weight: 400; }
h1 { font-size: 1.8rem; }
h2 { font-size: 1.25rem; }
p { margin: 0; }
.muted { color: var(--muted); }
.empty { color: var(--muted); padding: 1rem 0; }
.mt { margin-top: 1.2rem; }
.hint { color: var(--muted); font-size: .92rem; margin: 1rem 0 2rem; }

.shell {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 1rem;
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem;
  min-height: 100vh;
}

.sidebar {
  background: var(--sidebar);
  color: #f4fff6;
  border-radius: 28px;
  padding: 1.2rem 1rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  position: sticky;
  top: 1rem;
  height: calc(100vh - 2rem);
}
.parent-side { background: linear-gradient(165deg, #3c5a40, #243126); }

.brand { display: flex; gap: .8rem; align-items: center; padding: .4rem .5rem 1rem; }
.brand-mark {
  width: 48px; height: 48px; border-radius: 16px;
  display: grid; place-items: center; font-size: 1.5rem;
  background: rgba(255,255,255,.16);
}
.brand-name { font-family: var(--font-display); font-size: 1.25rem; }
.brand-tag { font-size: .78rem; opacity: .8; }

.nav { display: flex; flex-direction: column; gap: .35rem; flex: 1; overflow: auto; }
.nav-item {
  padding: .85rem 1rem;
  border-radius: 16px;
  color: rgba(255,255,255,.9);
  transition: .2s ease;
}
.nav-item:hover, .nav-item.active {
  background: rgba(255,255,255,.16);
  transform: translateX(2px);
}

.sidebar-foot {
  display: flex; align-items: center; gap: .7rem;
  background: rgba(255,255,255,.12);
  border-radius: 18px;
  padding: .75rem;
  margin-top: .5rem;
}
.avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: #ffe08a; display: grid; place-items: center; font-size: 1.3rem;
}
.foot-name { font-weight: 800; }
.foot-meta { font-size: .85rem; opacity: .9; }
.parent-link {
  margin-left: auto; opacity: .75; font-size: 1.1rem;
}

.main { min-width: 0; }
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.2rem;
  border: 1px solid rgba(255,255,255,.7);
}
.page-head {
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: center;
  justify-content: space-between; margin-bottom: 1rem;
}
.pills { display: flex; flex-wrap: wrap; gap: .45rem; }
.pill {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .4rem .75rem; border-radius: 999px; font-weight: 700; font-size: .9rem;
}
.pill-kid { background: #e7f6ec; color: var(--leaf); }
.pill-fruit { background: #ffe8df; color: var(--tomato); }
.pill-task { background: #e8f4ff; color: #2b6cb0; }
.pill-streak { background: #fff1d6; color: #b7791f; }
.pill-tv { background: #e8e4ff; color: #4c3fb5; }
.head-actions { display: flex; gap: .5rem; }

.btn {
  border: 0; cursor: pointer; border-radius: 999px;
  padding: .65rem 1.1rem; font-weight: 800; font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center; gap: .3rem;
  transition: .15s ease;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--leaf); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--leaf-2); }
.btn-soft { background: #e7f3ea; color: var(--leaf); }
.btn-accent { background: var(--sun); color: #4a3200; }
.btn-danger { background: #c53030; color: #fff; }
.btn-danger:hover:not(:disabled) { background: #9b2c2c; }
.btn-block { width: 100%; }
.danger-zone {
  border: 2px solid #fecaca;
  background: linear-gradient(180deg, #fff7f7, #fff);
}
.danger-zone h2 { color: #9b2c2c; }
.btn:active:not(:disabled) { transform: scale(.98); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}
.stat-card {
  border-radius: 24px; padding: 1.1rem 1.2rem; color: #fff;
  box-shadow: var(--shadow); min-height: 120px;
}
.stat-card .stat-label { opacity: .9; font-weight: 700; }
.stat-card .stat-value { font-family: var(--font-display); font-size: 2rem; margin: .35rem 0; }
.stat-card .stat-sub { opacity: .85; font-size: .9rem; }
.c-fruit { background: linear-gradient(145deg, #e4572e, #f08a5d); }
.c-task { background: linear-gradient(145deg, #2f7d4a, #56b07a); }
.c-prop { background: linear-gradient(145deg, #2b6cb0, #63b3ed); }
.c-streak { background: linear-gradient(145deg, #dd6b20, #f6ad55); }

.two-col {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 1rem;
}
.task-mini-list { display: flex; flex-direction: column; gap: .55rem; }
.task-mini {
  display: flex; align-items: center; gap: .7rem;
  padding: .65rem .7rem; border-radius: 14px; background: #f5faf4;
}
.check, .check-lg {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid #b7d0be; display: grid; place-items: center;
  color: transparent; flex-shrink: 0;
}
.check.on, .check-lg.on {
  background: var(--leaf); border-color: var(--leaf); color: #fff;
}
.ico, .task-ico {
  width: 42px; height: 42px; border-radius: 14px;
  background: #fff; display: grid; place-items: center;
  font-size: 1.3rem; flex-shrink: 0;
  box-shadow: inset 0 0 0 1px var(--line);
}
.t-title { font-weight: 800; }
.t-sub { color: var(--muted); font-size: .85rem; }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li {
  display: grid; grid-template-columns: 90px 1fr; gap: .6rem;
  padding: .55rem 0; border-bottom: 1px dashed var(--line);
}
.timeline.long li { grid-template-columns: 140px 1fr; }
.timeline .time { color: var(--muted); font-size: .85rem; }

.progress-wrap { display: flex; flex-direction: column; gap: .7rem; }
.progress-top { display: flex; justify-content: space-between; align-items: end; }
.bar {
  height: 14px; background: #e8f0e6; border-radius: 999px; overflow: hidden;
}
.bar-fill {
  height: 100%; background: linear-gradient(90deg, var(--leaf), #8fd19e);
  border-radius: inherit; transition: width .35s ease;
}

.task-list { display: flex; flex-direction: column; gap: .8rem; margin-top: 1rem; }
.task-card {
  background: #fff; border-radius: 20px; padding: 1rem 1.1rem;
  box-shadow: var(--shadow); display: flex; justify-content: space-between;
  gap: 1rem; align-items: center;
}
.task-card.done { opacity: .72; }
.task-left { display: flex; gap: .8rem; align-items: flex-start; min-width: 0; }
.task-left h3 { margin-bottom: .2rem; }
.task-left p { color: var(--muted); font-size: .92rem; }
.meta { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .45rem; font-size: .85rem; color: var(--muted); }
.meta .reward { color: #b7791f; font-weight: 800; }
.badge {
  display: inline-flex; padding: .35rem .7rem; border-radius: 999px;
  background: #edf2f0; font-size: .85rem; font-weight: 700;
}
.badge.wait { background: #fff4d6; color: #975a16; }
.badge.ok { background: #e3f7ea; color: var(--leaf); }

.garden-banner, .mall-banner {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; margin-bottom: 1rem;
  background: linear-gradient(120deg, #f7ffe9, #ffffff 55%, #fff8e8);
}
.prop-board {
  display: flex; flex-wrap: wrap; gap: .5rem;
}
.prop-board span, .fruit-big {
  background: #fff; border-radius: 999px; padding: .45rem .8rem;
  font-weight: 800; border: 1px solid var(--line);
}
.fruit-big { font-size: 1.2rem; color: var(--tomato); }

.plot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .9rem;
}
.plot-card {
  background: #fff; border-radius: 22px; padding: 1rem;
  text-align: center; box-shadow: var(--shadow);
  border: 2px solid transparent;
  min-height: 190px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem;
}
.plot-card.locked { background: #f3f0ea; color: var(--muted); }
.plot-icon { font-size: 2.2rem; }
.plot-title { font-weight: 800; }
.plot-sub { color: var(--muted); font-size: .85rem; margin-bottom: .4rem; }
.plot-actions { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: center; }

.mall-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.mall-card {
  background: #fff; border-radius: 22px; padding: 1.1rem;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .4rem;
}
.mall-ico { font-size: 2.2rem; }
.mall-foot {
  margin-top: auto; display: flex; justify-content: space-between; align-items: center;
}
.mall-foot strong { color: #b7791f; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  text-align: left; padding: .7rem .4rem; border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.ops { display: flex; gap: .4rem; flex-wrap: wrap; }
.check-inline {
  flex-direction: row !important;
  align-items: center;
  gap: .55rem !important;
}
.check-inline input { width: auto; margin: 0; }
.order-list { list-style: none; padding: 0; margin: 0; }
.order-list li {
  display: flex; justify-content: space-between; align-items: center;
  gap: .8rem; padding: .65rem 0; border-bottom: 1px dashed var(--line);
}

.quick-score { display: flex; flex-direction: column; gap: .55rem; }
.quick-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: .8rem; padding: .55rem .2rem; border-bottom: 1px dashed var(--line);
}
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6rem; }
.card-head a { color: var(--leaf); font-weight: 700; }

.score-board { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.score-top { display: flex; gap: .8rem; align-items: flex-start; }
.score-top .count {
  margin-left: auto; background: #eef8f0; color: var(--leaf);
  border-radius: 999px; padding: .3rem .7rem; font-weight: 800; white-space: nowrap;
}
.score-form { display: flex; gap: .5rem; margin-top: .8rem; }
.score-form input[type=text],
.form-grid input, .form-grid select,
.form-inline input, .form-inline select,
.login-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .7rem .8rem;
  font: inherit;
  background: #fcfffb;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .8rem;
}
.form-grid label, .login-form label { display: flex; flex-direction: column; gap: .35rem; font-weight: 700; }
.form-grid .span-2 { grid-column: 1 / -1; }
code {
  font-family: ui-monospace, Consolas, monospace;
  background: #eef3ee;
  padding: .1em .4em;
  border-radius: 6px;
  font-size: .9em;
}
.form-inline { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.form-inline > * { flex: 1; min-width: 140px; }
.form-inline .btn { flex: 0; }

.login-page {
  min-height: 100vh; display: grid; place-items: center; padding: 1rem;
}
.login-card { width: min(420px, 100%); text-align: center; }
.login-hero { font-size: 3rem; margin-bottom: .4rem; }
.login-form { text-align: left; display: flex; flex-direction: column; gap: .7rem; margin: 1rem 0; }
.back-link { color: var(--leaf); font-weight: 700; }
.alert {
  padding: .7rem .9rem; border-radius: 12px; margin: .8rem 0; font-weight: 700;
}
.alert.danger { background: #ffe8e2; color: #9b2c2c; }

.toast-wrap {
  position: fixed; top: 1rem; right: 1rem; z-index: 50;
  display: flex; flex-direction: column; gap: .5rem; max-width: min(360px, calc(100vw - 2rem));
}
.toast {
  background: #243126; color: #fff; padding: .8rem 1rem; border-radius: 14px;
  box-shadow: var(--shadow); animation: pop .25s ease;
}
.toast-success { background: var(--leaf); }
.toast-danger { background: var(--tomato); }
.toast-warning { background: #b7791f; }
.toast-info { background: #2b6cb0; }

.menu-toggle {
  display: none; position: fixed; right: 1rem; bottom: 1rem; z-index: 40;
  width: 52px; height: 52px; border-radius: 50%; border: 0;
  background: var(--leaf); color: #fff; font-size: 1.3rem;
  box-shadow: var(--shadow); cursor: pointer;
}

@keyframes pop {
  from { transform: translateY(-8px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.check.wait, .check-lg.wait {
  background: #fff4d6; border-color: #e3b341; color: #975a16;
}

.btn-lg { padding: .85rem 1.4rem; font-size: 1.05rem; }
.btn-rainbow {
  color: #fff;
  background: linear-gradient(110deg, #ef4444, #f59e0b 22%, #22c55e 45%, #3b82f6 68%, #8b5cf6 88%);
  border-color: rgba(255,255,255,.7);
  box-shadow: 0 5px 0 #6241a8, var(--shadow);
}
.btn-rainbow:hover { filter: brightness(1.05); transform: translateY(-1px); }

.home-garden {
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 3px solid #fff;
  margin-bottom: 1rem;
}
.sky-layer {
  position: relative;
  padding: 1.4rem 1.2rem 1.6rem;
  background:
    radial-gradient(circle at 85% 20%, rgba(255, 220, 100, .55), transparent 28%),
    linear-gradient(180deg, #9ad7ff 0%, #c8ebff 45%, #e7f8c9 100%);
  overflow: hidden;
  min-height: 210px;
}
.sun-ball {
  position: absolute; top: 18px; right: 28px;
  width: 64px; height: 64px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff6b0, #ffc107 60%, #f0a000);
  box-shadow: 0 0 0 10px rgba(255, 193, 7, .2), 0 0 40px rgba(255, 193, 7, .45);
  animation: sun-spin 18s linear infinite;
}
.cloud {
  position: absolute; background: #fff; border-radius: 40px;
  opacity: .85; filter: drop-shadow(0 4px 0 rgba(255,255,255,.4));
}
.cloud::before, .cloud::after {
  content: ""; position: absolute; background: #fff; border-radius: 50%;
}
.cloud.c1 { width: 90px; height: 34px; top: 36px; left: 18%; animation: drift 12s ease-in-out infinite; }
.cloud.c1::before { width: 40px; height: 40px; top: -20px; left: 14px; }
.cloud.c1::after { width: 50px; height: 50px; top: -26px; left: 40px; }
.cloud.c2 { width: 70px; height: 28px; top: 70px; right: 22%; animation: drift 15s ease-in-out infinite reverse; }
.cloud.c2::before { width: 34px; height: 34px; top: -16px; left: 10px; }
.cloud.c2::after { width: 42px; height: 42px; top: -22px; left: 30px; }

.home-hello { position: relative; z-index: 2; max-width: 420px; }
.home-hello h1 {
  font-size: 2.1rem; color: #1f4d2e;
  text-shadow: 0 2px 0 rgba(255,255,255,.55);
}
.home-hello p { color: #355743; font-weight: 700; }
.home-hello .weather-badge {
  display: inline-block;
  margin-top: .55rem;
  padding: .35rem .75rem;
  background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(232,246,255,.92));
  border: 2px solid #fff;
  border-radius: 999px;
  color: #355f78;
  font-size: .78rem;
  font-weight: 800;
  box-shadow: 0 3px 0 rgba(70, 110, 140, .2);
  max-width: 100%;
  line-height: 1.35;
}

.inv-floats {
  position: relative; z-index: 2;
  display: flex; flex-wrap: wrap; gap: .6rem;
  margin-top: 1rem;
}
.inv-chip {
  display: flex; align-items: center; gap: .55rem;
  background: rgba(255,255,255,.92);
  border-radius: 18px;
  padding: .55rem .8rem;
  box-shadow: 0 8px 0 rgba(47, 125, 74, .12);
  border: 2px solid #fff;
  min-width: 108px;
  animation: floaty 3.2s ease-in-out infinite;
}
.inv-chip:nth-child(2) { animation-delay: .2s; }
.inv-chip:nth-child(3) { animation-delay: .4s; }
.inv-chip:nth-child(4) { animation-delay: .6s; }
.inv-chip:nth-child(5) { animation-delay: .8s; }
.inv-chip:nth-child(6) { animation-delay: 1s; }
.inv-ico { font-size: 1.5rem; }
.inv-chip strong { display: block; font-size: 1.25rem; line-height: 1.1; }
.inv-chip small { color: var(--muted); font-weight: 700; }
.inv-fruit strong { color: var(--tomato); }
.inv-seed strong { color: var(--leaf); }
.inv-rainbow strong { color: #7c3aed; }
.inv-water strong { color: #2b6cb0; }
.inv-fert strong { color: #805ad5; }
.inv-shovel strong { color: #744210; }
.inv-streak strong { color: #c05621; }
.home-pause-tip {
  position: relative;
  z-index: 2;
  margin: .65rem 0 0;
  padding: .4rem .8rem;
  display: inline-block;
  background: rgba(255, 236, 179, .92);
  border: 2px solid #fff;
  border-radius: 999px;
  color: #7a4e12;
  font-weight: 800;
  font-size: .82rem;
}
.growth-pause-card { margin-bottom: 1rem; }
.growth-pause-card.is-paused {
  background: linear-gradient(180deg, #fff8e8, #ffe8c2);
  border-color: #f0c36d;
}
.tv-gate-card, .tv-live-card { margin-bottom: 1rem; }
.tv-gate-card.is-on, .tv-live-card {
  background: linear-gradient(180deg, #f4f1ff, #ece8ff);
  border-color: #c4b8f5;
}
.tv-mode-ops { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.tv-mode-ops form { margin: 0; }
.tv-mode-ops .btn { min-width: 4.5rem; }
.tv-privilege-ops { display: flex; flex-wrap: wrap; gap: .6rem; }
.tv-privilege-ops form { margin: 0; }
.tv-privilege-ops .btn { min-width: 5.5rem; }

.soil-layer {
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255,255,255,.06) 0 12px,
      transparent 12px 24px
    ),
    linear-gradient(180deg, #8b5a2b 0%, #6d4320 40%, #5a3618 100%);
  padding: 1.1rem 1.1rem 1.3rem;
  color: #fff8e8;
}
.soil-title {
  display: flex; justify-content: space-between; align-items: end;
  margin-bottom: .8rem;
}
.soil-title h2 { color: #fff8e8; }
.soil-title span {
  background: rgba(0,0,0,.2); padding: .25rem .7rem; border-radius: 999px; font-weight: 800;
}

.mini-plots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .7rem;
}
.mini-plot {
  background: linear-gradient(180deg, #b9783d, #8d5528);
  border: 3px solid #f0d2a8;
  border-radius: 18px;
  min-height: 110px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .15rem; text-align: center; color: #fff8e8;
  transition: transform .15s ease, box-shadow .15s ease;
  box-shadow: inset 0 -8px 0 rgba(0,0,0,.12);
}
.mini-plot:hover { transform: translateY(-3px) scale(1.02); }
.mini-plot.is-lock { opacity: .72; filter: grayscale(.2); }
.mini-plot.is-grow { background: linear-gradient(180deg, #6fae5d, #4f8a3f); border-color: #d7f0c8; }
.mini-plot.is-ready {
  background: linear-gradient(180deg, #f0a05a, #d97706);
  border-color: #ffe0a8;
  animation: pulse-ready 1.6s ease-in-out infinite;
}
.mp-emoji { font-size: 1.9rem; line-height: 1; }
.mp-emoji.bounce { animation: bounce 1.4s ease-in-out infinite; }
.mp-name { font-weight: 800; font-size: .95rem; }
.mp-stage { font-size: .78rem; opacity: .9; }

.home-actions {
  display: flex; flex-wrap: wrap; gap: .6rem;
  margin-top: 1rem; justify-content: center;
}
.home-bottom { margin-bottom: 1rem; }
.cartoon-card {
  border: 3px solid #d9efcf;
  background: linear-gradient(180deg, #ffffff, #f4fbf0);
}

.claim-list { display: flex; flex-direction: column; gap: .9rem; }
.claim-card {
  background: #f7fbf4; border-radius: 16px; padding: 1rem;
  border: 1px solid var(--line);
}
.claim-actions { display: flex; flex-direction: column; gap: .5rem; }

.exam-intro { margin-bottom: 1rem; }
.exam-rules {
  margin: .6rem 0 0;
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.exam-rules li {
  display: flex;
  align-items: center;
  gap: .4rem;
  color: #4a6350;
  font-size: .92rem;
}
.exam-rules .task-ico.mini {
  width: 28px; height: 28px; font-size: 1rem;
  display: grid; place-items: center;
}
.exam-board { display: flex; flex-direction: column; gap: 1rem; }
.exam-head { display: flex; gap: .8rem; align-items: flex-start; margin-bottom: .9rem; }
.exam-form { display: flex; flex-direction: column; gap: .75rem; }
.field-label { font-weight: 800; color: #355c3d; font-size: .9rem; }
.score-input-row {
  display: flex;
  align-items: center;
  gap: .55rem;
}
.exam-score {
  width: min(180px, 100%);
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: .9rem 1rem;
  font: inherit;
  font-size: 1.4rem;
  font-weight: 800;
  text-align: center;
  background: #fcfffb;
}
.score-unit { font-weight: 800; color: #5d7a63; }
.exam-preview {
  margin: -.2rem 0 0;
  min-height: 1.2em;
  font-size: .88rem;
  font-weight: 700;
  color: #c2410c !important;
}
.subject-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .5rem;
}
.subject-opt { cursor: pointer; position: relative; }
.subject-opt input {
  position: absolute; opacity: 0; pointer-events: none;
}
.subject-opt span {
  display: grid; place-items: center;
  min-height: 48px;
  border-radius: 14px;
  background: #f3f8f1;
  border: 2px solid var(--line);
  font-weight: 800;
  transition: .15s ease;
}
.subject-opt input:checked + span {
  background: #e4f6e9;
  border-color: var(--leaf);
  color: var(--leaf);
  box-shadow: 0 0 0 3px rgba(47, 125, 74, .12);
}
.exam-note {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .85rem .9rem;
  font: inherit;
  background: #fcfffb;
}

.tabbar, .nav-mask, .nav-parent-mobile { display: none; }

@keyframes sun-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes drift {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(18px); }
}
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes pulse-ready {
  0%, 100% { box-shadow: inset 0 -8px 0 rgba(0,0,0,.12), 0 0 0 0 rgba(240,160,90,.4); }
  50% { box-shadow: inset 0 -8px 0 rgba(0,0,0,.12), 0 0 0 8px rgba(240,160,90,.15); }
}

/* iPhone / 窄屏（iPhone 16 逻辑宽约 393） */
@media (max-width: 980px) {
  :root { --tabbar-h: calc(58px + var(--safe-bottom)); }

  .shell {
    grid-template-columns: 1fr;
    gap: .75rem;
    padding: .75rem .75rem calc(var(--tabbar-h) + .75rem);
    max-width: 480px;
    margin: 0 auto;
    min-height: auto;
  }

  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 40;
    width: min(78vw, 300px);
    height: 100dvh;
    border-radius: 0 24px 24px 0;
    transform: translateX(-105%);
    transition: transform .25s ease;
    padding-top: calc(1rem + var(--safe-top));
  }
  .sidebar.open { transform: translateX(0); }
  .nav-parent-mobile { display: block; }
  .sidebar-foot .parent-link { display: none; }

  .nav-mask {
    display: block;
    position: fixed; inset: 0;
    background: rgba(20, 40, 28, .35);
    z-index: 35;
    backdrop-filter: blur(2px);
  }
  .nav-mask[hidden] { display: none !important; }

  .tabbar {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 45;
    height: var(--tabbar-h);
    padding: .35rem .2rem var(--safe-bottom);
    background: rgba(255, 255, 255, .94);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 -8px 24px rgba(36, 49, 38, .06);
  }
  .tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .1rem;
    font-size: .68rem;
    font-weight: 800;
    color: var(--muted);
    min-height: 44px;
  }
  .tab-ico { font-size: 1.25rem; line-height: 1; }
  .tab.active { color: var(--leaf); }

  .menu-toggle {
    display: grid; place-items: center;
    right: .9rem;
    bottom: calc(var(--tabbar-h) + .55rem);
    width: 48px; height: 48px;
    font-size: 1.4rem;
    font-weight: 800;
  }

  .page-head {
    flex-direction: column;
    align-items: stretch;
    gap: .75rem;
    padding: .95rem 1rem;
  }
  .page-head h1 { font-size: 1.45rem; }
  .pills { gap: .35rem; }
  .pill { font-size: .8rem; padding: .35rem .6rem; }
  .head-actions { width: 100%; display: flex; gap: .5rem; }
  .head-actions .btn {
    flex: 1;
    min-height: 44px;
    justify-content: center;
  }

  .btn, button.btn {
    min-height: 44px;
    padding: .75rem 1rem;
  }

  .stats-grid, .two-col, .score-board, .form-grid, .mall-grid {
    grid-template-columns: 1fr;
  }
  .plot-grid, .mini-plots {
    grid-template-columns: repeat(3, 1fr);
    gap: .45rem;
  }
  .mini-plot { min-height: 92px; border-radius: 14px; padding: .45rem; }
  .mp-emoji { font-size: 1.45rem; }
  .mp-name { font-size: .78rem; }
  .plot-card { min-height: 160px; padding: .8rem; }
  .plot-actions .btn { min-width: 72px; padding: .55rem .7rem; font-size: .9rem; }

  .task-card {
    flex-direction: column;
    align-items: stretch;
    gap: .75rem;
  }
  .task-right { width: 100%; }
  .task-right .btn, .claim-form .btn { width: 100%; }

  .inv-floats { gap: .45rem; }
  .inv-chip { min-width: calc(50% - .3rem); flex: 1 1 40%; padding: .5rem .65rem; }
  .home-hello h1 { font-size: 1.55rem; }
  .home-actions { flex-direction: column; }
  .home-actions .btn { width: 100%; }

  .subject-grid { grid-template-columns: repeat(2, 1fr); gap: .55rem; }
  .subject-opt span { min-height: 52px; font-size: 1.05rem; }

  .toast-wrap {
    top: calc(.75rem + var(--safe-top));
    left: .75rem; right: .75rem;
    max-width: none;
  }
  .table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .login-card { width: min(420px, 100%); margin: .5rem; }

  .score-form { flex-direction: column; }
  .ops { width: 100%; }
  .ops .btn { flex: 1; }
  .quick-row { flex-wrap: wrap; }
}

@media (max-width: 380px) {
  .mini-plots { gap: .35rem; }
  .pill-kid { display: none; }
  .inv-chip small { font-size: .72rem; }
}
