/* HyperUnit shared design system — "Lumen".
   Loaded by every page before its page stylesheet. Component classes are
   namespaced with `ui-`; page layouts keep their own rules in web/styles/. */

/* Theme primitives. Every translucent tint is composed from these RGB triples,
   so one [data-theme="light"] override flips the whole palette without touching
   component rules: white overlays become slate overlays, accent washes stay
   accent-tinted, and status colours darken just enough for light surfaces. */
:root {
  color-scheme: dark;

  --tint-rgb: 255 255 255;
  --grid-rgb: 148 163 184;
  --accent-rgb: 91 140 255;
  --accent2-rgb: 139 92 246;
  --accent3-rgb: 34 211 238;
  --ok-rgb: 61 220 151;
  --warn-rgb: 251 191 36;
  --danger-rgb: 251 113 133;

  /* surfaces */
  --bg: #060910;
  --bg-soft: #0a0f1a;
  --panel: #0f1524;
  --panel-2: #141c2e;
  --glass: rgb(var(--tint-rgb) / 0.035);
  --glass-strong: rgb(var(--tint-rgb) / 0.07);

  /* composite surfaces shared by pages */
  --body-bg:
    radial-gradient(1100px 620px at 8% -12%, rgb(var(--accent-rgb) / 0.18), transparent 62%),
    radial-gradient(900px 560px at 96% -8%, rgb(var(--accent2-rgb) / 0.15), transparent 60%),
    radial-gradient(900px 620px at 50% 118%, rgb(var(--accent3-rgb) / 0.08), transparent 62%),
    linear-gradient(180deg, #070b14 0%, #060910 46%, #05080e 100%);
  --hero-bg:
    radial-gradient(760px 320px at 6% -30%, rgb(var(--accent-rgb) / 0.3), transparent 68%),
    radial-gradient(620px 300px at 96% 130%, rgb(var(--accent2-rgb) / 0.24), transparent 70%),
    linear-gradient(180deg, rgb(var(--tint-rgb) / 0.05), rgb(var(--tint-rgb) / 0.012));
  --card-bg: linear-gradient(180deg, rgb(var(--tint-rgb) / 0.045), rgb(var(--tint-rgb) / 0.012));
  --card-bg-soft: linear-gradient(180deg, rgb(var(--tint-rgb) / 0.05), rgb(var(--tint-rgb) / 0.015));
  --brand-bg:
    radial-gradient(900px 540px at 2% -14%, rgb(var(--accent-rgb) / 0.3), transparent 62%),
    radial-gradient(760px 560px at 104% 110%, rgb(var(--accent2-rgb) / 0.24), transparent 62%),
    radial-gradient(520px 420px at 62% 52%, rgb(var(--accent3-rgb) / 0.08), transparent 68%),
    linear-gradient(158deg, #0a101d 0%, #070b13 56%, #080d18 100%);
  --auth-card-bg:
    linear-gradient(180deg, rgb(var(--tint-rgb) / 0.06), rgb(var(--tint-rgb) / 0.018)),
    rgba(9, 14, 24, 0.66);

  /* opaque and glass panel colours */
  --topbar-bg: rgba(7, 10, 18, 0.72);
  --menu-bg: rgba(14, 20, 33, 0.96);
  --dialog-bg: rgba(13, 18, 30, 0.94);
  --backdrop: rgba(3, 6, 12, 0.72);
  --input-bg: rgba(6, 10, 18, 0.62);
  --input-bg-hover: rgba(8, 13, 23, 0.75);
  --input-bg-focus: rgba(7, 12, 21, 0.9);
  --media-bg: rgba(3, 6, 12, 0.55);
  --media-bg-strong: rgba(3, 6, 12, 0.6);
  --sticky-bg: rgba(11, 16, 27, 0.94);
  --avatar-ring: rgba(9, 14, 24, 0.92);
  --float-bg: rgba(13, 19, 32, 0.82);
  --chip-solid-bg: rgba(11, 17, 29, 0.9);
  --badge-bg: rgba(7, 11, 19, 0.78);
  --overlay-chip: rgba(8, 12, 20, 0.55);
  --seg-bg: rgba(4, 7, 13, 0.55);

  /* decorative gradients */
  --stat-grad: linear-gradient(120deg, #fff, #b9ccff);
  --headline-grad: linear-gradient(100deg, #a8c5ff 0%, #b9a5ff 52%, #7ee8f5 100%);
  --hero-headline-grad: linear-gradient(100deg, #b8ceff, #c0a8ff 55%, #7ee8f5);
  --side-on-bg: linear-gradient(135deg, rgb(var(--accent-rgb) / 0.24), rgb(var(--accent2-rgb) / 0.16));
  --chip-on-bg: linear-gradient(135deg, rgb(var(--accent-rgb) / 0.28), rgb(var(--accent2-rgb) / 0.22));
  --gradient-soft: linear-gradient(
    135deg,
    rgb(var(--accent-rgb) / 0.16),
    rgb(var(--accent2-rgb) / 0.12)
  );

  /* hairlines */
  --line: rgb(var(--tint-rgb) / 0.075);
  --line-strong: rgb(var(--tint-rgb) / 0.14);

  /* type */
  --text: #eef2ff;
  --text-soft: #cbd5e8;
  --muted: #93a1bd;
  --faint: #64748b;
  --placeholder: #6c7c96;

  /* accent */
  --accent: #5b8cff;
  --accent-2: #8b5cf6;
  --accent-3: #22d3ee;
  --accent-soft: rgb(var(--accent-rgb) / 0.14);
  --accent-line: rgb(var(--accent-rgb) / 0.34);
  --gradient: linear-gradient(135deg, #5b8cff 0%, #7c5cff 52%, #8b5cf6 100%);

  /* readable text on tinted surfaces */
  --on-accent: #fff;
  --nav-on-text: #fff;
  --chip-on-text: #fff;
  --seg-text: #fff;
  --accent-text: #aec7ff;
  --accent-text-strong: #b7cdff;
  --link-soft: #a9c6ff;
  --link-hover: #9dbaff;
  --link-muted: #8fb3e8;
  --icon-muted: #8aa9d8;
  --menu-hover-text: #cfe0ff;
  --ok-text: #7ff0bb;
  --warn-text: #fde68a;
  --danger-text: #fda4b4;
  --danger-text-strong: #fecdd6;

  /* status */
  --ok: #3ddc97;
  --warn: #fbbf24;
  --danger: #fb7185;

  /* geometry */
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  /* shadows */
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.28);
  --shadow: 0 30px 70px -28px rgba(0, 0, 0, 0.9), 0 10px 28px -18px rgba(0, 0, 0, 0.8);
  --shadow-glow: 0 18px 44px -18px rgb(var(--accent-rgb) / 0.55);
  --shadow-strong: rgba(0, 0, 0, 0.95);
  --shadow-card: rgba(0, 0, 0, 0.45);
  --shadow-inset: rgba(0, 0, 0, 0.35);
  --shadow-line: rgba(0, 0, 0, 0.25);

  /* type stacks */
  --font: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, "Microsoft YaHei",
    "PingFang SC", "Hiragino Sans GB", sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", -apple-system, BlinkMacSystemFont,
    "Microsoft YaHei", "PingFang SC", sans-serif;
  --mono: "Cascadia Code", ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono",
    monospace;

  --ease: cubic-bezier(0.2, 0.8, 0.25, 1);
}

/* Light theme. The same components and layout, with slate-based hairlines,
   white glass panels and deeper accent/status colours for readable contrast.
   `data-theme` is set on <html> by the inline bootstrap in every page head. */
:root[data-theme="light"] {
  color-scheme: light;

  --tint-rgb: 15 23 42;
  --grid-rgb: 100 116 139;
  --accent-rgb: 47 95 214;
  --accent2-rgb: 124 58 237;
  --accent3-rgb: 8 145 178;
  --ok-rgb: 5 150 105;
  --warn-rgb: 217 119 6;
  --danger-rgb: 220 38 38;

  --bg: #f2f5fb;
  --bg-soft: #eef2f9;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --glass: rgb(var(--tint-rgb) / 0.03);
  --glass-strong: rgb(var(--tint-rgb) / 0.06);

  --body-bg:
    radial-gradient(1100px 620px at 8% -12%, rgb(var(--accent-rgb) / 0.13), transparent 62%),
    radial-gradient(900px 560px at 96% -8%, rgb(var(--accent2-rgb) / 0.1), transparent 60%),
    radial-gradient(900px 620px at 50% 118%, rgb(var(--accent3-rgb) / 0.06), transparent 62%),
    linear-gradient(180deg, #f8faff 0%, #f2f5fb 46%, #eef2f9 100%);
  --hero-bg:
    radial-gradient(760px 320px at 6% -30%, rgb(var(--accent-rgb) / 0.16), transparent 68%),
    radial-gradient(620px 300px at 96% 130%, rgb(var(--accent2-rgb) / 0.13), transparent 70%),
    linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  --card-bg: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  --card-bg-soft: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
  --brand-bg:
    radial-gradient(900px 540px at 2% -14%, rgb(var(--accent-rgb) / 0.17), transparent 62%),
    radial-gradient(760px 560px at 104% 110%, rgb(var(--accent2-rgb) / 0.13), transparent 62%),
    radial-gradient(520px 420px at 62% 52%, rgb(var(--accent3-rgb) / 0.06), transparent 68%),
    linear-gradient(158deg, #f8faff 0%, #eef3fc 56%, #f5f8ff 100%);
  --auth-card-bg:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.8)), #ffffff;

  --topbar-bg: rgba(255, 255, 255, 0.8);
  --menu-bg: rgba(255, 255, 255, 0.98);
  --dialog-bg: rgba(255, 255, 255, 0.97);
  --backdrop: rgba(15, 23, 42, 0.42);
  --input-bg: rgba(255, 255, 255, 0.88);
  --input-bg-hover: #ffffff;
  --input-bg-focus: #ffffff;
  --media-bg: rgba(15, 23, 42, 0.045);
  --media-bg-strong: rgba(15, 23, 42, 0.06);
  --sticky-bg: rgba(255, 255, 255, 0.94);
  --avatar-ring: #ffffff;
  --float-bg: rgba(255, 255, 255, 0.92);
  --chip-solid-bg: rgba(255, 255, 255, 0.88);
  --badge-bg: rgba(255, 255, 255, 0.86);
  --overlay-chip: rgba(255, 255, 255, 0.72);
  --seg-bg: rgba(15, 23, 42, 0.045);

  --stat-grad: linear-gradient(120deg, #0f172a, #2f5fd6);
  --headline-grad: linear-gradient(100deg, #1d4ed8 0%, #6d28d9 52%, #0e7490 100%);
  --hero-headline-grad: linear-gradient(100deg, #1d4ed8, #6d28d9 55%, #0e7490);
  --side-on-bg: var(--gradient);
  --chip-on-bg: var(--gradient);
  --gradient-soft: linear-gradient(
    135deg,
    rgb(var(--accent-rgb) / 0.12),
    rgb(var(--accent2-rgb) / 0.1)
  );
  --gradient: linear-gradient(135deg, #2f5fd6 0%, #5b47e0 52%, #7c3aed 100%);

  --line: rgb(var(--tint-rgb) / 0.1);
  --line-strong: rgb(var(--tint-rgb) / 0.17);

  --text: #0f172a;
  --text-soft: #334155;
  --muted: #55647c;
  --faint: #6f7d94;
  --placeholder: #8794a8;

  --accent: #2f5fd6;
  --accent-2: #7c3aed;
  --accent-3: #0891b2;
  --accent-soft: rgb(var(--accent-rgb) / 0.09);
  --accent-line: rgb(var(--accent-rgb) / 0.28);

  --on-accent: #fff;
  --nav-on-text: #0f172a;
  --chip-on-text: #fff;
  --seg-text: #0f172a;
  --accent-text: #2448a8;
  --accent-text-strong: #1e40af;
  --link-soft: #2f5fd6;
  --link-hover: #1d4ed8;
  --link-muted: #3b5f9e;
  --icon-muted: #546b8f;
  --menu-hover-text: #1e40af;
  --ok-text: #047857;
  --warn-text: #92400e;
  --danger-text: #b42318;
  --danger-text-strong: #991b1b;

  --ok: #059669;
  --warn: #d97706;
  --danger: #dc2626;

  --shadow-sm: 0 2px 10px rgba(15, 23, 42, 0.07);
  --shadow: 0 30px 70px -28px rgba(15, 23, 42, 0.22), 0 10px 28px -18px rgba(15, 23, 42, 0.16);
  --shadow-glow: 0 18px 44px -18px rgb(var(--accent-rgb) / 0.35);
  --shadow-strong: rgba(15, 23, 42, 0.2);
  --shadow-card: rgba(15, 23, 42, 0.1);
  --shadow-inset: rgba(15, 23, 42, 0.06);
  --shadow-line: rgba(15, 23, 42, 0.08);
}

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

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 14.5px/1.6 var(--font);
  font-feature-settings: "ss01" 1, "cv05" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  isolation: isolate;
}

/* Ambient light + faint drafting grid behind every page. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: var(--body-bg);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(rgb(var(--tint-rgb) / 0.22) 1px, transparent 1px);
  background-size: 30px 30px;
  opacity: 0.14;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 58%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 58%);
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.16s var(--ease);
}

a:hover {
  color: var(--link-hover);
}

img {
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

::selection {
  background: rgb(var(--accent-rgb) / 0.38);
  color: var(--text);
}

:focus-visible {
  outline: 2px solid rgb(var(--accent-rgb) / 0.9);
  outline-offset: 2px;
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgb(var(--tint-rgb) / 0.16) transparent;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 99px;
  background: rgb(var(--tint-rgb) / 0.16);
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgb(var(--tint-rgb) / 0.28);
  background-clip: content-box;
}

/* ---------- top bar ---------- */

.ui-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  min-height: 64px;
  padding: 10px clamp(16px, 3vw, 30px);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
}

.ui-topbar::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgb(var(--accent-rgb) / 0.55) 28%,
    rgb(var(--accent2-rgb) / 0.45) 62%,
    transparent 100%
  );
  pointer-events: none;
}

.ui-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
  color: var(--text);
  border-radius: var(--radius-sm);
}

.ui-brand:hover {
  color: var(--text);
}

.ui-logo {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--on-accent);
  background: linear-gradient(145deg, #6d9bff 0%, #7c5cff 52%, #a855f7 100%);
  box-shadow:
    0 8px 20px -6px rgb(var(--accent-rgb) / 0.75),
    inset 0 1px 0 rgb(var(--tint-rgb) / 0.45),
    inset 0 -1px 0 var(--shadow-line);
}

.ui-logo::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 10px;
  border: 1px solid rgb(var(--tint-rgb) / 0.22);
  pointer-events: none;
}

.ui-brand-name {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 680;
  letter-spacing: -0.01em;
}

.ui-brand-name small {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0;
}

.ui-nav {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: rgb(var(--tint-rgb) / 0.025);
}

.ui-nav a {
  position: relative;
  padding: 7px 14px;
  border-radius: 99px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
  transition: color 0.16s var(--ease), background 0.16s var(--ease);
}

.ui-nav a:hover {
  color: var(--text);
  background: rgb(var(--tint-rgb) / 0.05);
}

.ui-nav a.on {
  color: var(--nav-on-text);
  background: linear-gradient(180deg, rgb(var(--tint-rgb) / 0.12), rgb(var(--tint-rgb) / 0.05));
  box-shadow:
    inset 0 0 0 1px rgb(var(--tint-rgb) / 0.09),
    0 6px 16px -12px var(--shadow-strong);
}

.ui-topbar-right {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-left: auto;
}

/* Compact 中 / EN switch shared by every page. */
.ui-lang {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: rgb(var(--tint-rgb) / 0.03);
}

.ui-lang-btn {
  min-width: 30px;
  padding: 5px 7px;
  border: 0;
  border-radius: 99px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: color 0.16s var(--ease), background 0.16s var(--ease);
}

.ui-lang-btn:hover {
  color: var(--text);
}

.ui-lang-btn.on {
  color: var(--nav-on-text);
  background: rgb(var(--tint-rgb) / 0.1);
  box-shadow: inset 0 0 0 1px rgb(var(--tint-rgb) / 0.08);
}

/* Sun / moon switch next to the language control. The icons are both in the
   button and CSS shows the one that describes the *other* theme. */
.ui-theme-btn {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgb(var(--tint-rgb) / 0.03);
  color: var(--muted);
  cursor: pointer;
  transition:
    color 0.16s var(--ease),
    background 0.16s var(--ease),
    border-color 0.16s var(--ease);
}

.ui-theme-btn:hover {
  color: var(--text);
  background: rgb(var(--tint-rgb) / 0.07);
  border-color: var(--line-strong);
}

.ui-theme-btn svg {
  width: 16px;
  height: 16px;
}

.ui-theme-btn .ui-theme-moon {
  display: none;
}

:root[data-theme="light"] .ui-theme-btn .ui-theme-moon {
  display: block;
}

:root[data-theme="light"] .ui-theme-btn .ui-theme-sun {
  display: none;
}

.ui-topbar-extra {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 320px;
  min-width: 0;
}

/* ---------- buttons ---------- */

.ui-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: var(--gradient);
  color: var(--on-accent);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  box-shadow:
    0 10px 24px -12px rgb(var(--accent-rgb) / 0.85),
    inset 0 1px 0 rgb(var(--tint-rgb) / 0.28);
  transition:
    transform 0.16s var(--ease),
    filter 0.16s var(--ease),
    box-shadow 0.16s var(--ease),
    background 0.16s var(--ease),
    border-color 0.16s var(--ease);
}

.ui-btn:hover {
  filter: brightness(1.08);
  color: var(--on-accent);
  transform: translateY(-1px);
  box-shadow:
    0 16px 32px -14px rgb(var(--accent-rgb) / 0.95),
    inset 0 1px 0 rgb(var(--tint-rgb) / 0.32);
}

.ui-btn:active {
  transform: translateY(0) scale(0.99);
  filter: brightness(0.98);
}

.ui-btn[disabled],
.ui-btn.is-busy {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.15);
  transform: none;
  box-shadow: none;
}

.ui-btn-ghost {
  background: rgb(var(--tint-rgb) / 0.04);
  border-color: var(--line-strong);
  color: var(--text-soft);
  box-shadow: inset 0 1px 0 rgb(var(--tint-rgb) / 0.05);
}

.ui-btn-ghost:hover {
  background: rgb(var(--tint-rgb) / 0.08);
  border-color: rgb(var(--tint-rgb) / 0.22);
  color: var(--text);
  box-shadow: 0 10px 24px -18px var(--shadow-strong), inset 0 1px 0 rgb(var(--tint-rgb) / 0.08);
}

.ui-btn-soft {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent-text-strong);
  box-shadow: none;
}

