/* /styles/tokens.css */
/* ==========================================================================
   Design Tokens — NJU Red Cross Platform
   Single source of truth. Components must never hard-code raw colour values.
   Two token surfaces:
     [data-surface="portal"] — public service portal, warm paper light theme
     [data-surface="console"] — internal operations console, neutral light theme
   ========================================================================== */

:root {
  /* ---- Brand ---------------------------------------------------------- */
  --brand-crimson: #d8283f;
  --brand-crimson-deep: #a3132a;
  --brand-plum: #5c1230;
  --brand-ink: #14100f;

  /* ---- Typography ----------------------------------------------------- */
  --font-sans: "Times New Roman", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
  --font-serif: "Times New Roman", "Songti SC", "SimSun", "Noto Serif CJK SC", "Source Han Serif SC", serif;
  --font-annotation: "Times New Roman", "Kaiti SC", "KaiTi", "STKaiti", "Noto Serif CJK SC", serif;
  --font-mono: "SFMono-Regular", "SF Mono", Consolas, "Liberation Mono", monospace;

  --fs-display: 2.75rem;
  --fs-h1: 1.9rem;
  --fs-h2: 1.375rem;
  --fs-h3: 1.0625rem;
  --fs-title: 0.9375rem;
  --fs-body: 0.875rem;
  --fs-secondary: 0.8125rem;
  --fs-caption: 0.75rem;
  --fs-label: 0.6875rem;
  --fs-data: 0.8125rem;

  --lh-tight: 1.1;
  --lh-snug: 1.3;
  --lh-normal: 1.55;
  --lh-relaxed: 1.7;

  --tracking-display: -0.032em;
  --tracking-heading: 0;
  --tracking-body: 0;
  --tracking-label: 0.08em;

  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 590;
  --fw-bold: 680;

  /* ---- Spacing — 4px base, 8px rhythm --------------------------------- */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 20px;
  --s6: 24px;
  --s8: 32px;
  --s10: 40px;
  --s12: 48px;
  --s16: 64px;
  --s20: 80px;
  --s24: 96px;
  --s32: 128px;

  /* ---- Radius --------------------------------------------------------- */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 9px;
  --r-lg: 13px;
  --r-xl: 20px;
  --r-2xl: 28px;
  --r-full: 999px;

  /* ---- Layout --------------------------------------------------------- */
  --nav-w: 248px;
  --nav-w-collapsed: 64px;
  --inspector-w: 384px;
  --topbar-h: 52px;
  --content-max: 1360px;
  --prose-max: 68ch;

  /* ---- Motion --------------------------------------------------------- */
  --dur-instant: 90ms;
  --dur-1: 140ms;
  --dur-2: 200ms;
  --dur-3: 280ms;
  --dur-4: 380ms;
  --dur-5: 620ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.45, 0, 0.25, 1);
  --ease-spring: cubic-bezier(0.34, 1.42, 0.52, 1);
  --ease-snap: cubic-bezier(0.2, 0.9, 0.2, 1);

  /* ---- Z index -------------------------------------------------------- */
  --z-ambient: 0;
  --z-base: 1;
  --z-sticky: 20;
  --z-dock: 40;
  --z-popover: 60;
  --z-overlay: 80;
  --z-toast: 100;

  --blood-open-bg: #eef8f2;
  --blood-open-ink: #185d3e;
  --blood-open-border: #96c7ab;
  --blood-full-bg: #f0f1f3;
  --blood-full-ink: #4b535e;
  --blood-full-border: #b2b8c0;
  --blood-pending-bg: #fff5e3;
  --blood-pending-ink: #795014;
  --blood-pending-border: #d9b474;
  --blood-own-bg: #edf3ff;
  --blood-own-ink: #284d8d;
  --blood-own-border: #95afda;
  --control-radius: 10px;

  /* ---- Semantic hues shared by both surfaces -------------------------- */
  --hue-success: 152;
  --hue-warning: 36;
  --hue-error: 6;
  --hue-info: 214;
}

/* ==========================================================================
   Public portal — warm paper, editorial, high legibility
   ========================================================================== */
[data-surface="portal"] {
  --field-h: 44px;
  --control-h: 44px;
  --bg-base: #f7f4f1;
  --bg-sunken: #efeae5;
  /* 2026-10-28：只读信息块（实名卡、只读栏目等）统一用中性灰，
     不跟门户的暖纸色走 —— 暖色会让人误以为是可编辑输入框的底色。 */
  --bg-readonly: #eef0f3;
  --surface: #fffefd;
  --surface-raised: #ffffff;
  --surface-inverse: #17110f;
  --surface-accent-soft: #fdeff0;

  --border: rgba(24, 16, 14, 0.09);
  --border-strong: rgba(24, 16, 14, 0.16);
  --border-hover: rgba(24, 16, 14, 0.26);
  --border-accent: rgba(216, 40, 63, 0.4);

  --text-primary: #191311;
  --text-secondary: #5b514c;
  --text-muted: #736863;
  --text-faint: #b3a9a3;
  --text-on-accent: #fffaf9;
  --text-on-inverse: #f6f1ee;

  --accent: #c31f35;
  --accent-hover: #ab1729;
  --accent-soft: rgba(195, 31, 53, 0.09);
  --accent-ring: rgba(195, 31, 53, 0.22);

  --success: hsl(var(--hue-success) 62% 32%);
  --success-soft: hsl(var(--hue-success) 58% 94%);
  --warning: hsl(var(--hue-warning) 88% 34%);
  --warning-soft: hsl(var(--hue-warning) 90% 94%);
  --error: hsl(var(--hue-error) 74% 43%);
  --error-soft: hsl(var(--hue-error) 84% 96%);
  --info: hsl(var(--hue-info) 76% 40%);
  --info-soft: hsl(var(--hue-info) 84% 95%);

  --e1: 0 1px 2px rgba(24, 16, 14, 0.05);
  --e2: 0 2px 6px -1px rgba(24, 16, 14, 0.07), 0 1px 2px rgba(24, 16, 14, 0.05);
  --e3: 0 10px 28px -10px rgba(24, 16, 14, 0.17), 0 2px 6px rgba(24, 16, 14, 0.05);
  --e4: 0 28px 70px -24px rgba(24, 16, 14, 0.3), 0 4px 12px rgba(24, 16, 14, 0.07);

  --mesh-1: rgba(195, 31, 53, 0.1);
  --mesh-2: rgba(92, 18, 48, 0.07);
  --mesh-3: rgba(215, 160, 96, 0.08);
  --grain-opacity: 0.032;
  --scrim: rgba(24, 16, 14, 0.36);
  --skeleton-base: rgba(24, 16, 14, 0.055);
  --skeleton-sheen: rgba(255, 255, 255, 0.72);
  color-scheme: light;
}

/* ==========================================================================
   Operations console — neutral light workspace, dense, keyboard first
   ========================================================================== */
[data-surface="console"] {
  --field-h: 36px;
  --control-h: 36px;
  --bg-base: #f5f6f8;
  --bg-sunken: #eef0f3;
  --bg-readonly: #eef0f3;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-inverse: #17110f;
  --surface-accent-soft: #fdeff0;

  --border: rgba(24, 16, 14, 0.09);
  --border-strong: rgba(24, 16, 14, 0.16);
  --border-hover: rgba(24, 16, 14, 0.26);
  --border-accent: rgba(216, 40, 63, 0.4);

  --text-primary: #20242b;
  --text-secondary: #505966;
  --text-muted: #606975;
  --text-faint: #66707c;
  --text-on-accent: #fffaf9;
  --text-on-inverse: #f6f1ee;

  --accent: #c31f35;
  --accent-hover: #ab1729;
  --accent-soft: rgba(195, 31, 53, 0.09);
  --accent-ring: rgba(195, 31, 53, 0.22);

  --success: hsl(var(--hue-success) 62% 32%);
  --success-soft: hsl(var(--hue-success) 58% 94%);
  --warning: hsl(var(--hue-warning) 88% 34%);
  --warning-soft: hsl(var(--hue-warning) 90% 94%);
  --error: hsl(var(--hue-error) 74% 43%);
  --error-soft: hsl(var(--hue-error) 84% 96%);
  --info: hsl(var(--hue-info) 76% 40%);
  --info-soft: hsl(var(--hue-info) 84% 95%);

  --e1: 0 1px 2px rgba(24, 16, 14, 0.05);
  --e2: 0 2px 6px -1px rgba(24, 16, 14, 0.07), 0 1px 2px rgba(24, 16, 14, 0.05);
  --e3: 0 10px 28px -10px rgba(24, 16, 14, 0.17), 0 2px 6px rgba(24, 16, 14, 0.05);
  --e4: 0 28px 70px -24px rgba(24, 16, 14, 0.3), 0 4px 12px rgba(24, 16, 14, 0.07);

  --mesh-1: rgba(195, 31, 53, 0.1);
  --mesh-2: rgba(92, 18, 48, 0.07);
  --mesh-3: rgba(215, 160, 96, 0.08);
  --grain-opacity: 0;
  --scrim: rgba(24, 16, 14, 0.36);
  --skeleton-base: rgba(24, 16, 14, 0.055);
  --skeleton-sheen: rgba(255, 255, 255, 0.72);
  color-scheme: light;
}

/* Compact density for data-heavy console views */
[data-density="compact"] {
  --row-h: 32px;
  --field-h: 32px;
  --control-h: 32px;
}
[data-density="comfortable"] {
  --row-h: 42px;
  --field-h: 36px;
  --control-h: 32px;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-instant: 1ms;
    --dur-1: 1ms;
    --dur-2: 1ms;
    --dur-3: 1ms;
    --dur-4: 1ms;
    --dur-5: 1ms;
  }
}

@media(max-width:700px) { [data-surface] { --field-h: 48px; --control-h: 44px; } }

/* One category palette for the public plaza and the administrator directory. */
:is(.portal .event-browser--aligned .event-row,.activity-v2-card)[data-category='主席团专项'] {--category-label-bg:#f0e4f6;--category-label-ink:#79558b;}
:is(.portal .event-browser--aligned .event-row,.activity-v2-card)[data-category='博爱中心'] {--category-label-bg:#ffd6a4;--category-label-ink:#87551f;}
:is(.portal .event-browser--aligned .event-row,.activity-v2-card)[data-category='生命中心'] {--category-label-bg:#ddf2e4;--category-label-ink:#39704c;}
:is(.portal .event-browser--aligned .event-row,.activity-v2-card)[data-category='综事中心'] {--category-label-bg:#cdf1f9;--category-label-ink:#2d6978;}
:is(.portal .event-browser--aligned .event-row,.activity-v2-card)[data-category='一加助残专项'] {--category-label-bg:#e6e9fa;--category-label-ink:#505c95;}
:is(.portal .event-browser--aligned .event-row,.activity-v2-card)[data-category='献血车专项'] {--category-label-bg:#fee5e4;--category-label-ink:#a34846;}
.activity-v2-card[data-category='排班专项'] {--category-label-bg:#f9f1c0;--category-label-ink:#806515;}

/* Chinese roles use installed families: PingFang/Songti/Kaiti on macOS,
   Microsoft YaHei/SimSun/KaiTi on Windows and Noto on Linux. Latin resolves
   to locally installed Times New Roman; no WebFont request is made. */
:root {
 --font-display-editorial:var(--font-sans); --font-heading:var(--font-sans);
 --font-ui:var(--font-serif); --font-reading:var(--font-serif);
 --font-numeric:var(--font-serif);
}
@media(min-width:1101px) {
 [data-surface="portal"] { --fs-display:4rem; --fs-h1:2.5rem; --fs-h2:1.875rem; --fs-h3:1.375rem; --fs-title:1.0625rem; --fs-body:1rem; --fs-secondary:.9375rem; --fs-caption:.8125rem; --fs-label:.8125rem; --fs-data:.9375rem; --lh-normal:1.7; --lh-tight:1.25; }
}

/* /styles/base.css */
/* ==========================================================================
   Base layer — reset, typography scale, ambient visual layer, primitives
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  font-family: var(--font-reading);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  letter-spacing: var(--tracking-body);
  color: var(--text-primary);
  background: var(--bg-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis-weight: none;
  overscroll-behavior-y: none;
  /* Theme tokens update together; no body-only color transition. */
}

h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
  margin: 0;
}

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
}

img {
  display: block;
  max-width: 100%;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

::selection {
  background: var(--accent-ring);
  color: var(--text-primary);
}

/* ---- Scrollbars ------------------------------------------------------- */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--r-full);
  border: 3px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
  background-clip: content-box;
}

/* ---- Skip link -------------------------------------------------------- */
.skip-link {
  position: fixed;
  top: var(--s3);
  left: var(--s3);
  z-index: var(--z-toast);
  padding: var(--s2) var(--s4);
  border-radius: var(--r-full);
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  box-shadow: var(--e3);
  font-size: var(--fs-secondary);
  transform: translateY(-200%);
  transition: transform var(--dur-2) var(--ease-out);
}
.skip-link:focus-visible {
  transform: translateY(0);
}

/* ---- Root ------------------------------------------------------------- */
.root {
  position: relative;
  z-index: var(--z-base);
  min-height: 100%;
  isolation: isolate;
}

/* Legacy ambient host remains inert for cached shells; page canvases own backgrounds. */
.ambient { display: none; pointer-events: none; }

/* ==========================================================================
   Typography primitives
   ========================================================================== */
.t-display {
  font-size: var(--fs-display);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-display);
  font-weight: var(--fw-semibold);
  text-wrap: balance;
}
.t-h1 {
  font-size: var(--fs-h1);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-heading);
  font-weight: var(--fw-semibold);
  text-wrap: balance;
}
.t-h2 {
  font-size: var(--fs-h2);
  line-height: var(--lh-snug);
  letter-spacing: var(--tracking-heading);
  font-weight: var(--fw-semibold);
}
.t-h3 {
  font-size: var(--fs-h3);
  line-height: var(--lh-snug);
  letter-spacing: var(--tracking-heading);
  font-weight: var(--fw-semibold);
}
.t-title {
  font-size: var(--fs-title);
  line-height: var(--lh-snug);
  font-weight: var(--fw-medium);
}
.t-body {
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
}
.t-secondary {
  font-size: var(--fs-secondary);
  line-height: var(--lh-normal);
  color: var(--text-secondary);
}
.t-caption {
  font-size: var(--fs-caption);
  line-height: 1.45;
  color: var(--text-muted);
}
.t-label {
  font-size: var(--fs-label);
  line-height: 1.2;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  font-weight: var(--fw-semibold);
  color: var(--text-muted);
}
.t-data {
  font-family: var(--font-mono);
  font-size: var(--fs-data);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.t-num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
.t-prose {
  max-width: var(--prose-max);
  line-height: var(--lh-relaxed);
  color: var(--text-secondary);
}
.t-muted { color: var(--text-muted); }
.t-faint { color: var(--text-faint); }
.t-accent { color: var(--accent); }
.t-strong { font-weight: var(--fw-semibold); color: var(--text-primary); }

.t-clamp-1,
.t-clamp-2,
.t-clamp-3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.t-clamp-1 { -webkit-line-clamp: 1; }
.t-clamp-2 { -webkit-line-clamp: 2; }
.t-clamp-3 { -webkit-line-clamp: 3; }

/* ==========================================================================
   Structure utilities — 每个变体自足，可单独使用。
   ========================================================================== */
.stack,
.stack-1, .stack-2, .stack-3, .stack-4, .stack-5,
.stack-6, .stack-8, .stack-10, .stack-12 {
  display: grid;
  align-content: start;
  min-width: 0;
}
.stack { gap: var(--s4); }
.stack-1 { gap: var(--s1); }
.stack-2 { gap: var(--s2); }
.stack-3 { gap: var(--s3); }
.stack-4 { gap: var(--s4); }
.stack-5 { gap: var(--s5); }
.stack-6 { gap: var(--s6); }
.stack-8 { gap: var(--s8); }
.stack-10 { gap: var(--s10); }
.stack-12 { gap: var(--s12); }

.row,
.row-1, .row-2, .row-3, .row-4, .row-5, .row-6,
.row-top, .row-base, .row-wrap, .row-between, .row-end {
  display: flex;
  align-items: center;
  min-width: 0;
}
.row { gap: var(--s3); }
.row-1 { gap: var(--s1); }
.row-2 { gap: var(--s2); }
.row-3 { gap: var(--s3); }
.row-4 { gap: var(--s4); }
.row-5 { gap: var(--s5); }
.row-6 { gap: var(--s6); }

/* Modifiers carry no gap of their own, so combining them with a gap class
   (e.g. "row-2 row-wrap") preserves the intended spacing. */
.row-top { align-items: flex-start; }
.row-base { align-items: baseline; }
.row-wrap { flex-wrap: wrap; }
.row-between { justify-content: space-between; }
.row-end { justify-content: flex-end; }

.spacer { flex: 1 1 auto; min-width: 0; }
.truncate { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.divider {
  height: 1px;
  border: 0;
  margin: 0;
  background: var(--border);
}
.divider-v {
  width: 1px;
  align-self: stretch;
  background: var(--border);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] { display: none !important; }
[aria-busy="true"] { cursor: progress; }

h1,h2,h3,h4,h5,h6,.t-display,.t-h1,.t-h2,.t-h3,.t-title { font-family:var(--font-heading); text-wrap:balance; }
input,button,select,textarea { font-family:var(--font-ui); }
button,.btn,[role="tab"],.t-label { font-family:var(--font-heading); }
small,figcaption,.t-caption,.field__hint,.field__error,.help-text { font-family:var(--font-annotation); }
.plogo__text > :is(b,strong),.nav__brand-text > :is(b,strong) { font-family:var(--font-heading); }
.hero__figure b,.blood-slot-capacity,.blood-calendar__date b,.metric__value { font-family:var(--font-numeric); font-variant-numeric:tabular-nums; }

/* /styles/components.css */
/* ==========================================================================
   Component layer — shared across portal and console
   Every interactive component defines: default / hover / active / focus /
   selected / loading / disabled states.
   ========================================================================== */

/* ==========================================================================
   Button
   ========================================================================== */
.btn {
  --btn-h: 34px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  height: var(--btn-h);
  padding: 0 var(--s4);
  border-radius: var(--r-md);
  border: 1px solid transparent;
  font-size: var(--fs-secondary);
  font-weight: var(--fw-medium);
  letter-spacing: var(--tracking-body);
  white-space: nowrap;
  user-select: none;
  isolation: isolate;
  transform: translate3d(var(--btn-dx, 0px), var(--btn-dy, 0px), 0);
  transition:
    background-color var(--dur-1) var(--ease-out),
    border-color var(--dur-1) var(--ease-out),
    color var(--dur-1) var(--ease-out),
    box-shadow var(--dur-2) var(--ease-out),
    transform var(--dur-2) var(--ease-spring),
    opacity var(--dur-1) linear;
}
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(120px 60px at var(--px, 50%) var(--py, 50%), rgba(255, 255, 255, 0.16), transparent 70%);
  opacity: 0;
  transition: opacity var(--dur-2) var(--ease-out);
  pointer-events: none;
  z-index: -1;
}
.btn:hover::after { opacity: 1; }
.btn:active { transition-duration: var(--dur-instant); transform: translate3d(var(--btn-dx, 0px), 1px, 0) scale(0.985); }

.btn--sm { --btn-h: 28px; padding: 0 var(--s3); font-size: var(--fs-caption); }
.btn--lg { --btn-h: 44px; padding: 0 var(--s6); font-size: var(--fs-title); border-radius: var(--r-lg); }
.btn--block { width: 100%; }
.btn--icon { width: var(--btn-h); padding: 0; }

.btn--primary {
  background: var(--accent);
  color: var(--text-on-accent);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
.btn--primary:hover { background: var(--accent-hover); box-shadow: 0 4px 14px -4px var(--accent-ring), inset 0 1px 0 rgba(255, 255, 255, 0.2); }

.btn--secondary {
  background: var(--surface-raised);
  border-color: var(--border-strong);
  color: var(--text-primary);
  box-shadow: var(--e1);
}
.btn--secondary:hover { border-color: var(--border-hover); --btn-dy: -1px; }

.btn--ghost { color: var(--text-secondary); }
.btn--ghost:hover { background: var(--accent-soft); color: var(--text-primary); }

.btn--quiet { color: var(--text-muted); }
.btn--quiet:hover { color: var(--text-primary); background: var(--surface-raised); }

.btn--danger {
  background: var(--error-soft);
  color: var(--error);
  border-color: color-mix(in srgb, var(--error) 28%, transparent);
}
.btn--danger:hover { background: var(--error); color: var(--text-on-accent); border-color: transparent; }

.btn--inverse {
  background: var(--surface-inverse);
  color: var(--text-on-inverse);
}
.btn--inverse:hover { --btn-dy: -1px; box-shadow: var(--e3); }

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.42;
  pointer-events: none;
  box-shadow: none;
}
.btn[data-loading="true"] {
  pointer-events: none;
  color: transparent;
}
.btn[data-loading="true"]::before {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  border-top-color: transparent;
  color: var(--text-on-accent);
  animation: spin 620ms linear infinite;
}
.btn--secondary[data-loading="true"]::before,
.btn--ghost[data-loading="true"]::before,
.btn--quiet[data-loading="true"]::before { color: var(--text-secondary); }

@keyframes spin { to { transform: rotate(360deg); } }

.btn__kbd {
  display: inline-flex;
  gap: 2px;
  margin-left: var(--s1);
  opacity: 0.55;
  font-family: var(--font-mono);
  font-size: 10px;
}

/* Icon glyph — inline SVG sprite driven */
.ico {
  width: 15px;
  height: 15px;
  flex: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  transition: transform var(--dur-2) var(--ease-spring), opacity var(--dur-1) linear;
}
.ico--sm { width: 13px; height: 13px; }
.ico--lg { width: 18px; height: 18px; }
.ico--xl { width: 22px; height: 22px; stroke-width: 1.5; }
.btn:hover .ico--spin { transform: rotate(90deg); }
.btn:hover .ico--nudge { transform: translateX(2px); }
.btn:hover .ico--pop { transform: scale(1.12); }

/* ==========================================================================
   Badge / Chip / Status
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  height: 20px;
  padding: 0 var(--s2);
  border-radius: var(--r-xs);
  font-size: var(--fs-label);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.02em;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  white-space: nowrap;
}
.badge--success { background: var(--success-soft); color: color-mix(in srgb, var(--success) 75%, var(--text-primary)); border-color: color-mix(in srgb, var(--success) 22%, transparent); }
.badge--warning { background: var(--warning-soft); color: color-mix(in srgb, var(--warning) 75%, var(--text-primary)); border-color: color-mix(in srgb, var(--warning) 22%, transparent); }
.badge--error { background: var(--error-soft); color: var(--error); border-color: color-mix(in srgb, var(--error) 22%, transparent); }
.badge--info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 22%, transparent); }
.badge--accent { background: var(--accent-soft); color: var(--accent); border-color: var(--border-accent); }
.badge--count { min-width: 20px; justify-content: center; font-variant-numeric: tabular-nums; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  height: 28px;
  padding: 0 var(--s3);
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: var(--fs-caption);
  transition: all var(--dur-1) var(--ease-out);
}
.chip:hover { border-color: var(--border-hover); color: var(--text-primary); }
.chip[aria-pressed="true"],
.chip[data-selected="true"] {
  background: var(--accent-soft);
  border-color: var(--border-accent);
  color: var(--accent);
}

/* Live status indicator: colour + text + motion, never colour alone */
.status {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-size: var(--fs-caption);
  color: var(--text-secondary);
  white-space: nowrap;
}
.status__dot {
  position: relative;
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--status-color, var(--text-muted));
}
.status--live .status__dot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid var(--status-color, var(--text-muted));
  animation: status-pulse 1.8s var(--ease-out) infinite;
}
.status--success { --status-color: var(--success); }
.status--warning { --status-color: var(--warning); }
.status--error { --status-color: var(--error); }
.status--info { --status-color: var(--info); }
.status--accent { --status-color: var(--accent); }
.status--idle { --status-color: var(--text-faint); }
@keyframes status-pulse {
  0% { transform: scale(0.7); opacity: 0.85; }
  100% { transform: scale(2.1); opacity: 0; }
}

