:root {
  color-scheme: light;
  --ink: #19372f;
  --muted: #687c75;
  --paper: #fffdf8;
  --card: rgba(255, 255, 255, .88);
  --green: #235347;
  --green-2: #3f7b68;
  --mint: #e4f0e9;
  --mint-2: #cce2d7;
  --sun: #f4c766;
  --sun-soft: #fff1c9;
  --coral: #e97c68;
  --coral-soft: #fde8e3;
  --line: rgba(25, 55, 47, .13);
  --shadow: 0 24px 70px rgba(25, 55, 47, .12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

button, input { font: inherit; }
button { color: inherit; }

.ambient {
  position: fixed;
  z-index: -1;
  width: 44vw;
  height: 44vw;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
}
.ambient-one { top: -18vw; left: -12vw; background: rgba(244, 199, 102, .27); }
.ambient-two { right: -16vw; bottom: -20vw; background: rgba(91, 158, 132, .22); }

.app-shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 64px; }
.loading-card { display: grid; place-items: center; min-height: 70vh; color: var(--muted); }
.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: #fff;
  background: var(--green);
  font-size: 23px;
  font-weight: 800;
}

.login-layout { display: grid; grid-template-columns: 1.15fr .85fr; gap: 36px; align-items: center; min-height: calc(100vh - 92px); }
.login-copy { padding: 28px; }
.eyebrow { color: var(--green-2); font-size: 13px; font-weight: 800; letter-spacing: .18em; }
.login-copy h1 { max-width: 680px; margin: 20px 0; font-family: "Songti SC", STSong, serif; font-size: clamp(45px, 7vw, 82px); font-weight: 600; line-height: 1.08; letter-spacing: -.045em; }
.login-copy p { max-width: 620px; color: var(--muted); font-size: 18px; line-height: 1.9; }
.feature-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.feature-pill { padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.58); font-size: 14px; }

.login-card, .panel, .study-card, .question-card, .result-card {
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}
.login-card { padding: 34px; border-radius: 28px; }
.login-card h2 { margin: 0 0 10px; font-size: 24px; }
.login-card > p { margin: 0 0 24px; color: var(--muted); line-height: 1.7; }
.field-label { display: block; margin-bottom: 9px; font-size: 14px; font-weight: 700; }
.text-input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid rgba(25,55,47,.22);
  border-radius: 14px;
  outline: none;
  background: #fff;
  transition: border .2s, box-shadow .2s;
}
.text-input:focus { border-color: var(--green-2); box-shadow: 0 0 0 4px rgba(63,123,104,.12); }
.hint { margin: 10px 0 22px !important; font-size: 12px; }