.ui-btn-soft:hover {
  color: var(--accent-text-strong);
  background: rgb(var(--accent-rgb) / 0.22);
  box-shadow: 0 10px 26px -18px rgb(var(--accent-rgb) / 0.8);
}

.ui-btn-danger {
  background: rgb(var(--danger-rgb) / 0.12);
  border-color: rgb(var(--danger-rgb) / 0.32);
  color: var(--danger-text);
  box-shadow: none;
}

.ui-btn-danger:hover {
  background: rgb(var(--danger-rgb) / 0.2);
  color: var(--danger-text-strong);
}

.ui-btn-sm {
  height: 32px;
  padding: 0 12px;
  border-radius: 9px;
  font-size: 12.5px;
}

.ui-btn-lg {
  height: 46px;
  padding: 0 22px;
  border-radius: 13px;
  font-size: 14.5px;
}

.ui-btn-block {
  width: 100%;
}

.ui-linkbtn {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 13px;
  padding: 7px 9px;
  border-radius: 9px;
  cursor: pointer;
  transition: color 0.16s var(--ease), background 0.16s var(--ease);
}

.ui-linkbtn:hover {
  color: var(--text);
  background: rgb(var(--tint-rgb) / 0.06);
}

/* ---------- avatar ---------- */

.ui-avatar {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--on-accent);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, #5b8cff, #8b5cf6);
  border: 1px solid rgb(var(--tint-rgb) / 0.18);
  box-shadow:
    inset 0 1px 0 rgb(var(--tint-rgb) / 0.3),
    0 4px 14px -6px var(--shadow-strong);
  user-select: none;
}