.dots { display: inline-flex; gap: 3px; align-items: center; }
.dots i {
  width: 3px; height: 3px; border-radius: 50%;
  background: currentColor;
  animation: dots 1.1s var(--ease-in-out) infinite;
}
.dots i:nth-child(2) { animation-delay: 0.14s; }
.dots i:nth-child(3) { animation-delay: 0.28s; }
@keyframes dots { 0%, 60%, 100% { opacity: 0.25; } 30% { opacity: 1; } }

/* Progress ring for long-running work */
.ring { width: 16px; height: 16px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 2; }
.ring .ring__track { stroke: var(--border-strong); }
.ring .ring__fill { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset var(--dur-4) var(--ease-out); }

/* ==========================================================================
   Fields
   ========================================================================== */
.field { display: grid; gap: var(--s2); min-width: 0; }
.field__label {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-size: var(--fs-caption);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
}
.field__req { color: var(--accent); font-size: var(--fs-label); }
.field__hint { font-family:var(--font-annotation); font-size: var(--fs-caption); color: var(--text-muted); }
.field__error {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-size: var(--fs-caption);
  color: var(--error);
}

.input,
.textarea,
.select {
  width: 100%;
  min-height: var(--field-h, 44px);
  padding: 0 var(--s3);
  border-radius: var(--r-md);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-primary);
  font-size: var(--fs-body);
  transition:
    border-color var(--dur-1) var(--ease-out),
    background-color var(--dur-1) var(--ease-out),
    box-shadow var(--dur-2) var(--ease-out);
}
.textarea { padding: var(--s3); min-height: 96px; resize: vertical; line-height: var(--lh-normal); }
.select { appearance: none; padding-right: var(--s8); cursor: pointer; }

.input::placeholder,
.textarea::placeholder { color: var(--text-faint); }

.input:hover,
.textarea:hover,
.select:hover { border-color: var(--border-hover); }

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--accent);
  background: var(--surface-raised);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.input[aria-invalid="true"],
.textarea[aria-invalid="true"] { border-color: var(--error); }
.input[aria-invalid="true"]:focus,
.textarea[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--error) 24%, transparent); }
.input[disabled],
.textarea[disabled],
.select[disabled] { opacity: 0.5; cursor: not-allowed; }

/* 只读信息块（2026-10-28）
   之前只读字段直接复用 .input（1px 硬边框 + 白底），边缘「切」得很生硬，
   和卡片、抽屉的柔和边缘不是一套语言。这里改成：
   · 极淡描边 + 顶部一条内高光，让边缘有过渡而不是硬切；
   · 中性灰底（--bg-readonly），一眼能看出「这是只读的，不用填」；
   · 与门户的 identity-card 用同一套视觉。 */
.field__readonly {
  display: flex;
  align-items: center;
  gap: var(--s2);
  width: 100%;
  min-height: var(--field-h, 40px);
  padding: 0 var(--s3);
  border-radius: var(--r-md);
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--surface) 45%, var(--bg-readonly, var(--bg-sunken))) 0%,
    var(--bg-readonly, var(--bg-sunken)) 100%);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 55%, transparent);
  color: var(--text-primary);
  font-size: var(--fs-body);
  overflow-wrap: anywhere;
}
.field__readonly .ico { color: var(--text-muted); flex: none; }
.field__readonly > .t-caption { color: var(--text-muted); }

.field--select { position: relative; }
.select-wrap { position: relative; display: block; }
.select-wrap .ico {
  position: absolute;
  right: var(--s3);
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-muted);
}

.input-group { position: relative; display: flex; align-items: center; }
.input-group .ico { position: absolute; left: var(--s3); color: var(--text-muted); pointer-events: none; }
.input-group .input { padding-left: var(--s8); }

/* Checkbox / consent block */
.check {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: var(--s3);
  align-items: start;
  padding: var(--s3);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: border-color var(--dur-1) var(--ease-out), background-color var(--dur-1) var(--ease-out);
}
.check:hover { border-color: var(--border-hover); }
.check__box {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: var(--r-xs);
  border: 1.5px solid var(--border-hover);
  display: grid;
  place-items: center;
  transition: all var(--dur-2) var(--ease-spring);
}
.check__box .ico { width: 11px; height: 11px; stroke-width: 2.4; color: var(--text-on-accent); opacity: 0; transform: scale(0.5); }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check input:checked ~ .check__box,
.check[data-checked="true"] .check__box {
  background: var(--accent);
  border-color: var(--accent);
}
.check input:checked ~ .check__box .ico,
.check[data-checked="true"] .check__box .ico { opacity: 1; transform: scale(1); }
.check[data-checked="true"] { border-color: var(--border-accent); background: var(--accent-soft); }
.check input:focus-visible ~ .check__box { box-shadow: 0 0 0 3px var(--accent-ring); }
.check__text { font-size: var(--fs-secondary); line-height: var(--lh-normal); color: var(--text-secondary); }

/* --------------------------------------------------------------------------
   Review checklist — 审核检查清单（勾 = 该项已确认合格）
   结构与 .check 同源：方框 + 说明 + 状态标签；分组展示、进度可见。
   已勾选：方框填实 + 行底色 accent-soft + 出现「已确认」标签（颜色之外另有图标与文字）。
   -------------------------------------------------------------------------- */
.checklist { display: grid; gap: var(--s3); }

.checklist__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s4);
}
.checklist__title {
  font-size: var(--fs-title);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
  color: var(--text-primary);
}
.checklist__sub {
  margin-top: 2px;
  font-size: var(--fs-caption);
  line-height: var(--lh-normal);
  color: var(--text-muted);
}
.checklist__count {
  flex: none;
  font-size: var(--fs-title);
  font-weight: var(--fw-semibold);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  white-space: nowrap;
}
.checklist__count[data-complete="true"] { color: var(--success); }
.checklist__count small {
  font-size: var(--fs-caption);
  font-weight: var(--fw-regular);
  color: var(--text-muted);
}

.checklist__meter {
  height: 6px;
  border-radius: var(--r-full);
  background: var(--bg-sunken);
  overflow: hidden;
}
.checklist__fill {
  display: block;
  width: var(--w, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width var(--dur-3) var(--ease-out), background-color var(--dur-2) var(--ease-out);
}
.checklist__meter[data-complete="true"] .checklist__fill { background: var(--success); }

.checklist__actions { display: flex; flex-wrap: wrap; gap: var(--s2); }

.checklist__group {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-sunken);
  overflow: hidden;
}
.checklist__group-head {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s3) var(--s3) var(--s2);
}
.checklist__group-title {
  font-size: var(--fs-caption);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-label);
  color: var(--text-secondary);
}
.checklist__group-count {
  font-size: var(--fs-caption);
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}
.checklist__group-count[data-complete="true"] { color: var(--success); }
.checklist__rule { flex: 1; height: 1px; background: var(--border); }

.checklist__items { display: grid; gap: 2px; padding: 0 var(--s2) var(--s2); }

/* 清单行：覆盖 .check 的卡片外壳，改为「面板内的一行」，21 项也不刺眼。 */
.checklist__items .check--review {
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--s3);
  padding: var(--s2) var(--s3);
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  transition: background-color var(--dur-1) var(--ease-out);
}
.checklist__items .check--review:hover { background: var(--surface); }
.checklist__items .check--review[data-checked="true"] { background: var(--accent-soft); }
.checklist__items .check--review:hover .check__box { border-color: var(--accent); }

.check--review .check__text { display: grid; gap: 3px; min-width: 0; }
.check--review .check__text > b { line-height: var(--lh-snug); }
.check--review .check__text > p { margin: 0; line-height: var(--lh-normal); }
.check--review[data-checked="true"] .check__text > p { color: var(--text-faint); }

/* 状态标签：常驻占位（避免勾选时文字跳动），仅切换可见性。 */
.check__tag {
  align-self: start;
  margin-top: 1px;
  padding: 1px var(--s2);
  border: 1px solid var(--border-accent);
  border-radius: var(--r-full);
  background: var(--surface);
  font-size: 10px;
  font-weight: var(--fw-semibold);
  line-height: 1.6;
  letter-spacing: 0.02em;
  color: var(--accent);
  white-space: nowrap;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-spring);
  pointer-events: none;
}
.check--review[data-checked="true"] .check__tag { opacity: 1; transform: none; }

/* Toggle with spring motion */
.toggle {
  position: relative;
  width: 36px;
  height: 21px;
  flex: none;
  border-radius: var(--r-full);
  background: var(--border-strong);
  transition: background-color var(--dur-2) var(--ease-out);
}
.toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--surface-raised);
  box-shadow: var(--e2);
  transition: transform var(--dur-3) var(--ease-spring);
}
.toggle[aria-checked="true"] { background: var(--accent); }
.toggle[aria-checked="true"]::after { transform: translateX(15px); }

/* Segmented control with sliding indicator */
.segmented {
  position: relative;
  display: inline-flex;
  padding: 2px;
  border-radius: var(--r-md);
  background: var(--bg-sunken);
  border: 1px solid var(--border);
}
.segmented__thumb {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 0;
  border-radius: calc(var(--r-md) - 2px);
  background: var(--surface-raised);
  box-shadow: var(--e2);
  transform: translateX(var(--thumb-x, 0px));
  width: var(--thumb-w, 0px);
  transition: transform var(--dur-3) var(--ease-spring), width var(--dur-3) var(--ease-spring);
}
.segmented button {
  position: relative;
  z-index: 1;
  height: 28px;
  padding: 0 var(--s3);
  font-size: var(--fs-caption);
  font-weight: var(--fw-medium);
  color: var(--text-muted);
  border-radius: calc(var(--r-md) - 2px);
  transition: color var(--dur-2) var(--ease-out);
}
.segmented button:hover { color: var(--text-secondary); }
.segmented button[aria-selected="true"] { color: var(--text-primary); }

/* ==========================================================================
   Surface & panel primitives (used instead of ubiquitous cards)
   ========================================================================== */
.panel {
  position: relative;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
}
.panel--raised { background: var(--surface-raised); box-shadow: var(--e2); }
.panel--flush { border-radius: 0; border-left: 0; border-right: 0; }
.panel__head {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s4) var(--s5);
  border-bottom: 1px solid var(--border);
}
.panel__body { padding: var(--s5); }
.panel__body--flush { padding: 0; }
.panel__foot {
  padding: var(--s3) var(--s5);
  border-top: 1px solid var(--border);
  background: var(--bg-sunken);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}

/* Spotlight hover — a faint radial highlight tracking the pointer */
.spotlight { position: relative; overflow: hidden; }
.spotlight::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(260px 180px at var(--px, 50%) var(--py, 50%), var(--accent-soft), transparent 68%);
  opacity: 0;
  transition: opacity var(--dur-3) var(--ease-out);
  pointer-events: none;
}
.spotlight:hover::before { opacity: 1; }

