:root {
  color-scheme: dark;
  --bg: #080c12;
  --surface: #0e141e;
  --surface-2: #141c29;
  --surface-3: #1b2535;
  --line: #26344b;
  --text: #f5f7fb;
  --muted: #93a1b6;
  --faint: #64728a;
  --amber: #ffad24;
  --amber-2: #f38a18;
  --green: #24d477;
  --red: #ff5f68;
  --blue: #68a7ff;
  --radius: 22px;
  --shadow: 0 16px 46px rgba(0,0,0,.28);
}

/* Cloud account and server-graded learning surfaces. */
.auth-panel{max-width:560px;margin:20px auto;padding:clamp(22px,5vw,40px)}
.cloud-card{padding:clamp(20px,4vw,30px);margin:20px 0;overflow-wrap:anywhere}
.cloud-form{display:grid;gap:18px;max-width:620px;margin:24px 0}
.cloud-form label{display:grid;gap:9px;color:var(--muted)}
.cloud-form input,.cloud-form textarea,.jump-input{font:inherit;font-size:16px;color:var(--text);background:var(--bg);border:1px solid var(--line);border-radius:12px;padding:13px;min-width:0;width:100%}
.cloud-form textarea{resize:vertical}.jump-input{width:80px;padding:10px}
.inline-form{grid-template-columns:1fr 1fr;align-items:end}.inline-form>button{grid-column:1/-1}
.button-row{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin:22px 0}
.button-row .primary-button{flex:1;min-width:150px}
.cloud-note{margin-top:26px;font-size:14px}
.cloud-question{white-space:pre-wrap;line-height:1.7;overflow-wrap:anywhere;font-size:clamp(18px,3vw,24px)}
.cloud-options{display:grid;gap:14px;margin:24px 0}
.cloud-option{display:flex;gap:16px;align-items:flex-start;text-align:left;width:100%;padding:20px;border:1px solid var(--line);border-radius:18px;background:var(--surface-2);line-height:1.6;font-size:18px;cursor:pointer}
.cloud-option b{display:grid;place-items:center;min-width:36px;height:36px;background:var(--surface-3);border-radius:10px}
.cloud-option span{min-width:0;overflow-wrap:anywhere;white-space:pre-wrap}.cloud-option small{display:block;color:var(--muted);font-size:16px;margin-top:6px}
.cloud-option:hover:not(:disabled),.cloud-option.selected{border-color:var(--amber);background:#292216}
.cloud-option.correct{border:2px solid var(--green);background:#102b21}.cloud-option.incorrect{border:2px solid var(--red);background:#301a21}
.cloud-option:disabled{opacity:1;cursor:default}.cloud-explanation{border:1px solid var(--green);border-radius:18px;padding:22px;background:#10231e;line-height:1.8;white-space:pre-wrap;overflow-wrap:anywhere}
.cloud-explanation h3{color:var(--green)}.cloud-explanation p:last-child{margin-bottom:0}
.image-warning{padding:14px;border:1px solid var(--amber);color:var(--amber);border-radius:12px;font-size:14px;line-height:1.7}
progress{width:100%;height:8px;accent-color:var(--amber)}
.history-row,.member-row{display:flex;justify-content:space-between;gap:20px;align-items:center;border-bottom:1px solid var(--line);padding:18px 0}.history-row p,.member-row p{margin:8px 0 0}
.table-scroll{overflow-x:auto}table{border-collapse:collapse;width:100%;font-size:14px;text-align:left}th,td{border-bottom:1px solid var(--line);padding:14px;white-space:nowrap}th{color:var(--muted)}
#notice{position:fixed;bottom:88px;left:50%;transform:translateX(-50%);z-index:100;max-width:calc(100% - 32px);width:max-content;background:#24344a;color:white;border:1px solid var(--blue);border-radius:14px;padding:16px 20px;box-shadow:var(--shadow);line-height:1.6;white-space:pre-wrap}
button:disabled{cursor:not-allowed;opacity:.5}button:focus-visible,input:focus-visible,textarea:focus-visible{outline:3px solid var(--blue);outline-offset:3px}
[aria-busy="true"]{cursor:progress}[aria-busy="true"] button{opacity:.65}
.results-card{text-align:center}.result-score{font-size:72px;color:var(--amber);font-weight:800}.result-score small{font-size:24px}
.eyebrow{font-size:14px!important}.stat-strip span,.section-card p{font-size:14px!important}
@media(max-width:600px){.member-row{display:block}.cloud-option{padding:16px;font-size:17px}.stat-strip{gap:18px!important}.stat-strip span{font-size:14px}.history-row{align-items:flex-start}.quiz-top{gap:8px}.cloud-form{width:100%}}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-padding-top:100px; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 85% -10%, rgba(255,173,36,.12), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Noto Sans SC", sans-serif;
  min-height: 100vh;
}
button, input { font: inherit; }
button { color: inherit; }
.app-shell { width: min(1120px, 100%); margin: 0 auto; min-height: 100vh; }

.topbar {
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 28px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(8,12,18,.86);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(38,52,75,.65);
}
.brand { display:flex; align-items:center; gap:12px; background:none; border:0; padding:0; cursor:pointer; text-align:left; }
.brand-mark { width:44px; height:44px; display:grid; place-items:center; border-radius:14px; background:linear-gradient(145deg,var(--amber),var(--amber-2)); box-shadow:0 8px 25px rgba(243,138,24,.24); }
.brand strong { display:block; font-size:1.05rem; letter-spacing:.02em; }
.brand small { display:block; color:var(--muted); margin-top:2px; }
.top-actions { display:flex; align-items:center; gap:10px; }
.icon-button,.avatar-button { border:1px solid var(--line); background:var(--surface-2); min-height:42px; border-radius:13px; cursor:pointer; }
.icon-button { padding:0 14px; color:var(--muted); }
.avatar-button { width:42px; font-weight:800; color:#111; background:var(--amber); border-color:var(--amber); }

main { padding: 28px 28px 108px; }
.eyebrow { color:var(--amber); font-size:.76rem; font-weight:800; letter-spacing:.16em; }
h1,h2,h3,p { margin-top:0; }
h1 { font-size:clamp(1.8rem,4vw,2.8rem); margin:8px 0 9px; line-height:1.14; letter-spacing:-.02em; }
h2 { font-size:1.35rem; }
.subtle { color:var(--muted); line-height:1.6; }
.section-heading { display:flex; align-items:end; justify-content:space-between; margin:34px 0 14px; }
.section-heading h2 { margin:0; }
.section-heading span { color:var(--faint); font-size:.88rem; }

.hero-grid { display:grid; grid-template-columns:1.35fr .65fr; gap:18px; }
.welcome-card,.resume-card,.panel-card,.account-card { border:1px solid var(--line); background:linear-gradient(145deg,rgba(20,28,41,.94),rgba(14,20,30,.94)); border-radius:var(--radius); box-shadow:var(--shadow); }
.welcome-card { padding:28px; min-height:205px; position:relative; overflow:hidden; }
.welcome-card:after { content:""; position:absolute; right:-10px; bottom:-42px; font-size:9rem; font-weight:900; color:rgba(255,255,255,.025); letter-spacing:-.1em; }
.stat-strip { display:flex; gap:28px; margin-top:28px; position:relative; z-index:1; }
.stat-strip strong { display:block; font-size:1.65rem; color:var(--amber); }
.stat-strip span { color:var(--muted); font-size:.84rem; }
.resume-card { padding:24px; display:flex; flex-direction:column; justify-content:space-between; }
.ring { width:82px; height:82px; border-radius:50%; display:grid; place-items:center; background:conic-gradient(var(--amber) var(--angle,0deg),var(--surface-3) 0); position:relative; }
.ring:after { content:""; position:absolute; inset:8px; border-radius:50%; background:var(--surface); }
.ring strong { z-index:1; }
.resume-card .primary-button { margin-top:18px; }

.section-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.section-card { min-height:132px; padding:20px; background:var(--surface); border:1px solid var(--line); border-radius:20px; cursor:pointer; text-align:left; transition:.2s ease; position:relative; overflow:hidden; }
.section-card:hover { transform:translateY(-2px); border-color:rgba(255,173,36,.7); }
.section-icon { display:inline-grid; place-items:center; width:40px; height:40px; border-radius:12px; background:rgba(255,173,36,.1); color:var(--amber); font-size:1.25rem; margin-bottom:20px; }
.section-card h3 { margin:0 0 4px; font-size:1.06rem; }
.section-card p { color:var(--muted); margin:0; font-size:.85rem; }
.section-meta { position:absolute; top:20px; right:20px; text-align:right; }
.section-meta strong { display:block; color:var(--amber); }
.section-meta small { color:var(--faint); }
.mini-progress { height:4px; border-radius:9px; background:var(--surface-3); margin-top:14px; overflow:hidden; }
.mini-progress i { display:block; height:100%; background:linear-gradient(90deg,var(--amber-2),var(--amber)); width:var(--value); }

.mode-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.mode-card { background:var(--surface-2); border:1px solid var(--line); border-radius:18px; padding:18px; text-align:left; cursor:pointer; min-height:126px; transition:.2s ease; }
.mode-card:hover { border-color:var(--amber); background:#191f29; }
.mode-card b { display:block; font-size:1.45rem; margin-bottom:18px; }
.mode-card strong { display:block; }
.mode-card small { display:block; color:var(--muted); margin-top:5px; line-height:1.4; }

.quiz-layout { width:min(820px,100%); margin:0 auto; }
.quiz-top { display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:15px; margin-bottom:24px; }
.back-button { border:1px solid var(--line); background:var(--surface-2); border-radius:12px; padding:11px 14px; cursor:pointer; }
.progress-wrap { min-width:0; }
.progress-label { color:var(--muted); display:flex; justify-content:space-between; font-size:.85rem; margin-bottom:8px; }
.progress-track { height:7px; background:var(--surface-3); border-radius:12px; overflow:hidden; }
.progress-track i { display:block; height:100%; background:linear-gradient(90deg,var(--amber-2),var(--amber)); }
.score-pill { white-space:nowrap; padding:10px 14px; border:1px solid var(--line); border-radius:99px; background:var(--surface-2); }
.score-pill .good { color:var(--green); }.score-pill .bad { color:var(--red); }
.question-card { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:clamp(20px,4vw,34px); box-shadow:var(--shadow); }
.question-tools { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:25px; }
.chapter-pill { padding:8px 12px; border-radius:99px; background:var(--surface-3); color:var(--muted); font-size:.84rem; }
.tool-buttons { display:flex; gap:8px; }
.tool-buttons button { border:1px solid var(--line); background:transparent; width:40px; height:40px; border-radius:12px; cursor:pointer; }
.tool-buttons button.on { color:var(--amber); border-color:var(--amber); }
.question-number { color:var(--amber); font-weight:800; margin-bottom:16px; }
.question-en { font-size:clamp(1.24rem,3vw,1.75rem); line-height:1.5; font-weight:750; margin-bottom:12px; }
.question-zh { color:#b2bfd1; font-size:1.05rem; line-height:1.65; padding-bottom:24px; border-bottom:1px solid var(--line); }
.image-alert { border:1px dashed #805f25; color:#e5bd71; background:rgba(255,173,36,.07); padding:13px 15px; border-radius:13px; margin:18px 0; line-height:1.5; }
.options { display:grid; gap:12px; margin-top:24px; }
.option { width:100%; display:grid; grid-template-columns:45px 1fr; gap:14px; align-items:start; text-align:left; background:var(--surface-2); border:1px solid var(--line); border-radius:17px; padding:18px; cursor:pointer; }
.option:hover:not(:disabled) { border-color:#4d607d; }
.option-letter { display:grid; place-items:center; width:40px; height:40px; border:1px solid #34435a; border-radius:12px; font-weight:800; }
.option strong { display:block; line-height:1.5; }.option small { display:block; color:var(--muted); margin-top:5px; line-height:1.5; font-size:.92rem; }
.option.selected { border-color:var(--blue); background:rgba(104,167,255,.08); }
.option.correct { border-color:var(--green); background:rgba(36,212,119,.1); }
.option.correct .option-letter { background:var(--green); border-color:var(--green); color:#062312; }
.option.wrong { border-color:var(--red); background:rgba(255,95,104,.08); }
.option.wrong .option-letter { background:var(--red); border-color:var(--red); color:#2a0709; }
.explanation { margin-top:24px; background:rgba(36,212,119,.07); border:1px solid rgba(36,212,119,.38); border-radius:18px; padding:22px; }
.explanation.wrong-explain { background:rgba(255,95,104,.06); border-color:rgba(255,95,104,.35); }
.explanation h3 { color:var(--green); margin-bottom:16px; }
.explanation.wrong-explain h3 { color:var(--red); }
.explanation-text { white-space:pre-line; color:#c3cddb; line-height:1.7; }
.quiz-actions { position:sticky; bottom:20px; margin-top:18px; display:grid; grid-template-columns:1fr auto; gap:12px; }

.primary-button,.secondary-button { min-height:52px; border-radius:15px; padding:0 20px; font-weight:800; cursor:pointer; }
.primary-button { color:#181005; border:0; background:linear-gradient(135deg,var(--amber),var(--amber-2)); box-shadow:0 10px 26px rgba(243,138,24,.2); }
.primary-button:disabled { opacity:.42; cursor:not-allowed; }
.secondary-button { border:1px solid var(--line); background:var(--surface-2); }

.progress-page,.account-page,.result-page { width:min(900px,100%); margin:0 auto; }
.metric-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; margin:24px 0; }
.metric { padding:22px; background:var(--surface); border:1px solid var(--line); border-radius:18px; }
.metric strong { display:block; font-size:1.8rem; color:var(--amber); }.metric span { color:var(--muted); }
.panel-card { padding:24px; margin-top:16px; }
.mastery-row { display:grid; grid-template-columns:180px 1fr 55px; gap:14px; align-items:center; padding:13px 0; border-bottom:1px solid rgba(38,52,75,.6); }
.mastery-row:last-child { border-bottom:0; }
.mastery-row .progress-track { height:8px; }
.mastery-row strong { text-align:right; }
.account-card { padding:26px; margin-top:18px; }
.status-line { display:flex; justify-content:space-between; align-items:center; gap:18px; padding:17px 0; border-bottom:1px solid var(--line); }
.status-line:last-child { border-bottom:0; }
.status-badge { color:#f9c86d; background:rgba(255,173,36,.1); border:1px solid rgba(255,173,36,.28); padding:7px 10px; border-radius:99px; white-space:nowrap; }
.setting-controls { display:flex; flex-wrap:wrap; gap:10px; margin-top:14px; }
.choice-button { background:var(--surface-2); border:1px solid var(--line); border-radius:12px; padding:10px 13px; cursor:pointer; }
.choice-button.active { border-color:var(--amber); color:var(--amber); }
.result-hero { text-align:center; padding:32px; background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); }
.result-score { font-size:4.6rem; font-weight:900; color:var(--amber); letter-spacing:-.06em; }
.result-actions { display:flex; justify-content:center; gap:12px; margin-top:22px; }
.empty { color:var(--muted); text-align:center; padding:35px; }

.course-intro { margin:8px 0 28px; }
.course-intro h1 { font-size:clamp(1.8rem,4vw,2.6rem); margin:10px 0; }
.course-catalog { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:20px; }
.course-tile { display:flex; flex-direction:column; min-width:0; padding:26px; border:1px solid var(--line); border-radius:24px; background:var(--surface); }
.course-available { border-color:var(--amber); background:linear-gradient(155deg,rgba(255,173,36,.09),var(--surface) 65%); }
.course-tile-top { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; }
.course-code { font-size:2rem; color:var(--muted); letter-spacing:-.04em; }
.course-available .course-code { color:var(--amber); }
.course-status { font-size:.875rem; color:var(--muted); background:var(--surface-2); padding:6px 10px; border-radius:99px; }
.course-available .course-status { color:var(--amber); }
.course-tile h2 { font-size:1.4rem; margin:26px 0 10px; }
.course-name { margin:0 0 8px; font-size:1rem; }
.course-english { font-size:.875rem; line-height:1.6; margin:0 0 24px; overflow-wrap:anywhere; }
.course-tile-footer { margin-top:auto; }
.course-tile-footer p { font-size:.875rem; }
.course-tile-footer button { width:100%; }
.course-tile-footer button:disabled { cursor:not-allowed; color:var(--muted); }
.course-access-note { margin-top:24px; font-size:.875rem; line-height:1.7; }
.course-breadcrumb { display:flex; align-items:center; flex-wrap:wrap; gap:14px; margin:0 0 20px; }
@media(max-width:900px) { .course-catalog { grid-template-columns:1fr; gap:16px; } .course-tile { padding:22px; } .course-tile h2 { margin-top:16px; } .course-english { margin-bottom:14px; } }
.membership-item { padding:16px 0; border-bottom:1px solid var(--line); }
.membership-item:last-child { margin-bottom:24px; }
.cloud-form select { min-height:52px; width:100%; max-width:100%; padding:12px; background:var(--surface-2); color:var(--text); border:1px solid var(--line); border-radius:13px; font:inherit; }
.legal-consent { min-width:0; margin:0 0 18px; padding:18px; border:1px solid var(--amber); border-radius:16px; }
.legal-consent legend { padding:0 6px; font-weight:700; }
.legal-consent a,.legal-footer a { color:var(--amber); text-decoration:underline; text-underline-offset:3px; }
.legal-consent label { display:flex; align-items:flex-start; gap:12px; margin:18px 0; line-height:1.7; }
.legal-consent input[type="checkbox"] { appearance:auto; flex:0 0 22px; width:22px; height:22px; min-height:22px; padding:0; margin:4px 0 0; accent-color:var(--amber); }
.legal-consent .referral-field { display:grid; gap:9px; }
.legal-consent p,.legal-footer { font-size:.875rem; line-height:1.75; }
.legal-footer { margin-top:28px; }
.cloud-form .security-check { display:flex;align-items:center;gap:12px; }
.security-check input[type="checkbox"] { width:22px;height:22px;flex:0 0 22px;margin:0;accent-color:var(--amber); }
.chapter-progress { display:flex;flex-wrap:wrap;justify-content:space-between;gap:10px;font-size:14px;color:var(--muted);margin-top:18px;border-top:1px solid var(--line);padding-top:16px; }
.chapter-progress progress { flex-basis:100%; }
.history-row>button { flex-shrink:0; }
.feedback-message { white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.8; }
.feedback-resolution { padding:16px;border-left:3px solid var(--amber);background:var(--surface-2);border-radius:8px;margin:16px 0; }
.feedback-resolution small { color:var(--muted); }
.question-report { margin-top:18px; }
.bottom-nav { display:none; }
dialog { border:0; background:transparent; padding:16px; color:var(--text); }
dialog::backdrop { background:rgba(0,0,0,.72); backdrop-filter:blur(5px); }
.dialog-card { width:min(440px,calc(100vw - 32px)); background:var(--surface); border:1px solid var(--line); border-radius:24px; padding:28px; position:relative; box-shadow:var(--shadow); }
.dialog-card h2 { margin:10px 0; }.dialog-card p { color:var(--muted); line-height:1.6; }
.dialog-close { position:absolute; right:16px; top:14px; border:0; background:none; font-size:1.8rem; color:var(--muted); cursor:pointer; }
.dialog-card label { display:block; color:var(--muted); margin:20px 0 12px; }
.dialog-card input { width:100%; margin-top:8px; min-height:52px; padding:0 14px; border:1px solid var(--line); border-radius:13px; background:var(--surface-2); color:var(--text); text-transform:uppercase; }
.dialog-card .primary-button { width:100%; }.form-message { min-height:24px; margin:10px 0 0!important; }

@media (max-width:780px) {
  .topbar { height:auto; min-height:68px; padding:10px 17px; }
  .brand small { display:none; }
  main { padding:20px 16px calc(120px + env(safe-area-inset-bottom)); }
  .hero-grid { grid-template-columns:1fr; }
  .resume-card { flex-direction:row; align-items:center; gap:20px; }
  .resume-card .primary-button { margin:0 0 0 auto; }
  .section-grid { grid-template-columns:1fr; }
  .mode-grid { grid-template-columns:repeat(2,1fr); }
  .metric-grid { grid-template-columns:1fr; }
  .bottom-nav { display:grid; grid-template-columns:repeat(3,1fr); position:fixed; z-index:30; left:0; right:0; bottom:0; padding:8px max(12px,env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left)); background:rgba(11,16,24,.96); border-top:1px solid var(--line); backdrop-filter:blur(18px); }
  .bottom-nav button { border:0; background:none; color:var(--faint); padding:6px; font-size:.75rem; }
  .bottom-nav button span { display:block; font-size:1.25rem; margin-bottom:3px; }.bottom-nav button.active { color:var(--amber); }
  .quiz-top { grid-template-columns:auto 1fr; }.score-pill { display:none; }
  .question-card { padding:20px 16px; }
  .option { padding:15px 13px; grid-template-columns:40px 1fr; gap:10px; }
  .quiz-actions { bottom:76px; }
  .mastery-row { grid-template-columns:1fr 50px; }.mastery-row .progress-track { grid-column:1 / -1; grid-row:2; }
}

@media (max-width:430px) {
  .icon-button { padding:0 10px; }
  .stat-strip { gap:18px; }.stat-strip strong { font-size:1.4rem; }
  .resume-card { align-items:flex-start; }.resume-card .primary-button { min-height:46px; padding:0 14px; }
  .mode-card { min-height:116px; padding:15px; }
  .question-en { font-size:1.2rem; }
  .result-score { font-size:3.8rem; }
}

/* Referral wallet and manual-payment order layout. */
.points-offer{flex-wrap:wrap}.points-offer>.button-row{flex-wrap:wrap;margin:0}.order-id{overflow-wrap:anywhere}.cloud-card details summary{overflow-wrap:anywhere}