.ui-avatar-lg {
  width: 64px;
  height: 64px;
  font-size: 22px;
}

.ui-avatar-xl {
  width: 84px;
  height: 84px;
  border-radius: 24px;
  font-size: 30px;
}

/* ---------- signed-in user menu ---------- */

/* Bell next to the avatar. The badge counts unread notifications + messages. */
.ui-inbox {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgb(var(--tint-rgb) / 0.03);
  color: var(--muted);
  transition:
    color 0.16s var(--ease),
    background 0.16s var(--ease),
    border-color 0.16s var(--ease);
}

.ui-inbox:hover {
  color: var(--text);
  background: rgb(var(--tint-rgb) / 0.07);
  border-color: var(--line-strong);
}

.ui-inbox svg {
  width: 17px;
  height: 17px;
}

.ui-inbox-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 99px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--bg);
}

.ui-inbox-badge[hidden] {
  display: none;
}

.ui-user {
  position: relative;
}

.ui-user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border: 1px solid transparent;
  border-radius: 99px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background 0.16s var(--ease), border-color 0.16s var(--ease);
}

.ui-user-btn:hover,
.ui-user-btn[aria-expanded="true"] {
  background: rgb(var(--tint-rgb) / 0.06);
  border-color: var(--line);
}

.ui-user-name {
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 550;
}

