/* 信息学与编程：柔和画布、清晰层级、轻量探索元素。功能布局沿用 styles.css。 */
:root {
  --exam-header-top: 80px;
  --canvas: #f7f8f4; --canvas-2: #edf2ec; --surface: #fff;
  --ink: #243f38; --ink-soft: #53665f; --muted: #6d7d75;
  --border: #dce5dd; --border-soft: #e7ece5;
  --primary: #217665; --primary-dark: #185c4e; --primary-soft: #e2f1e8; --primary-ink: #174d40;
  --accent: #edbf62; --accent-dark: #896323; --accent-soft: #fff5db;
  --success: #24845e; --success-soft: #e0f4e7; --danger: #c44248; --danger-soft: #ffeded;
  --code-bg: #f3f6f1; --code-ink: #2b4c43;
  --shadow-sm: 0 2px 3px #253f3803; --shadow-md: 0 6px 20px #253f380a; --shadow-lg: 0 20px 70px #193d3826;
  --r-sm: 12px; --r-md: 18px; --r-lg: 24px;
}
body { font-size: 14px; line-height: 1.6; }
a { color: var(--primary); }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
.ui-icon { width: 22px; height: 22px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.skip-link { position: fixed; z-index: 100; top: -60px; left: 12px; padding: 8px 16px; background: var(--primary); color: white; border-radius: 8px; }
.skip-link:focus { top: 8px; }
.topbar { height: 80px; padding: 0 30px; background: #fff; color: var(--ink); box-shadow: none; border-bottom: 1px solid var(--border-soft); }
.brand { opacity: 1; font-size: 19px; font-weight: 800; letter-spacing: .5px; gap: 11px; text-decoration: none; color: var(--ink); }
.brand::before { display: none; }
.brand-mark { display: grid; place-items: center; width: 43px; height: 43px; border-radius: 14px; background: var(--primary); color: #e0f1c7; font: 700 19px var(--mono); transform: rotate(-5deg); }
.brand small { display: block; font-size: 10px; color: var(--muted); font-weight: 500; letter-spacing: 1px; margin-top: 1px; }
.topbar-note { color: var(--muted); font-size: 12px; margin-right: 18px; }
.topbar-right { gap: 12px; }
.account-chip { height: 40px; background: #f8faf6; border-color: var(--border-soft); color: var(--ink); font-size: 13px; }
.account-chip:hover, .account-chip[aria-expanded="true"] { background: var(--primary-soft); }
.user-avatar { background: #f6dfaa; color: #685126; width: 30px; height: 30px; }
.layout { min-height: calc(100vh - 80px); }
.sidebar { position: sticky; top: 80px; height: calc(100dvh - 80px); overflow-y: auto; width: 220px; padding: 20px 16px 16px; gap: 5px; border-right-color: var(--border-soft); }
.nav-label { font-size: 10px; font-weight: 600; letter-spacing: 1.5px; color: var(--muted); margin: 10px 14px 9px; }
.nav-label:not(:first-child) { margin-top: 24px; }
.sidebar a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin: 0; font-size: 14px; font-weight: 550; min-height: 46px; }
.sidebar a.active { background: var(--primary); color: #fff; box-shadow: 0 4px 9px #21766517; }
.sidebar a.active::before { display: none; }
.sidebar a.active::after { content: ''; width: 5px; height: 5px; border-radius: 50%; background: #c9e9a7; margin-left: auto; }
.sidebar .ui-icon { width: 19px; height: 19px; }
.sidebar-note { position: relative; background: #f5f5e9; border: 1px solid #ededdc; border-radius: 16px; padding: 18px 14px 12px; margin: 26px 4px 12px; }
.sidebar-note > .ui-icon { color: #958141; margin-bottom: 9px; }
.sidebar-note strong { display: block; font-size: 12px; }
.sidebar-note p { color: var(--muted); font-size: 11px; line-height: 1.8; margin: 6px 0 0; }
.nav-spacer { flex: 1; min-height: 20px; }
.nav-divider { border-top: 1px solid var(--border-soft); margin-bottom: 8px; }
.sidebar-footer { font-size: 10px; color: var(--muted); padding: 12px 14px 0; }
.sidebar-language { flex-shrink: 0; }
.language-chip {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px;
  padding: 10px 14px; border: 0; border-radius: var(--r-md);
  background: transparent; color: var(--ink-soft); font: inherit; font-size: 14px;
  font-weight: 550; cursor: pointer; white-space: nowrap;
}
.language-chip:hover, .language-chip[aria-expanded="true"] { background: var(--canvas-2); color: var(--primary-dark); }
.language-chip .chev { margin-left: auto; font-size: 11px; }
.language-symbol { width: 19px; font-size: 11px; font-weight: 600; }
.account-menu.language-options { position: fixed; top: auto; right: auto; width: 200px; z-index: 100; }
@media (max-width: 760px) {
  .language-chip { min-height: 34px; padding: 6px 10px; font-size: 12px; gap: 6px; }
}
.view { min-width: 0; width: 100%; max-width: 1440px; margin: 0 auto; padding: 28px 38px 40px; }
.view h2 { font-size: 24px; letter-spacing: -.5px; }
.view h2::before { display: none; }
.view h3 { font-weight: 700; }
.view > .toolbar { margin-bottom: 24px; }
.view:focus { outline: none; }
.eyebrow { font-size: 11px; letter-spacing: 1.4px; color: var(--muted); font-weight: 600; }
.welcome-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 22px; }
.welcome-header h1 { font-size: 27px; line-height: 1.5; margin: 3px 0 0; letter-spacing: -.5px; overflow-wrap: anywhere; }
.welcome-meta { display: flex; align-items: center; gap: 14px; font-size: 11px; color: var(--muted); flex-shrink: 0; }
.language-pill { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--border); color: var(--ink-soft); border-radius: 9px; padding: 4px 9px; font-size: 12px; }
.language-pill .ui-icon { width: 16px; height: 16px; }
.exploration-hero { display: grid; grid-template-columns: 1.3fr 1fr; position: relative; isolation: isolate; overflow: hidden; background: #deeee0; border: 1px solid #d1e3d3; border-radius: 24px; min-height: 285px; }
.exploration-hero::after { content: ''; position: absolute; inset: 0; z-index: -1; background-image: radial-gradient(#74a18c2b .8px, transparent .8px); background-size: 18px 18px; mask-image: linear-gradient(90deg, transparent 40%, black); }
.hero-copy { padding: 29px 0 25px 32px; z-index: 1; }
.hero-label { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: #386a51; }
.hero-label .ui-icon { width: 16px; height: 16px; }
.view .hero-copy h2 { display: block; margin: 13px 0 12px; font-size: clamp(27px, 2.6vw, 40px); line-height: 1.45; font-weight: 800; letter-spacing: -1px; color: #244b3e; }
.hero-emphasis { position: relative; z-index: 0; white-space: nowrap; }
.hero-emphasis::after { content: ''; position: absolute; bottom: 1px; height: 11px; background: #edce79; left: 0; right: 0; z-index: -1; border-radius: 60% 35%; transform: rotate(-3deg); }
.hero-copy > p { font-size: 14px; color: #526e5e; max-width: 27em; line-height: 1.85; margin: 0 0 19px; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; }
a.hero-cta { display: inline-flex; align-items: center; gap: 16px; padding: 11px 18px; box-shadow: 0 3px 0 #164e43; }
.hero-secondary { display: inline-flex; align-items: center; gap: 7px; color: #315f4e; font-weight: 600; font-size: 12px; text-decoration: none; }
.hero-secondary:hover { text-decoration: underline; }
.hero-actions .ui-icon { width: 17px; height: 17px; }
.hero-footnote { color: #5b7666; margin-top: 16px; font-size: 11px; }
.hero-art { position: relative; display: flex; align-items: center; justify-content: center; min-width: 0; }
.hero-art img { width: 115%; max-width: 480px; height: auto; margin-left: -10px; animation: explorer-arrive .7s ease-out both; }
.art-caption { position: absolute; bottom: 19px; left: 50%; transform: translateX(-50%) rotate(-3deg); color: #3a705b; font: 9px var(--mono); letter-spacing: 2px; white-space: nowrap; }
.growth-strip { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-top: 18px; }
.growth-stat { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 17px 15px; background: #fff; border: 1px solid var(--border-soft); border-radius: 16px; }
.tone-mint { --tone-bg: #e5f2e8; --tone-ink: #28715a; }
.tone-lavender { --tone-bg: #eeebf8; --tone-ink: #7862a3; }
.tone-peach { --tone-bg: #fbefdc; --tone-ink: #926a29; }
.tone-blue { --tone-bg: #e7f0f7; --tone-ink: #497994; }
.stat-icon { width: 40px; height: 44px; border-radius: 12px; background: var(--tone-bg); color: var(--tone-ink); display: grid; place-items: center; flex-shrink: 0; }
.stat-icon .ui-icon { width: 21px; height: 21px; }
.stat-label { color: var(--muted); font-size: 12px; }
.stat-value { font-size: 21px; color: var(--ink); font-weight: 750; line-height: 1.5; }
.stat-sub { font-size: 11px; color: var(--muted); }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 28px 0 14px; }
.view .section-heading h2 { font-size: 18px; margin: 0; }
.section-heading > span { color: var(--muted); font-size: 11px; }
.exploration-entries { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 15px; }
.entry-card { display: block; text-decoration: none; background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 19px 21px; color: var(--ink); transition: transform .18s, box-shadow .18s, border-color .18s; }
.entry-card:hover { transform: translateY(-4px); border-color: var(--tone-ink); box-shadow: 0 9px 20px #253f380b; }
.entry-top { display: flex; gap: 10px; align-items: center; }
.entry-icon { display: grid; place-items: center; width: 38px; height: 38px; background: var(--tone-bg); color: var(--tone-ink); border-radius: 12px; transform: rotate(-5deg); }
.entry-tag { font-size: 10px; color: var(--tone-ink); font-weight: 600; }
.entry-arrow { margin-left: auto; width: 17px; height: 17px; color: var(--muted); transition: transform .18s; }
.entry-card:hover .entry-arrow { transform: translateX(3px); }
.view .entry-card h3 { margin: 15px 0 5px; font-size: 16px; }
.entry-card p { color: var(--muted); font-size: 13px; line-height: 1.85; margin: 0; }
.panel { padding: 21px 23px; }
.panel-head { gap: 12px; }
.panel-head h3 { font-size: 15px; }
.panel-link { font-size: 12px; }
.plan-empty { min-height: 132px; }
.plan-empty > div:last-child { line-height: 1.85; font-size: 13px !important; }
.friendly-empty { padding: 20px 8px 15px; display: flex; flex-direction: column; align-items: center; }
.friendly-empty > .ui-icon { width: 42px; height: 42px; margin-bottom: 12px; color: #76a591; }
.friendly-empty strong { font-size: 13px; color: var(--ink-soft); }
.friendly-empty p { font-size: 13px; max-width: 24em; margin: 7px 0 12px; }
.empty { font-size: 13px; line-height: 1.85; }
.thinking-note { display: flex; align-items: center; gap: 16px; margin-top: 22px; padding: 17px 22px; border-radius: 16px; background: #f1f0e4; }
.thinking-icon { color: #82773c; }
.view .thinking-note h3 { font-size: 13px; margin: 0 0 3px; }
.thinking-note p { font-size: 11px; color: var(--muted); margin: 0; }
.thinking-note .panel-link { margin-left: auto; flex-shrink: 0; }
.btn, .btn-ghost, .btn-danger { min-height: 40px; font-size: 13px; border-radius: 10px; padding: 9px 16px; }
.btn { box-shadow: 0 2px 0 #164e43; }
.btn:hover { box-shadow: 0 4px 9px #21766526; }
button:disabled { cursor: not-allowed; opacity: .55; transform: none; box-shadow: none; }
input, select, textarea { border-color: #d8e2d8; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); }
.modal-box { border: 1px solid var(--border); border-radius: 24px; }
.toast { max-width: calc(100vw - 32px); text-align: center; }
/* 页头：一条紧凑的横条，把空间留给内容 */
.page-intro { display: flex; justify-content: flex-start; align-items: center; gap: 14px; padding: 14px 20px; border: 1px solid var(--border-soft); border-radius: 16px; margin-bottom: 18px; background: var(--tone-bg); }
.page-intro > div:first-child { min-width: 0; }
.page-intro h2 { margin: 1px 0 3px; font-size: 20px; line-height: 1.35; }
.page-intro p { margin: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.6; }
.page-intro .eyebrow { color: var(--tone-ink); font-size: 10px; }
.intro-symbol { order: -1; display: grid; place-items: center; flex-shrink: 0; width: 44px; height: 44px; background: #ffffff99; border: 1px solid #fff; border-radius: 12px; color: var(--tone-ink); }
.intro-symbol .ui-icon { width: 22px; height: 22px; }
.qp-grid { gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
.qp-card { padding: 24px; min-height: 230px; border: 1px solid var(--border); position: relative; }
.qp-art { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; color: var(--tone-ink); }
.qp-art > .ui-icon { width: 42px; height: 42px; padding: 9px; box-sizing: content-box; background: var(--tone-bg); border-radius: 18px; transform: rotate(-6deg); }
.qp-art span { color: var(--muted); font: 11px var(--mono); }
.qp-title { font-size: 18px; white-space: normal; }
.qp-why { font-size: 13px; margin-top: 4px; line-height: 1.8; }
.qp-card.off { background: #f4f5f0; border-style: dashed; }
.qp-card.off .qp-art { opacity: .6; }
.qp-foot { padding-top: 22px; }
.qp-head { margin-bottom: 17px; }
.exam-card { border-top: 4px solid #a8d6bc; }
.exam-card:nth-child(3n+2) { border-top-color: #d4c5e8; }
.exam-card:nth-child(3n) { border-top-color: #ead39b; }
.ec-entry { border-radius: 12px; }
.learn-side { top: 100px; }
.learn-main { line-height: 1.8; }
pre { border-left-width: 3px; font-size: 14px; }
.opt.selected { box-shadow: 0 2px 10px #2176651c; }
.list-card { flex-wrap: wrap; }
.list-card .lc-main { min-width: min(220px,100%); }
.segmented button.active, .segmented a.active { box-shadow: 0 2px 4px #2176651a; }
.welcome-onboarding { display: flex; align-items: center; background: var(--primary-soft); padding: 8px 14px; border-radius: 16px; margin-bottom: 18px; }
.welcome-onboarding img { width: 125px; height: auto; margin-left: -20px; }
.welcome-onboarding p { margin: 0; color: var(--ink-soft); font-size: 13px; }
@keyframes explorer-arrive { from { transform: translateY(8px) rotate(-3deg); } to { transform: none; } }
@media (min-width: 1550px) { .view { padding-left: 50px; padding-right: 50px; } }
@media (max-width: 1150px) {
  .sidebar { width: 196px; padding-left: 12px; padding-right: 12px; }
  .view { padding: 25px; }
  .hero-copy { padding-left: 25px; }
  .growth-stat { gap: 9px; padding: 14px 11px; }
  .stat-icon { width: 32px; height: 38px; }
  .stat-sub { font-size: 10px; }
  .stat-value { font-size: 19px; }
  .welcome-meta > span:first-child { display: none; }
  .entry-card { padding: 18px 16px; }
  .topbar-note { display: none; }
}
@media (max-width: 960px) {
  .growth-strip { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .hero-art img { width: 135%; }
  .exploration-hero { grid-template-columns: 1.5fr 1fr; }
  .hero-actions { gap: 14px; }
  .hero-secondary { font-size: 11px; }
  .entry-tag { display: none; }
  .thinking-note { flex-wrap: wrap; }
  .thinking-note .panel-link { margin-left: 38px; }
}
@media (max-width: 760px) {
  :root { --exam-header-top: 123px; }
  .topbar { height: 68px; padding: 0 16px; gap: 10px; }
  .brand { display: flex; font-size: 16px; gap: 8px; min-width: 0; overflow: visible; }
  .brand-mark { width: 34px; height: 34px; font-size: 16px; border-radius: 11px; }
  .brand small { display: none; }
  .topbar-right { gap: 5px; }
  .account-chip { font-size: 11px; height: 35px; max-width: 140px; }
  .account-chip .name { max-width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .group-chip { padding: 0 8px; }
  .user-avatar { width: 25px; height: 25px; }
  .layout { min-height: calc(100vh - 68px); }
  .sidebar { top: 68px; z-index: 20; position: sticky; height: auto; width: 100%; flex-direction: row; gap: 5px; padding: 8px 12px; overflow-x: auto; border-bottom: 1px solid var(--border); scrollbar-width: none; }
  .sidebar::-webkit-scrollbar { display: none; }
  .sidebar a { min-height: 38px; padding: 8px 12px; font-size: 12px; gap: 6px; }
  .sidebar .ui-icon { width: 16px; height: 16px; }
  .sidebar a.active::after { display: none; }
  .nav-label, .sidebar-note, .nav-spacer, .nav-divider, .sidebar-footer { display: none; }
  .view { padding: 22px 18px 32px; }
  .welcome-header { margin-bottom: 17px; gap: 10px; }
  .welcome-header h1 { font-size: 24px; }
  .eyebrow { font-size: 9px; }
  .exploration-hero { grid-template-columns: 1.4fr 1fr; min-height: 270px; }
  .hero-copy { padding: 23px 0 23px 22px; }
  .view .hero-copy h2 { font-size: 28px; }
  .hero-copy > p { max-width: 22em; }
  .hero-art img { width: 140%; }
  .art-caption { display: none; }
  .hero-actions { gap: 12px; }
  .hero-actions .hero-cta { font-size: 12px; padding: 10px 14px; }
  .growth-strip { gap: 10px; margin-top: 14px; }
  .growth-stat { padding: 14px; }
  .stat-icon { width: 35px; height: 39px; }
  .section-heading { margin-top: 24px; }
  .section-heading > span { font-size: 10px; }
  .exploration-entries { gap: 10px; }
  .entry-card { padding: 15px 12px; }
  .view .entry-card h3 { font-size: 14px; }
  .entry-card p { font-size: 12px; }
  .entry-icon { width: 32px; height: 32px; }
  .entry-icon .ui-icon { width: 19px; height: 19px; }
  .entry-arrow { width: 14px; height: 14px; }
  .dash-grid { grid-template-columns: 1fr; }
  .panel { padding: 19px; }
  .page-intro { padding: 12px 16px; gap: 12px; }
  .page-intro p { font-size: 12px; }
  .learn-side { top: 0; }
  .qp-card { min-height: 210px; }
  .account-menu { max-width: calc(100vw - 32px); }
  .group-menu { right: -80px; }
  .view .toolbar { gap: 12px; }
  .modal-mask { padding: 12px; }
  .modal-box { width: 100%; padding: 22px; }
}
@media (max-width: 480px) {
  .topbar { padding: 0 12px; }
  .brand { font-size: 14px; gap: 6px; }
  .brand-mark { width: 29px; height: 31px; font-size: 13px; }
  .account-chip { gap: 4px; padding-right: 7px; }
  .group-chip .gc-suffix { display: none; }
  .view { padding: 20px 14px 30px; }
  .exploration-hero { display: block; min-height: 0; }
  .hero-copy { padding: 24px 21px; }
  .view .hero-copy h2 { font-size: 29px; position: relative; z-index: 1; }
  .hero-copy > p { max-width: 18em; padding-right: 22px; }
  .hero-art { position: absolute; width: 150px; right: -16px; top: 38px; opacity: 1; z-index: -1; }
  .hero-art img { width: 180px; max-width: none; }
  .hero-label { font-size: 10px; }
  .hero-actions { gap: 15px; }
  .hero-secondary { font-size: 10px; gap: 3px; }
  .hero-footnote { font-size: 10px; }
  .stat-value { font-size: 20px; }
  .stat-sub { font-size: 10px; }
  .stat-icon { width: 29px; height: 35px; }
  .growth-stat { padding: 13px 10px; gap: 9px; }
  .exploration-entries { grid-template-columns: 1fr; }
  .entry-card { display: grid; grid-template-columns: 43px 1fr; column-gap: 12px; padding: 17px; position: relative; }
  .entry-top { grid-column: 1; grid-row: 1 / 3; }
  .entry-icon { width: 42px; height: 44px; }
  .entry-arrow { position: absolute; right: 18px; top: 24px; }
  .view .entry-card h3 { margin: 0 20px 4px 0; }
  .entry-card p { grid-column: 2; font-size: 12px; padding-right: 15px; }
  .section-heading > span { display: none; }
  .thinking-note { padding: 17px; gap: 12px; }
  .thinking-note > div { flex: 1; min-width: 0; }
  .thinking-note .panel-link { margin-left: 34px; }
  .page-intro h2 { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
@media print {
  .topbar, .sidebar, .hero-art, .exploration-entries, .thinking-note { display: none; }
  .view { max-width: none; padding: 0; }
  .layout { display: block; }
  .panel, .card { break-inside: avoid; box-shadow: none; }
}

/* Keep long code and question images within the reading column. */
.qcard .qstem { min-width: 0; overflow-wrap: anywhere; }
.qcard .qtype { flex-shrink: 0; white-space: nowrap; }
.qstem img, .group-material img { max-width: 100%; height: auto; }
.opt > span { min-width: 0; overflow-wrap: anywhere; }
.opt .opt-key { flex-shrink: 0; }
.result-companion { display: block; width: 200px; max-width: 100%; height: auto; margin: -16px auto -6px; }
@media (max-width: 760px) {
  .qcard { padding: 18px 14px; }
  .qcard .qhead { display: grid; grid-template-columns: auto 1fr; align-items: center; }
  .qcard .qtype { justify-self: start; }
  .qcard .qstem { grid-column: 1 / -1; font-size: 15px; }
  .qcard .qstem pre { max-width: 100%; }
}
@media (max-width: 480px) {
  /* Give the companion its own space instead of overlapping the headline. */
  .hero-copy { padding-bottom: 12px; }
  .hero-art { position: relative; inset: auto; width: 100%; height: 145px; margin-top: -8px; z-index: 0; }
  .hero-art img { width: 240px; margin: 0; }
  .hero-copy > p { max-width: none; padding-right: 0; }
  .growth-stat { display: block; position: relative; padding: 14px; }
  .growth-stat > div { width: 100%; }
  .stat-icon { position: absolute; top: 12px; right: 10px; width: 25px; height: 27px; border-radius: 8px; }
  .stat-icon .ui-icon { width: 16px; height: 16px; }
  .stat-label { font-size: 11px; padding-right: 25px; }
  .stat-value { font-size: 18px; margin: 7px 0 2px; }
  .stat-sub { font-size: 10px; }
}
.stat-value-part { display: inline-block; }

/* Desktop navigation owns its scroll area; the document scrolls only the content beside it. */
@media (min-width: 761px) {
  .layout { padding-left: 220px; }
  .sidebar { position: fixed; left: 0; top: 80px; bottom: 0; height: auto; z-index: 20; overscroll-behavior: contain; }
}
@media (min-width: 761px) and (max-width: 1150px) { .layout { padding-left: 196px; } }

.exam-command { position: sticky; top: var(--exam-header-top); z-index: 15; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 14px 20px; box-shadow: 0 5px 16px #243f3810; }
.exam-command-heading { display: flex; align-items: center; gap: 20px; justify-content: space-between; }
.view .exam-command-heading h3 { margin: 0; font-size: 16px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exam-clock { display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
.exam-command-tools { display: flex; gap: 18px; align-items: center; margin-top: 10px; }
.exam-progress { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.exam-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.exam-actions .btn { padding-left: 24px; padding-right: 24px; }
.exam-abandon { background: none; border: none; color: var(--muted); font: inherit; padding: 9px 12px; cursor: pointer; min-height: 40px; border-radius: 10px; }
.exam-abandon:hover { background: var(--danger-soft); color: var(--danger); }
.exam-context { margin: 14px 4px 0; line-height: 1.8; }
.exam-questions { max-width: 860px; margin: 0 auto; padding: 12px 16px 28px; }
@media (max-width: 960px) { .exam-progress .progress { display: none; } }
@media (max-width: 760px) {
  .exam-command { padding: 12px; border-radius: 12px; }
  .view .exam-command-heading h3 { font-size: 13px; }
  .exam-command-heading { gap: 10px; }
  .exam-command-tools { gap: 8px; }
  .exam-actions { gap: 5px; }
  .exam-actions .btn, .exam-actions .btn-ghost { padding: 8px 10px; font-size: 12px; }
  .exam-abandon { padding: 8px 5px; font-size: 12px; }
  .exam-clock { gap: 4px; }
  .exam-clock .kicker { font-size: 10px; }
  .exam-questions { padding: 10px 0 24px; }
}

.event-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; margin: 0 0 25px; background: #eef2eb; border: 1px solid var(--border-soft); border-radius: 14px; width: fit-content; max-width: 100%; }
.event-tabs a { display: flex; align-items: center; justify-content: center; gap: 9px; border-radius: 10px; padding: 10px 24px; color: var(--ink-soft); font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.event-tabs a.active { color: var(--primary-dark); background: white; box-shadow: 0 2px 6px #243f380c; }
.event-tabs a:hover { color: var(--primary-dark); background: #ffffffa0; }
.event-tabs .ui-icon { width: 18px; height: 18px; }
@media (max-width: 480px) {
  .event-tabs { width: 100%; gap: 2px; padding: 5px; }
  .event-tabs a { flex: 1; padding: 9px 7px; gap: 5px; font-size: 12px; }
  .event-tabs .ui-icon { width: 16px; height: 16px; }
}

/* A direction for each practice session. */
.goal-card { margin: 20px 0; padding: 28px; border: 1px solid #dde6df; border-radius: 24px; background: #fff; box-shadow: 0 5px 20px #183f3010; min-width: 0; }
.goal-card.is-current { background: linear-gradient(120deg,#f1fbf3,#fffdf1); border-color: #bddfc7; }
.goal-card-head,.goal-actions,.goal-filter,.goal-result-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.goal-card-head .eyebrow { display: flex; align-items: center; gap: 8px; }
.goal-card h2 { font-size: 25px; margin: 14px 0 6px; overflow-wrap: anywhere; }
.goal-date,.goal-note { color: var(--muted); font-size: 13px; line-height: 1.7; }
.goal-intention { border-left: 3px solid #78ad85; padding-left: 12px; line-height: 1.7; }
.goal-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; margin: 23px 0 18px; }
.goal-metrics strong { display: block; font-size: 27px; color: #204f39; font-variant-numeric: tabular-nums; }
.goal-metrics span { display: block; color: var(--muted); font-size: 12px; margin-top: 5px; }
.goal-card progress { display: block; width: 100%; height: 9px; border: 0; border-radius: 8px; overflow: hidden; background: #e3ecdf; accent-color: #368a59; }
.goal-card progress::-webkit-progress-bar { background: #e3ecdf; }
.goal-card progress::-webkit-progress-value { background: #368a59; border-radius: 8px; }
.goal-actions { justify-content: flex-start; margin-top: 18px; }
.goal-empty { display: flex; align-items: center; gap: 22px; margin: 22px 0; padding: 28px; background: #f3f5fd; border: 1px dashed #b9c3e1; border-radius: 24px; }
.goal-empty > .ui-icon { flex-shrink: 0; width: 44px; height: 44px; color: #6564ac; }
.goal-empty > div { flex: 1; }
.goal-empty h2 { margin: 0 0 8px; font-size: 23px; }
.goal-empty p { margin: 0; color: var(--muted); line-height: 1.7; }
.goal-form { display: grid; gap: 12px; }
.goal-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.goal-field { display: grid; gap: 6px; margin: 7px 0; font-size: 14px; }
.goal-field input,.goal-field select,.goal-field textarea { min-width: 0; width: 100%; box-sizing: border-box; }
.goal-field textarea { resize: vertical; }
.goal-scope-summary { padding: 12px; background: #f2f6ef; border-radius: 12px; }
.goal-kp-picker { max-height: 245px; overflow: auto; border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px; }
.goal-kp-picker details { padding: 8px 0; }
.goal-kp-picker summary { cursor: pointer; font-weight: 600; }
.goal-kp-picker label { display: flex; gap: 8px; align-items: center; padding: 7px; }
.goal-kp-picker input { width: 17px; height: 17px; }
.goal-history > summary { cursor: pointer; font-weight: 700; padding: 18px 0; }
.goal-filter { margin-bottom: 20px; padding: 16px 20px; background: #fff; border-radius: 16px; border: 1px solid var(--border); }
.goal-filter label { display: flex; gap: 14px; align-items: center; min-width: 0; }
.goal-filter select { max-width: 450px; min-width: 160px; }
.goal-detail { margin: 20px 0; }
.goal-detail > .goal-note { padding: 0 18px; }
.goal-next { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px; font-size: 13px; }
.goal-next a { padding: 5px 10px; border-radius: 20px; background: #eff7f0; }
.goal-table-wrap { overflow: auto; }
.goal-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.goal-table th,.goal-table td { padding: 14px 18px; text-align: left; border-bottom: 1px solid #edf0eb; }
.goal-table th { background: #fafbf7; color: var(--muted); font-weight: 500; }
.goal-result-banner,.goal-paper-label { padding: 14px 18px; border-radius: 14px; background: #edf8ef; color: #2e6842; margin-bottom: 16px; }
@media(max-width:700px) {
  .goal-card { padding: 20px; border-radius: 20px; }
  .goal-card h2 { font-size: 21px; }
  .goal-metrics { grid-template-columns: 1fr 1fr; }
  .goal-metrics strong { font-size: 23px; }
  .goal-empty { flex-wrap: wrap; padding: 20px; gap: 14px; }
  .goal-empty > div { flex-basis: 70%; }
  .goal-form-grid { grid-template-columns: 1fr; }
  .goal-filter label { width: 100%; flex-wrap: wrap; }
  .goal-filter select { width: 100%; max-width: 100%; }
  .goal-table th,.goal-table td { padding: 10px; min-width: 85px; }
}
/* Long goal titles in recent papers must not expand the dashboard grid. */
.dash-grid > * { min-width: 0; }
.dash-grid .act-title,.dash-grid .lc-title { overflow-wrap: anywhere; }
@media(max-width:760px) { .dash-grid { grid-template-columns: minmax(0,1fr); } }

/* The goal is global context; page actions stay in the page. */
:root { --shell-height: 72px; --mobile-nav-height: 54px; --exam-header-top: var(--shell-height); }
.app-header { position: sticky; top: 0; z-index: 40; background: var(--surface); }
.app-header .topbar { position: relative; top: auto; height: 72px; z-index: 2; }
.app-header .topbar-note { display: none; }
.sidebar { top: var(--shell-height); }
.layout { min-height: calc(100dvh - var(--shell-height)); }
.learning-focus { display: flex; align-items: center; gap: 28px; padding: 32px; border: 1px solid #d0e2d3; border-radius: 24px; background: #e2efe0; }
.learning-focus-copy { flex: 1; min-width: 0; }
.view .learning-focus h2 { display: block; margin: 10px 0; font-size: clamp(23px,2.4vw,32px); line-height: 1.45; }
.learning-focus p { max-width: 44em; color: #536b5c; line-height: 1.9; margin: 0 0 22px; overflow-wrap: anywhere; }
.learning-focus > img { width: 210px; height: auto; flex-shrink: 0; }
.learning-focus .hero-cta { display: inline-flex; align-items: center; gap: 22px; }
.learning-grid { margin-top: 24px; align-items: start; grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
.learning-topics { display: grid; gap: 8px; margin-top: 16px; }
.learning-topics a { display: flex; align-items: center; gap: 10px; padding: 12px; background: #f4f7f1; border-radius: 12px; font-size: 13px; text-decoration: none; }
.learning-topics a span { flex: 1; }
.learning-topics .ui-icon { width: 17px; height: 17px; }
.learning-other { margin-top: 24px; }
.learning-other > summary { padding: 14px 0; cursor: pointer; font-weight: 600; color: var(--muted); }
.learning-other .panel { margin-top: 8px; }
.pw-card { scroll-margin-top: calc(var(--exam-header-top) + 12px); }
@media(min-width:761px) {
  .learn-side { top: calc(var(--shell-height) + 12px); max-height: calc(100dvh - var(--shell-height) - 24px); }
}
@media(max-width:1000px) {
  .learning-focus > img { width: 155px; }
  .learning-focus { padding: 24px; gap: 15px; }
}
@media(max-width:760px) {
  :root { --exam-header-top: calc(var(--shell-height) + var(--mobile-nav-height)); }
  .app-header .topbar { height: 60px; }
  .sidebar { padding: 6px 12px; }
  .sidebar a { min-height: 34px; padding: 6px 10px; }
  .learning-grid { grid-template-columns: minmax(0,1fr); gap: 16px; margin-top: 18px; }
  .learning-focus { padding: 22px; position: relative; overflow: hidden; }
  .learning-focus > img { position: absolute; width: 100px; right: 8px; top: 5px; opacity: .55; }
  .learning-focus .eyebrow { display: block; min-height: 28px; }
  .learning-focus-copy { position: relative; z-index: 1; }
  .view .learning-focus h2 { font-size: 23px; padding-right: 22px; }
}
@media print { .app-header { display: none; } }

/* One header row: goal → group → account. */
.goal-switcher { min-width: 0; }
.account-chip.goal-chip { width: clamp(210px,24vw,330px); max-width: none; height: 50px; padding: 6px 12px; border-radius: 14px; gap: 10px; background: #f0f7ed; border-color: #dbe8d7; }
.goal-chip-body { flex: 1; min-width: 0; display: grid; gap: 3px; }
.goal-chip-title { display: flex; gap: 7px; align-items: baseline; min-width: 0; text-align: left; }
.goal-chip-label { font-size: 10px; color: var(--muted); flex-shrink: 0; }
.goal-chip-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; }
.goal-chip-progress { display: flex; align-items: center; gap: 10px; font-size: 10px; color: var(--primary); white-space: nowrap; }
.goal-chip-progress progress { flex: 1; min-width: 24px; width: 40px; height: 4px; appearance: none; border: 0; border-radius: 8px; background: #dae7d4; accent-color: var(--primary); }
.goal-chip-progress progress::-webkit-progress-bar { background: #dae7d4; border-radius: 8px; }
.goal-chip-progress progress::-webkit-progress-value { background: var(--primary); border-radius: 8px; }
.goal-menu { width: 370px; max-width: calc(100vw - 24px); }
.goal-menu-list { max-height: 280px; overflow: auto; }
.goal-menu-item { align-items: flex-start; }
.goal-menu-item > span:last-child { min-width: 0; flex: 1; }
.goal-menu-item strong { display: block; font-size: 13px; font-weight: 600; white-space: normal; overflow-wrap: anywhere; }
.goal-menu-item small { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; white-space: normal; }
.goal-menu-note { font-size: 11px; color: var(--muted); padding: 6px 14px; margin: 0; }
@media(min-width:761px) and (max-width:1100px) {
  .app-header .brand small { display: none; }
  .app-header .brand { font-size: 16px; }
  .app-header .topbar { padding: 0 18px; gap: 14px; }
  .app-header .topbar-right { gap: 8px; }
  .account-chip.goal-chip { width: 215px; }
}
@media(max-width:760px) {
  .app-header .topbar { height: auto; min-height: 66px; flex-wrap: wrap; padding-top: 9px; padding-bottom: 9px; gap: 8px; }
  .app-header .topbar-right { flex-wrap: wrap; flex: 1; justify-content: flex-end; gap: 6px; min-width: 0; }
  .account-chip.goal-chip { width: 190px; height: 44px; }
  .goal-menu { position: fixed; top: calc(var(--shell-height) - 2px); right: 12px; max-height: calc(100dvh - var(--shell-height) - 16px); overflow-y: auto; }
}
@media(max-width:600px) {
  .app-header .topbar { display: block; position: relative; }
  .app-header .brand { height: 32px; width: fit-content; }
  .app-header .topbar-right { display: grid; grid-template-columns: minmax(0,1fr) auto; margin-top: 8px; }
  .app-header #accountMenu { position: absolute; top: 9px; right: 12px; }
  .app-header .brand small { display: none; }
  .account-chip.goal-chip { width: 100%; max-width: 100%; }
  .goal-chip-title strong { font-size: 11px; }
  .goal-chip-progress { gap: 6px; }
  .goal-switcher { grid-column: 1; }
  .app-header #groupMenu { grid-column: 2; }
  .app-header #groupMenu .account-chip { max-width: 120px; }
}

.practice-breadcrumb { display: flex; align-items: center; gap: 9px; margin: 0 0 16px; color: var(--muted); font-size: 12px; }
.welcome-hero .hero-footnote { margin-top: 20px; font-size: 12px; }

/* 官方公告独立于赛事背景资料，发布日期和核查日期分别展示。 */
.event-news-list { display: grid; gap: 16px; max-width: 960px; }
.event-news-card { padding: 24px; scroll-margin-top: 110px; }
.event-news-card h3 { margin: 12px 0; font-size: 1.12rem; line-height: 1.6; }
.event-news-card p { line-height: 1.8; overflow-wrap: anywhere; }
.event-news-meta,.event-news-footer,.event-news-preview-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }
.event-news-meta,.event-news-footer,.event-news-scope { font-size: 13px; color: var(--ink-soft); }
.event-news-meta span { color: var(--primary-dark); font-weight: 600; }
.event-news-footer { border-top: 1px solid var(--border-soft); padding-top: 14px; margin-top: 16px; }
.event-news-footer a,.event-news-preview a { color: var(--primary-dark); }
.event-news-preview { padding: 20px 24px; margin-top: 24px; margin-bottom: 24px; }
.event-news-preview h3 { margin: 0; }
.event-news-preview ul { list-style: none; margin: 16px 0 0; padding: 0; }
.event-news-preview li { display: flex; gap: 16px; padding: 9px 0; line-height: 1.6; }
.event-news-preview time { flex-shrink: 0; color: var(--ink-soft); font-size: 13px; }
@media (max-width: 480px) {
  .event-news-card,.event-news-preview { padding: 18px; }
  .event-news-preview li { flex-direction: column; gap: 2px; }
}

/* Goal setup keeps its actions visible; only the form scrolls. */
.goal-dialog-mask { padding: 16px; box-sizing: border-box; }
.modal-box.goal-dialog {
  width: min(720px, 100%); max-width: 720px; max-height: calc(100dvh - 32px);
  box-sizing: border-box; padding: 22px; overflow: hidden;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 16px;
}
.goal-dialog > h3 { margin: 0; font-size: 20px; }
.goal-dialog > .goal-form {
  min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  padding-right: 6px; gap: 12px; align-content: start;
}
.goal-dialog .goal-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.goal-dialog .goal-field { min-width: 0; margin: 0; gap: 5px; }
.goal-dialog .goal-field input, .goal-dialog .goal-field select,
.goal-dialog .goal-field textarea { min-height: 44px; padding: 9px 12px; }
.goal-dialog .goal-target-fields > :last-child { grid-column: 1 / -1; }
.goal-dialog .goal-note { margin: 0; font-size: 12px; line-height: 1.6; }
.goal-dialog .goal-scope-fields:empty, .goal-dialog .goal-note:empty { display: none; }
.goal-dialog .goal-scope-fields { display: grid; gap: 10px; }
.goal-dialog .goal-preparation, .goal-dialog .goal-scope-fields > details { font-size: 13px; }
.goal-dialog summary { cursor: pointer; color: var(--primary-dark); }
.goal-dialog .goal-preparation ul { margin: 8px 0 0; padding-left: 20px; }
.goal-dialog > .modal-footer { margin-top: 0 !important; padding-top: 14px; border-top: 1px solid var(--border-soft); }
.goal-dialog > .modal-footer button { min-height: 44px; }
@media (max-width: 520px) {
  .goal-dialog-mask { padding: max(8px, env(safe-area-inset-top)) 8px max(8px, env(safe-area-inset-bottom)); }
  .modal-box.goal-dialog { max-height: calc(100dvh - max(8px, env(safe-area-inset-top)) - max(8px, env(safe-area-inset-bottom))); padding: 16px; border-radius: 18px; gap: 12px; }
  .goal-dialog > h3 { font-size: 18px; }
  .goal-dialog .goal-form-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .goal-dialog .goal-field input, .goal-dialog .goal-field select,
  .goal-dialog .goal-field textarea { font-size: 16px; }
  .goal-dialog > .modal-footer > div { width: 100%; }
  .goal-dialog > .modal-footer button { flex: 1; padding-inline: 12px; }
}

/* Original-language reference opens above the question, without changing its layout. */
.translation-trigger {
  display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 0; border: 1px solid var(--border-soft);
  border-radius: 10px; background: var(--surface); color: var(--primary-dark); cursor: pointer;
}
.translation-trigger:hover { background: var(--primary-soft); border-color: var(--primary); }
.translation-trigger:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.translation-symbol { font-size: 13px; font-weight: 700; letter-spacing: -1px; }
.qcard .qhead > .qstem { flex: 1; }
.qcard .qhead > .qstem > :first-child { margin-top: 0; }
.qcard .qhead > .qstem > :last-child { margin-bottom: 0; }
.qcard .qhead > .translation-trigger { align-self: start; }
.translation-dialog-mask { padding: 16px; box-sizing: border-box; }
.modal-box.translation-dialog {
  box-sizing: border-box; width: min(720px, 100%); max-width: 720px; max-height: calc(100dvh - 32px);
  overflow: hidden; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 16px;
}
.translation-dialog > h3 { margin: 0; font-size: 18px; }
.translation-original { overflow: auto; min-height: 0; min-width: 0; overscroll-behavior: contain; line-height: 1.7; }
.translation-original > .qstem { font-weight: 600; margin-bottom: 16px; }
.translation-original > .qstem > :first-child { margin-top: 0; }
.translation-original > .qstem > :last-child { margin-bottom: 0; }
.translation-option { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 8px; padding: 8px 0; align-items: baseline; }
.translation-option-key { font-weight: 600; }
.translation-option-text { min-width: 0; overflow-wrap: anywhere; }
.translation-option-text > :first-child { margin-top: 0; }
.translation-option-text > :last-child { margin-bottom: 0; }
.translation-original img { max-width: 100%; height: auto; }
.translation-original pre { max-width: 100%; box-sizing: border-box; }
.translation-dialog > .modal-footer { margin-top: 0 !important; padding-top: 12px; border-top: 1px solid var(--border-soft); }
.translation-dialog > .modal-footer button { min-height: 44px; }
@media (max-width: 700px) {
  .qcard .qhead:has(> .translation-trigger) { grid-template-columns: auto minmax(0, 1fr) auto; }
  .qcard .qhead > .translation-trigger { grid-column: 3; grid-row: 1; width: 44px; height: 44px; }
}
@media (max-width: 520px) {
  .translation-dialog-mask { padding: max(8px, env(safe-area-inset-top)) 8px max(8px, env(safe-area-inset-bottom)); }
  .modal-box.translation-dialog { max-height: calc(100dvh - max(8px, env(safe-area-inset-top)) - max(8px, env(safe-area-inset-bottom))); padding: 16px; border-radius: 18px; }
}
