/* 语文书桌 · 参考翻翻英语：大字号、易点、结构清晰 · 橙红主色 */
:root {
  --bg: #fff8f3;
  --ink: #1c1917;
  --muted: #78716c;
  --line: #f0e4d8;
  --card: #ffffff;
  --brand: #e85d04;
  --brand-deep: #c2410c;
  --warm: #f4a261;
  --soft: #fff3e8;
  --sky: #ea580c;
  --ok: #16a34a;
  --bad: #dc2626;
  --shadow: 0 2px 0 rgba(194, 65, 12, 0.08);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 17px;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}
button, select, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
.hidden { display: none !important; }

.screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 88px;
}
#screenLesson { padding-bottom: 0; }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--card);
  border-bottom: 2px solid var(--line);
}
.brand {
  font-family: "Noto Serif SC", serif;
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0.02em;
  color: var(--brand);
}
.icon-btn {
  width: 48px;
  height: 48px;
  border: 2px solid var(--line);
  border-radius: 14px;
  color: var(--muted);
  background: var(--card);
  font-size: 1.25rem;
  font-weight: 800;
  box-shadow: var(--shadow);
}
.icon-btn:active { transform: translateY(1px); box-shadow: none; }

.home-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 18px 20px 28px;
  max-width: 460px;
  margin: 0 auto;
  width: 100%;
}
.hero-mark {
  width: 88px;
  height: 88px;
  margin: 0 auto 14px;
  border-radius: 24px;
  background: linear-gradient(145deg, var(--warm), var(--brand));
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 2.2rem;
  font-family: "Noto Serif SC", serif;
  font-weight: 700;
  box-shadow: 0 4px 0 rgba(194, 65, 12, 0.18);
  animation: popIn 0.45s var(--ease);
}
.mascot-line {
  margin: 0 auto 10px;
  max-width: 22em;
  text-align: center;
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.45;
  color: var(--ink);
}
.streak {
  text-align: center;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 18px;
}
.streak strong {
  color: var(--brand-deep);
  font-size: 1.35rem;
  font-weight: 800;
}

.today-card {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 22px;
  padding: 26px 22px 22px;
  text-align: center;
  box-shadow: 0 4px 0 rgba(194, 65, 12, 0.08);
  animation: popIn 0.45s var(--ease);
}
@keyframes popIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.today-card .eyebrow {
  display: inline-block;
  font-size: 1rem;
  font-weight: 800;
  color: var(--brand-deep);
  background: var(--soft);
  padding: 8px 14px;
  border-radius: 999px;
  line-height: 1.35;
  margin: 0 0 14px;
}
.today-card h1 {
  margin: 0 0 10px;
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.01em;
  font-family: "Noto Serif SC", serif;
  color: var(--ink);
}
.today-card .meta {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.45;
}

.home-cta-row {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 10px;
  margin-bottom: 4px;
}
.btn-start,
.btn-secondary,
.btn-warm,
.btn-answer {
  display: block;
  width: 100%;
  padding: 16px 14px 18px;
  border-radius: 16px;
  font-weight: 800;
  font-size: 1.12rem;
  text-align: center;
  transition: transform 0.12s var(--ease);
}
.btn-start {
  background: var(--brand);
  color: #fff;
  border-bottom: 4px solid var(--brand-deep);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.05);
}
.btn-start:active {
  border-bottom-width: 2px;
  transform: translateY(2px);
}
.btn-secondary,
.btn-answer {
  background: #fff;
  color: var(--brand-deep);
  border: 2px solid var(--brand);
  border-bottom-width: 4px;
}
.btn-secondary:active,
.btn-answer:active {
  border-bottom-width: 2px;
  transform: translateY(2px);
}
.btn-warm {
  background: var(--soft);
  color: var(--brand-deep);
  border: 2px solid #fbd5b0;
  border-bottom-width: 4px;
}
.btn-warm:active {
  border-bottom-width: 2px;
  transform: translateY(2px);
}
.btn-path {
  width: 100%;
  margin-top: 12px;
  padding: 14px 16px;
  border: 2px solid var(--line);
  border-bottom-width: 4px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 1.05rem;
  background: #fff;
  color: var(--brand-deep);
}
.btn-path:active {
  border-bottom-width: 2px;
  transform: translateY(2px);
}
.unit-line,
.path-summary {
  text-align: center;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 700;
  margin: 16px 0 0;
}
.path-summary { margin-top: 8px; }