/* Section header — typography-led structure, no container needed */
.section-head {
  display: flex;
  align-items: flex-end;
  gap: var(--s4);
  padding-bottom: var(--s3);
  border-bottom: 1px solid var(--border);
}
.section-head__text { display: grid; gap: 2px; min-width: 0; }

/* ==========================================================================
   Metric — animated counters, delta, sparkline slot
   ========================================================================== */
.metrics {
  display: grid;
  grid-template-columns: repeat(var(--metric-cols, 4), minmax(0, 1fr));
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  overflow: hidden;
}
.metric {
  position: relative;
  display: grid;
  gap: var(--s2);
  padding: var(--s4) var(--s5) var(--s5);
  border-right: 1px solid var(--border);
  text-align: left;
  transition: background-color var(--dur-2) var(--ease-out);
}
.metric:last-child { border-right: 0; }
.metric[data-clickable="true"] { cursor: pointer; }
.metric[data-clickable="true"]:hover { background: var(--surface-raised); }
.metric[data-clickable="true"]:hover .metric__go { opacity: 1; transform: translateX(0); }
.metric__go {
  position: absolute;
  top: var(--s4);
  right: var(--s4);
  opacity: 0;
  transform: translateX(-4px);
  color: var(--text-muted);
  transition: all var(--dur-2) var(--ease-out);
}
.metric__value {
  font-size: 1.625rem;
  line-height: 1.1;
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-heading);
  font-variant-numeric: tabular-nums;
}
.metric__unit { font-size: var(--fs-caption); color: var(--text-muted); font-weight: var(--fw-regular); margin-left: 2px; }
.metric__foot { display: flex; align-items: center; gap: var(--s2); min-height: 16px; }
.metric--alert .metric__value { color: var(--error); }
.metric--warn .metric__value { color: var(--warning); }

/* ==========================================================================
   Data table
   ========================================================================== */
.table-wrap { position: relative; overflow: auto; max-width: 100%; }
.table { font-size: var(--fs-secondary); }
.table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 0 var(--s4);
  height: 34px;
  text-align: left;
  white-space: nowrap;
  background: var(--surface);
  border-bottom: 1px solid var(--border-strong);
  font-size: var(--fs-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  font-weight: var(--fw-semibold);
  color: var(--text-muted);
  backdrop-filter: blur(8px);
}
.table th[data-sortable="true"] { cursor: pointer; user-select: none; }
.table th[data-sortable="true"]:hover { color: var(--text-primary); }
.table th .ico { width: 11px; height: 11px; opacity: 0; transition: opacity var(--dur-1) linear, transform var(--dur-2) var(--ease-out); }
.table th[data-sort="asc"] .ico,
.table th[data-sort="desc"] .ico { opacity: 1; color: var(--accent); }
.table th[data-sort="desc"] .ico { transform: rotate(180deg); }
.table th[data-sortable="true"]:hover .ico { opacity: 0.5; }

.table tbody td {
  padding: 0 var(--s4);
  height: var(--row-h, 40px);
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: middle;
}
.table tbody tr { transition: background-color var(--dur-instant) linear; }
.table tbody tr:hover td { background: var(--surface-raised); color: var(--text-primary); }
.table tbody tr[data-selected="true"] td { background: var(--accent-soft); color: var(--text-primary); }
.table tbody tr[data-clickable="true"] { cursor: pointer; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .cell--num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-mono); }
.table .cell--strong { color: var(--text-primary); font-weight: var(--fw-medium); }
.table .cell--tight { width: 1%; white-space: nowrap; }
.table .cell--actions { opacity: 0; transition: opacity var(--dur-1) linear; }
.table tbody tr:hover .cell--actions,
.table tbody tr:focus-within .cell--actions { opacity: 1; }

/* Toolbar above lists */
.datatable { display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 0; }
.table__search { width: min(280px, 46vw); }
.table__search .input { height: 30px; font-size: var(--fs-secondary); }

.toolbar {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.toolbar__count {
  font-size: var(--fs-caption);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Floating contextual toolbar for multi-select */
.float-toolbar {
  position: fixed;
  left: 50%;
  bottom: var(--s8);
  z-index: var(--z-dock);
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s2) var(--s3);
  border-radius: var(--r-full);
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  box-shadow: var(--e4);
  backdrop-filter: blur(20px) saturate(160%);
  transform: translate(-50%, 0) scale(1);
  animation: float-in var(--dur-3) var(--ease-spring);
}
@keyframes float-in {
  from { transform: translate(-50%, 14px) scale(0.96); opacity: 0; }
  to { transform: translate(-50%, 0) scale(1); opacity: 1; }
}

/* ==========================================================================
   Task queue rows — the primary "what do I do next" surface
   ========================================================================== */
.queue { display: grid; }
.queue__row {
  display: grid;
  grid-template-columns: 3px 1fr auto;
  align-items: center;
  gap: var(--s4);
  padding: var(--s3) var(--s5) var(--s3) 0;
  border-bottom: 1px solid var(--border);
  text-align: left;
  width: 100%;
  transition: background-color var(--dur-1) var(--ease-out);
}
.queue__row:last-child { border-bottom: 0; }
.queue__row:hover { background: var(--surface-raised); }
.queue__row:hover .queue__action { opacity: 1; transform: translateX(0); }
.queue__rail { align-self: stretch; background: var(--queue-color, var(--border-strong)); border-radius: 0 2px 2px 0; }
.queue__row[data-priority="high"] { --queue-color: var(--error); }
.queue__row[data-priority="medium"] { --queue-color: var(--warning); }
.queue__row[data-priority="low"] { --queue-color: var(--info); }
.queue__body { display: grid; gap: 3px; min-width: 0; padding-left: var(--s5); }
.queue__action { opacity: 0; transform: translateX(-4px); transition: all var(--dur-2) var(--ease-out); }

/* ==========================================================================
   Timeline
   ========================================================================== */
.timeline { display: grid; gap: 0; }
.timeline__item {
  position: relative;
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: var(--s4);
  padding-bottom: var(--s5);
}
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 18px;
  bottom: 0;
  width: 1px;
  background: var(--border);
}
.timeline__item:last-child::before { display: none; }
.timeline__node {
  width: 19px;
  height: 19px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  z-index: 1;
}
.timeline__node .ico { width: 10px; height: 10px; stroke-width: 2.2; }
.timeline__item[data-state="done"] .timeline__node { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 34%, transparent); color: var(--success); }
.timeline__item[data-state="active"] .timeline__node { background: var(--accent-soft); border-color: var(--border-accent); color: var(--accent); }
.timeline__item[data-state="blocked"] .timeline__node { background: var(--error-soft); border-color: color-mix(in srgb, var(--error) 34%, transparent); color: var(--error); }
.timeline__body { display: grid; gap: 3px; padding-top: 1px; min-width: 0; }

/* ==========================================================================
   Skeleton & progressive loading
   ========================================================================== */
.sk {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-sm);
  background: var(--skeleton-base);
}
.sk::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, var(--skeleton-sheen), transparent);
  animation: sheen 1.5s var(--ease-in-out) infinite;
}
@keyframes sheen { to { transform: translateX(100%); } }
.sk--text { height: 10px; }
.sk--line { height: 13px; }
.sk--title { height: 19px; border-radius: var(--r-xs); }
.sk--num { height: 28px; width: 72px; }
.sk--block { height: 100%; min-height: 84px; border-radius: var(--r-md); }
.sk--circle { border-radius: 50%; }
.sk--avatar { width: 22px; height: 22px; flex: none; }
.sk-group { display: grid; gap: var(--s3); }
.sk-w-40 { width: 40%; }
.sk-w-55 { width: 55%; }
.sk-w-70 { width: 70%; }
.sk-w-85 { width: 85%; }

/* ==========================================================================
   Empty & error states
   ========================================================================== */
.state {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: var(--s4);
  padding: var(--s16) var(--s6);
  max-width: 460px;
  margin: 0 auto;
}
.state__art {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: var(--r-xl);
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  color: var(--text-faint);
}
.state__art .ico { width: 28px; height: 28px; stroke-width: 1.3; }
.state--error .state__art { background: var(--error-soft); border-color: color-mix(in srgb, var(--error) 22%, transparent); color: var(--error); }
.state__text { display: grid; gap: var(--s2); }
.state__actions { display: flex; gap: var(--s2); margin-top: var(--s1); }
.state__debug {
  width: 100%;
  margin-top: var(--s2);
  text-align: left;
}
.state__debug summary {
  cursor: pointer;
  font-size: var(--fs-caption);
  color: var(--text-muted);
  list-style: none;
}
.state__debug summary::-webkit-details-marker { display: none; }
.state__debug summary:hover { color: var(--text-secondary); }
.state__debug pre {
  margin: var(--s2) 0 0;
  padding: var(--s3);
  border-radius: var(--r-sm);
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ==========================================================================
   Overlays — scrim, drawer, modal, popover, context menu
   ========================================================================== */
.overlay-root { position: relative; z-index: var(--z-overlay); }

.scrim {
  position: fixed;
  inset: 0;
  background: var(--scrim);
  backdrop-filter: blur(3px);
  animation: fade-in var(--dur-2) var(--ease-out);
}
.scrim[data-closing="true"] { animation: fade-out var(--dur-2) var(--ease-out) forwards; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { to { opacity: 0; } }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(var(--drawer-w, 480px), 100vw);
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--surface);
  border-left: 1px solid var(--border-strong);
  box-shadow: var(--e4);
  animation: drawer-in var(--dur-3) var(--ease-spring);
}
.drawer[data-closing="true"] { animation: drawer-out var(--dur-2) var(--ease-in-out) forwards; }
@keyframes drawer-in { from { transform: translateX(24px); opacity: 0.4; } to { transform: none; opacity: 1; } }
@keyframes drawer-out { to { transform: translateX(16px); opacity: 0; } }

.drawer__head {
  display: flex;
  align-items: flex-start;
  gap: var(--s4);
  padding: var(--s5) var(--s5) var(--s4);
  border-bottom: 1px solid var(--border);
}
.drawer__body { overflow: auto; padding: var(--s5); display: grid; gap: var(--s5); align-content: start; }
.drawer__foot {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s4) var(--s5);
  border-top: 1px solid var(--border);
  background: var(--bg-sunken);
}

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 86vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: var(--surface);
  border-top: 1px solid var(--border-strong);
  box-shadow: var(--e4);
  animation: sheet-in var(--dur-3) var(--ease-spring);
}
.sheet[data-closing="true"] { animation: sheet-out var(--dur-2) var(--ease-in-out) forwards; }
@keyframes sheet-in { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-out { to { transform: translateY(100%); } }
.sheet__grip {
  width: 34px;
  height: 4px;
  border-radius: var(--r-full);
  background: var(--border-hover);
  margin: var(--s3) auto 0;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(var(--modal-w, 440px), calc(100vw - var(--s8)));
  max-height: calc(100vh - var(--s16));
  display: grid;
  grid-template-rows: auto 1fr auto;
  border-radius: var(--r-lg);
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  box-shadow: var(--e4);
  transform: translate(-50%, -50%);
  animation: modal-in var(--dur-3) var(--ease-spring);
}
.modal[data-closing="true"] { animation: modal-out var(--dur-2) var(--ease-in-out) forwards; }
@keyframes modal-in {
  from { transform: translate(-50%, -48%) scale(0.96); opacity: 0; }
  to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
@keyframes modal-out { to { transform: translate(-50%, -50%) scale(0.98); opacity: 0; } }
.modal__body { padding: var(--s5); overflow: auto; display: grid; gap: var(--s4); }
.modal__foot { display: flex; gap: var(--s2); padding: var(--s4) var(--s5); border-top: 1px solid var(--border); }
.modal__art {
  width: 30px;
  height: 30px;
  border-radius: var(--r-sm);
  padding: 0;
}

/* ===== 图片灯箱（附件审核预览） =========================================== */
.lightbox {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: var(--s3);
  padding: var(--s5);
  animation: fade-in var(--dur-2) var(--ease-out);
}
.lightbox[data-closing="true"] { animation: fade-out var(--dur-2) var(--ease-out) forwards; }
.lightbox__head { display: flex; align-items: center; gap: var(--s2); color: var(--text-primary); }
.lightbox__figure { display: grid; place-items: center; min-height: 0; margin: 0; }
.lightbox__img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--r-md); box-shadow: var(--e4); }

