/* 鮫洲驾驶模拟器 · account pages (/login /reset /admin /records).
   Same house look as the landing (landing/v2/src/tokens.css + base.css + shell.html): dark gauge-face ground,
   road-paint text ladder, lane-blue accent. Served under a strict CSP: this file is the only stylesheet the pages
   own, so no inline styles and no style attributes anywhere in the markup. */
:root {
  color-scheme: dark;
  --ground: #0b0f11;
  --surface: #11171a;
  --surface-2: #182024;
  --surface-3: #212a2f;
  --text: #e6eeed;
  --body: #c3cdcd;
  --muted: #919d9f;
  --label: #7c888b;
  --edge: rgba(223,232,232,.08);
  --edge-2: rgba(223,232,232,.16);
  --edge-3: rgba(223,232,232,.28);
  --lane: #3d96c6;
  --lane-hi: #6cb8e2;
  --lane-deep: #2a6591;
  --on-lane: #061019;
  --recorded: #c6dba9;
  --deduct: #e0524b;
  --display: "Barlow", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  --sans: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --meta: "Barlow Semi Condensed", "Barlow", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, monospace;
  --maxw: 1320px;
  --gutter: clamp(16px, 4vw, 56px);
  --nav-h: 64px;
  --r-2: 10px; --r-3: 14px; --r-4: 20px;
  --ease-out: cubic-bezier(.2,.7,.1,1);
  --t-micro: .22s;
  --t-state: .45s;
  --shadow-1: 0 18px 50px -24px rgba(0,0,0,.7);
  --shadow-2: 0 40px 110px -50px rgba(0,0,0,.95), 0 18px 40px -26px rgba(0,0,0,.6);
  --glow-lane: 0 26px 80px -34px rgba(61,150,198,.55);
}

/* ---- base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--ground); }
body { margin: 0; min-height: 100vh; color: var(--body); font: 400 16px/1.75 var(--sans);
  background: radial-gradient(1100px 560px at 88% -12%, rgba(61,150,198,.11), transparent 62%), var(--ground);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
/* film grain, as on the landing */
body::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 90; opacity: .045; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
a { color: inherit; text-underline-offset: 4px; }
button, input { font: inherit; color: inherit; }
::selection { background: rgba(61,150,198,.38); color: var(--text); }
:focus-visible { outline: 2px solid var(--lane-hi); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }

/* scrollbars: thin, translucent green — the simulator's standard */
* { scrollbar-width: thin; scrollbar-color: rgba(124,160,134,.45) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(124,160,134,.45); border: 3px solid transparent; background-clip: content-box; border-radius: 10px; }

.skip { position: fixed; top: 8px; left: 8px; z-index: 200; padding: 10px 14px; border-radius: var(--r-2);
  background: var(--lane); color: var(--on-lane); font-weight: 600; text-decoration: none; transform: translateY(-160%); }
.skip:focus { transform: none; }

/* ---- type ---- */
h1, h2, h3 { margin: 0; color: var(--text); font-family: var(--display); font-weight: 700; text-wrap: balance;
  word-break: keep-all; overflow-wrap: anywhere; }
h1 { font-size: clamp(34px, 4.4vw, 54px); line-height: 1.18; letter-spacing: 0; }
h2 { font-size: 22px; line-height: 1.4; font-weight: 700; }
h3 { font-size: 17px; line-height: 1.45; font-weight: 600; }
p { margin: 0; line-break: strict; }
.lead { font-size: 18px; line-height: 1.8; color: var(--body); max-width: 30em; text-wrap: pretty; }
.note { font-size: 14px; line-height: 1.7; color: var(--muted); }
.eyebrow { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; font: 600 12px/1.5 var(--meta); letter-spacing: .08em; color: var(--label); }
.eyebrow::before { content: ""; flex: none; width: 22px; height: 2px; background: var(--lane); border-radius: 1px; }
/* the landing's one emphasis device: the blue boarding lane painted under the pivot phrase */
.pv { position: relative; white-space: nowrap; z-index: 0; }
.pv::after { content: ""; position: absolute; z-index: -1; left: 0; right: 0; bottom: -.08em; height: .13em; min-height: 3px; background: var(--lane); border-radius: 1px; }
.num { font-family: var(--display); font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

/* ---- controls ---- */
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px;
  border-radius: 999px; border: 1px solid var(--edge-2); background: transparent; color: var(--text);
  font: 600 15px/1.2 var(--sans); letter-spacing: .02em; text-decoration: none; cursor: pointer;
  transition: background var(--t-micro) var(--ease-out), border-color var(--t-micro) var(--ease-out), color var(--t-micro) var(--ease-out), transform var(--t-state) var(--ease-out), box-shadow var(--t-state) var(--ease-out); }