.btn {
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 13px;
  cursor: pointer;
  font-weight: 750;
  transition: transform .15s, box-shadow .15s, background .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { cursor: not-allowed; opacity: .5; transform: none; }
.btn-primary { color: #fff; background: var(--green); box-shadow: 0 10px 24px rgba(35,83,71,.2); }
.btn-secondary { border-color: var(--line); background: #fff; }
.btn-soft { background: var(--mint); color: var(--green); }
.btn-warn { background: var(--coral-soft); color: #963e31; }
.btn-block { width: 100%; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 70px; margin-bottom: 26px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; }
.brand .brand-mark { width: 38px; height: 38px; font-size: 18px; }
.user-area { display: flex; align-items: center; gap: 12px; }
.user-name { color: var(--muted); font-size: 14px; }
.link-btn { padding: 8px; border: 0; background: transparent; color: var(--green-2); cursor: pointer; font-weight: 700; }

.hero { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: end; margin: 42px 0 30px; }
.hero h1 { margin: 10px 0 8px; font-family: "Songti SC", STSong, serif; font-size: clamp(34px, 5vw, 58px); font-weight: 600; }
.hero p { margin: 0; color: var(--muted); line-height: 1.7; }
.overall { min-width: 210px; padding: 20px; border-radius: 20px; background: var(--green); color: white; }
.overall-number { font-family: Georgia, serif; font-size: 38px; }
.overall-label { margin-top: 4px; color: rgba(255,255,255,.72); font-size: 13px; }
.progress-track { height: 7px; margin-top: 14px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.18); }
.progress-fill { height: 100%; border-radius: inherit; background: var(--sun); }

.day-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.day-card { position: relative; min-height: 156px; padding: 20px; border: 1px solid var(--line); border-radius: 19px; background: rgba(255,255,255,.75); cursor: pointer; text-align: left; transition: transform .16s, box-shadow .16s, border .16s; }
.day-card:hover { transform: translateY(-3px); border-color: var(--mint-2); box-shadow: 0 16px 34px rgba(25,55,47,.09); }
.day-card.complete { background: linear-gradient(145deg, #f8fffb, var(--mint)); }
.day-index { color: var(--green-2); font-family: Georgia, serif; font-size: 13px; }
.day-title { margin: 24px 0 8px; font-size: 20px; font-weight: 800; }
.day-meta { color: var(--muted); font-size: 12px; }
.status-dot { position: absolute; top: 18px; right: 18px; width: 9px; height: 9px; border-radius: 50%; background: #d8dfdb; }
.complete .status-dot { background: var(--green-2); box-shadow: 0 0 0 5px rgba(63,123,104,.11); }

.day-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 32px 0 22px; }
.day-head h1 { margin: 4px 0 0; font-family: "Songti SC", STSong, serif; font-size: clamp(34px, 5vw, 52px); font-weight: 600; }
.day-actions { display: flex; gap: 10px; }
.mode-tabs { display: flex; gap: 8px; padding: 6px; margin-bottom: 22px; overflow-x: auto; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.62); }
.mode-tab { flex: 1; min-width: 100px; padding: 11px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; color: var(--muted); font-weight: 750; }
.mode-tab.active { background: var(--green); color: #fff; }
.mode-tabs.locked .mode-tab:not(.active) { cursor: not-allowed; opacity: .42; }
.mode-tabs.locked .mode-tab.active { cursor: default; opacity: 1; }
.test-lock-note { margin: -10px 0 20px; padding: 11px 14px; border-radius: 11px; color: #805713; background: var(--sun-soft); font-size: 13px; text-align: center; }

.study-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 20px; }
.study-card { min-height: 450px; padding: clamp(28px, 5vw, 58px); border-radius: 26px; }
.card-counter { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }
.confuse-tag { display: inline-block; margin-top: 26px; padding: 6px 10px; border-radius: 8px; color: #8b4e13; background: var(--sun-soft); font-size: 12px; font-weight: 800; }
.phrase { margin: 52px 0 14px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(35px, 6vw, 62px); line-height: 1.08; overflow-wrap: anywhere; }
.meaning { color: var(--green-2); font-size: 18px; font-weight: 700; line-height: 1.6; }
.example { margin-top: 34px; padding-top: 24px; border-top: 1px solid var(--line); color: #4b5f58; font-family: Georgia, "Times New Roman", serif; font-size: 20px; line-height: 1.7; }
.study-controls { display: flex; gap: 10px; margin-top: 34px; }
.study-controls .btn { flex: 1; }
.side-list { max-height: 560px; overflow-y: auto; padding: 12px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.58); }
.side-item { width: 100%; padding: 12px; border: 0; border-radius: 11px; background: transparent; cursor: pointer; text-align: left; }
.side-item:hover, .side-item.active { background: var(--mint); }
.side-item strong { display: block; font-family: Georgia, serif; }
.side-item span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.scene-hero { display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: end; padding: 30px 34px; margin-bottom: 20px; border: 1px solid var(--line); border-radius: 24px; background: linear-gradient(135deg, rgba(228,240,233,.9), rgba(255,253,248,.86)); }
.scene-hero h2 { margin: 9px 0 10px; font-family: "Songti SC", STSong, serif; font-size: clamp(30px, 5vw, 46px); font-weight: 600; }
.scene-hero p { max-width: 700px; margin: 0; color: var(--muted); line-height: 1.8; }
.scene-route { display: flex; align-items: center; gap: 8px; color: var(--green-2); white-space: nowrap; font-size: 13px; font-weight: 750; }
.scene-route span { padding: 8px 10px; border-radius: 9px; background: #fff; }
.scene-route i { color: #9db4aa; font-style: normal; }
.scene-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.scene-card { overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: rgba(255,255,255,.78); box-shadow: 0 18px 48px rgba(25,55,47,.07); }
.scene-card-visual { display: grid; place-items: center; height: 150px; background: linear-gradient(145deg, var(--sun-soft), var(--mint)); }
.scene-card:nth-child(2) .scene-card-visual { background: linear-gradient(145deg, #e3f0f7, var(--mint)); }
.scene-card:nth-child(3) .scene-card-visual { background: linear-gradient(145deg, #eee8fb, var(--sun-soft)); }
.scene-card-visual span { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; background: rgba(255,255,255,.72); font-size: 42px; box-shadow: 0 12px 30px rgba(25,55,47,.08); }
.scene-card-body { padding: 24px; }
.scene-time { color: var(--green-2); font-size: 12px; font-weight: 800; letter-spacing: .06em; }
.scene-card h2 { margin: 10px 0 9px; font-size: 23px; }
.scene-card p { min-height: 74px; margin: 0; color: var(--muted); line-height: 1.7; }
.scene-phrase-count { margin: 18px 0; color: var(--green-2); font-size: 12px; }
.scene-guide { display: flex; flex-wrap: wrap; gap: 12px 20px; margin-top: 20px; padding: 18px 22px; border-radius: 16px; color: var(--muted); background: rgba(255,255,255,.64); font-size: 13px; }
.scene-guide strong { color: var(--ink); }

.scene-detail-head { display: grid; grid-template-columns: auto 82px 1fr; gap: 22px; align-items: center; padding: 26px 30px; border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(135deg, rgba(255,241,201,.74), rgba(228,240,233,.8)); }
.scene-detail-head .link-btn { align-self: start; padding-left: 0; }
.scene-detail-icon { display: grid; place-items: center; width: 76px; height: 76px; border-radius: 50%; background: rgba(255,255,255,.82); font-size: 38px; }
.scene-detail-head h2 { margin: 5px 0 8px; font-family: "Songti SC", STSong, serif; font-size: 34px; font-weight: 600; }
.scene-detail-head p { max-width: 760px; margin: 0; color: var(--muted); line-height: 1.75; }
.mission-strip { display: flex; gap: 14px; margin: 14px 0 26px; padding: 14px 18px; border-left: 4px solid var(--sun); border-radius: 0 12px 12px 0; background: rgba(255,255,255,.68); line-height: 1.6; }
.mission-strip strong { white-space: nowrap; }
.dialogue-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 12px; }
.dialogue-toolbar h3 { margin: 0; font-size: 22px; }
.dialogue-toolbar > div { display: flex; gap: 8px; }
.dialogue-list { display: grid; gap: 11px; }
.dialogue-line { display: grid; grid-template-columns: 42px 1fr auto; gap: 14px; padding: 20px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.8); }
.speaker-badge { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: #fff; background: var(--green-2); font-weight: 800; }
.speaker-name { color: var(--green-2); font-size: 12px; font-weight: 800; }
.dialogue-english { margin: 7px 0 8px; font-family: Georgia, "Times New Roman", serif; font-size: 20px; line-height: 1.65; }
.phrase-toggle { display: inline; padding: 2px 5px; border: 0; border-radius: 6px; cursor: pointer; font-family: inherit; font-size: inherit; font-weight: 750; }
.phrase-toggle.revealed { color: #165c49; background: #dff1e8; box-shadow: inset 0 -2px 0 rgba(35,83,71,.18); }
.phrase-toggle.covered { min-width: 110px; color: var(--green-2); background: var(--sun-soft); letter-spacing: .06em; }
.dialogue-meaning { color: var(--muted); line-height: 1.6; }
.canonical-phrase { margin-top: 8px; color: #8b651c; font-size: 12px; line-height: 1.55; }
.canonical-phrase.muted { color: #90a09a; }
.line-speak { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; }
.line-speak:hover { background: var(--mint); }

.transfer-section { margin-top: 42px; padding-top: 32px; border-top: 1px solid var(--line); }
.transfer-head { margin-bottom: 18px; }
.transfer-head h2 { margin: 8px 0; font-family: "Songti SC", STSong, serif; font-size: 32px; font-weight: 600; }
.transfer-head p { margin: 0; color: var(--muted); }
.transfer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.transfer-card { padding: 20px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.78); }
.transfer-number { color: var(--green-2); font-size: 11px; font-weight: 800; letter-spacing: .1em; }
.transfer-card h3 { min-height: 76px; margin: 10px 0 16px; font-size: 16px; line-height: 1.6; }
.transfer-options { display: grid; gap: 8px; }
.transfer-option { min-height: 40px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; text-align: left; font-family: Georgia, "Times New Roman", serif; }
.transfer-option:hover:not(:disabled) { border-color: var(--green-2); }
.transfer-option.correct { border-color: #7bb29c; color: #175a47; background: var(--mint); }
.transfer-option.wrong { border-color: #eca093; color: #8b372d; background: var(--coral-soft); }
.transfer-feedback { min-height: 0; margin-top: 0; font-size: 12px; line-height: 1.6; }
.transfer-feedback.correct, .transfer-feedback.wrong { min-height: 52px; margin-top: 12px; }
.transfer-feedback.correct { color: var(--green); }
.transfer-feedback.wrong { color: #8b372d; }
.scene-next-actions { display: flex; justify-content: flex-end; margin-top: 22px; }

.question-card, .result-card { width: min(760px, 100%); min-height: 440px; margin: 0 auto; padding: clamp(26px, 5vw, 52px); border-radius: 26px; }
.question-top { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }
.mini-progress { height: 6px; margin: 14px 0 38px; overflow: hidden; border-radius: 999px; background: #e8ecea; }
.mini-progress span { display: block; height: 100%; border-radius: inherit; background: var(--green-2); }
.question-label { color: var(--green-2); font-size: 13px; font-weight: 800; letter-spacing: .12em; }
.question-prompt { margin: 16px 0 26px; font-size: clamp(24px, 4vw, 36px); font-weight: 750; line-height: 1.45; }
.question-prompt.english { font-family: Georgia, "Times New Roman", serif; font-weight: 600; }
.answer-row { display: flex; gap: 10px; }
.answer-row .text-input { flex: 1; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice { min-height: 64px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; text-align: left; line-height: 1.45; }
.choice:hover { border-color: var(--green-2); background: #f8fcfa; }
.feedback { margin-top: 24px; padding: 18px; border-radius: 14px; line-height: 1.6; }
.feedback.correct { background: var(--mint); color: var(--green); }
.feedback.wrong { background: var(--coral-soft); color: #83382e; }
.feedback strong { display: block; margin-bottom: 5px; font-family: Georgia, serif; font-size: 20px; }
.feedback-actions { display: flex; justify-content: flex-end; margin-top: 16px; }

.result-card { text-align: center; }
.score-ring { display: grid; place-items: center; width: 154px; height: 154px; margin: 10px auto 25px; border-radius: 50%; background: conic-gradient(var(--green) var(--score), #e6ece8 0); }
.score-ring::before { content: ""; grid-area: 1/1; width: 124px; height: 124px; border-radius: 50%; background: #fff; }
.score-number { z-index: 1; grid-area: 1/1; font-family: Georgia, serif; font-size: 44px; }
.result-card h2 { margin: 0 0 8px; font-size: 28px; }
.result-card > p { color: var(--muted); }
.wrong-list { margin: 28px 0; padding: 0; list-style: none; text-align: left; }
.wrong-list li { display: flex; justify-content: space-between; gap: 20px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.wrong-list strong { font-family: Georgia, serif; }
.wrong-list span { color: var(--muted); text-align: right; }
.result-actions { display: flex; justify-content: center; gap: 10px; }

.toast { position: fixed; left: 50%; bottom: 28px; z-index: 50; max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 12px; color: #fff; background: #183c32; box-shadow: 0 14px 34px rgba(0,0,0,.18); opacity: 0; transform: translate(-50%, 12px); pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) {
  .day-grid { grid-template-columns: repeat(4, 1fr); }
  .study-wrap { grid-template-columns: 1fr; }
  .side-list { display: grid; grid-template-columns: repeat(3, 1fr); max-height: none; }
  .scene-grid, .transfer-grid { grid-template-columns: 1fr; }
  .scene-card { display: grid; grid-template-columns: 180px 1fr; }
  .scene-card-visual { height: 100%; min-height: 220px; }
  .scene-card p, .transfer-card h3 { min-height: 0; }
}

@media (max-width: 720px) {
  .app-shell { width: min(100% - 22px, 1120px); padding-top: 10px; }
  .login-layout { grid-template-columns: 1fr; gap: 10px; padding: 32px 0; }
  .login-copy { padding: 8px; }
  .login-copy h1 { font-size: 48px; }
  .login-card { padding: 24px; }
  .topbar { min-height: 62px; }
  .brand > span:last-child { display: none; }
  .hero { grid-template-columns: 1fr; margin-top: 28px; }
  .overall { min-width: 0; }
  .day-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .day-card { min-height: 130px; padding: 16px; }
  .day-title { margin-top: 18px; }
  .day-head { align-items: flex-start; }
  .day-actions { flex-direction: column; }
  .study-card { min-height: 430px; }
  .phrase { margin-top: 40px; }
  .study-controls, .answer-row, .result-actions { flex-direction: column; }
  .choices { grid-template-columns: 1fr; }
  .side-list { grid-template-columns: repeat(2, 1fr); }
  .question-card, .result-card { min-height: 0; }
  .scene-hero { grid-template-columns: 1fr; padding: 24px; }
  .scene-route { overflow-x: auto; }
  .scene-card { display: block; }
  .scene-card-visual { height: 120px; min-height: 0; }
  .scene-detail-head { grid-template-columns: 58px 1fr; padding: 20px; }
  .scene-detail-head .link-btn { grid-column: 1 / -1; }
  .scene-detail-icon { width: 56px; height: 56px; font-size: 28px; }
  .scene-detail-head h2 { font-size: 28px; }
  .mission-strip, .dialogue-toolbar { align-items: flex-start; flex-direction: column; }
  .dialogue-toolbar > div { width: 100%; }
  .dialogue-toolbar .btn { flex: 1; padding: 0 10px; }
  .dialogue-line { grid-template-columns: 36px 1fr; padding: 16px; }
  .speaker-badge { width: 34px; height: 34px; }
  .line-speak { grid-column: 2; }
  .dialogue-english { font-size: 18px; }
}