/* ===== 附件审核区（控制台 · 投稿附件） ==================================== */
.attach-list { display: grid; gap: var(--s2); }
.attach-list__row { display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s3) var(--s4); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.attach-list__icon { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--accent-soft); color: var(--accent); }
.attach-list__body { flex: 1; min-width: 0; display: grid; gap: var(--s1); }
.attach-list__name { font-size: var(--fs-body); font-weight: var(--fw-medium); color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-list__meta { font-size: var(--fs-caption); color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-list__meta--mono { font-family: var(--font-mono); }

.menu {
  position: fixed;
  z-index: var(--z-popover);
  min-width: min(196px, calc(100vw - 16px));
  max-width: calc(100vw - 16px);
  max-height: calc(100dvh - 16px);
  overflow: auto;
  overscroll-behavior: contain;
  overflow-wrap: anywhere;
  padding: var(--s1);
  border-radius: var(--r-md);
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  box-shadow: var(--e3);
  backdrop-filter: blur(20px) saturate(160%);
  animation: menu-in var(--dur-1) var(--ease-out);
  transform-origin: var(--origin, top left);
}
@keyframes menu-in { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }
.menu__item {
  display: flex;
  align-items: center;
  gap: var(--s3);
  width: 100%;
  height: 30px;
  padding: 0 var(--s3);
  border-radius: var(--r-sm);
  font-size: var(--fs-secondary);
  color: var(--text-secondary);
  text-align: left;
}
.menu__item:focus-visible,
.menu__item:hover,
.menu__item[data-active="true"] { background: var(--accent-soft); color: var(--text-primary); }
.menu__item[data-variant="danger"] { color: var(--error); }
.menu__item[data-variant="danger"]:hover { background: var(--error-soft); }
.menu__item[disabled] { opacity: 0.4; pointer-events: none; }
.menu__kbd { margin-left: auto; font-family: var(--font-mono); font-size: 10px; color: var(--text-faint); }
.menu__sep { height: 1px; margin: var(--s1) 0; background: var(--border); }
.menu__label { padding: var(--s2) var(--s3) var(--s1); }

/* ==========================================================================
   Command palette / spotlight
   ========================================================================== */
.palette-scrim {
  position: fixed;
  inset: 0;
  display: grid;
  align-items: start;
  justify-items: center;
  padding-top: 12vh;
  background: var(--scrim);
  backdrop-filter: blur(8px) saturate(120%);
  animation: fade-in var(--dur-2) var(--ease-out);
}
.palette-scrim[data-closing="true"] { animation: fade-out var(--dur-1) linear forwards; }
.palette {
  width: min(620px, calc(100vw - var(--s8)));
  max-height: 60vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  border-radius: var(--r-lg);
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  box-shadow: var(--e4);
  overflow: hidden;
  animation: palette-in var(--dur-3) var(--ease-spring);
}
@keyframes palette-in {
  from { opacity: 0; transform: translateY(-10px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
.palette__search {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: 0 var(--s4);
  height: 50px;
  border-bottom: 1px solid var(--border);
}
.palette__search input {
  flex: 1;
  border: 0;
  background: none;
  font-size: var(--fs-h3);
  letter-spacing: var(--tracking-heading);
}
.palette__search input::placeholder { color: var(--text-faint); }
.palette__list { overflow: auto; padding: var(--s2); }
.palette__group { padding: var(--s3) var(--s3) var(--s1); }
.palette__item {
  display: flex;
  align-items: center;
  gap: var(--s3);
  width: 100%;
  padding: var(--s2) var(--s3);
  border-radius: var(--r-sm);
  text-align: left;
  color: var(--text-secondary);
  transition: background-color var(--dur-instant) linear;
}
.palette__item[data-active="true"] {
  background: var(--accent-soft);
  color: var(--text-primary);
}
.palette__item[data-active="true"] .palette__go { opacity: 1; }
.palette__item .ico { color: var(--text-muted); }
.palette__item[data-active="true"] .ico { color: var(--accent); }
.palette__text { display: grid; gap: 1px; min-width: 0; flex: 1; }
.palette__go { margin-left: auto; opacity: 0; }
.palette__foot {
  display: flex;
  align-items: center;
  gap: var(--s4);
  padding: var(--s2) var(--s4);
  border-top: 1px solid var(--border);
  background: var(--bg-sunken);
}

.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--r-xs);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: 0 1px 0 var(--border-strong);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

/* ==========================================================================
   Toast
   ========================================================================== */
.toast-root {
  position: fixed;
  right: var(--s5);
  bottom: var(--s5);
  z-index: var(--z-toast);
  display: grid;
  gap: var(--s2);
  justify-items: end;
  pointer-events: none;
}
.toast {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: var(--s3);
  width: min(380px, calc(100vw - var(--s8)));
  padding: var(--s3) var(--s4);
  border-radius: var(--r-md);
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  box-shadow: var(--e3);
  pointer-events: auto;
  overflow: hidden;
  animation: toast-in var(--dur-3) var(--ease-spring);
}
.toast[data-closing="true"] { animation: toast-out var(--dur-2) var(--ease-in-out) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateX(18px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(12px) scale(0.98); } }
.toast__icon { margin-top: 1px; color: var(--text-muted); }
.toast--success .toast__icon { color: var(--success); }
.toast--warning .toast__icon { color: var(--warning); }
.toast--error .toast__icon { color: var(--error); }
.toast--info .toast__icon { color: var(--info); }
.toast__text { display: grid; gap: 2px; min-width: 0; }
.toast__bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  transform-origin: left;
  background: var(--accent);
  animation: toast-bar linear forwards;
}
@keyframes toast-bar { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ==========================================================================
   Tooltip
   ========================================================================== */
.tip {
  position: fixed;
  z-index: var(--z-popover);
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: 5px var(--s2);
  border-radius: var(--r-sm);
  background: var(--surface-inverse);
  color: var(--text-on-inverse);
  font-size: var(--fs-caption);
  white-space: nowrap;
  box-shadow: var(--e3);
  pointer-events: auto;
  max-width: calc(100vw - 16px);
  white-space: normal;
  overflow-wrap: anywhere;
  animation: tip-in var(--dur-1) var(--ease-out);
}
@keyframes tip-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.tip .kbd { background: color-mix(in srgb, var(--surface-inverse) 70%, var(--text-on-inverse)); border-color: transparent; color: inherit; box-shadow: none; }

/* ==========================================================================
   Charts — restrained axes, expressive data
   ========================================================================== */
.chart { position: relative; width: 100%; }
.chart svg { width: 100%; overflow: visible; }
.chart .ch-grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 2 4; }
.chart .ch-axis { fill: var(--text-faint); font-size: 10px; font-family: var(--font-mono); }
.chart .ch-area { opacity: 0.16; }
.chart .ch-line { fill: none; stroke-width: 1.75; stroke-linejoin: round; stroke-linecap: round; }
.chart .ch-bar { transition: opacity var(--dur-1) linear; }
.chart .ch-bar--dim { opacity: 0.35; }
.chart .ch-cross { stroke: var(--border-hover); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .ch-node { stroke: var(--surface); stroke-width: 2; }
.chart .ch-enter { animation: ch-reveal var(--dur-5) var(--ease-out) forwards; }
@keyframes ch-reveal { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.chart__tip {
  position: absolute;
  z-index: 3;
  min-width: 128px;
  padding: var(--s2) var(--s3);
  border-radius: var(--r-sm);
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  box-shadow: var(--e3);
  pointer-events: none;
  transform: translate(var(--tip-x, 0), var(--tip-y, 0));
  transition: transform var(--dur-instant) linear;
}
.chart__legend { display: flex; flex-wrap: wrap; gap: var(--s4); }
.chart__legend button {
  display: flex; align-items: center; gap: var(--s2);
  font-size: var(--fs-caption); color: var(--text-secondary);
  transition: opacity var(--dur-1) linear;
}
.chart__legend button[aria-pressed="false"] { opacity: 0.4; }
.legend-swatch { width: 8px; height: 8px; border-radius: 2px; background: var(--swatch, var(--accent)); }

/* Distribution bar — compact composition visual */
.bar-track {
  display: flex;
  height: 6px;
  border-radius: var(--r-full);
  overflow: hidden;
  background: var(--skeleton-base);
}
.bar-track span {
  height: 100%;
  width: var(--w, 0%);
  background: var(--c, var(--accent));
  transition: width var(--dur-4) var(--ease-out);
}

/* Ranked bars */
.rank { display: grid; gap: var(--s1); }
.rank__row {
  display: grid;
  grid-template-columns: minmax(80px, 150px) minmax(0, 1fr) 56px;
  gap: var(--s3);
  align-items: center;
  padding: var(--s2) var(--s2);
  border-radius: var(--r-sm);
  text-align: left;
  transition: background-color var(--dur-1) var(--ease-out);
}
.rank__row:hover { background: var(--surface-raised); }
.rank__track { height: 8px; border-radius: var(--r-full); background: var(--skeleton-base); overflow: hidden; }
.rank__label { min-width: 0; }
.rank__fill {
  display: block;
  height: 100%;
  width: var(--w, 0%);
  border-radius: var(--r-full);
  background: var(--c, var(--accent));
  transition: width var(--dur-5) var(--ease-out);
}
.rank__value { text-align: right; color: var(--text-primary); }
.rank__row:hover .rank__fill { filter: brightness(1.12); }

/* Donut */
.donut { display: flex; align-items: center; gap: var(--s6); flex-wrap: wrap; }
.donut__figure { position: relative; display: grid; place-items: center; flex: none; }
.donut__center { position: absolute; display: grid; justify-items: center; gap: 0; text-align: center; pointer-events: none; }
.donut__legend { display: grid; gap: var(--s2); min-width: 160px; flex: 1; }
.donut circle { transition: stroke-width var(--dur-2) var(--ease-out); cursor: pointer; }

.spark { display: block; overflow: visible; }

/* ==========================================================================
   Misc
   ========================================================================== */
.avatar {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: var(--fs-caption);
  font-weight: var(--fw-semibold);
}
.avatar--lg { width: 34px; height: 34px; border-radius: var(--r-md); font-size: var(--fs-secondary); }

/* Definition list — label / value pairs inside inspectors and detail views */
.dl { display: grid; gap: var(--s3); }
.dl__row { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: var(--s4); align-items: start; }
.dl__row dd { margin: 0; min-width: 0; word-break: break-word; }

.code-block {
  padding: var(--s3);
  border-radius: var(--r-sm);
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  color: var(--text-secondary);
  overflow: auto;
  white-space: pre;
}

.notice {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s3);
  padding: var(--s3) var(--s4);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-sunken);
  font-size: var(--fs-secondary);
  color: var(--text-secondary);
}
.notice .ico { margin-top: 2px; color: var(--text-muted); }
.notice--warning { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 22%, transparent); color: color-mix(in srgb, var(--warning) 82%, var(--text-primary)); }
.notice--warning .ico { color: var(--warning); }
.notice--error { background: var(--error-soft); border-color: color-mix(in srgb, var(--error) 22%, transparent); }
.notice--error .ico { color: var(--error); }
.notice--info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 22%, transparent); }
.notice--info .ico { color: var(--info); }
.notice--success { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 22%, transparent); }
.notice--success .ico { color: var(--success); }

/* Step indicator for multi-step forms */
.steps { display: flex; align-items: center; gap: var(--s2); }
.steps__item { display: flex; align-items: center; gap: var(--s2); }
.steps__dot {
  width: 20px; height: 20px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  transition: all var(--dur-2) var(--ease-spring);
}
.steps__item[data-state="active"] .steps__dot { background: var(--accent); border-color: var(--accent); color: var(--text-on-accent); }
.steps__item[data-state="done"] .steps__dot { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 40%, transparent); color: var(--success); }
.steps__item[data-state="active"] .steps__name { color: var(--text-primary); }
.steps__name { font-size: var(--fs-caption); color: var(--text-muted); }
.steps__link { width: 20px; height: 1px; background: var(--border-strong); }

/* Impact preview: before → after */
.impact {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) var(--s4);
  border-radius: var(--r-md);
  background: var(--bg-sunken);
  border: 1px dashed var(--border-strong);
  font-family: var(--font-mono);
  font-size: var(--fs-secondary);
  font-variant-numeric: tabular-nums;
}
.impact__from { color: var(--text-muted); }
.impact__to { color: var(--text-primary); font-weight: var(--fw-semibold); }
.impact__arrow { color: var(--accent); }

/* Result receipt after a write */
.receipt {
  display: grid;
  gap: var(--s3);
  padding: var(--s5);
  border-radius: var(--r-lg);
  background: var(--success-soft);
  border: 1px solid color-mix(in srgb, var(--success) 26%, transparent);
}
.receipt__rows { display: grid; gap: var(--s2); }
.receipt__row { display: flex; gap: var(--s4); font-size: var(--fs-secondary); }
.receipt__row dt { width: 88px; flex: none; color: var(--text-muted); }
.receipt__row dd { margin: 0; font-family: var(--font-mono); word-break: break-all; }

/* Registration notice live preview (console events page) */
.notice-preview {
  margin: 0;
  padding: var(--s4);
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  font-family: var(--font-reading);
  font-size: var(--fs-secondary);
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 320px;
  overflow: auto;
}

/* View transition wrapper */
.view { animation: view-in var(--dur-3) var(--ease-out); }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.view[data-leaving="true"] { animation: view-out var(--dur-1) var(--ease-in-out) forwards; }
@keyframes view-out { to { opacity: 0; transform: translateY(-4px); } }

/* Staggered list entrance */
.stagger > * {
  animation: stagger-in var(--dur-4) var(--ease-out) backwards;
  animation-delay: calc(var(--i, 0) * 34ms);
}
@keyframes stagger-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

/* Activity template text must wrap on phones; no inline styles under CSP. */
.workflow-copy { white-space: pre-wrap; overflow-wrap: anywhere; font-family: inherit; }

/* Account-owned registration controls remain within narrow mobile cards. */
.workflow-page, .workflow-page .panel, .workflow-page .panel__body,
.workflow-registration, .workflow-registration details { min-width: 0; max-width: 100%; }
.workflow-registration { overflow-wrap: anywhere; padding-block: var(--s-3); }
.workflow-registration + .workflow-registration { border-top: 1px solid var(--border); }
.workflow-registration summary { cursor: pointer; padding-block: 12px; }
.workflow-registration input[type="file"] { display: block; width: 100%; max-width: 100%; min-width: 0; }

/* Shared select: native form semantics, themed top-layer listbox. */
.select-menu{position:relative;min-width:0;width:100%}
.select-menu__native{position:absolute;width:1px!important;height:1px!important;padding:0!important;border:0!important;opacity:0;pointer-events:none;clip-path:inset(50%)}
.select-menu__trigger{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;height:var(--field-h,44px);min-height:var(--field-h,44px);box-sizing:border-box;line-height:20px;padding:6px 12px;border:1px solid var(--border);border-radius:var(--control-radius);background:var(--surface);color:var(--text-primary);font:inherit;text-align:left;cursor:pointer;transition:border-color 140ms ease,box-shadow 140ms ease}
.select-menu__value{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.select-menu__trigger>.ico{flex:none;color:var(--text-muted);width:16px;height:16px}
.select-menu__description { margin-left:auto; color:var(--text-muted); font-size:var(--fs-caption); white-space:nowrap; font-variant-numeric:tabular-nums; }
.activity-category-field .select-menu__trigger { border-radius:var(--control-radius,9px); }
.activity-category-field .select-menu__value { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.activity-category-field:has(option:checked:not([value=""])) .select-menu__value { padding:2px 8px; border-radius:6px; color:var(--accent); background:var(--accent-soft); }
.select-menu__trigger:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
.select-menu__trigger[aria-expanded=true]{border-color:var(--accent)}
.select-menu__trigger[aria-invalid=true]{border-color:var(--danger,var(--accent))}
.select-menu__trigger:disabled{opacity:.55;cursor:not-allowed}
.select-menu__popup{position:fixed;inset:auto;margin:0;left:var(--select-left);top:var(--select-top);width:var(--select-width);max-height:var(--select-height);padding:6px;border:1px solid var(--border);border-radius:16px;background:var(--surface-raised,var(--surface));color:var(--text-primary);box-shadow:0 14px 40px rgb(0 0 0 / .14);overflow:auto;overscroll-behavior:contain}
.select-menu__popup::backdrop{background:transparent}
.select-menu__popup.is-searchable:popover-open{display:flex;flex-direction:column;overflow:hidden}
.select-menu__popup.is-searchable .select-menu__list{overflow-y:auto;overscroll-behavior:contain;min-height:0}
.select-menu__search-wrap{display:flex;align-items:center;gap:8px;padding:6px 8px 10px;flex:none;border-bottom:1px solid var(--border);margin-bottom:4px}
.select-menu__search-wrap>.ico{flex:none;color:var(--text-muted)}
.select-menu__search.input{width:100%;min-width:0;font-size:16px}
.select-menu__empty{padding:16px 12px;color:var(--text-muted);font-size:14px}
.select-menu__option{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:44px;padding:10px 12px;border-radius:10px;font-size:14px;line-height:1.5;cursor:pointer;overflow-wrap:anywhere}
.select-menu__option[aria-selected=true]{color:var(--accent);background:var(--accent-soft);font-weight:600}
.select-menu__option[data-highlighted=true]{outline:1px solid var(--accent);outline-offset:-1px}
.select-menu__option[aria-disabled=true]{opacity:.45;cursor:not-allowed}
.select-menu__option>.ico{flex:none}
@media(hover:hover) and (pointer:fine){.select-menu__option:not([aria-disabled=true]):hover{background:var(--accent-soft)}.select-menu__trigger:not(:disabled):hover{border-color:var(--text-muted)}}
@media(prefers-reduced-motion:no-preference){.select-menu__popup:popover-open:not([data-keyboard=true]){animation:select-menu-in 140ms cubic-bezier(.23,1,.32,1);transform-origin:top left}.select-menu__popup[data-side=top]{transform-origin:bottom left}}
@keyframes select-menu-in{from{opacity:0;transform:translateY(-3px) scale(.98)}to{opacity:1;transform:none}}

/* Shared search geometry follows the same field density as select/input. */
.search-field { position: relative; display: flex; align-items: center; width: min(100%,320px); min-width: 160px; }
.search-field > .ico { position: absolute; left: 12px; color: var(--text-secondary); pointer-events: none; }
.search-field > .input { width: 100%; height: var(--field-h,36px); min-height: var(--field-h,36px); padding-left: 36px; padding-right: 40px; border-radius: var(--control-radius); }
.search-field > .input::-webkit-search-cancel-button { display: none; }
.search-field__clear { position: absolute; right: 2px; display: grid; place-items: center; width: 32px; height: calc(var(--field-h,36px) - 4px); border: 0; border-radius: 8px; background: transparent; color: var(--text-secondary); cursor: pointer; }
.search-field__clear[hidden] { display: none; }
.search-field__clear:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
@media(max-width:700px) { .search-field { width: 100%; } .search-field > .input, .select-menu__trigger { font-size: 16px; } .search-field__clear { width: 44px; } .search-field > .input { padding-right: 48px; } }
.select-menu__search { display:block; width:100%; position:sticky; top:0; z-index:1; margin-bottom:6px; min-height:40px; font-size:16px; background:var(--surface-raised); }
.select-menu__search[hidden], .select-menu__option[hidden], .select-menu__empty[hidden] { display:none; }
.select-menu__empty { padding:16px 12px; color:var(--text-secondary); font-size:14px; }

/* /styles/portal.css */
/* ==========================================================================
   Public portal — editorial, immersive, service-first
   ========================================================================== */

.portal {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-columns: minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}
.portal__outlet { display: block; min-width: 0; min-height: calc(100svh - 76px); }

/* 资料提示条（2026-10-27）：这个容器原来没有任何样式，notice 里的「重新读取资料」
   按钮会挂在提示框外面、贴着视口左边缘，看起来像被截断的生按钮。
   统一成「提示框 + 行内小按钮」的一行，宽度与页面内容同宽。 */
.portal-profile-reminder:not(:empty) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s3);
  width: min(1200px, 100% - 2 * var(--s5));
  margin: var(--s3) auto 0;
}
.portal-profile-reminder > .notice { flex: 1 1 320px; min-width: 0; }
.portal-profile-reminder > .btn { flex: none; }
.events__search { width: min(320px, 100%); }
.events__category { width: min(180px, 100%); min-width: 0; }
@media (max-width: 560px) {
  .events__search, .events__category { width: 100%; }
}

/* Registration credential block */
.qr-block {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--s5);
  align-items: start;
  padding: var(--s5);
  border-radius: var(--r-lg);
  background: var(--bg-sunken);
  border: 1px solid var(--border);
}
.qr {
  width: 168px;
  height: 168px;
  border-radius: var(--r-md);
  background: #fffdfb;
  border: 1px solid var(--border);
  padding: var(--s2);
}
@media (max-width: 560px) {
  .qr-block { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.phead {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  border-bottom: 1px solid transparent;
  background: var(--bg-base);
  transition: border-color 160ms ease-out, background-color 160ms ease-out, box-shadow 160ms ease-out;
}
/* All public pages share the activity plaza's navigation typography. */
.portal :is(.phead,.pfoot,.mobile-dock) {
  --font-sans:'NJU Heading','Microsoft YaHei','PingFang SC',sans-serif;
  --font-heading:var(--font-sans);--font-ui:var(--font-sans);--font-reading:var(--font-sans);--font-numeric:var(--font-sans);
  font-family:var(--font-sans);
}
.portal .phead .plogo { min-width: 0; flex-shrink: 1; }
.portal .phead .plogo__text { min-width: 0; max-width: min(15em, 34vw); }
.portal .phead .plogo__text b { overflow: hidden; text-overflow: ellipsis; }
.portal :is(.phead,.pfoot) .plogo__text b {
  font-family:'Events Running','STXingkai','KaiTi',cursive;
  font-size:27px;font-weight:400;line-height:1.15;letter-spacing:.02em;-webkit-text-stroke:.25px currentColor;
}
.portal :is(.phead,.pfoot) .plogo__text .brand-wordmark { font-family:Georgia,'Times New Roman',serif;font-size:9px;letter-spacing:0;line-height:1.3; }
.portal .phead :is(.pnav__link,.phead__auth [data-account]) { font-family:'NJU Heading','Microsoft YaHei',sans-serif; }
.portal .phead .phead__auth [data-account] { font-weight:700; }
@media(max-width:1150px) and (min-width:641px) {
  .portal :is(.phead,.pfoot) .plogo__text b { font-size:24px; }
}
@media(max-width:640px) {
  .portal :is(.phead,.pfoot) .plogo__text b { font-size:19px; }
}
.phead[data-stuck="true"] {
  border-bottom-color: var(--border);
  background: var(--surface);
  box-shadow: 0 8px 20px -16px rgb(37 42 54 / .3);
}
.phead__inner {
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.3vw, 24px);
  height: 76px;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--s8);
}
.plogo { display: flex; align-items: center; gap: var(--s3); flex: none; }
/* 英文全称只作为副标，限宽省略，任何视口都不会把页头顶宽。 */
.plogo__text { display: grid; white-space: nowrap; max-width: min(15em, 34vw); }
.plogo__text b { font-size: var(--fs-title); font-weight: var(--fw-semibold); letter-spacing: var(--tracking-heading); color: var(--accent); }
.plogo__text span { font-size: 9px; letter-spacing: 0.1em; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; }
/* Leave room for navigation and appearance controls at narrow widths and zoom. */
.portal .phead .plogo { flex:0 1 auto; min-width:0; }
.portal .phead .plogo__text { min-width:0; max-width:100%; }
.portal .phead .plogo__text b { overflow:hidden; text-overflow:ellipsis; }

