@font-face {
  /* Cinzel 500（OFL，罗马碑体大写）子集：A–Z 与空格，3 KB */
  font-family: "Mahiru Caps";
  src: url("/site/mahiru-caps.woff2") format("woff2");
  font-display: swap;
  font-weight: 500;
  font-style: normal;
}

@font-face {
  /* Pinyon Script（OFL，铜版圆体）子集：只留拉丁字母，17 KB */
  font-family: "Mahiru Display";
  src: url("/site/mahiru-display.woff2") format("woff2");
  font-display: swap;
  font-weight: 400;
  font-style: normal;
}

:root {
  color-scheme: light dark;
  --page: light-dark(#fcfaf7, #191817);
  --surface: light-dark(#fffefc, #211f1e);
  --subtle: light-dark(#f5f1eb, #1d1b1a);
  --hover: light-dark(#f0eae2, #2d2925);
  --ink: light-dark(#2c2825, #ffffff);
  --muted: light-dark(#6d6359, #ffffffb3);
  --line: light-dark(#e8e0d6, #39322c);
  --input-line: light-dark(#cec4b9, #635a51);
  --accent: light-dark(#39617c, #abc8dc);
  --primary: light-dark(#3a302a, #f0e4d4);
  --on-primary: light-dark(#fffaf5, #302822);
  --gold: light-dark(#a86243, #d87254);
  --gold-soft: light-dark(#f6e7dc, #3a2620);
  --radius-control: 9px;
  --danger: light-dark(#a72f28, #ffa59e);
  --danger-bg: light-dark(#fff1ef, #391f20);
  --ok: light-dark(#19694e, #79d4af);
  --ok-bg: light-dark(#edf7f2, #15322c);
  --warning: light-dark(#8e5a11, #efba64);
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--page); font: 14px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button, summary { cursor: pointer; }
h1, h2, p, form { margin: 0; }
h1, h2, p, strong { overflow-wrap: anywhere; }
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); color: var(--ink); }
.sr-only { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.skip-link { position: fixed; z-index: 10; inset: 8px auto auto 8px; padding: 8px 14px; transform: translateY(-160%); background: var(--surface); }
.skip-link:focus { transform: none; }
.portal-icon { display: block; width: 18px; height: 18px; flex: none; }
.brand { display: inline-flex; gap: 10px; align-items: center; width: fit-content; color: var(--ink); text-decoration: none; }
.brand-mark { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: var(--radius-control); background: var(--primary); color: var(--on-primary); box-shadow: inset 0 0 0 1px #ae85594a; }
.brand-mark .portal-icon { width: 23px; height: 23px; }
.brand-word { display: inline-flex; align-items: baseline; gap: 6px; transform: none; font-family: "Mahiru Display", "Snell Roundhand", Georgia, serif; font-size: 29px; font-weight: 400; line-height: 1.15; letter-spacing: .005em; white-space: nowrap; }
.brand-word span { font-family: "Mahiru Caps", "Trajan Pro", Georgia, serif; font-size: 10px; font-weight: 500; line-height: 1; letter-spacing: .26em; text-transform: uppercase; opacity: .78; }
.theme-toggle, .icon-button, .password-toggle { display: inline-grid; place-items: center; flex: none; border: 0; background: transparent; color: var(--muted); border-radius: var(--radius-control); padding: 0; width: 40px; height: 40px; }
.theme-toggle:hover, .icon-button:hover, .password-toggle:hover { background: var(--hover); color: var(--ink); }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; width: fit-content; min-height: 40px; max-width: 100%; padding: 8px 16px; border: 1px solid transparent; border-radius: var(--radius-control); font-size: 14px; font-weight: 600; line-height: 1.4; text-decoration: none; text-align: center; }
.primary { background: var(--primary); color: var(--on-primary); }
.primary:hover { background: color-mix(in srgb, var(--primary) 86%, var(--on-primary)); }
.secondary { background: var(--surface); border-color: var(--input-line); color: var(--ink); }
.quiet { background: transparent; color: var(--muted); }
.secondary:hover, .quiet:hover { background: var(--hover); color: var(--ink); }
.danger { background: var(--danger-bg); border-color: color-mix(in srgb, var(--danger) 45%, transparent); color: var(--danger); }
.danger:hover { border-color: var(--danger); }
.button.full { width: 100%; }
.button:active, .icon-button:active, .theme-toggle:active { background-color: var(--hover); }
.primary:active { background-color: color-mix(in srgb, var(--primary) 77%, var(--on-primary)); }
.danger:active { background-color: color-mix(in srgb, var(--danger-bg) 88%, var(--danger)); }
button[aria-disabled="true"] { cursor: progress; opacity: .72; }
button[type="submit"][aria-disabled="true"]::before { content: ""; flex: none; width: 13px; height: 13px; border: 1.6px solid currentColor; border-right-color: transparent; border-radius: 50%; }
.stack { display: grid; gap: 18px; }
.field { display: grid; min-width: 0; gap: 7px; }
.field label { font-weight: 580; }
.field-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.field-help { color: var(--muted); font-size: 12px; line-height: 1.55; }
.field:has([aria-invalid="true"]) .field-help { color: var(--danger); }
input:not([type="hidden"]), select { display: block; width: 100%; min-width: 0; min-height: 44px; padding: 10px 13px; border: 1px solid var(--input-line); border-radius: var(--radius-control); color: var(--ink); background: var(--surface); font-size: 15px; line-height: 1.45; }
input::placeholder { color: var(--muted); opacity: .9; }
input:enabled:hover, select:enabled:hover { border-color: var(--muted); }
input[aria-invalid="true"], input[aria-invalid="true"]:hover { --field-focus: var(--danger); border-color: var(--danger); }
input:focus, select:focus {
  border-color: var(--field-focus, var(--accent));
  outline: 1px solid var(--field-focus, var(--accent));
  outline-offset: -1px;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--field-focus, var(--accent)) 14%, transparent);
}
.password-field { position: relative; }
.password-field input { padding-inline-end: 48px; }
.password-toggle { position: absolute; inset: 2px 3px 2px auto; width: 40px; height: auto; }
.password-toggle .portal-icon { width: 17px; height: 17px; }
.password-toggle[aria-pressed="true"] { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.password-toggle:focus-visible { outline-offset: -2px; }
.notice { display: flex; align-items: flex-start; gap: 10px; padding: 13px 15px; margin: 0 0 22px; border: 1px solid color-mix(in srgb, currentColor 22%, transparent); border-radius: 8px; font-size: 13px; }
.notice .portal-icon { width: 16px; height: 16px; margin-top: 2px; }
.notice-error { color: var(--danger); background: var(--danger-bg); }
.notice-success { color: var(--ok); background: var(--ok-bg); }
@media (max-width: 760px) {
  input:not([type="hidden"]), select { font-size: 16px; }
  .button, .icon-button, .theme-toggle { min-height: 44px; }
}
@media (prefers-reduced-motion: no-preference) {
  input, select { transition: box-shadow .14s ease; }
  button[type="submit"][aria-disabled="true"]::before { animation: busy .75s linear infinite; }
  @keyframes busy { to { transform: rotate(1turn); } }
}
@media (forced-colors: active) {
  .brand-mark, .button { border: 1px solid ButtonText; }
  input:focus, select:focus { outline: 2px solid Highlight; outline-offset: 1px; }
}
