:root {
  color-scheme: light;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  color: #182946;
  background: #f4f7fc;
  font-synthesis: none;
  --ink: #182946;
  --muted: #536884;
  --line: #e5edf7;
  --blue: #2165d6;
  --blue-dark: #164ea9;
  --pale-blue: #edf5ff;
  --width: 860px;
  --exam-width: 720px;
  --gutter: clamp(16px, 4vw, 28px);
  --shadow: 0 5px 22px #1d44700a;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 0; min-height: 100vh; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button, input { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible { outline: 3px solid #70a4f8; outline-offset: 3px; }
[data-focus]:focus { outline: none; }
svg { flex: none; display: block; }
h1, h2, h3, p, ol, ul { margin: 0; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
#app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.content { width: min(100%, var(--width)); padding: 24px var(--gutter) 32px; margin: 0 auto; flex: 1; }
.exam-content { width: min(100%, var(--exam-width)); }
.panel { background: white; border: 1px solid var(--line); border-radius: 19px; box-shadow: var(--shadow); }
.topbar {
  background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2;
  padding-top: env(safe-area-inset-top);
}
.topbar-inner {
  min-height: 64px; max-width: var(--width); padding: 0 var(--gutter); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.topbar-sub { max-width: var(--exam-width); display: grid; grid-template-columns: 1fr auto 1fr; }
.topbar-title { font-size: 17px; font-weight: 750; letter-spacing: .02em; }
.topbar-context {
  justify-self: end; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--muted);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 750; white-space: nowrap; }
.brand-mark {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px;
  background: var(--blue); color: white; box-shadow: 0 4px 10px #2165d630;
}
.topbar-user { display: flex; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0; }
.user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; color: var(--muted); }
.icon-button {
  display: grid; place-items: center; width: 44px; height: 44px; flex: none;
  border: 0; border-radius: 10px; background: transparent; color: var(--ink); padding: 0;
}
.icon-button:hover { background: var(--pale-blue); color: var(--blue); }
.logout { color: var(--muted); }

.cover {
  position: relative; isolation: isolate; display: flex; align-items: center;
  border-radius: 22px; overflow: hidden; min-height: 246px;
  background: #1965c4 url("./assets/study-cover.webp") center 54% / cover no-repeat;
  box-shadow: 0 10px 24px #245ec225; color: white;
}
.cover::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, #0b428dfa 0%, #0b428de8 34%, #0b428d74 69%, transparent 100%);
}
.cover-content { padding: 28px clamp(20px, 5vw, 42px); }
.cover-content > p { color: #e8f4ff; font-size: 13px; font-weight: 650; letter-spacing: .12em; margin-bottom: 10px; }
.cover h1 { font-size: clamp(23px, 5vw, 35px); line-height: 1.36; letter-spacing: .025em; text-shadow: 0 1px 6px #113d6b45; }
.cover-meta { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px; }
.cover-meta span {
  border-radius: 99px; border: 1px solid #fff8; background: #06367554;
  color: #fff; padding: 5px 10px; font-size: 12px; font-weight: 550; white-space: nowrap;
}
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 20px 0; }
.feature-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px; position: relative;
  text-align: left; background: #fff; color: var(--ink); border: 1px solid var(--line);
  border-radius: 17px; padding: 16px; min-height: 122px; box-shadow: var(--shadow);
}
.feature-card:hover { border-color: #8cb6f4; }
.feature-icon { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 12px; }
.blue { background: #eaf3ff; color: #2165d6; }
.violet { background: #f0edff; color: #6245bb; }
.amber { background: #fff2d9; color: #9b5911; }
.feature-copy { display: grid; gap: 4px; }
.feature-copy strong { font-size: 16px; }
.feature-copy small { font-size: 12px; color: var(--muted); line-height: 1.45; }
.feature-arrow { color: #55769d; position: absolute; top: 23px; right: 16px; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 17px 20px; border-bottom: 1px solid var(--line);
}
.panel-head h1, .panel-head h2 { display: flex; align-items: center; gap: 8px; font-size: 17px; }
.panel-head svg { color: var(--blue); }
.panel-head > span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.outline ol { list-style: none; padding: 0 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 22px; }
.outline li { display: flex; align-items: baseline; gap: 9px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 13px; line-height: 1.6; }
.outline li:nth-last-child(-n+2) { border-bottom: 0; }
.unit-number { font-size: 11px; font-weight: 750; color: var(--blue); font-variant-numeric: tabular-nums; }

.login-page { width: min(100%, 1060px); margin: auto; padding: 28px var(--gutter) max(28px, env(safe-area-inset-bottom)); }
.login-brand { margin-bottom: 20px; }
.login-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(310px, 1fr); gap: 18px; }
.login-layout .cover { min-height: 440px; background-position: 57% center; align-items: flex-start; }
.login-layout .cover::before { background: linear-gradient(150deg, #0c438d 0%, #0b428d99 40%, transparent 75%); }
.login-layout .cover-content { padding-top: 38px; }
.login-card { padding: 32px; background: #fff; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.login-card h2 { font-size: 24px; }
.login-intro { color: var(--muted); font-size: 14px; margin: 8px 0 23px; }
.login-card label { font-size: 14px; font-weight: 650; display: block; margin: 0 0 7px; }
.field {
  display: flex; align-items: center; min-height: 50px; padding: 0 12px; gap: 9px;
  border: 1px solid #d9e3ef; border-radius: 12px; color: var(--muted); background: #f8fafd;
  margin-bottom: 17px;
}
.field:focus-within { border-color: #79a9f2; box-shadow: 0 0 0 3px #dceaff; background: white; }
.field input { border: 0; outline: 0; min-width: 0; width: 100%; background: transparent; color: var(--ink); padding: 12px 0; font-size: 16px; }
.field input:focus-visible { outline: 0; }
.field input::placeholder { color: #687c97; font-size: 14px; }
.eye { width: 44px; height: 44px; margin-right: -6px; color: var(--muted); }
.button {
  min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 999px; padding: 10px 18px; font-weight: 700;
  font-size: 15px; line-height: 1.45; text-align: center;
}
.primary { background: var(--blue); color: #fff; }
.primary:hover:not(:disabled) { background: var(--blue-dark); }
.primary:disabled { background: #dce6f5; color: #4f6686; }
.secondary { background: #fff; color: var(--blue-dark); border-color: #c2d8f5; }
.secondary:hover { background: #eff6ff; }
.login-submit { width: 100%; margin-top: 4px; }
.demo-note {
  display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 17px;
  color: var(--muted); font-size: 12px; line-height: 1.5;
}
.demo-note strong { color: var(--blue-dark); letter-spacing: .03em; }
.error { color: #ae3229; font-size: 13px; margin: -5px 0 12px; }

.action-bar {
  position: sticky; bottom: 0; z-index: 1; background: #fffffff5; border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); backdrop-filter: blur(12px);
}
.action-inner { display: flex; gap: 10px; width: min(100%, var(--exam-width)); padding: 12px var(--gutter); margin: auto; }
.action-inner .primary { flex: 1; }
.reading { padding: clamp(19px, 5vw, 36px); }
.reading-head { padding-bottom: 19px; border-bottom: 1px solid var(--line); margin-bottom: 21px; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; color: var(--blue-dark); font-weight: 700; font-size: 13px; }
.reading h1 { text-wrap: balance; font-size: clamp(22px, 5vw, 29px); line-height: 1.45; margin-top: 8px; }
.prose { font-size: 16px; line-height: 1.92; color: #293e59; }
.prose p + p { margin-top: 1em; }
.source {
  margin-top: 23px; padding: 14px 16px; background: #f2f7ff; border-left: 3px solid #78a7ed;
  border-radius: 0 9px 9px 0; font-size: 13px; color: var(--muted); line-height: 1.65;
}
.source strong { color: var(--blue-dark); }
.source p { margin-top: 3px; }
.progress-block { margin: 0 2px 15px; }
.progress-block > div { display: flex; justify-content: space-between; margin-bottom: 9px; font-size: 13px; color: var(--muted); }
.progress-block > div span:first-child { color: var(--blue-dark); font-weight: 700; }
progress {
  display: block; width: 100%; height: 6px; appearance: none; border: 0;
  background: #dce8f9; border-radius: 20px; overflow: hidden; accent-color: var(--blue);
}
progress::-webkit-progress-bar { background: #dce8f9; }
progress::-webkit-progress-value { background: var(--blue); border-radius: 20px; }
progress::-moz-progress-bar { background: var(--blue); border-radius: 20px; }
.question { padding: clamp(16px, 4vw, 28px); }
fieldset { padding: 0; border: 0; margin: 0; min-width: 0; }
.question-meta { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--muted); }
.type-tag { color: var(--blue-dark); background: #eaf3ff; padding: 4px 9px; border-radius: 6px; font-weight: 750; white-space: nowrap; }
.type-tag.multi { color: #6245bb; background: #f0edff; }
.question h1 { font-size: clamp(18px, 4.5vw, 22px); line-height: 1.65; margin: 11px 0 16px; scroll-margin: 90px; }
.question-number { color: var(--blue-dark); font-variant-numeric: tabular-nums; }
.options { display: grid; gap: 9px; }
.option {
  position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr) 18px; align-items: center; gap: 10px;
  min-height: 54px; padding: 10px 12px; border: 1px solid #dfe8f3; border-radius: 17px;
  background: #fff; cursor: pointer; line-height: 1.56; font-size: 15px;
}
.option input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: inherit; }
.option:has(input:focus-visible) { outline: 3px solid #70a4f8; outline-offset: 2px; }
.option:not(:has(input:disabled)):hover { border-color: #87b1f3; }
.option:has(input:disabled) { cursor: default; }
.option-letter {
  display: grid; place-items: center; height: 30px; border-radius: 50%;
  background: #edf3fb; color: #405b7c; font-size: 13px; font-weight: 750;
}
.option:has(input[type="checkbox"]) .option-letter { border-radius: 8px; }
.option-text { overflow-wrap: anywhere; }
.option.is-selected { color: #174b9d; background: #eff6ff; border-color: #83b1f3; }
.option.is-selected .option-letter { background: var(--blue); color: #fff; }
.option.is-correct { color: #14654c; background: #effaf5; border-color: #a1d9c4; }
.option.is-correct .option-letter { background: #d8f2e7; color: #14654c; }
.option.is-wrong { color: #a3352e; background: #fff4f2; border-color: #efbbb5; }
.option.is-wrong .option-letter { background: #fbe1dd; color: #a3352e; }
.feedback {
  margin-top: 16px; padding: 15px; border-radius: 13px; border: 1px solid #f3d5cc;
  background: #fff7f3; color: #673b2c; line-height: 1.65; font-size: 14px;
}
.feedback h2 { display: flex; align-items: center; gap: 7px; color: #a3352e; font-size: 16px; scroll-margin: 78px; }
.feedback h3 { font-size: 14px; margin-top: 10px; }
.answer-summary { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 7px; }
.answer-summary span:last-child strong { color: #14654c; }
.feedback p { margin-top: 3px; }

.centered-card { padding: 32px 21px; text-align: center; }
.center-icon { display: grid; place-items: center; width: 68px; height: 68px; border-radius: 21px; margin: 0 auto 17px; }
.centered-card h1 { font-size: 25px; line-height: 1.4; }
.centered-card > p { font-size: 14px; color: var(--muted); margin-top: 8px; line-height: 1.6; }
.result-counts { max-width: 400px; margin: 24px auto 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.result-counts > div { border-radius: 15px; display: grid; justify-items: center; gap: 3px; padding: 15px 8px; }
.result-counts strong { font-size: 36px; font-variant-numeric: tabular-nums; }
.result-counts span { display: flex; align-items: center; gap: 5px; font-size: 13px; }
.right-count { background: #ebf8f2; color: #14654c; }
.wrong-count { background: #fff1ef; color: #a3352e; }
.centered-card .storage-note { margin-top: 15px; color: #a3352e; }
.listing { overflow: hidden; }
.history-list, .ranking-list { list-style: none; padding: 0 18px; }
.history-list li { display: flex; align-items: center; gap: 10px; min-height: 72px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.history-list li:last-child, .ranking-list li:last-child { border-bottom: 0; }
.history-list .feature-icon { width: 36px; height: 36px; border-radius: 10px; }
.history-entry { flex: 1; display: grid; gap: 4px; }
.history-entry strong { font-size: 14px; }
.history-entry time { font-size: 12px; color: var(--muted); }
.history-counts { display: grid; gap: 4px; text-align: right; font-size: 12px; color: var(--muted); }
.history-counts b { font-variant-numeric: tabular-nums; }
.history-counts span:first-child b { color: #14654c; }
.history-counts span:last-child b { color: #a3352e; }
.ranking-head { padding: 20px; display: flex; gap: 12px; align-items: center; background: linear-gradient(120deg, #edf5ff, #fbfdff); border-bottom: 1px solid var(--line); }
.ranking-head h1 { font-size: 21px; }
.ranking-head p { color: var(--muted); font-size: 13px; margin-top: 4px; line-height: 1.5; }
.rank-columns, .ranking-list li { display: grid; align-items: center; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 8px; }
.rank-columns { background: #f7faff; padding: 10px 18px; color: var(--muted); font-size: 12px; }
.rank-columns span:last-child, .rank-count { text-align: right; }
.ranking-list li { min-height: 56px; border-bottom: 1px solid var(--line); padding: 9px 0; }
.rank { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: #edf3fb; color: var(--muted); font-size: 13px; font-weight: 750; }
.rank-1 { background: #fff0cb; color: #865000; }
.rank-2 { background: #e6effc; color: #3a5e92; }
.rank-3 { background: #ffebde; color: #965128; }
.rank-name { font-weight: 650; font-size: 15px; overflow-wrap: anywhere; }
.rank-name small { color: var(--blue-dark); font-size: 11px; background: #edf5ff; border-radius: 5px; padding: 2px 5px; margin-left: 6px; }
.rank-count { color: var(--muted); font-size: 12px; white-space: nowrap; }
.rank-count strong { color: var(--blue-dark); font-size: 17px; font-variant-numeric: tabular-nums; }
.dialog {
  width: min(360px, calc(100vw - 36px)); padding: 22px; border: 1px solid var(--line);
  border-radius: 19px; color: var(--ink); box-shadow: 0 20px 75px #1533573f;
}
.dialog::backdrop { background: #11274570; }
.dialog h2 { font-size: 19px; }
.dialog p { color: var(--muted); margin: 9px 0 18px; font-size: 14px; line-height: 1.6; }
.dialog-actions { display: flex; gap: 8px; }
.dialog-actions .button { flex: 1; padding-inline: 10px; }

@media (max-width: 650px) {
  .topbar-inner { min-height: 57px; }
  .content { padding-top: 16px; }
  .cover { min-height: 207px; background-position: 62% center; }
  .cover-content { padding: 22px 19px; }
  .cover-meta { margin-top: 15px; }
  .features { grid-template-columns: 1fr; gap: 9px; margin: 15px 0; }
  .feature-card { flex-direction: row; align-items: center; gap: 11px; padding: 11px 13px; min-height: 65px; }
  .feature-arrow { position: static; margin-left: auto; }
  .outline ol { grid-template-columns: 1fr; }
  .outline li:nth-last-child(2) { border-bottom: 1px solid var(--line); }
  .login-page { max-width: 490px; margin: 0 auto; padding-top: max(19px, env(safe-area-inset-top)); }
  .login-brand { margin-bottom: 13px; }
  .login-layout { display: grid; grid-template-columns: 1fr; gap: 12px; }
  .login-layout .cover { min-height: 200px; background-position: 60% center; align-items: center; }
  .login-layout .cover-content { padding-top: 22px; }
  .login-layout .cover::before { background: linear-gradient(90deg, #0b428dfa, #0b428de8 34%, #0b428d74 69%, transparent 100%); }
  .login-card { padding: 21px 18px; }
  .login-card h2 { font-size: 22px; }
  .login-intro { margin-bottom: 17px; }
}
@media (max-width: 360px) {
  .brand { font-size: 15px; gap: 6px; }
  .cover-content { padding-inline: 15px; }
  .cover h1 { font-size: 21px; }
  .option { grid-template-columns: 28px minmax(0, 1fr) 16px; padding-inline: 8px; gap: 8px; }
  .option-letter { height: 28px; }
  .action-inner .button { padding-inline: 12px; }
}

.field select { width: 100%; min-width: 0; min-height: 48px; padding: 6px 0; background: transparent; color: var(--ink); border: 0; font: inherit; }
.login-layout .cover { min-height: 480px; }
.today-panel { margin-top: 18px; padding: 18px 20px; }
.today-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.today-heading h2 { font-size: 17px; }
.today-heading time, .today-panel p, .unit-title { color: var(--muted); font-size: 13px; }
.today-panel h3 { margin: 4px 0 6px; font-size: 18px; }
.unit-title { margin-top: 7px; }
.listing-empty { padding: 28px 20px; text-align: center; color: var(--muted); }
.action-inner { flex-wrap: wrap; }
.action-error { flex-basis: 100%; margin: 0; }
.centered-card .button { margin-top: 16px; }
.history-entry { min-width: 0; }
.history-counts { flex: none; }
@media (max-width: 650px) {
  .login-layout .cover { min-height: 200px; }
  .today-panel { margin-top: 14px; }
}