.ui-caret {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--muted);
}

.ui-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 226px;
  padding: 7px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--menu-bg);
  backdrop-filter: blur(26px) saturate(160%);
  -webkit-backdrop-filter: blur(26px) saturate(160%);
  box-shadow: var(--shadow);
  display: none;
  z-index: 50;
  transform-origin: top right;
  animation: ui-menu-in 0.16s var(--ease);
}

.ui-menu.open {
  display: block;
}

@keyframes ui-menu-in {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.ui-menu-head {
  padding: 9px 11px 10px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.ui-menu-head b {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

.ui-menu-head span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11.5px;
}

.ui-menu a,
.ui-menu button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--text-soft);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background 0.14s var(--ease), color 0.14s var(--ease);
}

.ui-menu a:hover,
.ui-menu button:hover {
  background: rgb(var(--tint-rgb) / 0.07);
  color: var(--text);
}

.ui-menu-ico {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.ui-menu-ico svg {
  width: 16px;
  height: 16px;
}

.ui-menu a:hover .ui-menu-ico,
.ui-menu button:hover .ui-menu-ico {
  color: var(--menu-hover-text);
}

.ui-menu .ui-menu-danger .ui-menu-ico {
  color: var(--danger-text);
}

.ui-menu .ui-menu-sep {
  height: 1px;
  margin: 6px 4px;
  background: var(--line);
}

.ui-menu .ui-menu-danger {
  color: var(--danger-text);
}

.ui-menu .ui-menu-danger:hover {
  background: rgb(var(--danger-rgb) / 0.1);
  color: var(--danger-text-strong);
}

/* ---------- forms ---------- */

.ui-field {
  display: grid;
  gap: 7px;
}

.ui-field + .ui-field {
  margin-top: 15px;
}

.ui-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 550;
}