.pnav__icon, .pnav .pnav__utility { display: none; }
.phead__auth { flex: none; }
.phead [data-mobile-account="true"] { display: none; }
.pnav { display: flex; align-items: center; gap: var(--s1); }
.pnav__link {
  position: relative;
  height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 var(--s3);
  border-radius: var(--r-sm);
  font-size: var(--fs-secondary);
  color: var(--text-secondary);
  transition: color var(--dur-1) var(--ease-out), background-color var(--dur-1) var(--ease-out);
}
.pnav__link:hover { color: var(--text-primary); background: var(--accent-soft); }
.pnav__link[aria-current="page"] { color: var(--accent); background: var(--accent-soft); font-weight: var(--fw-semibold); }
.pnav__link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: var(--s3);
  right: var(--s3);
  bottom: 5px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  animation: pnav-mark var(--dur-3) var(--ease-out);
}
@keyframes pnav-mark { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Header owns navigation styling; page atmosphere must not override it. */
.phead :is(a,button):focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
@media (min-width: 1181px) {
  .pnav__link { padding-inline: clamp(10px, .9vw, 16px); font-size: 14px; white-space: nowrap; }
  .pnav__link[href="/me"] { margin-left: 12px; }
  .pnav__link[href="/me"]::before { content: ""; position: absolute; left: -8px; height: 20px; border-left: 1px solid var(--border); }
  .phead__auth { gap: 4px; padding-left: 12px; border-left: 1px solid var(--border); }
  .phead__auth:empty, .phead__auth:has(> [data-mobile-account]:only-child) { display: none; }
  .phead__auth [data-hide-sm] { font-size: 12px; color: var(--text-secondary); }
  .phead__auth [data-account] { background: #b50b30; border: 1px solid #b50b30; color: #fff; font-weight: 600; }
  .phead__auth [data-account]:hover { background: #920825; border-color: #920825; }
  .phead .theme-trigger { width: 40px; height: 40px; padding: 0; border-color: transparent; background: transparent; }
  .phead .theme-trigger__label { display: none; }
}
/* 英文副标仅在完整桌面页头显示，避免放大或中宽视口把页头挤出屏幕。 */
@media (max-width: 1180px) { .plogo__text span { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .phead, .pnav__link { transition: none; }
  .pnav__link[aria-current="page"]::after { animation: none; }
}
@media (forced-colors: active) {
  .pnav__link[aria-current="page"] { outline: 1px solid Highlight; }
}

/* Scoped so it outranks the generic .icon-btn rule in admin.css,
   which is loaded after this stylesheet. */
.phead .pmenu-btn { display: none; order: 1; }

/* --------------------------------------------------------------------------
   Hero — parallax depth, live figures, single primary action
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: var(--s24) 0 var(--s20);
  background: var(--surface-inverse);
  color: var(--text-on-inverse);
}
.hero__depth {
  position: absolute;
  inset: -10%;
  background:
    radial-gradient(40% 46% at 18% 26%, rgba(216, 40, 63, 0.4), transparent 66%),
    radial-gradient(44% 40% at 84% 12%, rgba(92, 18, 48, 0.55), transparent 70%),
    radial-gradient(60% 52% at 58% 108%, rgba(24, 16, 14, 0.9), transparent 72%);
  transform: translate3d(var(--hx, 0px), var(--hy, 0px), 0) scale(1.06);
  transition: transform var(--dur-5) var(--ease-out);
  will-change: transform;
}
.hero__cross {
  position: absolute;
  top: 8%;
  right: 6%;
  width: 320px;
  height: 320px;
  border-radius: var(--r-2xl);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  clip-path: polygon(
    38% 0, 62% 0, 62% 38%, 100% 38%, 100% 62%, 62% 62%,
    62% 100%, 38% 100%, 38% 62%, 0 62%, 0 38%, 38% 38%
  );
  transform: translate3d(var(--cx, 0px), var(--cy, 0px), 0) rotate(-8deg);
  transition: transform var(--dur-5) var(--ease-out);
}
.hero__inner {
  position: relative;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--s8);
  display: grid;
  gap: var(--s10);
}
.hero__lede { display: grid; gap: var(--s5); max-width: min(760px, 62vw); }
.hero h1 {
  font-size: clamp(2.5rem, 5.2vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
  font-weight: var(--fw-semibold);
  max-width: 12em;
}
.hero h1 em {
  font-style: normal;
  display: block;
  color: color-mix(in srgb, var(--brand-crimson) 72%, #ffffff);
}
.hero__sub { max-width: 52ch; color: rgba(246, 241, 238, 0.68); font-size: var(--fs-title); line-height: var(--lh-relaxed); }
.hero__cta { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }

/* The hero sits on an inverted surface, so the secondary action becomes a
   translucent glass button instead of the light-theme inverse treatment. */
.hero__cta .btn--inverse {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.16);
  color: #f6f1ee;
  backdrop-filter: blur(10px);
}
.hero__cta .btn--inverse:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.26);
}
.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  padding: 5px var(--s3) 5px var(--s2);
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: var(--fs-caption);
  color: rgba(246, 241, 238, 0.82);
  width: fit-content;
}

.hero__figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.hero__figure {
  padding: var(--s4) var(--s5);
  background: rgba(20, 14, 13, 0.62);
  backdrop-filter: blur(10px);
  display: grid;
  gap: 2px;
}
.hero__figure b {
  font-size: 1.5rem;
  font-weight: var(--fw-semibold);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.hero__figure span { font-size: var(--fs-caption); color: rgba(246, 241, 238, 0.56); }

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
.psection { max-width: var(--content-max); margin: 0 auto; padding: var(--s20) var(--s8); }
.psection--tight { padding-top: var(--s12); padding-bottom: var(--s12); }
.psection--sunken { max-width: none; background: var(--bg-sunken); border-block: 1px solid var(--border); }
.psection--sunken > .psection__inner { max-width: var(--content-max); margin: 0 auto; padding: var(--s20) var(--s8); }

.psection__head {
  display: flex;
  align-items: flex-end;
  gap: var(--s6);
  margin-bottom: var(--s8);
}
.psection__head-text { display: grid; gap: var(--s2); max-width: 54ch; }

/* Event rail — horizontal scroller with snap */
.rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(300px, 340px);
  gap: var(--s4);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: var(--s4);
  margin-inline: calc(var(--s8) * -1);
  padding-inline: var(--s8);
}
.rail > * { scroll-snap-align: start; }

/* Event entry — content-led, not a boxed card grid */
.event {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: var(--s4);
  padding: var(--s5);
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: left;
  transition:
    border-color var(--dur-2) var(--ease-out),
    box-shadow var(--dur-3) var(--ease-out),
    transform var(--dur-3) var(--ease-out);
}
.event:hover {
  border-color: var(--border-hover);
  box-shadow: var(--e3);
  transform: translateY(-2px);
}
.event:hover .event__go { opacity: 1; transform: translateX(0); }
.event__meta { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.event__title { font-size: var(--fs-h3); font-weight: var(--fw-semibold); letter-spacing: var(--tracking-heading); }
.event__facts { display: grid; gap: var(--s2); }
.event__fact { display: flex; align-items: center; gap: var(--s2); font-size: var(--fs-secondary); color: var(--text-secondary); }
.event__fact .ico { color: var(--text-faint); }
.event__foot { display: flex; align-items: center; gap: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--border); }
.event__go { margin-left: auto; opacity: 0; transform: translateX(-4px); color: var(--accent); transition: all var(--dur-2) var(--ease-out); }
.event__capacity { display: grid; gap: var(--s2); flex: 1; min-width: 0; }

/* Event list layout for the browse page */
.event-list { display: grid; gap: var(--s4); }
.event-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: var(--s6);
  align-items: center;
  padding: var(--s5) var(--s6);
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: left;
  transition: border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-3) var(--ease-out), transform var(--dur-2) var(--ease-out);
}
.event-row:hover { border-color: var(--border-hover); box-shadow: var(--e2); transform: translateY(-1px); }
.event-row__date {
  display: grid;
  justify-items: center;
  gap: 0;
  padding: var(--s3) 0;
  border-radius: var(--r-md);
  background: var(--accent-soft);
  color: var(--accent);
}
.event-row__date b { font-size: 1.5rem; line-height: 1; font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }
.event-row__date span { font-size: var(--fs-label); letter-spacing: var(--tracking-label); text-transform: uppercase; }
.event-row__body { display: grid; gap: var(--s2); min-width: 0; }

/* Programme blocks — typography + whitespace, no card soup */
.programs { display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.program {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: var(--s5);
  align-items: start;
  padding: var(--s6);
  background: var(--surface);
  text-align: left;
  transition: background-color var(--dur-2) var(--ease-out);
}
.program:hover { background: var(--surface-raised); }
.program:hover .event__go { opacity: 1; transform: translateX(0); }
.program__icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  background: var(--accent-soft);
  color: var(--accent);
}
.program__body { display: grid; gap: var(--s2); }

/* Detail page */
.pdetail {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--s10) var(--s8) var(--s20);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 356px;
  gap: var(--s12);
  align-items: start;
}
.pdetail__main { display: grid; gap: var(--s8); min-width: 0; }
.pdetail__aside { position: sticky; top: calc(62px + var(--s5)); display: grid; gap: var(--s4); }
.pdetail__hero { display: grid; gap: var(--s4); }
.pdetail__facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.pdetail__fact { padding: var(--s4) var(--s5); background: var(--surface); display: grid; gap: 3px; }

/* Session picker */
.sessions { display: grid; gap: var(--s2); }
.session {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: var(--s3);
  align-items: center;
  padding: var(--s3) var(--s4);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  text-align: left;
  transition: all var(--dur-1) var(--ease-out);
}
.session:hover { border-color: var(--border-hover); }
.session[aria-checked="true"] { border-color: var(--border-accent); background: var(--accent-soft); }
.session__radio {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--border-hover);
  display: grid; place-items: center;
  transition: all var(--dur-2) var(--ease-spring);
}
.session__radio::after {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  transform: scale(0);
  transition: transform var(--dur-2) var(--ease-spring);
}
.session[aria-checked="true"] .session__radio { border-color: var(--accent); }
.session[aria-checked="true"] .session__radio::after { transform: scale(1); }
.session[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }

/* Form workspace for submissions / applications */
.formpage {
  width: 100%;
  max-width: 920px;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
  margin: 0 auto;
  padding: var(--s10) var(--s8) var(--s20);
  display: grid;
  gap: var(--s8);
}
.formgrid { display: grid; align-items: start; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: var(--s4); }
.formgrid--full { grid-template-columns: minmax(0, 1fr); }
.fieldset { display: grid; gap: var(--s4); }
.fieldset__head { display: grid; gap: var(--s1); padding-bottom: var(--s3); border-bottom: 1px solid var(--border); }

/* Bullet lists — used in place of icon cards */
.bullets { display: grid; gap: var(--s2); }
.bullets li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s2);
  align-items: start;
  font-size: var(--fs-secondary);
  color: var(--text-secondary);
  line-height: var(--lh-normal);
}
.bullets li .ico { margin-top: 3px; color: var(--success); }
.bullets--deny li .ico { color: var(--text-faint); }

.warmth__facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--s6);
  padding-top: var(--s3);
  margin-top: var(--s1);
  border-top: 1px solid var(--border);
}

/* Document layout for long-form explanations */
.doc { display: grid; gap: var(--s10); }
.doc__section { display: grid; gap: var(--s3); }
.doc__section .t-prose + .t-prose { margin-top: calc(var(--s1) * -1); }

/* Footer */
.pfoot { border-top: 1px solid var(--border); background: var(--bg-sunken); }.pfoot__inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--s12) var(--s8) var(--s8);
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--s10);
}
.pfoot__col { display: grid; gap: var(--s3); align-content: start; }
.pfoot__col a { font-size: var(--fs-secondary); color: var(--text-secondary); transition: color var(--dur-1) linear; width: fit-content; }
.pfoot__col a:hover { color: var(--accent); }
.pfoot__bar > .t-caption { color: var(--text-secondary); }
.pfoot__bar {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--s4) var(--s8) var(--s8);
  display: flex;
  align-items: center;
  gap: var(--s4);
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
}

/* Collapse before the complete desktop navigation becomes crowded. */
@media (max-width: 1180px) {
  .phead, .phead[data-stuck="true"] {
    background: var(--bg-base);
    border-bottom-color: var(--border);
    padding-top: env(safe-area-inset-top, 0px);
  }
  .phead__inner {
    height: 68px;
    padding-inline: max(var(--s4), env(safe-area-inset-left, 0px)) max(var(--s4), env(safe-area-inset-right, 0px));
    gap: var(--s2);
  }
  .phead [data-hide-sm="true"], .phead [data-header-cta="true"] { display: none; }
  .phead .pmenu-btn {
    display: grid;
    place-items: center;
    padding: 0;
    line-height: 1;
    flex: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    background: var(--surface);
  }
  .phead .pmenu-btn[aria-expanded="true"] { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
  .phead [data-account="true"] { min-height: 44px; padding-inline: var(--s2); }
  .phead [data-mobile-account="true"] { display: inline-flex; min-width: 44px; }
  .phead [data-mobile-account="true"][aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
  .pnav { display: none; }
  .pnav[data-open="true"] {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    gap: var(--s2);
    padding: var(--s4) max(var(--s4), env(safe-area-inset-left, 0px)) var(--s5) max(var(--s4), env(safe-area-inset-right, 0px));
    max-height: calc(100dvh - 90px - env(safe-area-inset-top, 0px));
    overflow-y: auto;
    background: var(--surface-raised);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--e3);
    animation: view-in var(--dur-2) var(--ease-out);
  }
  .pnav[data-open="true"] .pnav__link { min-height: 48px; height: auto; gap: var(--s3); background: var(--bg-sunken); }
  .pnav .pnav__icon { display: block; flex: none; color: var(--accent); }
  .pnav[data-open="true"] .pnav__utility { display: flex; grid-column: 1 / -1; background: transparent; border-top: 1px solid var(--border); border-radius: 0; }
  .pnav__link[aria-current="page"] { background: var(--accent-soft); }
}

/* Responsive */
@media (max-width: 1180px) {
  .pdetail { grid-template-columns: minmax(0, 1fr); gap: var(--s8); }
  .pdetail__aside { position: static; }
}
@media (max-width: 860px) {
  .hero { padding: var(--s12) 0; }
  .hero__lede { max-width: 100%; }
  .hero__inner, .psection, .psection--sunken > .psection__inner, .pdetail, .formpage, .pfoot__inner, .pfoot__bar { padding-inline: var(--s4); }
  .hero__cross { display: none; }
  .rail { margin-inline: calc(var(--s4) * -1); padding-inline: var(--s4); grid-auto-columns: minmax(270px, 84vw); }
  .psection { padding-block: var(--s12); }
  .event-row { grid-template-columns: 64px minmax(0, 1fr); }
  .event-row > .btn { grid-column: 1 / -1; }
  .program { grid-template-columns: 36px minmax(0, 1fr); padding: var(--s5) var(--s4); }
  .pfoot__inner { grid-template-columns: minmax(0, 1fr); gap: var(--s6); }
}

/* Phone surfaces: stable masthead, comfortable forms, compact footer. */
@media (max-width: 600px) {
  .plogo { gap: var(--s2); }
  .plogo__text { gap: 3px; }
  .plogo__text b { font-size: 15px; line-height: 1.35; }
  .plogo__text span { font-size: 9px; letter-spacing: .16em; line-height: 1.2; }
  .phead__inner > .spacer { min-width: 0; }
  .hero h1 { font-size: clamp(32px, 9vw, 40px); line-height: 1.15; }
  .hero__figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero__figure { padding: var(--s4); }
  .hero__cta .btn { min-height: 48px; }
  .psection__head { display: grid; gap: var(--s4); align-items: start; }
  .psection__head > .spacer { display: none; }
  .psection__head > .btn { justify-self: start; min-height: 44px; }
  .event-row { gap: var(--s4); padding: var(--s4); }
  .event__go { opacity: 1; transform: none; }
  .phead__auth { gap: 0; }
  .phead [data-account="true"] .ico { display: none; }
  .formpage { padding-block: var(--s6) var(--s12); gap: var(--s6); }
  .formpage > header { gap: var(--s3); }
  .formpage > header .t-h1 { font-size: 26px; line-height: 1.3; text-wrap: pretty; }
  .formpage .t-prose { font-size: 14px; line-height: 1.8; }
  .formpage .panel { min-width: 0; border-radius: var(--r-xl); }
  .formpage .panel__body { padding: var(--s5) var(--s4); }
  .portal .input, .portal .select, .portal .textarea { min-width: 0; min-height: 48px; font-size: 16px; }
  .formpage .input-group, .formpage .select-wrap { min-width: 0; }
  .formpage .t-caption, .pfoot p { overflow-wrap: anywhere; }
  .formpage .btn { min-height: 44px; white-space: normal; text-align: center; }
  .formpage .btn--lg { min-height: 52px; }
  .formpage ol { counter-reset: registration-step; gap: var(--s4); }
  .formpage ol > li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: var(--s3); }
  .formpage ol > li::before { counter-increment: registration-step; content: counter(registration-step) / ""; display: grid; place-items: center; width: 24px; height: 24px; border-radius: var(--r-full); background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: var(--fw-semibold); }
  .pfoot__inner { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-block: var(--s8) var(--s6); gap: var(--s6) var(--s4); }
  .pfoot__col:first-child { grid-column: 1 / -1; }
  .pfoot__col { min-width: 0; gap: var(--s2); }
  .pfoot__col a { display: flex; align-items: center; min-height: 44px; max-width: 100%; }
  .pfoot__bar { display: grid; gap: var(--s2); padding-bottom: max(var(--s6), env(safe-area-inset-bottom, 0px)); }
  .pfoot__bar > .spacer { display: none; }
}
@media (max-width: 360px) {
  .plogo__text b { font-size: 14px; }
  .plogo__text span { font-size: 8px; letter-spacing: .12em; }
  .phead__inner { gap: var(--s1); }
  .hero__cta { flex-direction: column; align-items: stretch; }
}