button:hover, .button:hover { border-color: var(--edge-3); background: rgba(223,232,232,.04); }
.primary, button.primary { background: var(--lane); border-color: var(--lane); color: var(--on-lane); }
.primary:hover, button.primary:hover { background: var(--lane-hi); border-color: var(--lane-hi); box-shadow: var(--glow-lane); }
button:disabled, button:disabled:hover { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
@media (hover: hover) { .primary:not(:disabled):hover { transform: translateY(-2px); } }

/* ---- layout ---- */
.shell { position: relative; min-height: 100vh; display: flex; flex-direction: column; }
.wrap { width: min(var(--maxw), calc(100vw - 2 * var(--gutter))); margin-inline: auto; }
.page { flex: 1; padding: clamp(36px, 6vw, 72px) 0 clamp(56px, 7vw, 96px); }

/* ---- header: the landing's nav bar ---- */
.header { position: sticky; top: 0; z-index: 80; background: rgba(11,15,17,.72); border-bottom: 1px solid var(--edge);
  -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%); }
.header .wrap { min-height: var(--nav-h); display: flex; align-items: center; flex-wrap: wrap; gap: 8px 24px; }
.brand { display: inline-flex; align-items: center; gap: 11px; min-height: 44px; color: var(--text); text-decoration: none; flex: none; border-radius: 8px; }
.brand svg { display: block; width: 28px; height: 28px; flex: none; }
.brand b { display: block; font: 700 17px/1 var(--display); letter-spacing: .02em; }
.brand small { display: block; margin-top: 4px; font: 600 11px/1 var(--meta); letter-spacing: .08em; color: var(--label); }
.nav { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-inline-start: auto; }
.nav a { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 8px;
  color: var(--muted); text-decoration: none; font: 500 14px/1 var(--sans); white-space: nowrap; transition: color var(--t-micro) var(--ease-out); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }
.nav a[aria-current="page"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 6px; height: 2px; border-radius: 1px; background: var(--lane); }
.nav .quiet { color: var(--label); }
.nav .quiet:hover { color: var(--text); }
.nav button { min-height: 44px; padding: 0 16px; margin-inline-start: 6px; font-size: 14px; }

/* ---- surfaces ---- */
.card { position: relative; background: var(--surface); border: 1px solid var(--edge); border-radius: var(--r-3); padding: clamp(22px, 3vw, 32px); box-shadow: var(--shadow-2); }
.card > h2 { margin-bottom: 20px; }
/* the simulator's floating panels carry L-shaped corner marks (landing .bracket) */
.bracket::before, .bracket::after { content: ""; position: absolute; width: 9px; height: 9px; pointer-events: none; border-color: rgba(168,196,156,.55); border-style: solid; }
.bracket::before { top: -1px; left: -1px; border-width: 1.5px 0 0 1.5px; border-top-left-radius: 2px; }
.bracket::after { bottom: -1px; right: -1px; border-width: 0 1.5px 1.5px 0; border-bottom-right-radius: 2px; }
.callout { padding: 16px 18px; border-radius: var(--r-2); background: color-mix(in srgb, var(--lane) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--lane) 26%, transparent); color: var(--body); font-size: 14px; line-height: 1.75; }
.callout:focus-visible { outline-offset: 2px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--edge-2);
  font: 600 12px/1.4 var(--meta); letter-spacing: .06em; color: var(--muted); white-space: nowrap; }

/* ---- forms ---- */
.form label { display: block; margin-bottom: 18px; color: var(--text); font-size: 14px; font-weight: 600; }
.form input, .link-box input { display: block; width: 100%; min-height: 48px; margin-top: 8px; padding: 11px 14px; border-radius: var(--r-2);
  border: 1px solid var(--edge-2); background: var(--surface-2); color: var(--text); font-weight: 400; font-size: 16px;
  transition: border-color var(--t-micro) var(--ease-out), background var(--t-micro) var(--ease-out); }
.form input::placeholder { color: var(--label); opacity: 1; }
.form input:hover { border-color: var(--edge-3); }
.form input:focus-visible, .link-box input:focus-visible { outline: 2px solid var(--lane-hi); outline-offset: 1px; border-color: var(--lane); background: var(--surface-3); border-radius: var(--r-2); }
.form input:-webkit-autofill, .form input:-webkit-autofill:hover, .form input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text); caret-color: var(--text); -webkit-box-shadow: 0 0 0 1000px var(--surface-2) inset; box-shadow: 0 0 0 1000px var(--surface-2) inset; }
.form .primary { width: 100%; min-height: 50px; margin-top: 6px; font-size: 16px; }
.form .secondary-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.form .secondary-actions button { min-height: 44px; padding: 0 4px; border: 0; background: transparent; color: var(--muted); font-size: 14px; font-weight: 500; }
.form .secondary-actions button:hover { color: var(--text); background: transparent; }
.status { min-height: 26px; margin-top: 14px; font-size: 14px; line-height: 1.7; color: var(--body); overflow-wrap: anywhere; }
.status:empty { min-height: 0; margin-top: 0; }
.status.error { color: var(--deduct); }
.status.error::before { content: "! "; font-weight: 700; }

