/* 视觉来自中国学生的作业本：护眼绿纸、横线、蓝黑墨水、老师的红笔。全部使用系统字体，大陆访问不依赖外部资源。 */
:root {
  color-scheme: light;
  --paper: #e4f0e6;
  --rule: #c3d9ca;
  --ink: #1c2f6b;
  --ink-soft: #4f635a;
  --red-pen: #c1202c;
  --sheet: #f3f8f3;
  --line: 32px;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --english: Georgia, "Noto Serif", "Times New Roman", "Songti SC", serif;
  --kai: "Kaiti SC", STKaiti, KaiTi, "Noto Serif SC", serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
  -webkit-text-size-adjust: 100%;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--red-pen); outline-offset: 2px; }

.screen { max-width: 560px; margin: 0 auto; min-height: 100dvh; }

.button-primary {
  background: var(--ink);
  color: #fff;
  border: 0;
  border-radius: 6px;
  min-height: 48px;
  padding: 0 20px;
  font-weight: 600;
}
.button-primary:disabled { opacity: .55; }

.link-button {
  background: none;
  border: 0;
  padding: 8px 0;
  min-height: 44px;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.error-text { color: var(--red-pen); margin: 0; min-height: 26px; }

.wechat-tip {
  background: var(--red-pen);
  color: #fff;
  padding: 10px 16px;
  text-align: center;
}

/* 登录页：田字格 */
.login { padding: 12vh 24px 32px; }
.grid-title { display: flex; margin: 0; font-weight: 400; }
.grid-title span {
  --cell: min(38vw, 150px);
  width: var(--cell);
  height: var(--cell);
  display: grid;
  place-items: center;
  font: 400 calc(var(--cell) * .74)/1 var(--kai);
  border: 2px solid var(--red-pen);
  background:
    linear-gradient(var(--red-pen), var(--red-pen)) center / 100% 1px no-repeat,
    linear-gradient(var(--red-pen), var(--red-pen)) center / 1px 100% no-repeat;
  background-blend-mode: normal;
}
.grid-title span + span { border-left: 0; }
.login-line { font-size: 20px; margin: 28px 0 36px; }
.login-form { display: grid; gap: 10px; }
.login-form label { font-weight: 600; }
.login-form input {
  min-height: 52px;
  padding: 0 14px;
  background: var(--sheet);
  border: 1px solid var(--ink);
  border-radius: 6px;
  font-size: 18px;
  letter-spacing: .04em;
}

/* 首页 */
.home, .summary { padding: 20px 20px 40px; }
.home-head { display: flex; justify-content: space-between; align-items: center; }
.home-head h1 { font: 400 34px/1.2 var(--kai); margin: 0; }
.quota-line { color: var(--ink-soft); margin: 6px 0 20px; }
.levels { border: 0; padding: 0; margin: 0 0 16px; display: flex; align-items: center; gap: 8px; }
.levels legend { float: left; padding: 0; margin-right: 12px; line-height: 40px; font-weight: 600; }
.levels label { flex: 0 0 auto; }
.levels input { position: absolute; opacity: 0; }
.levels span {
  display: block;
  padding: 0 16px;
  line-height: 38px;
  border: 1px solid var(--ink);
  border-radius: 20px;
  cursor: pointer;
}
.levels input:checked + span { background: var(--ink); color: #fff; }
.levels input:focus-visible + span { outline: 2px solid var(--red-pen); outline-offset: 2px; }

.scenario-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.scenario-list li { border-bottom: 1px solid var(--rule); }
.scenario-list button {
  width: 100%;
  background: none;
  border: 0;
  padding: 14px 4px;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}
.scenario-list strong { font-size: 18px; font-weight: 600; white-space: nowrap; }
.scenario-list span { color: var(--ink-soft); font-size: 14px; text-align: right; }

/* 对话页：一页作业纸 */
.talk { height: 100dvh; min-height: 0; display: flex; flex-direction: column; }
.talk-head {
  flex: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  border-bottom: 2px solid var(--ink);
}
.talk-head h1 { font-size: 17px; margin: 0; font-weight: 600; }

.talk-log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 16px var(--line) 44px;
  line-height: var(--line);
  background-color: var(--paper);
  background-image:
    linear-gradient(90deg, transparent 31px, rgb(193 32 44 / .45) 31px, rgb(193 32 44 / .45) 32px, transparent 32px),
    repeating-linear-gradient(to bottom, transparent 0 calc(var(--line) - 1px), var(--rule) calc(var(--line) - 1px) var(--line));
  background-attachment: local;
}

.turn { margin: 0 0 var(--line); }
.turn:first-child { padding-top: var(--line); }
.speech { font: 18px/var(--line) var(--english); margin: 0; overflow-wrap: anywhere; }
.turn-user .speech { color: #17171f; }
.translation { color: var(--ink-soft); font-size: 14px; margin: 0; }
.turn-tools { display: flex; gap: 16px; height: var(--line); }
.turn-tools button {
  background: none;
  border: 0;
  padding: 0;
  height: var(--line);
  line-height: var(--line);
  font-size: 14px;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* 红笔批改 */
.speech mark {
  background: none;
  color: inherit;
  text-decoration: underline wavy var(--red-pen) 1.5px;
  text-underline-offset: 5px;
}
.marks { color: var(--red-pen); margin: 0; padding: 0; list-style: none; }
.marks li { overflow-wrap: anywhere; }
.marks .better { font: italic 17px/var(--line) var(--english); }
.marks .why { font-size: 14px; margin-left: 8px; }
.natural { color: var(--red-pen); margin: 0; font-size: 14px; }
.natural em { font: italic 17px/var(--line) var(--english); }
.all-good { color: var(--red-pen); font: 22px/var(--line) var(--kai); margin: 0; }
.checking { color: var(--ink-soft); font-size: 14px; margin: 0; }
.retry { color: var(--red-pen); font-size: 14px; margin: 0; }
.retry button { background: none; border: 0; padding: 0 0 0 8px; color: inherit; text-decoration: underline; }

.hint-box { color: var(--ink); margin: 0 0 var(--line); }
.hint-box .speech { font-style: italic; }

/* 底部 */
.dock {
  flex: none;
  background: var(--sheet);
  border-top: 2px solid var(--ink);
  padding: 8px 16px calc(12px + env(safe-area-inset-bottom));
}
.status { margin: 0; min-height: 26px; text-align: center; font-size: 15px; color: var(--ink-soft); }
.status.is-error { color: var(--red-pen); }
.recording-progress { height: 3px; background: var(--rule); margin: 4px 0; }
.recording-progress span { display: block; height: 100%; width: 0; background: var(--red-pen); }
.dock-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin-top: 4px; }
.dock-side { background: none; border: 0; min-height: 48px; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.mic {
  --level: 0;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 0;
  background: var(--ink);
  color: #fff;
  display: grid;
  place-items: center;
  transition: background-color .15s;
}
.mic.is-recording {
  background: var(--red-pen);
  box-shadow: 0 0 0 calc(3px + var(--level) * 16px) rgb(193 32 44 / .22);
}
.mic:disabled { opacity: .5; }

.type-form { display: flex; gap: 8px; margin-top: 8px; }
.type-form input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  background: #fff;
}

/* 总结页 */
.summary-list { list-style: none; margin: 0 0 24px; padding: 0; border-top: 1px solid var(--rule); }
.summary-list li { border-bottom: 1px solid var(--rule); padding: 12px 4px; }
.summary-list .was { font: 17px/1.5 var(--english); text-decoration: line-through var(--red-pen); margin: 0; overflow-wrap: anywhere; }
.summary-list .now { font: italic 18px/1.5 var(--english); color: var(--red-pen); margin: 2px 0; overflow-wrap: anywhere; }
.summary-list .why { color: var(--ink-soft); font-size: 14px; margin: 0; }
.summary .button-primary { width: 100%; }

@media (prefers-reduced-motion: reduce) {
  .mic { transition: none; }
  .mic.is-recording { box-shadow: 0 0 0 6px rgb(193 32 44 / .22); }
}

/* 入学测试 */
.test-entry {
  width: 100%;
  display: block;
  text-align: left;
  background: var(--ink);
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 24px;
}
.test-entry strong { display: block; font-size: 19px; }
.test-entry span { font-size: 14px; opacity: .85; }
.home-sub { font: 400 24px/1.3 var(--kai); margin: 0 0 12px; }

.test, .report { padding: 16px 20px calc(32px + env(safe-area-inset-bottom)); }
.test-head { display: flex; justify-content: space-between; align-items: center; }
.test-head span { font-weight: 600; }
.test-progress { height: 3px; background: var(--rule); margin: 4px 0 20px; }
.test-progress i { display: block; height: 100%; background: var(--red-pen); }
.test h1 { font: 400 30px/1.25 var(--kai); margin: 0 0 8px; }
.test-lead { color: var(--ink-soft); margin: 0 0 24px; }
.test fieldset { border: 0; padding: 0; margin: 0 0 22px; }
.test legend { font-weight: 600; padding: 0; margin-bottom: 8px; }
.choice-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-chips input { position: absolute; opacity: 0; }
.choice-chips span { display: block; padding: 0 14px; line-height: 40px; border: 1px solid var(--ink); border-radius: 20px; cursor: pointer; }
.choice-chips input:checked + span { background: var(--ink); color: #fff; }
.choice-chips input:focus-visible + span { outline: 2px solid var(--red-pen); outline-offset: 2px; }
.full-button { width: 100%; }
.passage { white-space: pre-wrap; background: var(--sheet); border-left: 3px solid var(--ink); padding: 12px 14px; margin: 0 0 20px; font: 16px/1.6 var(--english); overflow-wrap: anywhere; }
.question { font: 19px/1.5 var(--english); margin: 0 0 16px; overflow-wrap: anywhere; }
.question:lang(zh) { font-family: var(--sans); font-size: 18px; }
.options { list-style: none; margin: 0 0 20px; padding: 0; border-top: 1px solid var(--rule); }
.options li { border-bottom: 1px solid var(--rule); }
.options button { width: 100%; min-height: 54px; padding: 12px 4px 12px 34px; background: none; border: 0; text-align: left; position: relative; overflow-wrap: anywhere; }
.options button::before { content: ""; position: absolute; left: 6px; top: 50%; width: 16px; height: 16px; margin-top: -8px; border: 1.5px solid var(--ink); border-radius: 50%; }
.options button[aria-pressed="true"] { font-weight: 600; }
.options button[aria-pressed="true"]::before { background: var(--ink); box-shadow: inset 0 0 0 3px var(--paper); }
.test-actions { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.test-actions .button-primary { grid-column: 3; min-width: 112px; }
.play-button { width: 100%; min-height: 56px; margin-bottom: 20px; background: var(--sheet); border: 1px solid var(--ink); border-radius: 6px; font-weight: 600; }
.play-button:disabled { opacity: .55; }
.task-brief { margin: 0 0 16px; }
.task-area { width: 100%; min-height: 220px; padding: 12px; border: 1px solid var(--ink); border-radius: 6px; background: var(--sheet); font: 17px/1.6 var(--english); resize: vertical; }
.word-count { color: var(--ink-soft); font-size: 14px; margin: 4px 0 14px; }
.task-note { min-height: 26px; margin: 0 0 10px; }
.task-note.is-error { color: var(--red-pen); }
.mic-center { display: grid; justify-items: center; margin: 20px 0; }
.transcript { font: 18px/1.6 var(--english); background: var(--sheet); padding: 12px 14px; margin: 0 0 14px; overflow-wrap: anywhere; }
.pair-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.button-outline { min-height: 48px; background: none; border: 1px solid var(--ink); border-radius: 6px; font-weight: 600; }

/* 诊断报告 */
.report h1 { font: 400 34px/1.2 var(--kai); margin: 8px 0 0; }
.report h2 { font: 400 24px/1.3 var(--kai); margin: 32px 0 12px; border-bottom: 2px solid var(--ink); padding-bottom: 4px; }
.overall { display: flex; align-items: center; gap: 16px; margin: 16px 0 4px; }
.overall b {
  width: 84px; height: 84px; display: grid; place-items: center;
  font: 400 34px/1 var(--english);
  border: 2px solid var(--red-pen); color: var(--red-pen);
}
.overall b.is-long { font-size: 20px; }
.overall p { margin: 0; color: var(--ink-soft); }
.bars { margin: 0; padding: 0; list-style: none; }
.bars li { display: grid; grid-template-columns: 84px 1fr 76px; gap: 10px; align-items: center; min-height: 36px; }
.bar-track { height: 10px; background: var(--rule); border-radius: 0 4px 4px 0; }
.bar-track i { display: block; height: 100%; background: var(--ink); border-radius: 0 4px 4px 0; }
.bars em { font-style: normal; text-align: right; font-size: 14px; white-space: nowrap; }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { padding: 10px 0; border-bottom: 1px solid var(--rule); }
.plain-list small { display: block; color: var(--ink-soft); font-size: 14px; }
.report-task { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.report-task h3 { font-size: 17px; margin: 0 0 6px; display: flex; justify-content: space-between; }
.report-task .answer { font: 16px/1.6 var(--english); white-space: pre-wrap; margin: 0 0 8px; overflow-wrap: anywhere; }
.report-note { color: var(--ink-soft); font-size: 14px; margin: 24px 0; }
.report details { border-bottom: 1px solid var(--rule); padding: 10px 0; }
.report summary { cursor: pointer; overflow-wrap: anywhere; }
.report details p { margin: 6px 0 0; font-size: 15px; }
.report .right-answer { color: var(--red-pen); }
.report-actions { display: grid; gap: 12px; }

/* 今日任务和打卡 */
.today { margin-bottom: 20px; }
.streak-line { margin: 0 0 8px; font-size: 17px; }
.streak-line b { font: 400 30px/1 var(--english); color: var(--red-pen); margin: 0 3px; }
.task-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.task-list li { border-bottom: 1px solid var(--rule); }
.task-list button { width: 100%; background: none; border: 0; padding: 12px 4px; display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; align-items: center; text-align: left; }
.task-list .tick { width: 20px; height: 20px; border: 1.5px solid var(--ink); border-radius: 50%; display: grid; place-items: center; color: var(--red-pen); font-size: 16px; line-height: 1; }
.task-list .is-done .tick { border-color: var(--red-pen); }
.task-list strong { font-weight: 600; overflow-wrap: anywhere; }
.task-list .is-done strong { color: var(--ink-soft); }
.task-list span.detail { color: var(--ink-soft); font-size: 14px; text-align: right; }
.calendar { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; margin: 14px 0 2px; }
.calendar i { aspect-ratio: 1; background: var(--rule); border-radius: 2px; }
.calendar i.on { background: var(--red-pen); }
.calendar i.today-cell { outline: 1.5px solid var(--ink); outline-offset: 1px; }

/* 单词卡 */
.word-card { padding: 8px 0 20px; }
.word-term { font: 32px/1.25 var(--english); margin: 0 0 8px; overflow-wrap: anywhere; }
.word-zh { font-size: 20px; margin: 0 0 16px; }
.word-example { font: italic 18px/1.6 var(--english); margin: 0 0 16px; overflow-wrap: anywhere; }
.fix-original { font: 22px/1.5 var(--english); text-decoration: underline wavy var(--red-pen) 1.5px; text-underline-offset: 5px; margin: 0 0 16px; overflow-wrap: anywhere; }
.fix-better { font: italic 22px/1.5 var(--english); color: var(--red-pen); margin: 0 0 6px; overflow-wrap: anywhere; }
.feedback-line { min-height: 26px; margin: 0 0 8px; color: var(--red-pen); }
.check-in { text-align: center; padding-top: 12vh; }
.check-in .stamp {
  width: 128px; height: 128px; margin: 0 auto 20px; display: grid; place-items: center;
  border: 3px solid var(--red-pen); color: var(--red-pen); font: 400 64px/1 var(--kai); transform: rotate(-6deg);
}
.check-in p { margin: 0 0 24px; font-size: 18px; }

/* 课程页 */
.pattern { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.pattern p { margin: 0; }
.pattern .en { font: 18px/1.5 var(--english); overflow-wrap: anywhere; }
.pattern .zh { color: var(--ink-soft); font-size: 14px; }
.pattern button { background: none; border: 0; padding: 4px 0 0; text-decoration: underline; text-underline-offset: 3px; font-size: 14px; min-height: 32px; }
.section-title { font: 400 24px/1.3 var(--kai); margin: 24px 0 8px; }
.dictation input { width: 100%; min-height: 48px; padding: 0 12px; margin-bottom: 8px; border: 1px solid var(--ink); border-radius: 6px; background: var(--sheet); font: 17px var(--english); }
.dictation .result { min-height: 26px; color: var(--red-pen); margin: 0 0 12px; overflow-wrap: anywhere; }
.week-row { display: grid; grid-template-columns: 62px 1fr; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.week-row small { display: block; color: var(--ink-soft); font-size: 14px; }
.week-row.is-current { font-weight: 600; color: var(--red-pen); }
.week-row.is-past { color: var(--ink-soft); }
.test-entry.is-quiet { background: none; color: var(--ink); border: 1px solid var(--ink); padding: 10px 14px; }

/* V2：学习方向、阅读与跟读 */
.industry-panel {border:1px solid var(--rule); border-radius:12px; padding:15px; margin:16px 0 12px;background:var(--sheet);}
.industry-header {display:flex;justify-content:space-between;gap:8px;align-items:center;margin-bottom:9px;}
.industry-header label {font-weight:600;font-size:15px;}
.industry-header span {font-size:12px;color:var(--ink-soft);}
.industry-panel select {width:100%; min-height:48px;padding:10px;border:1px solid var(--ink);border-radius:7px;background:var(--paper,#fff);font-size:16px;color:var(--ink);}
.industry-panel p {font-size:12px;line-height:1.6;color:var(--ink-soft);margin:9px 0 0;}
.quick-actions {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin:14px 0 22px;}
.quick-action {text-align:left;border:1px solid var(--rule);background:var(--sheet);border-radius:12px;padding:14px 12px;min-height:75px;}
.quick-action strong,.quick-action span {display:block;}
.quick-action strong {font-size:16px;margin-bottom:6px;}
.quick-action span {font-size:12px;color:var(--ink-soft);}
.practice-choice {padding:12px 0;border-bottom:1px solid var(--rule);}
.practice-choice button {width:100%;border:0;background:transparent;text-align:left;padding:8px 0;color:var(--ink);}
.practice-choice small {display:block;color:var(--ink-soft);margin-top:6px;}
.practice-body {white-space:pre-wrap;font:18px/1.75 var(--english);padding:12px 0;}
.practice-score {font-size:18px;line-height:1.6;margin:18px 0;}
.practice-answer {border:1px solid var(--rule);border-radius:10px;padding:12px;margin:10px 0;}
.practice-answer button {display:block;width:100%;text-align:left;margin:5px 0;border:1px solid var(--rule);background:var(--sheet);padding:9px;border-radius:8px;}
.practice-answer button[aria-pressed=true] {border-color:var(--ink);font-weight:600;}
.shadow-target {font:24px/1.55 var(--english);padding:24px 0;}
.shadow-words {font:16px/1.6 var(--english);white-space:pre-wrap;}
.shadow-note {font-size:13px;color:var(--ink-soft);line-height:1.6;}
@media(max-width:400px){.quick-actions{grid-template-columns:1fr;}}

.intake-industry {display:grid;gap:8px;margin:18px 0;}
.intake-industry label {font-weight:600;}
.intake-industry select {width:100%;min-height:48px;padding:10px;font-size:16px;border:1px solid var(--ink);border-radius:8px;background:var(--sheet);color:var(--ink);}

/* 课程讲解、回炉和档案 */
.today-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lesson-tip { margin: 0 0 8px; }
.shadow-result { font-size: 14px; color: var(--red-pen); margin: 0; overflow-wrap: anywhere; }
.shadow-result:empty { display: none; }
.pattern button + button { margin-left: 16px; }
.right-answer { color: var(--red-pen); }
.skill-title { font-size: 16px; margin: 16px 0 4px; }
.talk-brief { padding-top: var(--line); color: var(--ink-soft); font-size: 14px; }
.talk-brief p { margin: 0; line-height: var(--line); }
.talk-score { margin-bottom: 16px; }
.talk-overall { font: 400 44px/1.2 var(--kai); color: var(--red-pen); margin: 0 0 8px; }
.score-list, .goal-list { list-style: none; margin: 0 0 12px; padding: 0; }
.score-list li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--rule); }
.goal-list li { color: var(--ink-soft); padding: 2px 0; }
.goal-list li.is-met { color: var(--red-pen); }