.ui-label small {
  color: var(--faint);
  font-size: 11px;
  font-weight: 400;
}

.ui-input,
.ui-textarea,
.ui-select {
  width: 100%;
  min-height: 42px;
  padding: 10px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--input-bg);
  color: var(--text);
  font-size: 13.5px;
  box-shadow: inset 0 1px 2px var(--shadow-inset);
  transition:
    border-color 0.16s var(--ease),
    box-shadow 0.16s var(--ease),
    background 0.16s var(--ease);
}

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

.ui-input:hover,
.ui-textarea:hover,
.ui-select:hover {
  border-color: rgb(var(--tint-rgb) / 0.24);
  /* background-color, not the shorthand: .ui-select draws its arrow with
     background-image and the shorthand would wipe it on hover. */
  background-color: var(--input-bg-hover);
}

.ui-input:focus,
.ui-textarea:focus,
.ui-select:focus {
  outline: none;
  border-color: rgb(var(--accent-rgb) / 0.85);
  background-color: var(--input-bg-focus);
  box-shadow:
    0 0 0 4px rgb(var(--accent-rgb) / 0.16),
    inset 0 1px 2px var(--shadow-inset);
}

.ui-textarea {
  min-height: 104px;
  resize: vertical;
  line-height: 1.65;
}

