/* trace: DD-014-19 入学前训练页（SCR-211）：深绿＋金色 */
:root {
  --bg: #1b3127;
  --card: #26473a;
  --deep: #14251d;
  --line: #3b5f50;
  --gold: #e8b04a;
  --text: #f2efe6;
  --muted: #b9c4bc;
  --num: "DIN Condensed", "Bahnschrift", "Oswald", "Arial Narrow", sans-serif;
}
* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button {
  font: inherit;
  color: inherit;
}
.page {
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 48px;
}
.back {
  display: inline-block;
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
  margin-bottom: 14px;
}
.back:hover {
  color: var(--gold);
}
h1 {
  margin: 0;
  font-size: clamp(24px, 6vw, 34px);
  font-weight: 900;
  letter-spacing: 0.5px;
}
h2 {
  margin: 0;
}
.sub {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  margin: 20px 0 18px;
}
.stats div {
  background: var(--deep);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 4px 10px;
  text-align: center;
}
.stats strong {
  display: block;
  font: 700 34px/1.1 var(--num);
  color: var(--gold);
}
.stats span {
  font-size: 12px;
  color: var(--text);
}
.level {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
}
.level-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.level h2 {
  font-size: 21px;
  font-weight: 900;
}
.level-head span {
  font-size: 13px;
  color: var(--muted);
}
.bar {
  margin-top: 12px;
  height: 10px;
  border-radius: 99px;
  background: var(--deep);
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: var(--gold);
  transition: width 0.4s;
}
.stage {
  margin: 18px 0 22px;
  background: var(--deep);
  border-left: 4px solid var(--gold);
  border-radius: 0 10px 10px 0;
  padding: 12px 16px;
}
.stage b {
  color: var(--gold);
  font-size: 14px;
}
.stage p {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.6;
}
.day-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  scroll-margin-top: 12px;
}
.day-head h2 {
  font-size: 20px;
  font-weight: 900;
}
.nav-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--deep);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.nav-btn:disabled {
  opacity: 0.3;
  cursor: default;
}
.today-btn {
  border: 1px solid var(--gold);
  background: none;
  color: var(--gold);
  border-radius: 99px;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
}
.day-score {
  margin-left: auto;
  font: 700 18px var(--num);
  color: var(--muted);
}
.day-score.complete {
  color: var(--gold);
}
.notice {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--gold);
}
.items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 9px;
}
.item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.item:hover:not(:disabled) {
  border-color: #5d8573;
}
.item:disabled {
  cursor: default;
  opacity: 0.75;
}
.check {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px dashed #8fa79b;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 900;
  color: var(--deep);
}
.item.done {
  background: #2f5545;
  border-color: var(--gold);
}
.item.done .check {
  border: 0;
  background: var(--gold);
}
.body {
  flex: 1;
  min-width: 0;
}
.body b {
  display: block;
  font-size: 16px;
  font-weight: 800;
}
.body small {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}
.item.done .body b {
  color: var(--gold);
}
.amount {
  flex: none;
  font: 700 18px var(--num);
  color: var(--gold);
  white-space: nowrap;
}
.item.bonus .amount {
  color: var(--muted);
}
.item.bonus.done .amount {
  color: var(--gold);
}
.section-title {
  margin: 26px 0 12px;
  font-size: 18px;
  font-weight: 900;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}
.legend i {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 3px;
  margin-right: 5px;
  vertical-align: -1px;
}
.calendar {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.month {
  background: var(--deep);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
}
.month h3 {
  margin: 0 0 8px;
  font-size: 14px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.wd {
  text-align: center;
  font-size: 10px;
  color: var(--muted);
}
.cell {
  aspect-ratio: 1;
  border: 0;
  border-radius: 5px;
  font-size: 11px;
  padding: 0;
  cursor: pointer;
}
.cell:disabled {
  cursor: default;
}
.c-full {
  background: var(--gold);
  color: var(--deep);
  font-weight: 700;
}
.c-part {
  background: #7a6a3c;
  color: var(--text);
}
.c-none {
  background: #2f4a3e;
  color: var(--muted);
}
.c-future {
  background: transparent;
  color: #5e7a6d;
  box-shadow: inset 0 0 0 1px #2f4a3e;
}
.cell.today {
  box-shadow: inset 0 0 0 2px var(--text);
}
.cell.sel {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}
button:focus-visible,
.import:focus-within {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}
footer {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}
footer p {
  margin: 0 0 10px;
}
.tools {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}
.tools button,
.import {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  position: relative;
}
.import input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
@media (max-width: 520px) {
  .stats {
    gap: 6px;
  }
  .stats strong {
    font-size: 28px;
  }
  .stats span {
    font-size: 11px;
  }
  .item {
    gap: 10px;
    padding: 12px;
  }
  .check {
    width: 30px;
    height: 30px;
  }
  .body b {
    font-size: 15px;
  }
  .amount {
    font-size: 15px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .bar i,
  .item {
    transition: none;
  }
}

/* 云端保存（CR-027） */
.sync {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--deep);
}
.sync.ok {
  border-style: solid;
}
.sync > p {
  flex: 1 1 260px;
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}
.sync.ok > p {
  color: var(--text);
}
.sync-actions {
  display: flex;
  gap: 8px;
}
.sync-actions button,
.sync-actions a,
.login button {
  border: 0;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  background: var(--gold);
  color: var(--deep);
  text-decoration: none;
  cursor: pointer;
}
#sync-logout {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}
.login {
  flex: 1 1 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}
.login[hidden],
.sync [hidden] {
  display: none;
}
.login label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
  flex: 1 1 200px;
}
.login input {
  font: inherit;
  font-size: 16px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
}
.login button:disabled {
  opacity: 0.5;
  cursor: default;
}
.login-msg {
  flex: 1 1 100%;
  margin: 0;
  font-size: 12px;
  color: var(--gold);
}
.login-msg:empty {
  display: none;
}

/* 基本项目的做法（CR-028） */
.items > li {
  display: grid;
  gap: 0;
}
.guide {
  margin: -4px 0 0;
  padding: 4px 14px 2px 64px;
  background: var(--deep);
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 10px 10px;
  font-size: 14px;
  line-height: 1.7;
}
.guide summary {
  display: inline-block;
  cursor: pointer;
  padding: 8px 0;
  color: var(--gold);
  font-weight: 700;
  list-style: none;
}
.guide summary::-webkit-details-marker {
  display: none;
}
.guide summary::before {
  content: "▸ ";
}
.guide[open] summary::before {
  content: "▾ ";
}
.guide-count {
  margin-left: 8px;
  font-size: 12px;
  color: var(--muted);
}
.guide h4 {
  margin: 10px 0 2px;
  font-size: 15px;
  color: var(--text);
}
.guide .rule {
  margin: 4px 0 6px;
  padding: 8px 10px;
  border-left: 3px solid var(--gold);
  background: rgba(232, 176, 74, 0.08);
  color: var(--text);
}
.guide ol {
  margin: 6px 0 8px;
  padding-left: 1.4em;
}
.guide ol li {
  margin: 0 0 10px;
}
.guide ol li b {
  color: var(--gold);
}
.guide .why {
  display: block;
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.guide .tip {
  margin: 4px 0 10px;
  font-size: 13px;
  color: var(--muted);
}
@media (max-width: 560px) {
  .guide {
    padding: 4px 12px 2px 14px;
  }
}