@media (max-width: 960px) {
  .profile-fields .input, .profile-fields .select { min-height: 48px; font-size: 16px; }
}

/* The five public squares share a clear hierarchy and the selected palette. */
.square-intro { display:grid; gap:var(--s3); padding-bottom:var(--s6); }
.square-intro > h1 { max-width:28ch; }
.square-intro > p { max-width:56ch; }
.square-intro > .row-3 { margin-top:var(--s6); }
.square-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:var(--s5); }
.square-grid--home { grid-template-columns:repeat(3,minmax(0,1fr)); }
.square-card { min-width:0; display:flex; flex-direction:column; align-items:flex-start; gap:var(--s3); padding:var(--s6); border:1px solid var(--border); border-radius:var(--r-lg); background:var(--surface); color:var(--text-primary); transition:transform var(--theme-time) var(--theme-curve),border-color var(--theme-time),box-shadow var(--theme-time); }
.square-card__icon { width:48px; height:48px; display:grid; place-items:center; color:var(--accent); background:var(--accent-soft); border-radius:var(--r-md); }
.square-card__action { display:flex; align-items:center; justify-content:space-between; align-self:stretch; color:var(--accent); font-size:var(--fs-caption); padding-top:var(--s5); margin-top:auto; }
.member-shortcuts { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:var(--s3); }
.member-shortcuts .btn { justify-content:center; }
.member-anchor { scroll-margin-top:100px; }
@media(hover:hover) { .square-card:hover { border-color:var(--accent-ring); transform:translate(var(--theme-shift),var(--theme-lift)) scale(var(--theme-scale)); box-shadow:var(--e2); } }
@media(max-width:800px) { .square-grid--home { grid-template-columns:repeat(2,minmax(0,1fr)); } .member-shortcuts { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:540px) { .square-grid { grid-template-columns:minmax(0,1fr); } .square-card { padding:var(--s5); } }

/* ===== 内容投稿 · 三步工作台 ============================================= */
.submit-steps { padding-block: var(--s2) var(--s5); }
.typegrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
.typecard { display: flex; align-items: flex-start; gap: var(--s4); padding: var(--s5); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); cursor: pointer; transition: border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out); }
.typecard:focus-within { outline: 2px solid var(--accent-ring); outline-offset: 2px; }
.typecard__icon { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--r-md); background: var(--bg-sunken); color: var(--text-secondary); transition: background var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out); }
.typecard__body { display: grid; gap: var(--s1); min-width: 0; }
.typecard__label { font-size: var(--fs-title); font-weight: var(--fw-semibold); color: var(--text-primary); }
.typecard__hint { font-size: var(--fs-caption); color: var(--text-muted); }
.typecard--selected { border-color: var(--accent); box-shadow: var(--e2); }
.typecard--selected .typecard__icon { background: var(--accent); color: var(--text-on-accent); }
.typecard--selected .typecard__label { color: var(--accent); }
@media(hover:hover) { .typecard:hover { border-color: var(--border-hover); transform: translateY(-1px); } }

.dropzone { display: grid; justify-items: center; gap: var(--s2); width: 100%; padding: var(--s8) var(--s5); border: 1.5px dashed var(--border-strong); border-radius: var(--r-lg); background: var(--surface); color: var(--text-muted); text-align: center; cursor: pointer; transition: border-color var(--dur-2) var(--ease-out), background var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out); }
.dropzone__title { font-size: var(--fs-body); font-weight: var(--fw-medium); color: var(--text-primary); }
.dropzone__hint { font-size: var(--fs-caption); }
.dropzone:focus-visible { outline: 2px solid var(--accent-ring); outline-offset: 2px; }
.dropzone--drag, .dropzone:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.dropzone--drag .dropzone__title, .dropzone:hover .dropzone__title { color: var(--accent); }

.filelist { display: grid; gap: var(--s2); }
.filelist__row { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.filelist__row[data-status="error"] { border-color: color-mix(in srgb, var(--error) 45%, transparent); background: var(--error-soft); }
.filelist__row[data-status="pending"] { border-style: dashed; }
.filelist__icon { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--accent-soft); color: var(--accent); }
.filelist__row[data-status="error"] .filelist__icon { background: color-mix(in srgb, var(--error) 12%, transparent); color: var(--error); }
.filelist__meta { flex: 1; min-width: 0; display: grid; gap: var(--s1); }
.filelist__name { font-size: var(--fs-body); font-weight: var(--fw-medium); color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filelist__sub { font-size: var(--fs-caption); color: var(--text-muted); }
.filelist__sub--error { color: var(--error); }
.filelist__bar { height: 4px; border-radius: var(--r-full); background: var(--bg-sunken); overflow: hidden; }
.filelist__fill { height: 100%; width: var(--w, 0%); border-radius: inherit; background: var(--accent); transition: width var(--dur-3) var(--ease-out); }

.submit-dock { position: sticky; bottom: var(--s4); z-index: var(--z-dock); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--s3) var(--s4); padding: var(--s4); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface-raised); box-shadow: var(--e3); }
.submit-dock__summary { display: flex; align-items: center; gap: var(--s3); flex: 1; min-width: 0; }
.submit-dock__chip { flex: none; padding: 3px var(--s3); border-radius: var(--r-full); background: var(--accent-soft); color: var(--accent); font-size: var(--fs-caption); font-weight: var(--fw-semibold); }
.submit-dock__title { font-size: var(--fs-body); font-weight: var(--fw-semibold); color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.submit-dock__actions { display: flex; gap: var(--s3); flex: none; }
@media(max-width:640px) {
  .typegrid { grid-template-columns: minmax(0, 1fr); }
  .submit-dock { bottom: 0; border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .submit-dock__actions { width: 100%; }
  .submit-dock__actions .btn { flex: 1; }
}

/* ===== v2 投稿工作台补充：类型角标与实名卡 ================================= */
.typecard__tag { flex: none; margin-left: auto; }
/* 实名/联系方式只读卡（2026-10-28）
   2026-10-27 曾直接用 --bg-sunken，而门户的 --bg-sunken 是暖纸色 #efeae5，
   身份证卡看起来像「可填写的米色输入框」。改为统一的中性灰只读底 +
   极淡描边 + 顶部内高光，边缘有过渡，与管理端只读块（.field__readonly）同源。 */
.identity-card {
  display: grid;
  gap: var(--s3);
  padding: var(--s4) var(--s5);
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--surface) 45%, var(--bg-readonly, #eef0f3)) 0%,
    var(--bg-readonly, #eef0f3) 100%);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 55%, transparent);
}
.identity-card__row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s4); }
.identity-card__row > .t-body { font-weight: var(--fw-semibold); }
@media(max-width:540px) { .identity-card__row { flex-direction: column; gap: var(--s1); } }

/* ===== 影像库（/photos） =================================================== */
.photogrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: var(--s4); }
.photocard { position: relative; display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; transition: border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out); }
.photocard--selected { border-color: var(--accent); box-shadow: var(--e2); }
.photocard__check { position: absolute; top: var(--s2); right: var(--s2); z-index: 2; display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--border-strong); border-radius: var(--r-full); background: var(--surface-raised); color: var(--text-muted); cursor: pointer; transition: background var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out); }
.photocard__check:has(:checked) { background: var(--accent); border-color: var(--accent); color: var(--text-on-accent); }
.photocard__check:has(:focus-visible) { outline: 2px solid var(--accent-ring); outline-offset: 2px; }
.photocard__thumb { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 3; border: 0; padding: 0; background: var(--bg-sunken); color: var(--text-muted); cursor: zoom-in; overflow: hidden; }
/* 预览图盖住占位图标；加载失败时 img 会被移除，图标自然露出来。 */
.photocard__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--bg-sunken); }
.photocard__thumb:hover { color: var(--accent); }
.photocard__thumb:focus-visible { outline: 2px solid var(--accent-ring); outline-offset: -2px; }
.photocard__body { display: grid; gap: var(--s1); padding: var(--s3) var(--s4) 0; min-width: 0; }
.photocard__name { font-size: var(--fs-body); font-weight: var(--fw-medium); color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photocard__actions { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); padding: var(--s2) var(--s3) var(--s3); }
.photocard__corner { position: absolute; top: var(--s2); left: var(--s2); z-index: 2; padding: 2px var(--s2); border-radius: var(--r-full); background: var(--accent); color: var(--text-on-accent); font-size: var(--fs-caption); font-weight: var(--fw-medium); }
@media(hover:hover) { .photocard:hover { border-color: var(--border-hover); box-shadow: var(--e2); } }

.photo-lightbox { position: fixed; inset: 0; z-index: var(--z-overlay); display: grid; place-items: center; padding: var(--s5); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(6px); animation: fade-in var(--dur-2) var(--ease-out); }
.photo-lightbox__panel { display: grid; gap: var(--s3); max-width: min(1080px, 100%); max-height: 100%; }
.photo-lightbox__img { max-width: 100%; max-height: min(76vh, 100%); object-fit: contain; border-radius: var(--r-lg); box-shadow: var(--e4); }
.photo-lightbox__bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); padding: var(--s3) var(--s4); border-radius: var(--r-lg); background: var(--surface-raised); box-shadow: var(--e3); }
.photo-lightbox__name { font-size: var(--fs-caption); color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media(max-width:640px) { .photo-lightbox { padding: var(--s3); } .photo-lightbox__bar { flex-direction: column; align-items: stretch; gap: var(--s2); } }

/* ===== 宣传展示墙（/showcase） ============================================ */
.showcase-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--s5); }
.showcase-card { min-width: 0; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); color: var(--text-primary); overflow: hidden; transition: transform var(--theme-time) var(--theme-curve), border-color var(--theme-time), box-shadow var(--theme-time); }
.showcase-card__cover { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--bg-sunken); }
.showcase-card__cover--empty { display: grid; place-items: center; color: var(--text-faint); }
.showcase-card__body { display: grid; gap: var(--s1); padding: var(--s4) var(--s5) 0; }
.showcase-card__source { font-size: var(--fs-caption); color: var(--accent); }
.showcase-card__action { display: flex; align-items: center; justify-content: space-between; align-self: stretch; margin-top: auto; padding: var(--s4) var(--s5) var(--s5); color: var(--accent); font-size: var(--fs-caption); }
.showcase-card:focus-visible { outline: 3px solid var(--accent-ring); outline-offset: 4px; }
@media(hover:hover) { .showcase-card:hover { border-color: var(--accent-ring); transform: translate(var(--theme-shift), var(--theme-lift)) scale(var(--theme-scale)); box-shadow: var(--e2); } }
@media(max-width:540px) { .showcase-grid { grid-template-columns: minmax(0, 1fr); } }
/* v3 第 14 项：展示墙双板（公众号推文 / 文创展示）+ 文创卡片笔名 */
.showcase-board { padding-top: var(--s4); }
.showcase-board + .showcase-board { margin-top: var(--s6); border-top: 1px solid var(--border); padding-top: var(--s6); }
.showcase-card--design { border-style: solid; }
.showcase-card__pen { font-size: var(--fs-caption); color: var(--text-muted); }
/* v3 第 15 项：栏目标签芯片行（投稿页快选 + 展示页筛选） */
.chip-row { display: flex; flex-wrap: wrap; gap: var(--s2); }

/* ===== 影像库文件夹视图（/photos，要求4） ================================ */
.chip--static { cursor: default; }
.mediafolder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--s4); }
.mediafolder { display: flex; align-items: center; gap: var(--s4); width: 100%; padding: var(--s4) var(--s5); text-align: left; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); color: var(--text-primary); cursor: pointer; transition: border-color var(--theme-time) var(--theme-curve), box-shadow var(--theme-time), transform var(--theme-time); }
.mediafolder__icon { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-md); background: var(--accent-soft); color: var(--accent); }
.mediafolder__body { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; }
.mediafolder__name { font-weight: var(--fw-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mediafolder__meta { display: block; }
.mediafolder:focus-visible { outline: 3px solid var(--accent-ring); outline-offset: 3px; }
@media(hover:hover) { .mediafolder:hover { border-color: var(--accent-ring); transform: translate(var(--theme-shift), var(--theme-lift)); box-shadow: var(--e2); } }
@media(max-width:540px) { .mediafolder-grid { grid-template-columns: minmax(0, 1fr); } }
/* Roster states are semantic, independent of the selected brand theme. */
.blood-calendar { padding: 20px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); }
.blood-calendar__grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 10px; }
.blood-calendar__day { min-width: 0; }
.blood-calendar__date { width: 100%; display: grid; justify-items: center; gap: 4px; min-height: 56px; padding: 8px 4px; background: transparent; border: 0; color: inherit; border-radius: 10px; cursor: pointer; font-size: 13px; }
.blood-calendar__slots { display: grid; gap: 8px; margin-top: 8px; }
.portal .blood-calendar__slot { --slot-bg: var(--blood-open-bg); --slot-ink: var(--blood-open-ink); --slot-border: var(--blood-open-border); min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 7px; padding: 12px 10px; border: 1px solid var(--slot-border); border-left-width: 3px; border-radius: 10px; background: var(--slot-bg); color: var(--slot-ink); text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.portal .blood-calendar__slot[data-state="full"] { --slot-bg: var(--blood-full-bg); --slot-ink: var(--blood-full-ink); --slot-border: var(--blood-full-border); border-style: dashed; }
.portal .blood-calendar__slot[data-state="pending"] { --slot-bg: var(--blood-pending-bg); --slot-ink: var(--blood-pending-ink); --slot-border: var(--blood-pending-border); }
.portal .blood-calendar__slot:is([data-state="confirmed"],[data-state="attended"]) { --slot-bg: var(--blood-own-bg); --slot-ink: var(--blood-own-ink); --slot-border: var(--blood-own-border); }
.blood-slot-status { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 650; line-height: 1.5; }
.blood-slot-status .ico { width: 14px; height: 14px; flex: none; }
.portal .blood-calendar__slot strong { color: var(--text-primary); font-size: 13px; font-weight: 600; line-height: 1.4; }
.portal .blood-calendar__slot .blood-calendar__time { font-size: 12px; font-variant-numeric: tabular-nums; }
.portal .blood-calendar__slot small { font-size: 11px; color: var(--slot-ink); font-variant-numeric: tabular-nums; }
.portal .blood-calendar__slot[data-active="true"] { outline: 2px solid var(--text-primary); outline-offset: 2px; }
.portal .blood-calendar__slot:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.blood-calendar__empty { font-size: 12px; color: var(--text-secondary); padding: 12px 4px; }
.blood-calendar__legend { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 12px; color: var(--text-secondary); }
.blood-calendar__legend > span { display: inline-flex; align-items: center; gap: 6px; }
.blood-calendar__legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--blood-open-bg); border: 2px solid var(--blood-open-ink); }
.blood-calendar__legend [data-state="full"] i { background: var(--blood-full-bg); border-color: var(--blood-full-ink); border-style: dashed; }
.blood-calendar__legend [data-state="pending"] i { background: var(--blood-pending-bg); border-color: var(--blood-pending-ink); }
.blood-calendar__legend [data-state="confirmed"] i { background: var(--blood-own-bg); border-color: var(--blood-own-ink); }
.blood-calendar__toolbar { flex-wrap: nowrap; }
.blood-calendar__toolbar .btn { flex: none; white-space: nowrap; }
@media (hover: hover) and (pointer: fine) { .portal .blood-calendar__slot:hover { box-shadow: inset 0 0 0 1px var(--slot-ink); } }
@media(max-width: 700px) {
 .blood-calendar { padding: 14px; }
 .blood-calendar__grid { gap: 4px; }
 .blood-calendar__day { display: contents; }
 .blood-calendar__date { grid-row: 1; font-size: 11px; }
 .blood-calendar__day[data-selected="true"] .blood-calendar__date { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 -2px var(--accent); }
 .blood-calendar__slots { display: none; }
 .blood-calendar__day[data-selected="true"] .blood-calendar__slots { display: grid; grid-column: 1/-1; gap: 8px; }
 .portal .blood-calendar__slot { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; padding: 14px; gap: 7px 12px; }
 .blood-calendar__slot .blood-slot-status { grid-column: 2; grid-row: 1; }
 .blood-calendar__slot strong { grid-column: 1; grid-row: 1; }
 .blood-calendar__slot .blood-calendar__time { grid-column: 1; grid-row: 2; }
 .blood-calendar__slot small { grid-column: 2; grid-row: 2; }
}