/* —— path / records —— */
.path-top,
.lesson-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  background: var(--card);
  border-bottom: 2px solid var(--line);
}
.path-top h1,
.records-top h1 {
  flex: 1;
  margin: 0;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 800;
  font-family: "Noto Serif SC", serif;
  color: var(--brand-deep);
}
.path-meta {
  margin: 14px 18px 0;
  color: var(--muted);
  font-weight: 700;
  font-size: 1rem;
}
.path-scroll {
  flex: 1;
  overflow: auto;
  padding: 14px 18px 28px;
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.path-unit {
  margin: 18px 4px 6px;
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.35;
  color: var(--brand-deep);
}
.path-node {
  display: flex;
  gap: 14px;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 16px 16px;
  background: var(--card);
  border: 2px solid var(--line);
  border-bottom-width: 4px;
  border-radius: 16px;
}
.path-node:active {
  border-bottom-width: 2px;
  transform: translateY(2px);
}
.path-node.is-current {
  border-color: var(--brand);
  background: #fff7f0;
}
.path-node.is-done {
  border-color: #86efac;
  background: #f0fdf4;
}
.path-badge {
  min-width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--soft);
  color: var(--brand-deep);
  font-weight: 800;
  font-size: 1.05rem;
  flex-shrink: 0;
}
.path-node.is-done .path-badge {
  background: #dcfce7;
  color: #166534;
}
.path-node.is-current .path-badge {
  background: var(--brand);
  color: #fff;
}
.path-copy strong {
  display: block;
  margin-bottom: 4px;
  font-size: 1.12rem;
  font-weight: 800;
  line-height: 1.35;
}
.path-copy small {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
}
.path-footer {
  padding: 12px 18px 16px;
  background: linear-gradient(transparent, var(--bg) 30%);
}

/* —— overlays —— */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 25, 23, 0.4);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 40;
  padding: 16px;
}
.overlay.is-center { align-items: center; }
.sheet {
  width: min(440px, 100%);
  background: var(--card);
  border-radius: 22px;
  padding: 22px 20px;
  border: 2px solid var(--line);
  max-height: 85vh;
  overflow: auto;
  box-shadow: 0 8px 32px rgba(28, 25, 23, 0.12);
}
.sheet-a4 {
  width: min(720px, 96vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  padding: 16px 16px 18px;
  overflow: hidden;
}
.sheet-a4-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-shrink: 0;
}
.sheet-a4-note {
  margin: 6px 0 10px;
  flex-shrink: 0;
}
.sheet-a4-actions {
  flex-shrink: 0;
  margin-top: 12px;
}
.a4-frame {
  flex: 1;
  min-height: 58vh;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  background: #e7e5e4;
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 8px;
}
.a4-iframe {
  flex: 1;
  width: 100%;
  min-height: 56vh;
  border: 0;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(28, 25, 23, 0.12);
}
.a4-paper {
  flex: 1;
  overflow: auto;
  background: #fff;
  border-radius: 6px;
  padding: 22px 24px 28px;
  box-shadow: 0 2px 8px rgba(28, 25, 23, 0.12);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--ink);
}
.a4-paper h2 {
  margin: 0 0 12px;
  text-align: center;
  font-family: "Noto Serif SC", serif;
  font-size: 1.35rem;
  color: var(--brand);
}
.a4-paper h3 {
  margin: 18px 0 8px;
  font-size: 1.12rem;
  color: var(--brand);
  font-weight: 800;
}
.a4-paper p { margin: 0 0 10px; }
.a4-paper .meta { color: var(--muted); font-size: 0.95rem; }

.sheet h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  font-family: "Noto Serif SC", serif;
  color: var(--brand-deep);
  line-height: 1.35;
}
.sheet .meta {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
}
.mod-grid {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}
.mod-btn {
  text-align: left;
  padding: 18px 18px;
  border-radius: 16px;
  border: 2px solid var(--line);
  border-bottom-width: 4px;
  background: #fff;
  font-weight: 800;
  font-size: 1.15rem;
  line-height: 1.35;
}
.mod-btn small {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.4;
}
.mod-btn:active {
  border-bottom-width: 2px;
  transform: translateY(2px);
}
.mod-btn.is-primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand-deep);
}
.mod-btn.is-primary small { color: rgba(255, 255, 255, 0.85); }
.mod-btn.is-answer {
  background: #fff;
  border-color: var(--brand);
  color: var(--brand-deep);
}