.ui-select {
  appearance: none;
  padding-right: 36px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 19px) 50%, calc(100% - 14px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}

.ui-select-sm {
  min-height: 34px;
  padding: 6px 32px 6px 12px;
  border-radius: 9px;
  font-size: 12.5px;
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
}

.ui-hint {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
}

.ui-pw {
  position: relative;
}

.ui-pw .ui-input {
  padding-right: 50px;
}

.ui-pw-toggle {
  position: absolute;
  top: 50%;
  right: 5px;
  width: 38px;
  height: 32px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
  transition: color 0.14s var(--ease), background 0.14s var(--ease);
}

.ui-pw-toggle:hover {
  color: var(--text);
  background: rgb(var(--tint-rgb) / 0.08);
}

.ui-msg {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
}

.ui-msg.err {
  color: var(--danger-text);
}

.ui-msg.ok {
  color: var(--ok-text);
}

.ui-form-error {
  padding: 10px 12px;
  border: 1px solid rgb(var(--danger-rgb) / 0.32);
  border-radius: 10px;
  background: rgb(var(--danger-rgb) / 0.09);
  color: var(--danger-text);
  font-size: 12.5px;
}

/* ---------- search ---------- */

.ui-search {
  position: relative;
  display: flex;
  flex: 1 1 320px;
  min-width: 200px;
  max-width: 580px;
}

.ui-search svg {
  position: absolute;
  top: 50%;
  left: 15px;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  color: var(--faint);
  pointer-events: none;
}

.ui-search .ui-input {
  height: 40px;
  min-height: 40px;
  padding-left: 41px;
  border-radius: 99px;
  background: rgb(var(--tint-rgb) / 0.04);
}

.ui-search .ui-input:focus {
  background: var(--input-bg-focus);
}

/* ---------- segmented tabs ---------- */

.ui-seg {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--seg-bg);
}

.ui-seg button {
  height: 34px;
  border: 0;
  border-radius: 99px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.16s var(--ease), background 0.16s var(--ease), box-shadow 0.16s var(--ease);
}

.ui-seg button:hover {
  color: var(--text);
}

.ui-seg button[aria-selected="true"] {
  background: linear-gradient(180deg, rgb(var(--tint-rgb) / 0.14), rgb(var(--tint-rgb) / 0.055));
  color: var(--seg-text);
  box-shadow:
    inset 0 0 0 1px rgb(var(--tint-rgb) / 0.1),
    0 8px 18px -14px var(--shadow-strong);
}

/* ---------- badges / chips ---------- */

.ui-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 23px;
  padding: 1px 10px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: rgb(var(--tint-rgb) / 0.05);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.ui-badge-ok,
.ui-badge-warn,
.ui-badge-danger,
.ui-badge-accent {
  position: relative;
}

.ui-badge-ok::before,
.ui-badge-warn::before,
.ui-badge-danger::before,
.ui-badge-accent::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.ui-badge-ok {
  border-color: rgb(var(--ok-rgb) / 0.34);
  background: rgb(var(--ok-rgb) / 0.1);
  color: var(--ok-text);
}

.ui-badge-warn {
  border-color: rgb(var(--warn-rgb) / 0.34);
  background: rgb(var(--warn-rgb) / 0.1);
  color: var(--warn-text);
}

.ui-badge-danger {
  border-color: rgb(var(--danger-rgb) / 0.34);
  background: rgb(var(--danger-rgb) / 0.1);
  color: var(--danger-text);
}

.ui-badge-accent {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent-text-strong);
}

.ui-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: rgb(var(--tint-rgb) / 0.04);
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.4;
}

.ui-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 9px;
  border: 1px solid var(--accent-line);
  border-radius: 99px;
  background: rgb(var(--accent-rgb) / 0.08);
  color: var(--accent-text);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ui-kicker::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-3);
  box-shadow: 0 0 10px var(--accent-3);
}