/* Dense signup views: a week at a time, with readable touch targets. */
.portal .event-list--compact { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.portal .event-row--compact { grid-template-columns: 48px minmax(0,1fr); gap: 14px; padding: 18px; border-radius: 20px; }
.portal .event-row--compact .event-row__date { width: 48px; padding: 8px 0; border-radius: 12px; }
.portal .event-row--compact .event-row__date b { font-size: 22px; }
.portal .event-row--compact .t-h3 { font-size: 17px; }
.portal .event-row--compact > .btn { grid-column: 2; width: auto; justify-self: start; }
.blood-calendar__summary { margin: 0; color: var(--text-secondary); font-size: 13px; font-variant-numeric: tabular-nums; }
@media(max-width:700px) {
 .portal .event-list--compact { grid-template-columns: minmax(0,1fr); }
 .portal .event-row--compact { padding: 16px; gap: 12px; }
}
@media(max-width:700px) {
 .portal .event-browser .psection { padding-top: 20px; }
 .portal .event-browser .psection__head { margin-bottom: 18px; gap: 10px; }
 .portal .event-browser .psection__head .t-h1 { font-size: 28px; line-height: 1.25; }
 .portal .event-browser .psection__head .t-label { display: none; }
 .portal .event-browser .psection__head .t-secondary { font-size: 13px; }
}

/* Weekly entries keep the square concise; details stay inside the calendar. */
.portal .blood-week-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.portal .blood-week-entry{display:flex;align-items:center;gap:16px;padding:20px;border:1px solid var(--border);border-radius:20px;background:var(--surface);color:inherit;text-decoration:none;transition:transform 150ms cubic-bezier(.23,1,.32,1)}
.portal .blood-week-entry__icon{display:grid;place-items:center;width:48px;height:48px;flex:none;border-radius:14px;background:var(--surface-accent-soft);color:var(--accent)}
.portal .blood-week-entry__body{flex:1;min-width:0}.portal .blood-week-entry h3{font-size:16px;line-height:1.5;margin:0}.portal .blood-week-entry p{font-size:13px;color:var(--text-secondary);margin:4px 0 0}.portal .blood-week-entry__count{font-size:13px;white-space:nowrap;color:var(--accent)}
.portal .vacancy-callout{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px;border:1px solid var(--border);border-radius:16px;background:var(--surface)}
.portal .vacancy-callout p{font-size:14px;line-height:1.6;margin:6px 0 0;color:var(--text-secondary)}
.activity-position-details{border:1px solid var(--border);border-radius:16px;padding:16px}.activity-position-details summary{cursor:pointer;font-weight:600}.activity-position-list{display:grid;gap:12px;padding-top:16px}
@media(hover:hover){.portal .blood-week-entry:hover{transform:translateY(-2px)}}
.portal .blood-week-entry:active{transform:scale(.985)}.portal .blood-week-entry:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
@media(max-width:700px){.portal .blood-week-list{grid-template-columns:minmax(0,1fr)}.portal .blood-week-entry{padding:16px;gap:12px}.portal .blood-week-entry__count{display:none}.portal .vacancy-callout{align-items:stretch;flex-direction:column}.portal .vacancy-callout .btn{min-height:44px}}
@media(prefers-reduced-motion:reduce){.portal .blood-week-entry{transition:none}.portal .blood-week-entry:hover{transform:none}}

.position-roster__list{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr));gap:16px}
.position-roster__person{border:1px solid var(--border);border-radius:16px;padding:20px;min-width:0;overflow-wrap:anywhere}
.position-roster{border:1px solid var(--border);border-radius:16px;overflow:hidden}
.position-roster summary{list-style:none;display:flex;align-items:center;gap:14px;padding:18px;cursor:pointer;color:var(--text-primary)}
.position-roster>.participation-action__body{padding:0 18px 18px}
.position-roster .dl{min-width:0}

.blood-calendar__header{display:grid;gap:24px}
.blood-calendar__toolbar{justify-self:start}
.blood-calendar__filters{display:grid;grid-template-columns:minmax(0,1fr) 260px;align-items:end;gap:24px;min-width:0}
.blood-calendar__filter-group{display:grid;gap:10px;min-width:0}
.blood-calendar__filter-group .field__label{margin:0;line-height:20px}
.blood-calendar__empty-hint{margin:0;padding:14px 16px;border:1px solid var(--border);border-radius:12px;background:var(--bg-sunken);color:var(--text-secondary);font-size:13px;line-height:1.7}
@media(max-width:1000px){.blood-calendar__filters{grid-template-columns:minmax(0,1fr);gap:16px}.blood-calendar__filter-group:last-child{max-width:300px;width:100%}}
@media(max-width:700px){.blood-calendar__header{gap:20px}.blood-calendar__toolbar{justify-self:stretch}.blood-calendar__filters .filter-segments button{white-space:normal;overflow-wrap:anywhere;min-height:48px;line-height:1.5;padding:6px}.blood-calendar__filter-group:last-child{max-width:none}.blood-calendar__filter-group:first-child .filter-segments button{padding-inline:2px;font-size:12px}.blood-calendar__filters .filter-segments__compact-label{white-space:pre-line}}

.blood-calendar__toolbar .btn{min-height:44px}

.profile-fields .select-menu__trigger{height:48px;min-height:48px;font-size:16px}

/* Shared activity facts: readable labels, aligned values, no nested tiles. */
.activity-facts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px 32px; margin: 0; padding-block: 4px 20px; border-bottom: 1px solid var(--border); }
.activity-facts__item { min-width: 0; }
.activity-facts dt { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }
.activity-facts dt .ico { width: 16px; height: 16px; }
.activity-facts dd { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.6; color: var(--text-primary); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.activity-facts dd small { font-size: 13px; font-weight: 400; color: var(--text-secondary); }
.workflow-event-detail .panel__title { line-height: 1.5; }
.workflow-event-detail .workflow-actions { align-items: end; padding-top: 16px; border-top: 1px solid var(--border); }
.workflow-event-detail .workflow-actions > .field { flex: 0 1 220px; }
.workflow-event-detail .workflow-actions > .btn { min-height: 44px; }
@media(max-width:700px) { .activity-facts { gap: 20px 16px; } .activity-facts dd { font-size: 15px; } .workflow-event-detail .workflow-actions { display: grid; grid-template-columns: minmax(0,1fr); } .workflow-event-detail .workflow-actions > .field { width: 100%; } }
.member-profile-editor { border-top:1px solid var(--border); padding-top:12px; }
.member-profile-editor > summary { display:flex; align-items:center; gap:10px; min-height:44px; font-weight:600; cursor:pointer; color:var(--accent); }
.member-profile-editor > summary::after { content:'＋'; margin-left:auto; }
.member-profile-editor[open] > summary::after { content:'−'; }
.member-profile-editor > summary::marker { content:''; }
.member-profile-editor > summary::-webkit-details-marker { display:none; }
.member-profile-editor > .stack-4 { padding-top:16px; }
.member-profile-editor > summary:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }

.workflow-event-detail, .workflow-detail-anchor { scroll-margin-top: 88px; }

/* Keep the complete brand legible alongside touch controls on narrow phones. */
@media (max-width: 400px) { .portal .phead .plogo__text b { font-size: 13px; } }

