:root {
  color-scheme: light;
  --ink: #1d2434; --muted: #5e697d; --accent: #5b47bb; --line: #dfe4ed;
  --canvas: #f4f6fa; --radius: 12px;
  font: 15px/1.55 system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink); background: var(--canvas);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body, h1, h2, p { margin: 0; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid #9178f3; outline-offset: 2px; }
.topbar { min-height: 64px; padding: 12px 28px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; background: white; border-bottom: 1px solid var(--line); }
.brand, #account { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand strong { font-size: 19px; letter-spacing: -.7px; }
.mark { width: 31px; line-height: 31px; text-align: center; border-radius: 9px 9px 3px 9px; background: var(--accent); color: white; font-weight: 800; }
.brand-label { border-left: 1px solid var(--line); padding-left: 12px; color: var(--muted); }
#identity { overflow-wrap: anywhere; color: var(--muted); font-size: 13px; }
.plain, .primary { border: 1px solid var(--line); background: white; color: var(--ink); border-radius: 7px; padding: 6px 12px; white-space: nowrap; }
.plain:hover:enabled { background: var(--canvas); }
.primary { background: var(--accent); color: white; padding: 10px; border: 0; font-weight: 600; }
.gate { min-height: calc(100vh - 64px); display: grid; place-items: center; padding: 22px; }
.gate-card, .panel, .metric { border-radius: var(--radius); background: white; border: 1px solid var(--line); box-shadow: 0 3px 14px #192f5210; }
.gate-card { padding: clamp(24px, 4vw, 44px); width: min(100%, 410px); }
.gate-card h1 { margin: 12px 0 8px; }
#auth-note, #subtitle { color: var(--muted); }
#login { display: grid; gap: 8px; margin-top: 24px; }
#login label { font-weight: 600; }
#login input { width: 100%; border: 1px solid #bcc5d3; border-radius: 7px; padding: 9px 12px; margin-bottom: 8px; }
#check-session { margin-top: 16px; }
#shell { display: grid; grid-template-columns: 204px minmax(0, 1fr); min-height: calc(100vh - 64px); }
aside { background: #1c202a; color: #dce1ed; padding: 28px 12px; }
.nav-label, .eyebrow { font-size: 12px; letter-spacing: .08em; font-weight: 600; }
.nav-label { margin: 0 14px 14px; color: #a3adc0; }
nav { display: grid; gap: 5px; }
nav a { display: flex; gap: 14px; align-items: baseline; padding: 11px 16px; border-radius: 8px; font-weight: 550; }
nav a:hover { background: #313746; }
nav a[aria-current="page"] { background: white; color: var(--accent); }
.index { font: 12px ui-monospace, monospace; opacity: .75; }
.workspace { width: 100%; max-width: 1620px; margin: 0 auto; min-width: 0; padding: clamp(18px, 3vw, 46px); }
.eyebrow { color: var(--muted); }
.eyebrow > span:first-child { margin: 0 5px; color: #9ba5b5; }
.heading, .pager { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.heading { margin: 12px 0 28px; }
h1 { font-size: clamp(24px, 2.3vw, 34px); letter-spacing: -.04em; }
h2 { font-size: 17px; }
#subtitle { margin-top: 4px; }
#periods { display: flex; gap: 3px; border-radius: 9px; padding: 3px; background: #e7ebf2; }
#periods button { border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 14px; padding: 6px 12px; }
#periods button[aria-pressed="true"] { background: white; color: var(--accent); box-shadow: 0 1px 4px #1d243422; }
.section-heading { margin: 24px 0 10px; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 14px; }
.metric { display: flex; flex-direction: column; padding: 18px 20px; gap: 8px; }
.metric:hover { border-color: #aca0dc; }
.metric strong { font-size: clamp(23px, 2.4vw, 34px); font-variant-numeric: tabular-nums; line-height: 1.25; overflow-wrap: anywhere; }
.metric small { color: var(--muted); }
.metric small::after { content: ' ›'; color: var(--accent); }
.panel { padding: clamp(16px, 2vw, 26px); }
.notice { padding: 30px 12px; text-align: center; color: var(--muted); }
.notice button { margin-top: 12px; }
#action-error { color: #922a2a; margin: 0 0 14px; }
.table-wrap { overflow-x: auto; margin-top: 15px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; border-bottom: 1px solid var(--line); padding: 12px 14px; }
th { background: var(--canvas); color: var(--muted); white-space: nowrap; font-size: 13px; }
td { min-width: 7em; max-width: 32em; overflow-wrap: anywhere; white-space: pre-wrap; vertical-align: top; }
.pager { margin-top: 18px; justify-content: flex-end; color: var(--muted); font-size: 14px; }
@media (max-width: 760px) {
  .topbar { padding: 10px 16px; }
  #shell { display: block; }
  aside { padding: 8px 12px; }
  .nav-label, .index { display: none; }
  nav { display: flex; overflow-x: auto; }
  nav a { white-space: nowrap; padding: 8px 11px; font-size: 14px; }
  .heading { margin-bottom: 18px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .metric { padding: 13px; }
  .pager { gap: 8px; }
}
