:root {
    color-scheme: light;
    font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
    color: #172033;
    background: #f4f7fb;
    --brand: #155eef;
    --brand-dark: #0d47bd;
    --danger: #b42318;
    --warning: #9a6700;
    --success: #067647;
    --border: #d8dee9;
    --muted: #667085;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: #f4f7fb; }
a { color: var(--brand-dark); }
.site-header { background: #102a56; color: white; }
.site-header__inner, .site-footer__inner { width: min(1540px, calc(100% - 32px)); margin: 0 auto; }
.site-header__inner { min-height: 64px; display: flex; gap: 24px; align-items: center; justify-content: space-between; }
.brand { display: grid; color: white; text-decoration: none; font-weight: 700; font-size: 1.02rem; line-height: 1.25; }
.brand small { color: #c8d8f1; font-size: .76rem; font-weight: 500; }
.top-actions { display: flex; flex-wrap: nowrap; align-items: center; gap: 18px; white-space: nowrap; }
.top-actions a, .link-button { color: white; text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; padding: 8px 0; }
.top-actions form { margin: 0; }
.nav-disabled { color: #aebbd0; cursor: not-allowed; font-size: .92rem; }
.app-shell { width: min(1540px, 100%); min-height: calc(100vh - 64px); margin: 0 auto; display: grid; grid-template-columns: 224px minmax(0, 1fr); }
.app-sidebar { padding: 22px 14px 40px; background: #eaf0f9; border-right: 1px solid #d5deec; }
.sidebar-menu > summary { display: none; }
.sidebar-nav { display: grid; gap: 19px; position: sticky; top: 18px; }
.sidebar-group { display: grid; gap: 4px; }
.sidebar-label { padding: 0 11px 5px; color: #687892; font-size: .76rem; font-weight: 700; letter-spacing: .08em; }
.sidebar-nav a { padding: 9px 11px; border-radius: 8px; color: #243b61; text-decoration: none; font-weight: 600; }
.sidebar-nav a:hover, .sidebar-nav a:focus { color: #0d47bd; background: white; }
.app-main { min-width: 0; }
.page { width: min(1240px, calc(100% - 40px)); margin: 0 auto; padding: 28px 0 60px; }
.page--public { width: min(1180px, calc(100% - 32px)); }
.page-title { margin: 0 0 8px; font-size: clamp(1.55rem, 4vw, 2rem); }
.lead { color: var(--muted); margin-top: 0; }
.card { background: white; border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin: 18px 0; box-shadow: 0 4px 14px rgb(16 42 86 / 5%); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.search-grid { display: grid; grid-template-columns: minmax(300px, 1fr) 150px 170px auto; gap: 12px; align-items: end; }
.suggestions { position: relative; }
.suggestions ul { list-style: none; padding: 6px; margin: 8px 0 0; border: 1px solid var(--border); border-radius: 9px; background: white; box-shadow: 0 8px 28px rgb(16 42 86 / 10%); }
.suggestions li { display: grid; gap: 2px; padding: 9px 10px; border-bottom: 1px solid #eef1f6; }
.suggestions li:last-child { border-bottom: 0; }
.suggestions small { color: var(--muted); }
.result-card__top, .hierarchy-title { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.result-card h2, .hierarchy-title h2, .track-block h3 { margin: 0 0 6px; }
.result-card { position: relative; overflow: hidden; }
.result-card__badges { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; }
.result-card__attention { display: flex; align-items: baseline; gap: 10px; width: fit-content; margin: 14px 0; padding: 9px 12px; color: #123466; background: #eef5ff; border-radius: 9px; }
.result-card__attention span { color: var(--muted); font-size: .82rem; }
.result-card__facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 14px 0 18px; }
.result-card__facts > div { display: grid; gap: 5px; min-height: 76px; padding: 12px 14px; background: #f8fafc; border: 1px solid #e4e9f2; border-radius: 9px; }
.result-card__facts span { color: var(--muted); font-size: .82rem; }
.result-card__facts strong { line-height: 1.45; }
.hierarchy-guide { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 18px 0; }
.hierarchy-guide > div { display: grid; gap: 5px; min-height: 82px; padding: 14px; color: #29466f; background: #eaf1fd; border: 1px solid #cedbf0; border-radius: 10px; }
.hierarchy-guide span { color: var(--muted); font-size: .84rem; line-height: 1.45; }
.year-badge { display: inline-flex; padding: 7px 11px; border-radius: 8px; color: #0d47bd; background: #e8f0ff; white-space: nowrap; }
.details.compact { grid-template-columns: 105px 1fr; font-size: .94rem; }
.empty-state { text-align: center; color: var(--muted); padding: 28px; }
.candidate-list { display: grid; gap: 10px; }
.candidate-list article { padding: 12px; border: 1px solid var(--border); border-radius: 8px; }
.import-row { border-left: 5px solid #98a2b3; }
.import-row--existing { border-left-color: var(--success); }
.import-row--suspected, .import-row--multiple_candidates { border-left-color: var(--warning); }
.import-row--suggested_new { border-left-color: var(--brand); }
.import-row--error { border-left-color: var(--danger); }
.candidate-review { border-bottom: 1px solid var(--border); padding: 10px 0 20px; }
.allow-create { margin-top: 14px; padding: 14px; background: #f8fafc; border-radius: 8px; }
.score { margin-left: 12px; color: var(--warning); }
.eyebrow { color: var(--muted); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }
.track-block { border-left: 4px solid #b7caf4; padding: 12px 0 12px 18px; margin: 18px 0; }
.track-heading { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.stage-empty { display: grid; gap: 5px; margin: 14px 0; padding: 15px; color: #6f4e00; background: #fffaeb; border: 1px solid #f4d78b; border-radius: 9px; }
.stage-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.stage-card { background: #f8fafc; border: 1px solid var(--border); border-radius: 9px; padding: 14px; }
.stage-card h4 { margin: 5px 0 12px; font-size: 1.08rem; }
.editor { border-top: 1px dashed var(--border); padding-top: 12px; margin-top: 14px; }
.editor summary { cursor: pointer; font-weight: 700; color: var(--brand-dark); margin-bottom: 14px; }
.optional-entry-card > .editor { margin-top: 0; padding-top: 0; border-top: 0; }
.optional-entry-card > .editor > summary { margin-bottom: 0; }
.optional-entry-card > .editor[open] > summary { margin-bottom: 14px; }
.stage-editor { margin-top: 18px; padding: 14px; border: 1px solid #c8d8f1; border-radius: 10px; background: #f7faff; }
.recognition-strip { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.check-field input, .confirm-line input { width: auto; }
.confirm-line { display: block; margin: 14px 0; }
code { overflow-wrap: anywhere; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 600; }
.required-marker { color: var(--danger); font-weight: 800; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
input, select, textarea { width: 100%; border: 1px solid #aeb8c8; border-radius: 7px; padding: 10px 11px; font: inherit; background: white; }
input:focus, select:focus, textarea:focus, button:focus, a:focus { outline: 3px solid rgb(21 94 239 / 28%); outline-offset: 2px; }
textarea { min-height: 88px; resize: vertical; }
.button { display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 7px; padding: 10px 16px; background: var(--brand); color: white; text-decoration: none; font: inherit; font-weight: 600; cursor: pointer; }
.button:hover { background: var(--brand-dark); }
.button--secondary { color: #24314d; background: #e8edf5; }
.button--danger { background: var(--danger); }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.text-links { margin: 16px 0 0; }
.notice { padding: 13px 15px; border-radius: 8px; margin: 14px 0; border-left: 4px solid; }
.notice--success { color: var(--success); background: #ecfdf3; border-color: var(--success); }
.notice--error { color: var(--danger); background: #fef3f2; border-color: var(--danger); }
.notice--warning { color: #6f4e00; background: #fffaeb; border-color: var(--warning); }
.muted { color: var(--muted); }
.status { display: inline-block; border-radius: 999px; padding: 3px 9px; background: #e8edf5; font-size: .88rem; }
.status--ongoing { color: #075985; background: #e0f2fe; }
.status--registration_open, .status--upcoming, .status--waiting, .status--waiting_next { color: #0d47bd; background: #e8f0ff; }
.status--ended { color: #475467; background: #eef1f6; }
.status--cancelled { color: var(--danger); background: #fef3f2; }
.status--warning { color: #6f4e00; background: #fffaeb; }
.status--approved { color: var(--success); background: #ecfdf3; }
.status--submitted, .status--returned { color: #6f4e00; background: #fffaeb; }
.status--rejected { color: var(--danger); background: #fef3f2; }
.workbench-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 24px 0 12px; }
.workbench-heading h2 { margin: 4px 0; font-size: 1.45rem; }
.year-filter { min-width: 220px; }
.year-filter label { display: block; font-weight: 700; margin-bottom: 6px; }
.year-filter input { width: 120px; }
.todo-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 10px; margin: 14px 0 22px; }
.todo-chip { display: flex; align-items: center; gap: 9px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 9px; background: white; color: #475467; text-decoration: none; }
.todo-chip strong { font-size: 1.2rem; }
.todo-chip--active { color: #6f4e00; border-color: #f5cf72; background: #fffaeb; }
.competition-workbench-list { display: grid; gap: 16px; }
.workbench-item { position: relative; overflow: hidden; margin: 0; padding: 0; border-left: 6px solid #98a2b3; box-shadow: 0 8px 24px rgb(16 42 86 / 8%); }
.workbench-item--ongoing { border-left-color: #0284c7; }
.workbench-item--registration_open, .workbench-item--upcoming, .workbench-item--waiting, .workbench-item--waiting_next { border-left-color: var(--brand); }
.workbench-item--ended { border-left-color: #667085; }
.workbench-item--cancelled { border-left-color: var(--danger); }
.workbench-item__header { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding: 22px 24px 18px; background: linear-gradient(135deg, #fff 55%, #f3f7ff); border-bottom: 1px solid #e8edf5; }
.workbench-item__identity { min-width: 0; }
.workbench-item__header h3 { margin: 7px 0 10px; font-size: clamp(1.16rem, 2.5vw, 1.4rem); line-height: 1.45; }
.workbench-item__header h3 a { text-decoration-thickness: 1px; text-underline-offset: 3px; }
.workbench-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.recognition-status { color: #067647; background: #ecfdf3; }
.workbench-item__state { flex: 0 0 160px; min-height: 106px; display: grid; align-content: center; justify-items: end; gap: 5px; padding: 15px 17px; color: #344054; background: rgb(255 255 255 / 82%); border: 1px solid #cfdaed; border-radius: 13px; box-shadow: 0 5px 14px rgb(16 42 86 / 8%); text-align: right; }
.workbench-item__state strong { font-size: 1rem; }
.workbench-item__state small { color: var(--muted); }
.workbench-state-label { color: var(--brand-dark); font-size: 1.16rem; font-weight: 800; }
.workbench-item--ongoing .workbench-state-label { color: #075985; }
.workbench-item--ended .workbench-state-label { color: #475467; }
.workbench-item--cancelled .workbench-state-label { color: var(--danger); }
.workbench-facts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; margin: 0; padding: 18px 24px; }
.workbench-facts > div { display: grid; align-content: start; gap: 5px; min-height: 92px; padding: 8px 18px; border-right: 1px solid #e4e9f2; }
.workbench-facts > div:first-child { padding-left: 0; }
.workbench-facts > div:last-child { border-right: 0; }
.workbench-facts span { color: var(--muted); font-size: .85rem; }
.workbench-facts strong { line-height: 1.45; }
.workbench-facts small { color: #7b8495; }
.workbench-metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 9px; padding: 0 24px 20px; }
.workbench-metrics > div { display: grid; gap: 3px; min-height: 72px; align-content: center; padding: 10px 12px; border: 1px solid #dce5f3; border-radius: 10px; background: #f7faff; }
.workbench-metrics strong { color: #123466; font-size: 1.35rem; }
.workbench-metrics span { color: var(--muted); font-size: .78rem; line-height: 1.25; }
.metric-alert { color: #6f4e00; background: #fffaeb !important; }
.next-stage { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0; padding: 15px 24px; color: #123466; background: #eef5ff; border-top: 1px solid #dce8fa; }
.next-stage > div:nth-child(2) { display: grid; flex: 1; gap: 3px; }
.next-stage small { color: var(--muted); }
.next-stage__icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: white; background: var(--brand); font-weight: 800; }
.next-stage--empty { color: #475467; background: #f8fafc; }
.next-stage--empty .next-stage__icon { background: #98a2b3; }
.pagination { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 18px 0 28px; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 9px; margin: 8px 0 16px; }
.choice-grid label { display: flex; align-items: center; gap: 7px; padding: 8px; background: #f8fafc; border-radius: 7px; }
.choice-grid input { width: auto; }
.notification-item--unread { border-left: 5px solid var(--brand); }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 760px; }
th, td { border-bottom: 1px solid var(--border); text-align: left; padding: 11px 9px; vertical-align: top; }
th { color: #344054; background: #f8fafc; }
.inline-form { display: inline-flex; flex-wrap: wrap; gap: 7px; align-items: end; margin: 3px 0; }
.inline-form input, .inline-form select { width: auto; min-width: 120px; }
.details { display: grid; grid-template-columns: minmax(120px, 180px) 1fr; gap: 8px 18px; }
.details dt { color: var(--muted); }
.details dd { margin: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid--five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.split-fields { display: flex; gap: 8px; }
.split-fields > * { min-width: 0; }
fieldset { border: 1px solid var(--border); border-radius: 10px; padding: 16px; margin: 0 0 18px; }
legend { padding: 0 8px; color: #123466; font-weight: 800; }
.award-form { max-width: 1120px; }
.compact-editor { margin-top: 8px; }
.compact-list { margin: 8px 0 0; padding-left: 22px; }
.compact-list li { margin: 6px 0; }
.review-card { border-left: 5px solid var(--warning); }
.review-action { margin-top: 16px; padding-top: 15px; border-top: 1px solid var(--border); }
.report-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.report-summary > div { display: grid; gap: 5px; padding: 16px; background: white; border: 1px solid var(--border); border-radius: 10px; }
.report-summary span { color: var(--muted); font-size: .86rem; }
.report-summary strong { color: #123466; font-size: 1.65rem; }
.student-no { font-variant-numeric: tabular-nums; white-space: nowrap; }
.site-footer { color: var(--muted); border-top: 1px solid var(--border); background: white; }
.site-footer__inner { padding: 20px 0; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 12px; top: 12px; z-index: 20; background: white; color: #111; padding: 8px; }

@media (max-width: 700px) {
    .site-header__inner { min-height: 58px; }
    .brand span { font-size: .92rem; }
    .brand small { display: none; }
    .top-actions { gap: 12px; font-size: .92rem; }
    .app-shell { display: block; min-height: 0; }
    .app-sidebar { padding: 10px 16px; border-right: 0; border-bottom: 1px solid #d5deec; }
    .sidebar-menu > summary { display: block; cursor: pointer; color: #123466; font-weight: 800; padding: 8px 2px; }
    .sidebar-nav { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 10px 0; }
    .sidebar-group { align-content: start; }
    .sidebar-nav a { padding: 7px 9px; }
    .page { width: min(100% - 28px, 1240px); padding-top: 20px; }
    .details { grid-template-columns: 1fr; }
    .details dd { margin-bottom: 8px; }
    .page-heading, .result-card__top { flex-direction: column; }
    .result-card__badges { justify-content: flex-start; }
    .result-card__facts { grid-template-columns: 1fr; }
    .hierarchy-guide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .track-heading { flex-direction: column; }
    .search-grid { grid-template-columns: 1fr; }
    .workbench-heading, .workbench-item__header, .pagination { align-items: stretch; flex-direction: column; }
    .workbench-item__state { justify-items: start; flex-basis: auto; min-height: 0; text-align: left; }
    .workbench-facts { grid-template-columns: 1fr; padding: 12px 18px; }
    .workbench-facts > div, .workbench-facts > div:first-child { min-height: 0; padding: 11px 0; border-right: 0; border-bottom: 1px solid #e4e9f2; }
    .workbench-facts > div:last-child { border-bottom: 0; }
    .workbench-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 18px 18px; }
    .form-grid, .form-grid--three, .form-grid--five, .report-summary { grid-template-columns: 1fr; }
    .split-fields { flex-direction: column; }
}