#answerBody h2 {
  font-size: 1.25rem;
  margin: 0 0 10px;
}
#answerBody h3 {
  font-size: 1.1rem;
  margin: 16px 0 8px;
  color: var(--brand);
}
#answerBody p { margin: 0 0 10px; }

@media (max-width: 640px) {
  .sheet-a4 { width: 100%; max-height: 94vh; padding: 12px; }
  .a4-frame, .a4-iframe { min-height: 50vh; }
}

.help-list {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 14px;
}
.help-list li {
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--soft);
  border: 2px solid var(--line);
}
.help-list strong {
  display: block;
  font-size: 1.08rem;
  color: var(--brand-deep);
  margin-bottom: 4px;
}
.help-list span {
  color: var(--muted);
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.45;
}

/* —— lesson —— */
.lesson-body {
  flex: 1;
  padding: 22px 18px 24px;
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
  animation: popIn 0.35s var(--ease);
}
.card-type {
  margin: 0 0 10px;
  color: var(--brand);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}
.lesson-unit {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 700;
}
.lesson-name {
  margin: 6px 0 16px;
  font-size: 1.25rem;
  font-weight: 800;
  font-family: "Noto Serif SC", serif;
  color: var(--brand-deep);
}
.card-prompt {
  margin: 0 0 12px;
  font-size: 1.45rem;
  line-height: 1.4;
  font-weight: 800;
}
.card-sub {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.5;
}
.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}
.chip {
  padding: 14px 18px;
  border-radius: 999px;
  border: 2px solid var(--line);
  border-bottom-width: 4px;
  background: #fff;
  font-weight: 800;
  font-size: 1.05rem;
}
.chip:active {
  border-bottom-width: 2px;
  transform: translateY(2px);
}
.chip.active,
.chip.is-ok {
  border-color: var(--ok);
  background: #f0fdf4;
}
.chip.is-bad {
  border-color: var(--bad);
  background: #fef2f2;
}
.write-box {
  width: 100%;
  min-height: 110px;
  padding: 16px;
  border-radius: 14px;
  border: 2px solid var(--line);
  resize: vertical;
  margin-bottom: 14px;
  font-size: 1.15rem;
  line-height: 1.5;
}
.lesson-actions {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}
.feedback {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #fff7ed;
  color: var(--brand-deep);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.5;
}
.feedback.bad {
  background: #fef2f2;
  color: var(--bad);
}

.records-score {
  margin: 14px 18px;
  padding: 18px;
  background: var(--card);
  border: 2px solid var(--line);
  border-bottom-width: 4px;
  border-radius: 16px;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.5;
}
.records-actions {
  display: grid;
  gap: 10px;
  padding: 0 18px 10px;
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
}
.rec-card {
  text-align: left;
  padding: 16px 18px;
  border-radius: 16px;
  border: 2px solid var(--line);
  border-bottom-width: 4px;
  background: #fff;
  width: 100%;
  font-size: 1.05rem;
}
.rec-card strong {
  display: block;
  font-size: 1.12rem;
  color: var(--brand-deep);
  margin-bottom: 4px;
}
.rec-card small {
  color: var(--muted);
  font-weight: 600;
}
.mistake-item {
  background: var(--card);
  border: 2px solid var(--line);
  border-bottom-width: 4px;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 10px;
  font-size: 1.02rem;
}
.mistake-item .row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

/* —— bottom nav —— */
.app-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 6px 10px calc(8px + env(safe-area-inset-bottom));
  background: #fff;
  border-top: 2px solid var(--line);
  box-shadow: 0 -4px 16px rgba(194, 65, 12, 0.06);
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 60px;
  border-radius: 14px;
  color: var(--muted);
  font-weight: 800;
  font-size: 0.88rem;
}
.nav-item.is-on {
  color: var(--brand-deep);
  background: var(--soft);
}
.nav-emoji {
  font-size: 1.45rem;
  line-height: 1;
}
.nav-label { letter-spacing: 0.02em; }

