:root {
  --ink: #1d3038;
  --muted: #6b7d84;
  --line: #dfe9e9;
  --paper: #ffffff;
  --canvas: #f3f8f7;
  --teal: #146b72;
  --teal-dark: #0d4e55;
  --teal-soft: #e2f2ef;
  --amber: #d38b2c;
  --amber-soft: #fff3dc;
  --coral: #d8695e;
  --coral-soft: #fff0ed;
  --shadow: 0 18px 50px rgba(25, 76, 82, 0.08);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }

body { margin: 0; min-width: 320px; background: var(--canvas); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid rgba(20, 107, 114, 0.22); outline-offset: 2px; }

.app-shell { min-height: 100vh; }
.topbar { height: 88px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 36px; background: rgba(255,255,255,0.92); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(16px); }
.brand-lockup, .topbar-actions, .mode-switch, .heading-actions, .lesson-title-row, .card-heading-row, .session-actions, .practice-footer, .legend, .sidebar-intro { display: flex; align-items: center; }
.brand-lockup { gap: 12px; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; color: white; background: var(--teal); border-radius: 14px 14px 14px 5px; font-size: 21px; font-weight: 800; box-shadow: 4px 5px 0 #b8ded6; }
.eyebrow, .section-label, .stat-label, .card-kicker, .field-label { margin: 0; color: var(--muted); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; }
.eyebrow { font-size: 10px; margin-bottom: 2px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 20px; letter-spacing: 0.02em; }
h2 { margin: 6px 0 0; font-size: clamp(28px, 4vw, 42px); letter-spacing: -0.04em; line-height: 1.1; }
h3 { margin-bottom: 8px; font-size: 20px; letter-spacing: -0.02em; }
.topbar-actions { gap: 18px; }
.date-control { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.date-control input { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; color: var(--ink); background: white; }
.mode-switch { gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 12px; background: #f7fbfa; }
.mode-button { border: 0; border-radius: 9px; padding: 8px 12px; color: var(--muted); background: transparent; font-size: 12px; }
.mode-button.is-active { color: var(--teal-dark); background: white; box-shadow: 0 3px 10px rgba(16, 80, 83, 0.1); font-weight: 700; }

.app-layout { display: grid; grid-template-columns: 238px minmax(0, 1fr); min-height: calc(100vh - 88px); }
.sidebar { display: flex; flex-direction: column; padding: 28px 18px; border-right: 1px solid var(--line); background: #eef6f4; }
.sidebar-intro { gap: 8px; margin: 0 10px 28px; color: var(--teal-dark); font-size: 12px; font-weight: 700; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #48a681; box-shadow: 0 0 0 4px rgba(72, 166, 129, 0.14); }
.nav-list { display: grid; gap: 6px; }
.nav-button { display: flex; align-items: center; gap: 11px; width: 100%; padding: 11px 12px; border: 0; border-radius: 12px; color: #557078; background: transparent; text-align: left; font-size: 13px; }
.nav-button:hover { background: rgba(255,255,255,0.7); color: var(--teal-dark); }
.nav-button.is-active { color: var(--teal-dark); background: white; box-shadow: 0 8px 18px rgba(20, 107, 114, 0.08); font-weight: 700; }
.nav-icon { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 8px; background: var(--teal-soft); color: var(--teal); font-size: 12px; font-weight: 800; }
.nav-count { margin-left: auto; min-width: 22px; padding: 3px 6px; border-radius: 999px; color: #a65149; background: var(--coral-soft); text-align: center; font-size: 11px; }
.sidebar-footer { display: grid; gap: 10px; margin-top: auto; padding: 20px 10px 0; border-top: 1px solid rgba(160, 193, 190, 0.45); }
.text-button, .quiet-button { border: 0; color: var(--muted); background: transparent; text-align: left; font-size: 12px; }
.text-button:hover, .quiet-button:hover { color: var(--teal); }
.danger-text:hover { color: var(--coral); }

.main-content { width: min(1320px, 100%); padding: 44px clamp(22px, 4vw, 60px) 70px; margin: 0 auto; }
.view-panel { display: none; animation: fade-in 180ms ease-out; }
.view-panel.is-visible { display: block; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.heading-actions { gap: 14px; }
.date-badge, .small-badge, .status-pill { display: inline-flex; align-items: center; border-radius: 999px; white-space: nowrap; }
.date-badge { padding: 8px 12px; color: var(--teal-dark); background: var(--teal-soft); font-size: 12px; font-weight: 700; }
.small-badge { padding: 5px 9px; color: var(--muted); background: #f3f7f6; font-size: 11px; }
.status-pill { padding: 6px 10px; color: #718287; background: #f1f5f4; font-size: 11px; }
.status-pill.done { color: #23785e; background: #e4f5ec; }
.status-pill.current { color: #a25c1b; background: var(--amber-soft); }
.quiet-button { padding: 6px 0; }
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card, .card { border: 1px solid rgba(210, 228, 226, 0.9); border-radius: 18px; background: var(--paper); box-shadow: var(--shadow); }
.stat-card { position: relative; overflow: hidden; padding: 18px 20px; }
.stat-card::after { position: absolute; right: -18px; bottom: -30px; width: 90px; height: 90px; border-radius: 50%; background: currentColor; opacity: 0.08; content: ""; }
.accent-teal { color: var(--teal); }.accent-amber { color: var(--amber); }.accent-coral { color: var(--coral); }
.stat-label, .stat-footnote { display: block; color: var(--muted); }
.stat-card strong { display: block; margin: 8px 0 3px; color: var(--ink); font-size: 27px; letter-spacing: -0.04em; }
.stat-footnote { font-size: 11px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr); gap: 18px; margin-bottom: 18px; }
.lower-grid { grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr); }
.card { padding: 24px; }
.pet-dashboard-card { margin-bottom: 18px; padding: 18px 22px; }
.pet-dashboard-art { display: grid; grid-template-columns: 126px minmax(0, 1fr); align-items: center; gap: 20px; }
.pet-image-frame, .pet-hero-image-wrap { position: relative; display: grid; place-items: center; overflow: hidden; border: 1px solid #d6e8e3; border-radius: 18px; background: linear-gradient(145deg, #eef9f5, #fff8e7); }
.pet-image-frame-small { width: 126px; height: 126px; }
.pet-image { display: block; width: 100%; height: 100%; object-fit: contain; }
.pet-image[hidden], .pet-image-empty[hidden] { display: none; }
.pet-image-empty { padding: 16px; color: var(--muted); text-align: center; font-size: 11px; line-height: 1.6; }
.pet-dashboard-copy h3 { margin: 5px 0 5px; font-size: 20px; }
.pet-dashboard-copy .muted-copy { margin-bottom: 13px; font-size: 12px; }
.pet-progress-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; }
.pet-progress-track { width: 100%; height: 8px; margin-top: 9px; overflow: hidden; border-radius: 999px; background: #e7f0ed; }
.pet-progress-fill { height: 100%; min-width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--teal), #58b69a); transition: width 220ms ease-out; }
.lesson-card { min-height: 330px; }
.card-kicker { display: flex; gap: 8px; color: var(--teal); }
.card-kicker span + span::before { margin-right: 8px; color: #aacbc5; content: "/"; }
.lesson-title-row { align-items: flex-start; justify-content: space-between; gap: 15px; margin: 22px 0 18px; }
.lesson-title-row h3 { margin-bottom: 8px; font-size: clamp(24px, 3vw, 32px); }
.muted-copy, .large-copy { color: var(--muted); line-height: 1.7; }
.goal-box { display: flex; gap: 12px; padding: 15px; border-radius: 14px; color: #5f4a2d; background: var(--amber-soft); }
.goal-icon { color: var(--amber); font-size: 23px; line-height: 1; }
.goal-box strong { font-size: 12px; }.goal-box p { margin: 5px 0 0; font-size: 13px; line-height: 1.6; }
.session-actions { flex-wrap: wrap; gap: 9px; margin-top: 22px; }
.primary-button, .secondary-button { border-radius: 10px; padding: 10px 14px; font-size: 12px; font-weight: 700; }
.primary-button { border: 1px solid var(--teal); color: white; background: var(--teal); box-shadow: 0 6px 14px rgba(20, 107, 114, 0.18); }
.primary-button:hover { background: var(--teal-dark); }
.secondary-button { border: 1px solid #b9d6d1; color: var(--teal-dark); background: var(--teal-soft); }
.secondary-button:hover { background: #d3eae5; }
.parent-note-strip { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: baseline; margin-top: 20px; padding-top: 14px; border-top: 1px dashed var(--line); }
.parent-note-strip span { color: var(--coral); font-size: 11px; font-weight: 800; }.parent-note-strip p { margin: 0; color: var(--muted); font-size: 12px; }
.video-card { min-height: 330px; }
.card-heading-row { align-items: flex-start; justify-content: space-between; gap: 12px; }
.card-heading-row h3 { margin-top: 5px; }
.video-frame { position: relative; min-height: 205px; margin: 16px 0 12px; overflow: hidden; border-radius: 13px; background: #183e43; }
.video-frame video { display: block; width: 100%; min-height: 205px; max-height: 310px; object-fit: contain; background: #183e43; }
.video-frame video[hidden], .video-empty[hidden] { display: none; }
.video-empty { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 8px; color: #d1e7e3; text-align: center; }.video-empty p { margin: 0; font-size: 13px; line-height: 1.6; }.video-empty small { color: #9fc4bf; }.play-symbol { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,0.26); border-radius: 50%; color: #fff; }
.video-list { display: flex; flex-wrap: wrap; gap: 6px; }.video-chip { padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: white; font-size: 11px; }.video-chip.is-selected { color: var(--teal-dark); border-color: #9acac0; background: var(--teal-soft); font-weight: 700; }
.micro-copy, .save-feedback { margin: 10px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }.save-feedback { color: #2d8765; }
.practice-card h3, .due-card h3 { margin-top: 5px; }.practice-prompt { min-height: 54px; margin: 15px 0 18px; padding: 14px; border-left: 4px solid var(--teal); border-radius: 0 10px 10px 0; color: var(--ink); background: #f1f8f6; font-size: 14px; line-height: 1.8; }
.field-label { display: block; margin-bottom: 7px; color: #587178; font-size: 11px; letter-spacing: 0.04em; text-transform: none; }.text-area, .select-input { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; color: var(--ink); background: #fbfdfd; font-size: 13px; line-height: 1.6; resize: vertical; }.text-area:focus, .select-input:focus { border-color: #8bbeb4; outline: 0; box-shadow: 0 0 0 3px rgba(20, 107, 114, 0.08); }.practice-footer { justify-content: space-between; gap: 10px; margin-top: 10px; }
.compact-list { display: grid; gap: 8px; margin-top: 17px; }.compact-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; background: #fbfdfd; }.compact-item strong { display: block; font-size: 12px; }.compact-item span { color: var(--muted); font-size: 11px; }.empty-state { padding: 28px 12px; color: var(--muted); text-align: center; font-size: 13px; line-height: 1.7; }

.legend { flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 11px; }.legend span { display: inline-flex; align-items: center; gap: 6px; }.legend-dot { width: 8px; height: 8px; border-radius: 50%; background: #dbe6e4; }.legend-dot.done { background: #55ae87; }.legend-dot.current { background: var(--amber); }
.plan-list { display: grid; gap: 16px; }.plan-week { padding: 20px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,0.72); }.plan-week-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 14px; }.plan-week-heading h3 { margin: 0; }.plan-week-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }.week-progress { color: var(--teal); font-size: 12px; font-weight: 700; }.plan-days { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; }.plan-day { min-height: 112px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: white; text-align: left; }.plan-day:hover, .plan-day.is-current { border-color: #8fc4b9; box-shadow: 0 5px 12px rgba(20, 107, 114, 0.08); }.plan-day.is-done { border-color: #bfe3cf; background: #f3fbf6; }.plan-day-top { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 10px; }.plan-day strong { display: block; margin: 14px 0 6px; color: var(--ink); font-size: 13px; line-height: 1.4; }.plan-day small { color: var(--muted); font-size: 10px; line-height: 1.4; }
.pet-hero-card { display: grid; grid-template-columns: 220px minmax(0, 1fr); align-items: center; gap: 30px; margin-bottom: 18px; }
.pet-hero-image-wrap { width: 220px; height: 220px; }
.pet-image-large { width: 100%; height: 100%; }
.pet-hero-copy h3 { margin: 7px 0 10px; font-size: clamp(22px, 3vw, 30px); }
.pet-hero-copy .large-copy { margin-bottom: 17px; }
.pet-gallery { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.pet-gallery-item { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: white; box-shadow: 0 8px 24px rgba(25, 76, 82, 0.05); }
.pet-gallery-item.is-unlocked { border-color: #b9ded1; }
.pet-gallery-image-wrap { position: relative; display: grid; place-items: center; height: 170px; overflow: hidden; background: linear-gradient(145deg, #eef9f5, #fff8e7); }
.pet-gallery-image { width: 100%; height: 100%; object-fit: contain; transition: transform 180ms ease-out; }
.pet-gallery-item.is-unlocked:hover .pet-gallery-image { transform: scale(1.05); }
.pet-gallery-image.is-locked { filter: grayscale(1) blur(1.5px); opacity: 0.42; }
.pet-lock { position: absolute; display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid rgba(255,255,255,0.75); border-radius: 50%; background: rgba(29, 48, 56, 0.66); font-size: 17px; }
.pet-gallery-image-wrap.is-image-missing::after { padding: 18px; color: var(--muted); content: "图片暂时无法读取"; text-align: center; font-size: 11px; }
.pet-gallery-copy { padding: 14px; }.pet-level-number { color: var(--teal); font-size: 10px; font-weight: 800; letter-spacing: 0.08em; }.pet-gallery-copy h3 { margin: 6px 0; font-size: 14px; line-height: 1.4; }.pet-gallery-copy p { min-height: 32px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }

.errors-layout { display: grid; grid-template-columns: minmax(300px, 0.78fr) minmax(0, 1.22fr); gap: 18px; align-items: start; }.form-stack { display: grid; gap: 8px; margin-top: 18px; }.form-stack .primary-button { margin-top: 7px; }.error-list { display: grid; gap: 12px; margin-top: 18px; }.error-item { padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: #fbfdfd; }.error-item.is-mastered { opacity: 0.68; }.error-meta { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; color: var(--muted); font-size: 11px; }.error-meta .topic-tag { color: var(--teal-dark); background: var(--teal-soft); }.error-meta span { padding: 4px 7px; border-radius: 999px; background: #f0f5f4; }.error-item h4 { margin: 11px 0 8px; font-size: 14px; line-height: 1.6; }.error-answer { margin: 0 0 12px; padding: 10px; border-radius: 9px; color: #567078; background: #f4f8f7; font-size: 12px; line-height: 1.6; }.error-actions { display: flex; flex-wrap: wrap; gap: 7px; }.review-button { padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: white; font-size: 11px; }.review-button:hover { border-color: #9fc9c0; color: var(--teal-dark); background: var(--teal-soft); }

.parent-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }.brief-divider { margin: 22px 0; border-top: 1px dashed var(--line); }.question-list, .hint-list { display: grid; gap: 11px; margin: 12px 0 0; padding-left: 24px; color: var(--ink); font-size: 13px; line-height: 1.7; }.hint-list { color: #4f676d; }.answer-box { margin-top: 24px; padding: 15px; border-radius: 12px; background: var(--amber-soft); }.answer-box p { margin: 7px 0 0; color: #6b4c28; font-size: 13px; line-height: 1.7; }.large-copy { font-size: 15px; }.coach-card { margin-bottom: 30px; }.coach-hint { min-height: 60px; margin: 17px 0; padding: 16px; border-left: 4px solid var(--teal); border-radius: 0 12px 12px 0; color: var(--teal-dark); background: var(--teal-soft); font-size: 14px; line-height: 1.75; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 20; max-width: 310px; padding: 11px 14px; border-radius: 10px; color: white; background: #203e42; box-shadow: 0 12px 30px rgba(13, 49, 54, 0.24); font-size: 12px; opacity: 0; pointer-events: none; transform: translateY(8px); transition: 180ms ease; }.toast.is-visible { opacity: 1; transform: translateY(0); }

body[data-mode="child"] .parent-only, body[data-mode="child"] .parent-nav { display: none !important; }
body[data-mode="child"] .sidebar-footer { display: none; }

@media (max-width: 980px) {
  .app-layout { grid-template-columns: 76px minmax(0, 1fr); }.sidebar { padding: 24px 10px; }.sidebar-intro { justify-content: center; margin: 0 0 24px; }.sidebar-intro span:last-child, .nav-button > span:not(.nav-icon), .sidebar-footer { display: none; }.nav-button { justify-content: center; padding: 10px 6px; }.nav-count { position: absolute; transform: translate(17px, -13px); }.nav-button { position: relative; }
}

@media (max-width: 740px) {
  .topbar { height: auto; min-height: 76px; padding: 14px 18px; align-items: flex-start; }.topbar-actions { flex-direction: column; align-items: flex-end; gap: 8px; }.date-control span { display: none; }.main-content { padding: 30px 16px 50px; }.page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 22px; }.heading-actions { width: 100%; justify-content: space-between; }.stats-grid, .dashboard-grid, .lower-grid, .errors-layout, .parent-grid { grid-template-columns: 1fr; }.plan-days { grid-template-columns: repeat(2, minmax(0, 1fr)); }.card { padding: 19px; }.video-card { min-height: 0; }.lesson-card { min-height: 0; }
  .pet-dashboard-art, .pet-hero-card { grid-template-columns: 1fr; }.pet-image-frame-small, .pet-hero-image-wrap { width: 100%; max-width: 220px; margin: 0 auto; }.pet-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 430px) { .brand-lockup h1 { font-size: 17px; }.brand-mark { width: 36px; height: 36px; }.mode-button { padding: 7px 8px; }.topbar { gap: 10px; }.plan-days { grid-template-columns: 1fr; } }