/* ---- sign-in / reset ---- */
.auth-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,440px); gap: clamp(40px, 7vw, 96px); align-items: center; max-width: 1020px; margin-inline: auto; }
.auth-copy h1 { margin-bottom: 22px; }
.auth-copy .lead + .callout, .auth-copy .lead + .note { margin-top: 26px; }
.auth-copy .note + .note { margin-top: 10px; }
.card .callout { margin-top: 14px; }
.card #resetDone { width: 100%; min-height: 50px; margin-top: 6px; }

/* ---- signed-in pages ---- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 16px 24px; margin-bottom: 28px; }
.page-head h1 { font-size: clamp(30px, 3.6vw, 44px); margin-bottom: 6px; }
.page-head #identity { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.page-head .eyebrow { margin-bottom: 12px; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin: 0 0 18px; }
.stat { background: var(--surface); border: 1px solid var(--edge); border-radius: var(--r-3); padding: 18px 20px; }
.stat strong { display: block; color: var(--text); font: 700 clamp(26px, 2.6vw, 34px)/1.15 var(--display); font-variant-numeric: tabular-nums; }
.stat span { display: block; margin-top: 6px; font: 600 12px/1.5 var(--meta); letter-spacing: .08em; color: var(--label); }

.records { list-style: none; padding: 0; margin: 0; }
.record { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 6px 20px; padding: 20px 0; border-bottom: 1px solid var(--edge); }
.record:first-child { padding-top: 0; }
.record:last-child { border-bottom: 0; padding-bottom: 0; }
.record h3 { margin-bottom: 4px; }
.record p { font-size: 13px; color: var(--muted); }
.score { align-self: center; text-align: right; color: var(--text); font: 700 26px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.score small { display: block; margin-top: 4px; font: 600 12px/1.4 var(--meta); letter-spacing: .06em; color: var(--label); }
details { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
summary { display: inline-flex; align-items: center; min-height: 44px; cursor: pointer; color: var(--lane-hi); }
summary:hover { color: var(--text); }
details ul { margin: 4px 0 0; padding-left: 20px; }
details li { margin: 2px 0; }
.load-more { display: flex; margin: 24px auto 0; }
.empty { padding: 28px 12px; text-align: center; }
.empty h3 { margin-bottom: 8px; }
.empty p { color: var(--muted); font-size: 14px; }
.empty a { display: inline-flex; align-items: center; min-height: 44px; margin-top: 8px; color: var(--lane-hi); font-weight: 600; }

.admin-grid { display: grid; grid-template-columns: minmax(0,380px) minmax(0,1fr); gap: 20px; align-items: start; }
.admin-grid .card > .note { margin-bottom: 18px; }
.admin-grid .form + .note { margin: 4px 0 0; }
.user-row { display: flex; justify-content: space-between; align-items: center; gap: 12px 16px; padding: 16px 0; border-bottom: 1px solid var(--edge); }
.user-row:first-child { padding-top: 0; }
.user-row:last-child { border-bottom: 0; padding-bottom: 0; }
.user-row strong { display: block; color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.user-row small { color: var(--muted); font-size: 13px; }
.user-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; flex: none; }
.user-actions button { padding: 0 14px; font-size: 13px; }
.link-box { margin-top: 22px; padding: 20px; border-radius: var(--r-3); border: 1px solid color-mix(in srgb, var(--lane) 45%, transparent);
  background: color-mix(in srgb, var(--lane) 9%, var(--surface)); }
.link-box h3 { margin-bottom: 6px; }
.link-box .note { margin-bottom: 12px; }
.link-box label.note { display: block; margin: 0; color: var(--text); font-weight: 600; }
.link-box input { margin-bottom: 12px; font: 13px/1.5 var(--mono); color: var(--lane-hi); background: var(--ground); }
.link-box button { margin: 0 8px 8px 0; }
#setupCopy { background: var(--lane); border-color: var(--lane); color: var(--on-lane); }
#setupCopy:hover { background: var(--lane-hi); border-color: var(--lane-hi); }
.page-head + .status { margin: -8px 0 18px; }
.stats + .status { margin: 0 0 14px; }

/* ---- footer ---- */
.footer { border-top: 1px solid var(--edge); padding: 28px 0 36px; color: var(--label); font-size: 13px; line-height: 1.7; }
.footer .wrap { display: flex; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; }
.footer b { color: var(--muted); font-weight: 600; }

/* ---- small screens ---- */
@media (max-width: 860px) {
  .auth-grid, .admin-grid { grid-template-columns: minmax(0,1fr); gap: 28px; }
  .stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 560px) {
  .header .wrap { gap: 0 12px; padding-block: 6px; }
  .brand small { display: none; }
  .nav a { padding: 0 9px; }
  .nav button { padding: 0 14px; }
  .signed-in .header .nav { width: 100%; margin-inline-start: -9px; }
  .signed-in .header .nav button { margin-inline-start: auto; }
  .page-head .button { width: 100%; }
  .user-row { flex-direction: column; align-items: stretch; }
  .footer .wrap { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .001ms !important; transition-delay: 0s !important; animation-duration: .001ms !important; }
}
@media print {
  body { background: #fff; color: #000; }
  body::after, .header .nav { display: none; }
}