/* Development rollout: a calm branded waiting page, with no endless spinner. */
.development-gate { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); align-items:center; gap:clamp(28px,5vw,76px); width:min(100%,1440px); margin:auto; padding:clamp(28px,5vw,76px); min-height:calc(100svh - 76px); background:radial-gradient(circle at 8% 10%,#b50b3008,transparent 50%); }
.development-gate__copy { min-width:0; }
.development-gate__brand { display:flex; align-items:center; gap:12px; color:var(--text-secondary); font-size:13px; margin-bottom:44px; }
.development-gate__brand img { flex:none; border-radius:50%; }
.development-gate__eyebrow { color:var(--accent); letter-spacing:.16em; font-size:12px; margin:0 0 12px; }
.development-gate h1 { color:#920825; font-size:clamp(32px,4vw,54px); line-height:1.25; margin:0; overflow-wrap:anywhere; }
.development-gate__motto { color:#920825; font-family:"Songti SC","SimSun",serif; font-size:clamp(20px,2.2vw,30px); margin:14px 0 24px; }
.development-gate__description { color:var(--text-secondary); white-space:pre-line; line-height:1.9; margin:0 0 28px; }
.development-gate__status { display:flex; align-items:flex-start; gap:12px; border:1px solid var(--border); border-radius:16px; padding:20px; background:var(--surface); color:var(--text-primary); }
.development-gate__status>.ico { color:#b50b30; flex:none; margin-top:3px; }
.development-gate__status strong { font-size:16px; line-height:1.7; }
.development-gate__status p { margin:5px 0 0; font-size:13px; line-height:1.8; color:var(--text-secondary); }
.development-gate__status:focus-visible { outline:2px solid var(--accent); outline-offset:4px; }
.development-gate__actions { display:flex; flex-wrap:wrap; gap:12px; margin-top:24px; }
.development-gate__actions .btn { min-height:46px; white-space:normal; text-align:center; }
.development-gate__media { position:relative; margin:0; min-width:0; overflow:hidden; aspect-ratio:4/5; max-height:620px; border-radius:24px; background:#f1e6df; }
.development-gate__media>img { display:block; width:100%; height:100%; object-fit:cover; object-position:55% center; }
.development-gate__media::after { content:""; position:absolute; inset:30% 0 0; background:linear-gradient(transparent,#41242bb8); pointer-events:none; }
.development-gate__media figcaption { position:absolute; z-index:1; inset:auto 28px 28px; display:grid; gap:8px; color:#fff; }
.development-gate__media figcaption strong { font-size:clamp(19px,2vw,26px); line-height:1.5; }
.development-gate__media figcaption span { letter-spacing:.18em; font-size:13px; }
@media(max-width:760px) { .development-gate { grid-template-columns:minmax(0,1fr); min-height:0; padding:30px 20px; gap:28px; } .development-gate__brand { margin-bottom:28px; } .development-gate__media { aspect-ratio:16/9; max-height:320px; border-radius:18px; } .development-gate__media figcaption { inset:auto 20px 18px; } }

.blood-participation-summary p{line-height:1.9;margin:0 0 12px;overflow-wrap:anywhere}.blood-participation-summary a{margin-inline:3px;text-decoration:underline;text-underline-offset:3px}
.blood-participation-guide{min-width:0}.blood-guide-block{padding:16px 0;border-bottom:1px solid var(--border)}.blood-guide-block h3{font-size:17px;margin:0 0 10px}.blood-guide-block p{white-space:pre-line;line-height:1.9;margin:0;overflow-wrap:anywhere}.blood-participation-guide figure{margin:20px 0}.blood-participation-guide img{display:block;width:100%;height:auto;max-width:820px;border:1px solid var(--border);border-radius:12px}.blood-participation-guide figcaption{font-size:12px;color:var(--text-muted);margin-top:6px}

/* Consistent sans-serif typography and clearly distinguishable participation links. */
.workflow-page,.blood-participation-guide{font-family:"Microsoft YaHei","微软雅黑","PingFang SC",sans-serif;--font-heading:"Microsoft YaHei","微软雅黑","PingFang SC",sans-serif;--font-reading:"Microsoft YaHei","微软雅黑","PingFang SC",sans-serif}
.workflow-page,.workflow-page *,.blood-participation-guide,.blood-participation-guide *{font-family:"Microsoft YaHei","微软雅黑","PingFang SC",sans-serif!important}
.workflow-page a:not(.btn),.blood-participation-guide a{font-weight:700;color:var(--accent);text-decoration:underline;text-underline-offset:3px}
.workflow-page a:not(.btn):hover,.blood-participation-guide a:hover{color:var(--accent-hover)}
.blood-participation-summary>p{white-space:pre-line}
.blood-participation-links{margin:0;padding-left:1.4em;list-style:decimal;display:grid;gap:10px;line-height:1.9}
.blood-participation-links li{padding-left:3px;overflow-wrap:anywhere}

.portal-profile-reminder:empty{display:none}.portal-profile-reminder{padding:12px 24px;display:flex;align-items:center;flex-wrap:wrap;gap:12px}.portal-profile-reminder>.notice{flex:1;min-width:0}

/* /styles/themes.css */
/* Five independent palettes per surface; semantic status colours stay stable. */
:root { --theme-lift: 0px; --theme-shift: 0px; --theme-scale: 1; --theme-time: 180ms; --theme-curve: cubic-bezier(.16,1,.3,1); --hero-tint: #37141c; }
[data-theme="dawn"], [data-theme="porcelain"] { --accent:#b91c37; --accent-hover:#98152b; --accent-soft:#fbecef; --accent-ring:#e6a6b3; --mesh-1:#b91c3714; --mesh-2:#edc1ad25; --mesh-3:#d6bc9420; --hero-tint:#431b25; }
[data-theme="sail"], [data-theme="blueprint"] { --bg-base:#f1f7fc; --bg-sunken:#e8f0f8; --accent:#175f9d; --accent-hover:#104b7e; --accent-soft:#e5f0fb; --accent-ring:#9bc4e9; --surface-accent-soft:#e5f0fb; --border-accent:#175f9d66; --mesh-1:#75b5e92b; --mesh-2:#afd2e42b; --mesh-3:#c4def127; --hero-tint:#173c58; --r-md:10px; --r-lg:14px; --theme-shift:2px; --theme-time:150ms; }
[data-theme="garden"], [data-theme="botanic"] { --bg-base:#f2f8f3; --bg-sunken:#e8f1eb; --accent:#17684f; --accent-hover:#104f3d; --accent-soft:#e3f1e9; --accent-ring:#92c8ae; --surface-accent-soft:#e3f1e9; --border-accent:#17684f66; --mesh-1:#98c7a82b; --mesh-2:#ceda932b; --mesh-3:#b5cec727; --hero-tint:#204336; --r-md:18px; --r-lg:24px; --theme-scale:1; --theme-time:220ms; }
[data-theme="iris"], [data-theme="atelier"] { --bg-base:#f7f4fc; --bg-sunken:#eee9f7; --accent:#6744a5; --accent-hover:#513483; --accent-soft:#eee7f9; --accent-ring:#c7b3e5; --surface-accent-soft:#eee7f9; --border-accent:#6744a566; --mesh-1:#c7b3e52b; --mesh-2:#d5bada2b; --mesh-3:#b6bce927; --hero-tint:#342947; --r-md:16px; --r-lg:20px; --e2:0 3px 12px -5px #6744a526; --theme-time:200ms; }
[data-theme="amber"], [data-theme="archive"] { --bg-base:#fcf8ee; --bg-sunken:#f2ecde; --accent:#82570b; --accent-hover:#654206; --accent-soft:#f5ecd5; --accent-ring:#d4b36d; --surface-accent-soft:#f5ecd5; --border-accent:#82570b66; --mesh-1:#d8b67124; --mesh-2:#dac5a324; --mesh-3:#dfc5a124; --hero-tint:#483720; --r-md:6px; --r-lg:8px; --theme-time:120ms; }
[data-surface="portal"][data-theme="dawn"] { --bg-base:#fbf6f2; --r-lg:22px; --theme-lift:-1px; }
[data-surface="console"][data-theme="porcelain"] { --bg-base:#f5f6f8; }
[data-surface="console"][data-theme="blueprint"] { --bg-base:#f0f5fa; --r-lg:10px; }
[data-surface="console"][data-theme="botanic"] { --bg-base:#f2f7f4; --r-lg:16px; --theme-scale:1; --theme-lift:-1px; }
[data-surface="console"][data-theme="atelier"] { --bg-base:#f5f3fa; --r-lg:16px; }
[data-surface="console"][data-theme="archive"] { --bg-base:#faf6ed; --r-lg:6px; }
/* Art profiles: the only source of non-semantic palette values. */
[data-theme="dawn"], [data-theme="porcelain"] { --canvas-base:#f7f1eb; --canvas-muted:#efe4dc; --page-aura-1:#ead1c5; --page-aura-2:#e6d7ad; --hero-ink:#462d35; --hero-base:#f8eee5; --art-accent:#6e233b; --canvas-raised:#fffaf5; }
[data-theme="sail"], [data-theme="blueprint"] { --canvas-base:#f0f5f8; --canvas-muted:#e2ebf1; --page-aura-1:#c4dfe9; --page-aura-2:#d8e0d8; --hero-ink:#253d51; --hero-base:#eef5f7; --art-accent:#204d6a; --canvas-raised:#fcfeff; }
[data-theme="garden"], [data-theme="botanic"] { --canvas-base:#f2f5ec; --canvas-muted:#e4ebdf; --page-aura-1:#ccdbc3; --page-aura-2:#e5d9ac; --hero-ink:#2d4638; --hero-base:#f2f4e7; --art-accent:#315f45; --canvas-raised:#fcfdf8; }
[data-theme="iris"], [data-theme="atelier"] { --canvas-base:#f5f1f7; --canvas-muted:#eae2ef; --page-aura-1:#dbcee8; --page-aura-2:#e7d8cf; --hero-ink:#443350; --hero-base:#f6eef6; --art-accent:#624175; --canvas-raised:#fffbff; }
[data-theme="amber"], [data-theme="archive"] { --canvas-base:#faf4e6; --canvas-muted:#eee3ca; --page-aura-1:#ead6a5; --page-aura-2:#e1cdbd; --hero-ink:#513e27; --hero-base:#faf0db; --art-accent:#76542b; --canvas-raised:#fffdf6; }
[data-theme] {
 --art-canvas:var(--canvas-base); --art-surface:var(--art-paper);
 --art-line:var(--border-soft); --art-decor:var(--art-accent);
 --art-hero-depth:var(--canvas-muted); --art-section-transition:var(--canvas-raised);
 --art-type-accent:var(--art-accent);
 --art-paper:color-mix(in srgb,var(--canvas-base) 70%,var(--canvas-raised));
 --card-surface:var(--canvas-raised); --card-surface-contrast:var(--art-accent);
 --border-soft:color-mix(in srgb,var(--hero-ink) 16%,transparent);
 --elevation-1:0 2px 8px color-mix(in srgb,var(--hero-ink) 5%,transparent);
 --elevation-2:0 18px 44px -28px color-mix(in srgb,var(--hero-ink) 32%,transparent);
 --link:var(--accent); --focus-ring:var(--accent); --hero-secondary:var(--text-secondary);
 --hero-line:var(--border-soft); --hero-accent:var(--art-accent);
 --canvas-paper:var(--canvas-base); --canvas-editorial:var(--art-paper);
 --canvas-workspace:color-mix(in srgb,var(--canvas-base) 50%,var(--canvas-raised));
 --canvas-footer:var(--canvas-muted);
 --discovery-ink:var(--text-primary); --discovery-muted:var(--text-secondary); --discovery-shadow:var(--elevation-2);
 --calendar-ink:var(--text-primary); --calendar-muted:var(--text-secondary); --calendar-shadow:var(--elevation-1);
}
[data-surface="portal"] {
 --bg-base:var(--canvas-base); --bg-sunken:var(--canvas-muted);
 --surface:var(--card-surface); --surface-raised:var(--canvas-raised);
 --border:var(--border-soft); --text-primary:var(--hero-ink);
 --text-secondary:color-mix(in srgb,var(--hero-ink) 84%,var(--canvas-raised));
 --text-muted:color-mix(in srgb,var(--hero-ink) 82%,var(--canvas-raised));
}
.brand-mark { color:var(--brand-crimson); background:var(--brand-crimson); }
[data-theme="amber"] :is(.hero h1,.gate__intro h2), [data-theme="archive"] :is(.gate__intro h2,.page-head h1) { font-family:var(--font-heading); letter-spacing:0; }
:is(.event,.event-row,.theme-choice,.gate-art__node,.activity-list-item,.nav__item) { transition:transform var(--theme-time) var(--theme-curve),box-shadow var(--theme-time) var(--theme-curve),background var(--theme-time) var(--theme-curve); }
.btn { transition-duration:var(--theme-time); }
[data-theme="blueprint"] .nav { background-image:linear-gradient(var(--border) 1px,transparent 1px); background-size:100% 32px; }
[data-theme="atelier"] :is(.panel,.gate__card) { box-shadow:0 4px 24px -16px var(--accent-ring); }
[data-theme="archive"] :is(.panel,.activity-master) { border-radius:8px; }
@media (hover:hover) {
  :is(.event,.event-row):hover { transform:translate(var(--theme-shift),var(--theme-lift)) scale(var(--theme-scale)); }
  [data-theme-motion="slide"] :is(.nav__item,.activity-list-item):hover { transform:translateX(2px); }
  [data-theme-motion="soft"] :is(.nav__item,.activity-list-item):hover { box-shadow:0 2px 8px -3px var(--accent-ring); }
  [data-theme-motion="glow"] :is(.event,.event-row,.theme-choice,.square-card):hover { box-shadow:inset 0 0 0 1px var(--accent-ring); }
  [data-theme-motion="quiet"] .activity-list-item:hover strong { text-decoration:underline; text-underline-offset:5px; }
  [data-theme-motion="quiet"] .event:hover .event__title { text-decoration:underline; text-underline-offset:5px; }
  .gate-art__node:hover { transform:translateY(-3px); }
}
.theme-trigger { flex:none; color:var(--text-secondary); }
.theme-trigger:hover { color:var(--accent); background:var(--accent-soft); }
.theme-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.theme-choice { position:relative; display:grid; gap:8px; padding:12px; border:1px solid var(--border-strong); border-radius:14px; cursor:pointer; min-width:0; background:var(--surface); }
.theme-choice input { position:absolute; right:15px; top:14px; accent-color:var(--accent); z-index:2; width:17px; height:17px; }
.theme-choice:has(input:checked) { border-color:var(--accent); box-shadow:0 0 0 1px var(--accent); }
.theme-choice:has(input:focus-visible) { outline:3px solid var(--accent-ring); outline-offset:3px; }
.theme-choice__preview { display:block; position:relative; height:112px; border-radius:8px; background:var(--canvas-base); overflow:hidden; border:1px solid #00000008; }
.theme-choice__mini-nav { position:absolute; left:8px; right:8px; top:8px; height:54px; background:radial-gradient(ellipse at 90% 0,var(--page-aura-1),transparent 70%),var(--hero-base); border:1px solid var(--border-soft); border-radius:4px; }
.theme-choice__mini-card { position:absolute; left:8px; top:70px; width:58%; height:32px; background:var(--canvas-raised); border-radius:5px; box-shadow:0 2px 8px #0000000c; }
.theme-choice__mini-action { position:absolute; left:72%; top:78px; width:20%; height:16px; background:var(--accent); border-radius:4px; }
.theme-motion { display:flex; align-items:center; gap:14px; padding:20px 0; border-top:1px solid var(--border); margin-top:22px; }
.theme-motion input { width:20px; height:20px; accent-color:var(--accent); flex:none; }
/* Studio login: a visual map of the four service lines, never live operational data. */
.gate--studio { grid-template-columns:minmax(0,1.16fr) minmax(380px,.84fr); background:var(--surface); }
.gate--studio .gate__aside { position:relative; display:flex; flex-direction:column; gap:30px; padding:clamp(28px,4vw,72px); background:linear-gradient(140deg,var(--bg-base),var(--accent-soft)); overflow:hidden; }
.gate__brand { font-size:15px; position:relative; z-index:1; }
.gate__edition { margin-left:auto; color:var(--text-muted); font-size:10px; letter-spacing:.18em; }
.gate__intro { margin-top:clamp(12px,3vh,38px); position:relative; z-index:1; }
.gate__intro .t-label { color:var(--accent); letter-spacing:.12em; }
.gate__intro h2 { font-size:clamp(30px,3.1vw,50px); font-weight:650; line-height:1.4; letter-spacing:-.045em; margin:0; }
.gate__intro h2 span,.gate__intro h2 em { display:block; }
.gate__intro h2 em { color:var(--accent); font-style:normal; }
.gate__intro p { max-width:38ch; white-space:pre-line; }
.gate-art { height:clamp(250px,28vw,360px); position:relative; isolation:isolate; margin:0 auto; width:100%; max-width:620px; }
.gate-art__grid { position:absolute; inset:0; background-image:radial-gradient(var(--border-strong) 1px,transparent 1px); background-size:22px 22px; mask-image:radial-gradient(ellipse,black,transparent 70%); }
.gate-art__ring { position:absolute; top:50%; left:50%; border:1px solid var(--accent-ring); border-radius:50%; transform:translate(-50%,-50%); }
.gate-art__ring--one { width:190px; height:190px; opacity:.6; }
.gate-art__ring--two { width:280px; height:280px; opacity:.3; }
.gate-art__core { position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); width:128px; height:128px; display:grid; place-content:center; justify-items:center; gap:16px; background:var(--surface); border:1px solid var(--border); border-radius:32px; box-shadow:0 15px 40px -20px var(--accent-ring); }
.gate-art__core .brand-mark { width:38px; height:38px; }
.gate-art__core>span:last-child { font-size:8px; letter-spacing:.1em; color:var(--text-muted); }
.gate-art__node { position:absolute; display:flex; align-items:center; gap:12px; padding:15px 20px; border:1px solid var(--border); background:var(--surface); border-radius:16px; box-shadow:var(--e3); font-size:13px; font-weight:600; animation:studio-in 550ms var(--theme-curve) var(--intro-delay) both; }
.gate-art__node .ico { color:var(--accent); }
.gate-art__node--0 { left:5%; top:13%; }
.gate-art__node--1 { right:3%; top:23%; }
.gate-art__node--2 { left:0; bottom:21%; }
.gate-art__node--3 { right:1%; bottom:9%; }
.gate-art__line { position:absolute; height:1px; width:36px; background:var(--accent-ring); right:-37px; top:50%; }
.gate-art__node--1 .gate-art__line,.gate-art__node--3 .gate-art__line { right:auto; left:-37px; }
.gate-art__caption { position:absolute; bottom:-15px; left:50%; transform:translateX(-50%); white-space:nowrap; font-size:12px; color:var(--text-muted); letter-spacing:.08em; }
.gate--studio .gate__facts { grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px 24px; margin-top:auto; padding-top:30px; border-top:1px solid var(--border); }
.gate--studio .gate__fact { font-size:12px; }
.gate--studio .gate__fact p { font-size:11px; line-height:1.6; }
.gate--studio .gate__form { position:relative; display:flex; flex-direction:column; justify-content:space-between; align-items:stretch; padding:32px clamp(26px,4vw,64px); min-width:0; }
.gate__toolbar { display:flex; align-items:center; justify-content:space-between; gap:15px; }
.gate__form-inner { width:100%; display:grid; place-items:center; margin:40px 0; }
.gate--studio .gate__card { width:min(410px,100%); gap:24px; padding:36px; border:1px solid var(--border); background:var(--surface); box-shadow:0 15px 60px -30px var(--accent-ring); border-radius:24px; animation:studio-in 500ms var(--theme-curve) both; }
.gate--studio .gate__card h1 { font-size:30px; letter-spacing:-.035em; }
.gate--studio .gate__card .field__control { min-height:44px; }
.gate__mobile-brand { display:none; }
.gate__signature { text-align:center; font-size:11px; letter-spacing:.3em; color:var(--text-muted); }
@keyframes studio-in { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }
@media (max-width:1100px) and (min-width:801px) { .gate--studio { grid-template-columns:minmax(0,1fr) minmax(360px,1fr); } .gate--studio .gate__aside { display:flex; padding:32px; } .gate__edition { display:none; } .gate-art__node { padding:12px; gap:8px; } .gate-art__core { width:105px; height:105px; } }
@media (max-width:800px) { .gate--studio { grid-template-columns:minmax(0,1fr); background:linear-gradient(160deg,var(--accent-soft),var(--bg-base) 55%); } .gate--studio .gate__aside { display:none; } .gate--studio .gate__form { min-height:100dvh; padding:20px; } .gate__form-inner { margin:32px 0; gap:26px; } .gate__mobile-brand { display:flex; font-size:14px; } .gate--studio .gate__card { padding:28px 24px; } .gate__toolbar .theme-trigger { width:44px; height:44px; } .gate__signature { margin:20px 0; } .phead__inner { gap:8px; } .phead .theme-trigger { width:36px; height:36px; } .gate--studio .gate__card { animation:none; } }
@media (max-width:360px) { .theme-grid { grid-template-columns:minmax(0,1fr); } .gate--studio .gate__form { padding:14px; } }
[data-motion="reduced"] *,[data-motion="reduced"] *::before,[data-motion="reduced"] *::after { animation:none!important; transition:none!important; scroll-behavior:auto!important; }
[data-motion="reduced"] :is(.event,.event-row,.gate-art__node,.btn,.brand-mark,.nav__item,.activity-list-item,.square-card) { transform:none!important; }
[data-motion="reduced"] .hero__depth { transform:scale(1.06)!important; }
[data-motion="reduced"] .hero__cross { transform:none!important; }
@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after { animation:none!important; transition:none!important; scroll-behavior:auto!important; }
  :is(.event,.event-row,.gate-art__node,.btn,.brand-mark,.nav__item,.activity-list-item,.square-card) { transform:none!important; }
  .hero__depth { transform:scale(1.06)!important; }
  .hero__cross { transform:none!important; }
}
/* Explicit appearance control, anchored at the end of the header. */
.theme-trigger { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: auto; min-width: 44px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.theme-trigger > .ico { width: 20px; height: 20px; flex-shrink: 0; }
.theme-trigger__label { font-size: 13px; font-weight: 600; white-space: nowrap; }
.phead .theme-trigger { order: 2; margin-left: 4px; }
@media(max-width:1180px) {
 .phead .theme-trigger { width: 44px; height: 44px; padding: 0; }
 .phead .theme-trigger__label { display: none; }
}
@media(max-width:800px) {
 .gate__toolbar .theme-trigger { width: auto; min-width: 44px; }
}
@media(max-width:400px) {
 .phead__inner { gap: 4px; padding-inline: 12px; }
 .phead .plogo { gap: 6px; }
 .phead .plogo__text b { font-size: 12px; }
 .phead .plogo__text span { font-size: 7px; }
 .phead .brand-mark { width: 20px; height: 20px; }
 .phead .theme-trigger { margin-left: 0; }
}

.console :is(.activity-list-item,.nav__item):hover { transform:none; box-shadow:none; }

.theme-choice__mini-title { position:absolute; top:23px; left:18px; font-family:var(--font-display-editorial); font-size:17px; color:var(--hero-ink); }

/* Shape profiles accompany the palette; business status tokens are untouched. */
[data-theme="dawn"] { --art-page-edge:polygon(18% 0,100% 0,100% 100%,0 100%,0 22%); --art-turn:-6deg; }
[data-theme="sail"] { --art-page-edge:ellipse(80% 70% at 90% 30%); --art-turn:0deg; }
[data-theme="garden"] { --art-page-edge:ellipse(72% 88% at 85% 10%); --art-turn:-12deg; }
[data-theme="iris"] { --art-page-edge:polygon(12% 0,90% 8%,100% 86%,0 100%); --art-turn:6deg; }
[data-theme="amber"] { --art-page-edge:inset(0 0 0 0); --art-turn:0deg; }

/* /styles/mobile.css */
/* Mobile navigation stays visible across routes; content reserves its space. */
.mobile-dock { display: none; }
@media (max-width: 960px) {
  :root { --mobile-dock-h: calc(66px + env(safe-area-inset-bottom)); }
  #ambient { display: none; }
  .portal, .console { --tile-radius: 18px; --tile-shadow: none; }
  .portal { padding-bottom: var(--mobile-dock-h); background: var(--bg-base); }
  .mobile-dock {
    position: fixed; inset: auto 0 0; z-index: 35;
    display: flex; align-items: stretch; min-height: var(--mobile-dock-h);
    padding: 6px max(8px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(8px, env(safe-area-inset-left));
    background: var(--surface); border-top: 1px solid var(--border);
    box-shadow: 0 -3px 14px rgba(20, 28, 40, .035);
  }
  .mobile-dock__item {
    display: flex; flex: 1 1 0; min-width: 0; min-height: 54px;
    flex-direction: column; align-items: center; justify-content: center; gap: 5px;
    padding: 4px 0; border: 0; border-radius: 10px;
    background: transparent; color: var(--text-secondary); font: inherit;
    font-size: 11px; line-height: 1.3; white-space: nowrap; text-decoration: none;
    touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  }
  .mobile-dock__item .ico { width: 22px; height: 22px; }
  .mobile-dock__item[aria-current="page"], .mobile-dock__item[data-active="true"] { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
  .mobile-dock__item:active { opacity: .7; }
  .mobile-dock__item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
  .console .workspace { padding-bottom: var(--mobile-dock-h); }
  .console .topbar { background: var(--surface); backdrop-filter: none; }
  .console .topbar__refresh, .console .topbar__density { display: none; }
  .console .topbar .theme-trigger__label { display: none; }
  .console .topbar .theme-trigger { width: 44px; min-width: 44px; padding: 0; }
  .console .crumbs { min-width: 0; }
  .portal .phead { background: var(--surface); backdrop-filter: none; }
  .portal .phead__inner { gap: 4px; }
  .portal .phead .pmenu-btn { border-radius: 12px; }
  .portal .theme-trigger { min-width: 44px; padding-inline: 8px; }
  .portal .theme-trigger__label { display: none; }
  .portal .hero__lede { background: var(--surface); border-radius: 20px; box-shadow: none; }
  .portal .hero__figure, .console .view:not(.operations-module) .metric, .activity-summary > * { border-radius: 16px; box-shadow: none; }
  .portal .square-card__icon { width: 44px; height: 44px; border-radius: 12px; box-shadow: none; }
  .portal .square-card { padding: 20px; gap: 16px; }
  .portal .event, .portal .event-row { padding: 20px; gap: 16px; }
  .console .wsregion { padding: 18px; box-shadow: none; }
  .console .queue__row { padding: 14px; border-radius: 12px; }
  :is(.input, .select, .textarea) { font-size: 16px; border-radius: 10px; }
  :is(.btn, .icon-btn) { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
  .toast-root { bottom: calc(var(--mobile-dock-h) + 12px); }
}
@media (max-width: 360px) {
  .console .topbar > .icon-btn:not(.icon-btn--mobile):not(.theme-trigger) { display: none; }
  .portal .plogo__text b { font-size: 14px; }
  .portal .plogo__text > span { font-size: 8px; }
}
@media (hover: none), (pointer: coarse) {
  .btn, .icon-btn { min-height: 44px; }
  .btn:hover { transform: none; }
}