/* ---------- icon tile ---------- */

.ui-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border: 1px solid var(--accent-line);
  border-radius: 12px;
  background: var(--gradient-soft);
  color: var(--accent-text);
  font-size: 15px;
  line-height: 1;
}

.ui-icon svg {
  width: 18px;
  height: 18px;
}

/* ---------- surfaces ---------- */

.ui-card {
  position: relative;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  box-shadow:
    inset 0 1px 0 rgb(var(--tint-rgb) / 0.05),
    0 24px 50px -42px var(--shadow-strong);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.ui-card + .ui-card {
  margin-top: 16px;
}

.ui-card-title {
  margin: 0 0 5px;
  color: var(--text);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.ui-card-sub {
  margin: 0 0 15px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

.ui-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 10px;
}

.ui-stat {
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card-bg-soft);
  box-shadow: inset 0 1px 0 rgb(var(--tint-rgb) / 0.05);
}

.ui-stat b {
  display: block;
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.ui-stat span {
  color: var(--muted);
  font-size: 11.5px;
}

.ui-bar {
  height: 7px;
  border-radius: 99px;
  background: rgb(var(--tint-rgb) / 0.08);
  box-shadow: inset 0 1px 2px var(--shadow-inset);
  overflow: hidden;
}

.ui-bar > i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 99px;
  background: var(--gradient);
  box-shadow: 0 0 14px rgb(var(--accent-rgb) / 0.55);
  transition: width 0.45s var(--ease);
}

.ui-empty {
  padding: 52px 22px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(400px 180px at 50% 0%, rgb(var(--accent-rgb) / 0.08), transparent 70%),
    rgb(var(--tint-rgb) / 0.015);
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  line-height: 1.7;
}

.ui-empty b {
  display: block;
  margin-bottom: 5px;
  color: var(--text);
  font-size: 15px;
  font-weight: 650;
}

.ui-empty .ui-btn {
  margin-top: 16px;
}

.ui-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgb(var(--tint-rgb) / 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: ui-spin 0.7s linear infinite;
}

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

/* ---------- tables ---------- */

.ui-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
}

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

.ui-table th,
.ui-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
  vertical-align: middle;
}

