:root {
  color-scheme: light;
  --bg: #f3f6fa;
  --surface: #fff;
  --ink: #172d46;
  --muted: #55687f;
  --blue: #2458c7;
  --blue-dark: #163f9c;
  --line: #dce5ef;
  --soft: #edf3fd;
  --green: #1e6254;
  --green-bg: #e8f5ef;
  --amber: #7a5016;
  --amber-bg: #fff4dd;
  --red: #9a2932;
  --red-bg: #fff0f0;
  --shadow: 0 6px 24px #172d4610;
  --radius: 12px;
  --caption: .75rem;
  --body: .875rem;
  --title: 1rem;
  --heading: 1.625rem;
  --fast: 170ms;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--bg); font-size: var(--body); line-height: 1.55; }
a { color: var(--blue); text-underline-offset: .2em; }
::selection { color: var(--ink); background: #cbdcff; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
button, input, select { font: inherit; }
button, input, select { min-height: 36px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); }
button { padding: 6px 12px; cursor: pointer; transition: background var(--fast) ease, border-color var(--fast) ease; }
button:hover { background: var(--soft); border-color: var(--blue); }
input, select { padding: 6px 10px; max-width: 100%; caret-color: var(--blue); }
input::placeholder { color: var(--muted); }
.primary { background: var(--blue); color: var(--surface); border-color: var(--blue); }
.primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.muted { color: var(--muted); }
.brand { font-size: var(--title); font-weight: 700; color: var(--ink); text-decoration: none; }
h1 { margin: 0; font-size: var(--heading); line-height: 1.25; font-weight: 600; }
.layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.rail { background: var(--surface); border-right: 1px solid var(--line); padding: 24px 16px; }
.rail .brand { display: block; padding-inline: 10px; }
.rail nav { display: grid; gap: 4px; margin-top: 30px; }
.rail nav a { color: var(--ink); padding: 9px 10px; border-radius: 6px; text-decoration: none; }
.rail nav a:hover, .rail nav [aria-current] { background: var(--soft); color: var(--blue-dark); }
.rail nav [aria-current] { font-weight: 600; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 62px; padding: 10px 28px; border-bottom: 1px solid var(--line); background: var(--surface); }
.top form { display: flex; align-items: center; gap: 12px; }
.content { max-width: 1340px; margin-inline: auto; padding: 28px; }
.page-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.page-title p { margin: 6px 0 0; }
.state { display: inline-block; padding: 3px 8px; border-radius: 5px; white-space: nowrap; color: var(--ink); background: var(--soft); font-size: var(--caption); }
.state.warning { background: var(--amber-bg); color: var(--amber); }
.state.success { background: var(--green-bg); color: var(--green); }
.totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 0; margin: 20px 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.totals div { padding: 12px 16px; }
.totals div + div { border-inline-start: 1px solid var(--line); }
.totals dt { color: var(--muted); }
.totals dd { margin: 2px 0 0; font-size: var(--title); font-weight: 700; font-variant-numeric: tabular-nums; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.tabs { display: flex; align-items: stretch; padding-inline: 16px; border-bottom: 1px solid var(--line); gap: 22px; }
.tabs a { padding-block: 13px 11px; border-bottom: 2px solid transparent; text-decoration: none; color: var(--muted); }
.tabs a:hover, .tabs [aria-current] { color: var(--blue-dark); border-color: var(--blue); }
.tabs [aria-current] { font-weight: 600; }
.filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px 16px; }
.table-frame { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-variant-numeric: tabular-nums; }
th, td { padding: 11px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: var(--bg); color: var(--muted); font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }
.identity small { display: block; color: var(--muted); font-size: var(--caption); }
.resume-file { min-inline-size: 10rem; max-inline-size: 24rem; white-space: normal; overflow-wrap: anywhere; }
.resume-file a { display: block; width: fit-content; margin-block-start: 3px; }
.empty, .table-note { margin: 0; padding: 18px 16px; color: var(--muted); }
.community-actions { display: grid; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--line); }
.inbox-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; justify-content: space-between; padding: 16px; }
.inbox-head h2 { margin: 4px 0 0; font-size: var(--title); overflow-wrap: anywhere; }
.inbox-filter, .inbox-pages { display: flex; flex-wrap: wrap; gap: 10px; }
.inbox-filter a { padding: 5px 8px; border-radius: 5px; }
.inbox-filter [aria-current] { background: var(--soft); color: var(--blue-dark); font-weight: 600; text-decoration: none; }
.group-messages { list-style: none; margin: 0; padding: 0; }
.group-message { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; padding: 14px 16px; border-top: 1px solid var(--line); }
.message-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: baseline; overflow-wrap: anywhere; }
.message-body { max-width: 75ch; margin: 5px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-action { min-width: max-content; }
.inbox-pages { padding: 14px 16px; border-top: 1px solid var(--line); }
details { padding: 9px 0; }
details > summary { cursor: pointer; font-weight: 600; color: var(--blue-dark); }
details p { margin: 8px 0 0; }
.stack { display: grid; justify-items: start; gap: 12px; max-width: 390px; margin-top: 14px; }
.stack label { display: grid; gap: 5px; width: 100%; }
.feedback { margin: 12px 16px; padding: 9px 11px; border-radius: 6px; }
.feedback.error { background: var(--red-bg); color: var(--red); }
.feedback.success { background: var(--green-bg); color: var(--green); }
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(100%, 400px); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: var(--radius); padding: 25px; }
.login-card .brand { margin: 0 0 18px; }
.login-card .stack { margin-top: 19px; }
.login-card .feedback { margin: 0; width: 100%; }
.login-card .primary { width: 100%; }

@media (max-width: 720px) {
  .layout { display: block; }
  .rail { padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .rail .brand { padding: 0; }
  .rail nav { display: flex; margin-top: 8px; }
  .top { min-height: 56px; padding-inline: 16px; }
  .content { padding: 18px 16px; }
  .page-title { flex-wrap: wrap; }
  .totals div { padding: 8px 10px; }
  .totals dt { font-size: var(--caption); }
  .group-message { grid-template-columns: minmax(0, 1fr); gap: 8px; }
}

@media (prefers-reduced-motion: reduce) { button { transition: none; } }
