:root {
  color-scheme: light;
  --bg: #f6f5fa;
  --paper: #fff;
  --text: #272037;
  --muted: #665e73;
  --line: #e7e1ee;
  --accent: #6540ab;
  --accent-dark: #4e2d89;
  --accent-soft: #f1ebfb;
  --green: #216247;
  --shadow: 0 10px 30px #311d4d0a;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
}
*, *::before, *::after { box-sizing: border-box; }
body { display: flex; flex-direction: column; min-height: 100vh; margin: 0; color: var(--text); background: var(--bg); line-height: 1.6; }
main { flex: 1; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.3; }
h1 { font-size: clamp(1.9rem, 3vw, 2.65rem); }
h2 { font-size: 1.22rem; }
h3 { font-size: 1.05rem; }
a { color: var(--accent-dark); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
button, input, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #9970d7; outline-offset: 3px; }
.container { width: min(1170px, calc(100% - 64px)); margin-inline: auto; }
.site-header, .site-footer { background: var(--paper); }
.site-header { border-bottom: 1px solid var(--line); }
.header-grid, .session-controls, .brand { display: flex; align-items: center; gap: 13px; }
.header-grid { min-height: 71px; justify-content: space-between; }
.brand { color: var(--text); text-decoration: none; font-weight: 750; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 40px; border-radius: 12px; background: var(--accent); color: white; font-weight: 800; }
.session-controls { font-size: .89rem; }
.session-role { margin-left: 4px; color: var(--muted); }
.session-links { display: flex; flex-wrap: wrap; gap: 4px 11px; }
.session-links a { white-space: nowrap; }
.session-person { overflow-wrap: anywhere; }
.site-footer { margin-top: 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: .84rem; }
.site-footer > div { padding-block: 20px; }
.main-content { padding-top: 31px; }
.skip-link { position: fixed; z-index: 5; left: 12px; top: 12px; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
.skip-link:focus { width: auto; height: auto; clip-path: none; padding: 7px 13px; background: white; }

.page-head { display: flex; align-items: end; justify-content: space-between; gap: 15px; margin-bottom: 19px; }
.eyebrow { color: var(--accent-dark); font-size: .89rem; font-weight: 750; margin-bottom: 6px; }
.page-head h1 + p, .panel-heading h2 + p, .panel h2 + .muted { margin-top: 5px; }
.head-actions, .toolbar, .button-row, .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.muted, .help-text { color: var(--muted); }
.help-text { font-size: .85rem; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 40px; padding: 6px 13px; border: 1px solid transparent; border-radius: 9px; font-weight: 700; font-size: .9rem; text-decoration: none; white-space: nowrap; }
.button.primary { color: white; background: var(--accent); }
.button.primary:hover { background: var(--accent-dark); }
.button.secondary { color: var(--accent-dark); background: #f8f4fe; border-color: #e6d9f5; }
.button.secondary:hover { background: var(--accent-soft); }
.button:disabled { cursor: default; opacity: .55; }
.panel { padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); box-shadow: var(--shadow); min-width: 0; }
.panel + .panel, .panel + .grid, .grid + .panel { margin-top: 16px; }
.panel-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 13px; }
.grid { display: grid; gap: 13px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); align-items: start; }
.metric-card { padding: 14px; min-width: 0; background: #fbf9fe; border: 1px solid var(--line); border-radius: 10px; }
.metric-card strong { color: var(--accent-dark); font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.notice { padding: 9px 12px; margin: 0 0 12px; border: 1px solid #eadcf4; border-radius: 8px; background: #f8f2fc; color: var(--accent-dark); overflow-wrap: anywhere; }
.notice.success { color: #205d45; background: #edf8f2; border-color: #d2eadc; }
.notice.error, .errorlist { color: #8b2e47; background: #fff3f6; border-color: #f1d5df; }
.errorlist { padding: 8px 10px 8px 27px; margin: 0; border: 1px solid #f1d5df; border-radius: 8px; font-size: .89rem; }
.pill { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 20px; background: var(--accent-soft); color: var(--accent-dark); font-size: .81rem; font-weight: 700; white-space: nowrap; }
.pill.complete, .pill.success { background: #e7f3ed; color: #225e49; }

.form-grid { display: grid; gap: 12px; }
.form-field, .form-grid > div { min-width: 0; }
label { font-weight: 650; }
.form-field label, .form-grid > div > label { display: block; margin-bottom: 5px; font-size: .92rem; }
input:not([type="checkbox"], [type="radio"], [type="hidden"]), select { min-height: 41px; padding: 6px 9px; border: 1px solid #dcd4e8; border-radius: 8px; background: white; color: var(--text); max-width: 100%; }
.form-grid input:not([type="checkbox"], [type="radio"], [type="hidden"]), .form-grid select { width: 100%; }
input[type="file"] { font-size: .9rem; }
input[type="file"]::file-selector-button { margin-right: 8px; border: 1px solid #e1d4f1; border-radius: 6px; padding: 4px 8px; background: var(--accent-soft); color: var(--accent-dark); cursor: pointer; }
fieldset { min-width: 0; }
.inline-form { display: inline; }
.form-actions { margin-top: 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filter-form, .term-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; margin-block: 10px; }
.filter-form label { display: block; font-size: .88rem; margin-bottom: 3px; }
.term-actions { align-items: center; }
.term-actions .muted, .score-nav { font-size: .89rem; }
.stacked-form { display: grid; gap: 10px; }
.narrow-panel { width: min(100%, 610px); margin-inline: auto; }
.error-page p { margin-block: 8px 13px; }
.personal-result-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.review-trace summary { cursor: pointer; color: var(--accent-dark); }
.review-trace ul { margin: 4px 0 0; padding-left: 17px; }
.student-number { font-size: .78rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.table-scroll { width: 100%; overflow: auto; }
.data-table, .table-scroll table { border-collapse: collapse; width: 100%; text-align: left; }
.data-table td, .data-table th, .table-scroll table td, .table-scroll table th { padding: 9px 10px; border-bottom: 1px solid var(--line); font-size: .9rem; }
.data-table thead, .table-scroll table thead { background: #f3eff8; }
.data-table th, .table-scroll table th { white-space: nowrap; }
.data-table tbody tr:last-child > *, .table-scroll table tbody tr:last-child > * { border-bottom: 0; }

.score-grid { display: grid; gap: 12px; }
.score-nav { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.score-completion { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--muted); font-size: .89rem; }
.score-completion [data-next-score] { font-weight: 700; }
.review-form { margin-top: 15px; }
.score-group { border: 1px solid var(--line); border-radius: 9px; margin: 0 0 11px; padding: 8px 12px; }
.score-group legend { padding-inline: 5px; font-weight: 700; }
.score-section { padding: 14px; border: 1px solid var(--line); border-radius: 10px; }
.score-section legend { padding-inline: 6px; font-weight: 750; color: var(--accent-dark); }
.score-item { display: flex; align-items: start; justify-content: space-between; gap: 12px; padding: 10px 2px; }
.score-item + .score-item { border-top: 1px solid var(--line); }
.score-field { flex: 0 0 105px; }
.score-field select, .score-field input { width: 100%; }
.score-submit { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.score-submit .head-actions { flex-shrink: 0; }
.result-total { font-size: .95rem; }
.result-total strong { font-size: 1.85rem; color: var(--accent-dark); }
.radar-layout { display: grid; grid-template-columns: minmax(265px, .95fr) minmax(0, 1.15fr); align-items: center; gap: 18px; }
.radar-chart { display: block; width: min(100%, 430px); height: auto; margin-inline: auto; }
.radar-table { width: 100%; }

.login-layout { display: grid; grid-template-columns: 1.22fr 1fr; align-items: stretch; gap: 18px; }
.login-cover { display: grid; align-items: end; min-height: 475px; padding: clamp(21px, 4vw, 42px); border-radius: 17px; color: white; background: linear-gradient(90deg, #2c153af5, #2d143984 68%, #2d14394b), url("growth-portfolio.70b7c24c1d19.jpg") center / cover; }
.login-cover h1 { font-size: clamp(2.4rem, 5vw, 4.1rem); font-weight: 800; line-height: 1.16; }
.login-cover .eyebrow { color: #eadbf6; }
.login-cover h1 + p { color: #f7edf8; margin-top: 14px; }
.login-panel { padding: clamp(17px, 4vw, 32px); }
.login-panel header { margin-bottom: 13px; }
.login-panel h2 { margin-bottom: 5px; }

@media (max-width: 730px) {
  .container { width: calc(100% - 30px); }
  .main-content { padding-top: 21px; }
  .page-head, .radar-layout, .login-layout { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; }
  .score-submit { align-items: flex-start; flex-direction: column; gap: 8px; }
  .login-cover { min-height: 245px; }
  .panel { padding: 14px; }
  .session-controls { gap: 6px; }
  .session-role { display: none; }
  .button { padding-inline: 9px; }
}
@media (max-width: 400px) {
  .header-grid { flex-wrap: wrap; gap: 6px; padding-block: 8px; }
  .session-controls { width: 100%; justify-content: space-between; flex-wrap: wrap; }
  .brand { font-size: .92rem; gap: 7px; }
  .brand-mark { width: 33px; height: 33px; flex-basis: 33px; }
  .score-field { flex-basis: 76px; }
}