.ui-table th {
  color: var(--faint);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ui-table tbody tr {
  transition: background 0.14s var(--ease);
}

.ui-table tbody tr:hover {
  background: rgb(var(--tint-rgb) / 0.03);
}

.ui-table tbody tr:last-child td {
  border-bottom: 0;
}

.ui-table td.num {
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.ui-table .ui-cell-main {
  min-width: 180px;
}

.ui-cell-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11.5px;
}

/* ---------- dialogs ---------- */

.ui-dialog {
  width: min(720px, calc(100% - 32px));
  max-height: 88vh;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  background: var(--dialog-bg);
  color: var(--text);
  box-shadow: var(--shadow);
  backdrop-filter: blur(26px) saturate(150%);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
}

.ui-dialog[open] {
  animation: ui-dialog-in 0.22s var(--ease);
}

@keyframes ui-dialog-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.ui-dialog::backdrop {
  background: var(--backdrop);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
}

.ui-dialog-body {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.ui-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.ui-dialog-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 680;
  letter-spacing: -0.02em;
}

/* ---------- feedback dialog (v1.27) ---------- */

/* Opened by the footer's 意见反馈 button (web/js/feedback.js). It reuses the
   dialog surface above but owns its form layout, because the message is the
   only field that should grow. */
.feedback-dialog {
  width: min(560px, calc(100% - 28px));
  max-height: 90vh;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: var(--dialog-bg);
  color: var(--text);
  box-shadow: var(--shadow);
  backdrop-filter: blur(26px) saturate(150%);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
}

.feedback-dialog[open] {
  animation: ui-dialog-in 0.22s var(--ease);
}

.feedback-dialog::backdrop {
  background: var(--backdrop);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
}

.feedback-form {
  display: grid;
  gap: 16px;
  max-height: 90vh;
  padding: 22px;
  overflow: auto;
}

.feedback-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.feedback-title {
  margin: 2px 0 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.feedback-sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

.feedback-close {
  flex: none;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.feedback-close:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.feedback-fields {
  display: grid;
  gap: 14px;
}

.feedback-textarea {
  min-height: 140px;
  resize: vertical;
  line-height: 1.6;
  font-family: inherit;
}

.feedback-counter {
  justify-self: end;
  margin-top: -6px;
  color: var(--faint);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.feedback-trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.feedback-status {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.55;
}

.feedback-status.ok {
  border-color: rgb(var(--ok-rgb) / 0.34);
  background: rgb(var(--ok-rgb) / 0.1);
  color: var(--ok-text);
}

.feedback-status.error {
  border-color: rgb(var(--danger-rgb) / 0.34);
  background: rgb(var(--danger-rgb) / 0.1);
  color: var(--danger-text);
}

.feedback-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.feedback-privacy {
  margin: 0;
  color: var(--faint);
  font-size: 11.5px;
  line-height: 1.5;
}

@media (max-width: 520px) {
  .feedback-form {
    padding: 18px;
  }

  .feedback-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .feedback-actions .ui-btn {
    width: 100%;
  }
}

/* ---------- utilities ---------- */

.ui-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ui-spread {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.ui-muted {
  color: var(--muted);
}

.ui-small {
  font-size: 12px;
}

.ui-mono {
  font-family: var(--mono);
}

.ui-grow {
  flex: 1 1 auto;
}

.ui-divider {
  height: 1px;
  margin: 16px 0;
  border: 0;
  background: var(--line);
}

@keyframes ui-rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- shared site footer ---------- */

/* Injected by src/site-footer.js into every page shell. It stays quiet: the
   work is the content above it, and these links are discoverable, not loud. */
.site-footer {
  border-top: 1px solid var(--line);
  background: rgb(var(--tint-rgb) / 0.012);
  color: var(--faint);
  font-size: 11.5px;
}

.site-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px 28px;
  flex-wrap: wrap;
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px clamp(16px, 3vw, 30px) 0;
}

.site-footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 200px;
}

.site-footer-brand .ui-logo {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  font-size: 11px;
}

.site-footer-brand b {
  display: block;
  color: var(--text-soft);
  font-size: 12.5px;
  letter-spacing: -0.01em;
}

.site-footer-brand p {
  margin: 2px 0 0;
  color: var(--faint);
  font-size: 11px;
}

.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
}

.site-footer-links a,
.site-footer-legal a {
  color: var(--muted);
  transition: color 0.16s var(--ease);
}

.site-footer-links a:hover,
.site-footer-legal a:hover {
  color: var(--text);
}

.site-footer-feedback {
  appearance: none;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  transition: color 0.16s var(--ease);
}

.site-footer-feedback:hover {
  color: var(--text);
}

.site-footer-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.site-footer-base {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 16px clamp(16px, 3vw, 30px) 26px;
  color: var(--faint);
  font-size: 11px;
}

.site-footer-count:empty {
  display: none;
}

@media (max-width: 700px) {
  .site-footer-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    padding-top: 20px;
  }

  .site-footer-links {
    gap: 8px 16px;
  }

  .site-footer-base {
    justify-content: flex-start;
    padding-bottom: 22px;
  }
}

/* ---------- responsive ---------- */

/* Breakpoints (shared by every page)
   desktop  > 1100px   full layout
   tablet   701-1100   tighter gutters, two-row bars where needed
   phone    <= 700px   single row header, stacked actions
   compact  <= 380px   brand mark only                                          */

@media (max-width: 1100px) {
  .ui-topbar {
    gap: 12px;
    padding: 10px clamp(14px, 2.4vw, 22px);
  }

  .ui-brand-name small {
    display: none;
  }

  .ui-user-name {
    max-width: 96px;
  }
}

@media (max-width: 700px) {
  .ui-topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 10px;
    padding: 8px 12px;
  }

  .ui-brand {
    min-width: 0;
  }

  .ui-brand-name {
    display: block;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  /* The four-item second-level nav is the primary way to reach 关注 / 收藏 /
     我的, so it keeps a full-width row on a phone instead of disappearing. */
  .ui-nav {
    display: flex;
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: stretch;
    padding: 3px;
  }

  .ui-nav a {
    flex: 1 1 0;
    padding: 6px 2px;
    text-align: center;
    font-size: 12px;
  }

  .ui-topbar-right {
    margin-left: 0;
    justify-self: end;
    gap: 6px;
  }

  .ui-topbar-extra {
    order: 3;
    flex-basis: 100%;
  }

  .ui-user-name {
    display: none;
  }

  .ui-user-btn {
    padding: 3px 7px 3px 3px;
  }

  .ui-menu {
    min-width: 216px;
    max-width: calc(100vw - 24px);
  }

  .ui-search {
    min-width: 0;
    max-width: none;
    flex-basis: auto;
  }

  .ui-dialog {
    width: calc(100% - 16px);
    max-height: 92vh;
    max-height: 92dvh;
    border-radius: 18px;
  }

  .ui-dialog-body {
    padding: 18px 16px;
  }

  .ui-table-wrap {
    -webkit-overflow-scrolling: touch;
  }

  .ui-table {
    min-width: 680px;
  }

  .ui-btn {
    height: 40px;
    padding: 0 15px;
  }

  .ui-btn-sm {
    height: 34px;
    padding: 0 11px;
  }
}

@media (max-width: 380px) {
  .ui-topbar .ui-brand-name {
    display: none;
  }

  .ui-topbar {
    padding: 8px 10px;
  }
}