.progress {
  flex: 1;
  height: 14px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
  margin: 0 10px;
}
.progress > i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--warm), var(--brand));
  border-radius: 999px;
  transition: width 0.25s var(--ease);
}

@media (min-width: 720px) {
  .home-main,
  .path-scroll,
  .lesson-body { max-width: 500px; }
  .today-card h1 { font-size: 2rem; }
}


/* 错题本录入 */
.records-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 10px;
}
.records-toolbar .btn-warm,
.records-toolbar .btn-path,
.records-toolbar .btn-start {
  flex: 1 1 auto;
  min-width: 42%;
  font-size: 0.92rem;
}
.sheet-mistake {
  max-width: 520px;
  width: min(96vw, 520px);
  max-height: 88vh;
  overflow: auto;
}
.mist-label {
  display: block;
  margin: 10px 0 6px;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink);
}
.mist-label input[type="file"],
.mist-label input[type="text"],
.mist-label select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  font: inherit;
  background: #fff;
}
.mist-preview {
  margin: 8px 0 4px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #faf7f2;
}
.mist-preview img {
  display: block;
  width: 100%;
  max-height: 180px;
  object-fit: contain;
  background: #fff;
}
.mist-qnos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 8px;
}
.mist-q {
  min-width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: #fff;
  font-weight: 800;
  cursor: pointer;
}
.mist-q.is-on {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.mistake-item .mist-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
}
.mistake-item .mist-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.rec-card.is-empty {
  opacity: 0.62;
  border-style: dashed;
}

/* —— 卷面对照 / 红笔圈题 —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--brand-dark);
  font-weight: 700;
  font-size: 0.95rem;
}
.btn.primary {
  background: var(--brand);
  border-color: var(--brand-dark);
  color: #fff;
}
.photo-btn-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--brand-dark);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
}
.photo-btn-inline:active {
  transform: translateY(1px);
}
.mark-cta-wrap {
  margin: 0 auto 14px;
  max-width: 520px;
  width: calc(100% - 36px);
}
.btn-mark-cta {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 18px 18px 16px;
  border: 2px solid var(--line);
  border-bottom-width: 5px;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff 0%, var(--soft) 100%);
  color: var(--brand-dark);
  font-weight: 800;
  font-size: 1.2rem;
  text-align: left;
  box-shadow: var(--shadow);
}
.btn-mark-cta small {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--muted);
}
.btn-mark-cta:active {
  border-bottom-width: 2px;
  transform: translateY(2px);
  box-shadow: none;
}
.mistake-advanced {
  margin: 0 auto 16px;
  max-width: 520px;
  width: calc(100% - 36px);
}
.mistake-advanced > summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--muted);
  padding: 8px 4px;
  list-style: none;
}
.mistake-advanced > summary::-webkit-details-marker { display: none; }
.mistake-advanced[open] > summary {
  color: var(--brand-dark);
  margin-bottom: 8px;
}
.mark-sheet {
  width: min(760px, 100%);
  max-height: min(94vh, 960px);
  overflow: auto;
}
.mark-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.mark-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0 8px;
}
.mark-filters label {
  display: block;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--brand-dark);
}
.mark-filters select {
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-size: 1rem;
}
.mark-paper-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.mark-page-label {
  font-weight: 800;
  color: var(--muted);
  font-size: 0.95rem;
  min-width: 4.5rem;
  text-align: center;
}
.mark-photo-btn { padding: 10px 14px; font-size: 0.95rem; }
.mark-stage-wrap {
  position: relative;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #dbeaf4;
  overflow: auto;
  max-height: min(58vh, 560px);
  -webkit-overflow-scrolling: touch;
}
.mark-stage {
  position: relative;
  margin: 0 auto;
  width: max-content;
  max-width: 100%;
  touch-action: none;
  user-select: none;
}
.mark-stage canvas {
  display: block;
  max-width: 100%;
  height: auto;
}
.mark-stage #markInk {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}
.mark-paper-hint {
  margin: 0;
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.5;
}
.mark-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
@media (max-width: 520px) {
  .mark-filters { grid-template-columns: 1fr; }
  .mark-stage-wrap { max-height: min(52vh, 480px); }
}

