/* Fish Cloud 平台面板 — 原生 CSS，无构建步骤。
   设计基线：深海青 + 珊瑚橙；暗色为默认，亮色为同等第一公民。 */

:root {
  --font-sans: "Inter", "Segoe UI Variable", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "Cascadia Code", "SFMono-Regular", "SF Mono", Consolas, "Liberation Mono", monospace;
  --bg: #07121c;
  --bg-deep: #050d15;
  --surface: rgba(13, 29, 41, 0.82);
  --surface-solid: #0d1d29;
  --surface-2: #112534;
  --surface-3: #173042;
  --ink: #e9f4f2;
  --ink-strong: #ffffff;
  --muted: #91a9b4;
  --faint: #617b88;
  --line: rgba(157, 195, 203, 0.14);
  --line-strong: rgba(157, 195, 203, 0.26);
  --accent: #3ddbc4;
  --accent-strong: #6cebd7;
  --accent-ink: #042621;
  --accent-soft: rgba(61, 219, 196, 0.11);
  --blue: #69a9ff;
  --blue-soft: rgba(105, 169, 255, 0.12);
  --coral: #ff967a;
  --coral-soft: rgba(255, 150, 122, 0.12);
  --ok: #5fe3a1;
  --ok-soft: rgba(95, 227, 161, 0.12);
  --warn: #f4c560;
  --warn-soft: rgba(244, 197, 96, 0.12);
  --danger: #ff7d92;
  --danger-soft: rgba(255, 125, 146, 0.12);
  --shadow-sm: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 8px 24px rgba(0, 0, 0, 0.18);
  --shadow-md: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 22px 60px rgba(0, 0, 0, 0.34);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --sidebar-w: 264px;
  --topbar-h: 76px;
  --content-max: 1280px;
}

[data-theme="light"] {
  --bg: #f1f5f0;
  --bg-deep: #e5ede6;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-solid: #ffffff;
  --surface-2: #f4f8f4;
  --surface-3: #e9f2ec;
  --ink: #142f2e;
  --ink-strong: #071c1b;
  --muted: #5b7471;
  --faint: #809591;
  --line: rgba(20, 47, 46, 0.11);
  --line-strong: rgba(20, 47, 46, 0.2);
  --accent: #0c9c87;
  --accent-strong: #087d6c;
  --accent-ink: #ffffff;
  --accent-soft: rgba(12, 156, 135, 0.1);
  --blue: #2e73d2;
  --blue-soft: rgba(46, 115, 210, 0.09);
  --coral: #d96243;
  --coral-soft: rgba(217, 98, 67, 0.1);
  --ok: #12885b;
  --ok-soft: rgba(18, 136, 91, 0.1);
  --warn: #9a6b05;
  --warn-soft: rgba(154, 107, 5, 0.1);
  --danger: #c63b55;
  --danger-soft: rgba(198, 59, 85, 0.1);
  --shadow-sm: 0 1px 2px rgba(13, 43, 40, 0.06), 0 10px 28px rgba(13, 43, 40, 0.06);
  --shadow-md: 0 1px 2px rgba(13, 43, 40, 0.06), 0 24px 70px rgba(13, 43, 40, 0.12);
}

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

html,
body {
  min-height: 100%;
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

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

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

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

button {
  cursor: pointer;
}

img {
  max-width: 100%;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

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

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

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

.num {
  font-variant-numeric: tabular-nums;
}

/* ── 背景 ─────────────────────────────────────────────── */

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
}

.ambient-orb-a {
  width: 46vw;
  height: 46vw;
  min-width: 340px;
  min-height: 340px;
  top: -22vw;
  right: -8vw;
  background: radial-gradient(circle, rgba(49, 196, 177, 0.3), transparent 65%);
}

.ambient-orb-b {
  width: 40vw;
  height: 40vw;
  min-width: 300px;
  min-height: 300px;
  bottom: -22vw;
  left: -10vw;
  background: radial-gradient(circle, rgba(255, 150, 122, 0.2), transparent 65%);
}

.ambient-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(157, 195, 203, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(157, 195, 203, 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at 50% 15%, black 10%, transparent 70%);
}

[data-theme="light"] .ambient-grid {
  background-image:
    linear-gradient(rgba(20, 47, 46, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 47, 46, 0.045) 1px, transparent 1px);
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--surface-solid);
  border: 1px solid var(--line-strong);
  transform: translateY(-160%);
  transition: transform 0.18s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* ── 品牌标记 ─────────────────────────────────────────── */

.brand-mark {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 30px;
  flex: none;
  border-radius: 52% 48% 46% 54% / 56% 54% 46% 44%;
  background: linear-gradient(135deg, var(--accent) 0%, #55c7e8 58%, var(--blue) 100%);
  box-shadow: 0 6px 18px rgba(61, 219, 196, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.brand-mark::before {
  content: "";
  position: absolute;
  top: 7px;
  left: -9px;
  width: 12px;
  height: 16px;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  clip-path: polygon(100% 0, 100% 100%, 0 50%);
  opacity: 0.9;
}

.brand-mark::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #05211e;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.22);
}

.brand-mark-lg {
  width: 58px;
  height: 52px;
}

.brand-mark-lg::before {
  top: 12px;
  left: -15px;
  width: 20px;
  height: 28px;
}

.brand-mark-lg::after {
  top: 14px;
  right: 14px;
  width: 7px;
  height: 7px;
}

/* ── 启动屏 ───────────────────────────────────────────── */

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background:
    radial-gradient(ellipse at 50% 38%, rgba(61, 219, 196, 0.08), transparent 55%),
    var(--bg);
}

.boot-title {
  margin-top: 14px;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.boot-sub {
  color: var(--muted);
  font-size: 13px;
}

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-lg {
  width: 28px;
  height: 28px;
  border-width: 3px;
}

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

/* ── 登录 ─────────────────────────────────────────────── */

.login-root {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(20px, 4vw, 52px);
  display: grid;
  place-items: center;
}

.login-shell {
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(360px, 0.88fr);
  gap: clamp(28px, 5vw, 76px);
  align-items: center;
}

.login-hero {
  position: relative;
  padding: clamp(10px, 2vw, 26px) 0;
}

.login-brand {
  display: flex;
  width: max-content;
  align-items: center;
  gap: 12px;
  margin-bottom: clamp(28px, 5vh, 58px);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.login-brand .brand-copy strong {
  display: block;
  font-size: 17px;
}

.login-brand .brand-copy small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.login-eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.login-title {
  margin-top: 22px;
  font-size: clamp(34px, 5.2vw, 62px);
  line-height: 1.04;
  letter-spacing: -0.045em;
  font-weight: 720;
  color: var(--ink-strong);
}

.login-title em {
  font-style: normal;
  color: var(--accent);
}

.login-sub {
  margin-top: 20px;
  max-width: 500px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}

.feature-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: clamp(26px, 5vh, 48px);
  max-width: 560px;
}

.feature {
  padding: 16px 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.035), transparent 60%);
}

.feature strong {
  display: block;
  font-size: 13px;
  font-weight: 650;
  color: var(--ink);
}

.feature span {
  display: block;
  margin-top: 4px;
  color: var(--faint);
  font-size: 11.5px;
  line-height: 1.55;
}

.login-panel {
  width: 100%;
}

.login-card {
  position: relative;
  padding: clamp(24px, 3.4vw, 38px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  backdrop-filter: blur(22px);
  box-shadow: var(--shadow-md);
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.07), transparent 42%);
}

.login-card-head {
  position: relative;
  margin-bottom: 26px;
}

.login-card-title {
  font-size: 22px;
  font-weight: 680;
  letter-spacing: -0.02em;
  color: var(--ink-strong);
}

.login-card-sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.auth-form {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.field-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.field-hint {
  color: var(--faint);
  font-size: 11px;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.14);
  color: var(--ink);
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

[data-theme="light"] .input,
[data-theme="light"] .select,
[data-theme="light"] .textarea {
  background: rgba(255, 255, 255, 0.78);
}

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

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

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--surface-solid);
}

.input[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-soft);
}

.input:disabled,
.select:disabled,
.textarea:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.select {
  appearance: none;
  padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 20px, calc(100% - 12px) 20px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.password-wrap {
  position: relative;
}

.password-wrap .input {
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 5px;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--faint);
  font-size: 11px;
  white-space: nowrap;
}

.password-toggle:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.password-toggle svg {
  width: 17px;
  height: 17px;
}

.form-error {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 11px 13px;
  border: 1px solid rgba(255, 125, 146, 0.28);
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 12.5px;
  line-height: 1.5;
}

.form-error::before {
  content: "!";
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  flex: none;
  margin-top: 1px;
  border-radius: 50%;
  background: currentColor;
  color: var(--bg);
  font-size: 11px;
  font-weight: 800;
}

.login-submit {
  width: 100%;
  min-height: 46px;
  margin-top: 2px;
}

.login-foot {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 11.5px;
  line-height: 1.65;
}

.login-foot code {
  color: var(--muted);
  font-family: var(--font-mono);
}

/* ── 应用整体 ─────────────────────────────────────────── */

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 22px 14px 16px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(9, 22, 32, 0.76), rgba(7, 17, 25, 0.92));
  backdrop-filter: blur(20px);
}

[data-theme="light"] .sidebar {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(241, 245, 240, 0.92));
}

.sidebar-brand {
  padding: 0 10px 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  border-radius: 10px;
}

.brand-copy strong {
  display: block;
  font-size: 15px;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.brand-copy small {
  display: block;
  margin-top: 2px;
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.side-label,
.side-label-row .side-label {
  padding: 0 12px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.side-nav > .side-label {
  margin: 0 0 8px;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 550;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.side-link svg {
  width: 18px;
  height: 18px;
  opacity: 0.8;
}

.side-link:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.side-link.active {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--ink-strong);
  box-shadow: var(--shadow-sm);
}

.side-link.active svg {
  color: var(--accent);
  opacity: 1;
}

.side-link[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
}

.side-tenants {
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin-top: 26px;
}

.side-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-right: 8px;
  margin-bottom: 8px;
}

.side-add {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  transition: 0.15s ease;
}

.side-add:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.tenant-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
}

.tenant-nav-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 12.5px;
  min-width: 0;
  transition: 0.15s ease;
}

.tenant-nav-link:hover,
.tenant-nav-link.active {
  background: var(--surface-2);
  color: var(--ink);
}

.tenant-nav-link.active {
  box-shadow: inset 2px 0 0 var(--accent);
}

.tenant-nav-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--faint);
  box-shadow: 0 0 0 3px rgba(97, 123, 136, 0.08);
}

.status-dot[data-tone="ok"] {
  background: var(--ok);
  box-shadow: 0 0 0 3px var(--ok-soft);
}

.status-dot[data-tone="warn"] {
  background: var(--warn);
  box-shadow: 0 0 0 3px var(--warn-soft);
}

.status-dot[data-tone="danger"] {
  background: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-soft);
}

.status-dot[data-tone="info"] {
  background: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.side-hint {
  padding: 8px 12px;
  color: var(--faint);
  font-size: 11.5px;
  line-height: 1.6;
}

.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 14px 6px 0;
  border-top: 1px solid var(--line);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex: 1;
}

.avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: linear-gradient(145deg, var(--accent-soft), var(--blue-soft));
  color: var(--accent);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.user-copy {
  min-width: 0;
}

.user-copy strong,
.user-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-copy strong {
  font-size: 12px;
  font-weight: 600;
}

.user-copy small {
  color: var(--faint);
  font-size: 10.5px;
}

.workspace {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: var(--topbar-h);
  padding: 14px clamp(18px, 3vw, 38px);
  border-bottom: 1px solid var(--line);
  background: rgba(7, 18, 28, 0.72);
  backdrop-filter: blur(18px);
}

[data-theme="light"] .topbar {
  background: rgba(241, 245, 240, 0.78);
}

.topbar-titles {
  min-width: 0;
  flex: 1;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 15px;
  color: var(--faint);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.breadcrumb a:hover {
  color: var(--ink);
}

.breadcrumb .sep {
  opacity: 0.5;
}

.page-title {
  margin-top: 2px;
  font-size: clamp(19px, 2.1vw, 24px);
  font-weight: 690;
  line-height: 1.25;
  letter-spacing: -0.025em;
  color: var(--ink-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  transition: 0.15s ease;
}

.icon-btn:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
  color: var(--ink);
}

.icon-btn svg {
  width: 17px;
  height: 17px;
}

.menu-btn {
  display: none;
}

.theme-icon-moon {
  display: none;
}

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

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

.sidebar-scrim {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: none;
  border: 0;
  padding: 0;
  background: rgba(3, 10, 15, 0.6);
  backdrop-filter: blur(2px);
}

.view-root {
  width: 100%;
  max-width: calc(var(--content-max) + 76px);
  margin: 0 auto;
  padding: clamp(20px, 3vw, 36px) clamp(16px, 3vw, 38px) 56px;
  outline: none;
}

/* ── 通用组件 ─────────────────────────────────────────── */

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.page-head-main {
  min-width: 0;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--faint);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.eyebrow .dot-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--faint);
}

.page-title-lg {
  margin-top: 7px;
  font-size: clamp(25px, 3.1vw, 34px);
  font-weight: 710;
  line-height: 1.15;
  letter-spacing: -0.035em;
  color: var(--ink-strong);
}

.page-sub {
  margin-top: 8px;
  max-width: 680px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.page-head-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  border-color: var(--muted);
  background: var(--surface-3);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn-primary {
  border-color: transparent;
  background: linear-gradient(140deg, var(--accent-strong), var(--accent));
  color: var(--accent-ink);
  box-shadow: 0 6px 18px rgba(61, 219, 196, 0.18);
}

[data-theme="light"] .btn-primary {
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(12, 156, 135, 0.2);
}

.btn-primary:hover {
  background: linear-gradient(140deg, var(--accent), var(--accent-strong));
  color: var(--accent-ink);
  border-color: transparent;
}

[data-theme="light"] .btn-primary:hover {
  color: #ffffff;
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.btn-ghost:hover {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--ink);
}

.btn-danger {
  border-color: rgba(255, 125, 146, 0.3);
  background: var(--danger-soft);
  color: var(--danger);
}

.btn-danger:hover {
  border-color: var(--danger);
  background: rgba(255, 125, 146, 0.18);
}

.btn-soft {
  border-color: transparent;
  background: var(--accent-soft);
  color: var(--accent);
}

.btn-soft:hover {
  background: rgba(61, 219, 196, 0.18);
}

.btn-sm {
  min-height: 31px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 11.5px;
}

.btn-lg {
  min-height: 46px;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 13.5px;
}

.btn.is-loading {
  color: transparent !important;
  position: relative;
  pointer-events: none;
}

.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  color: var(--ink);
  animation: spin 0.75s linear infinite;
}

.btn-primary.is-loading::after {
  color: var(--accent-ink);
}

[data-theme="light"] .btn-primary.is-loading::after {
  color: #ffffff;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.75;
}

.badge[data-tone="ok"] {
  border-color: rgba(95, 227, 161, 0.24);
  background: var(--ok-soft);
  color: var(--ok);
}

.badge[data-tone="warn"] {
  border-color: rgba(244, 197, 96, 0.26);
  background: var(--warn-soft);
  color: var(--warn);
}

.badge[data-tone="danger"] {
  border-color: rgba(255, 125, 146, 0.26);
  background: var(--danger-soft);
  color: var(--danger);
}

.badge[data-tone="info"] {
  border-color: rgba(105, 169, 255, 0.24);
  background: var(--blue-soft);
  color: var(--blue);
}

.badge[data-tone="neutral"] {
  color: var(--muted);
}

.badge.no-dot::before {
  display: none;
}

.chip-row {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px);
  overflow: hidden;
}

.card-pad {
  padding: clamp(18px, 2.4vw, 26px);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.card-head-main {
  min-width: 0;
}

.card-kicker {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.card-title {
  font-size: 17px;
  font-weight: 670;
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--ink-strong);
}

.card-sub {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.card-divide {
  height: 1px;
  margin: 20px -26px;
  background: var(--line);
}

.section-label {
  margin-bottom: 10px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hosting-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.alert strong {
  color: inherit;
}

.alert[data-tone="warn"] {
  border-color: rgba(244, 197, 96, 0.26);
  background: var(--warn-soft);
  color: var(--warn);
}

.alert[data-tone="danger"] {
  border-color: rgba(255, 125, 146, 0.28);
  background: var(--danger-soft);
  color: var(--danger);
}

.alert[data-tone="info"] {
  border-color: rgba(105, 169, 255, 0.25);
  background: var(--blue-soft);
  color: var(--blue);
}

.alert-icon {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 1px;
  border-radius: 50%;
  background: currentColor;
  color: var(--bg);
  font-size: 11px;
  font-weight: 800;
}

.alert span {
  min-width: 0;
}

.note {
  color: var(--faint);
  font-size: 11.5px;
  line-height: 1.6;
}

.note code {
  font-family: var(--font-mono);
  color: var(--muted);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 220px;
  padding: 32px 20px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.02), transparent);
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--muted);
}

.empty-icon svg {
  width: 21px;
  height: 21px;
}

.empty-title {
  font-size: 14px;
  font-weight: 650;
  color: var(--ink);
}

.empty-sub {
  max-width: 420px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.empty-actions {
  margin-top: 8px;
}

.divider {
  height: 1px;
  background: var(--line);
}

/* ── 骨架屏 ───────────────────────────────────────────── */

.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface-2);
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  animation: shimmer 1.4s infinite;
}

[data-theme="light"] .skeleton::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
}

@keyframes shimmer {
  100% { transform: translateX(100%); }
}

.skeleton-line {
  height: 12px;
  margin-bottom: 9px;
}

.skeleton-title {
  width: 45%;
  height: 19px;
  margin-bottom: 14px;
}

.skeleton-card {
  height: 148px;
  border-radius: var(--radius-lg);
}

/* ── 租户总览 ─────────────────────────────────────────── */

.overview-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  backdrop-filter: blur(12px);
}

.stat-key {
  color: var(--faint);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.stat-val {
  margin-top: 6px;
  font-size: 25px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--ink-strong);
  font-variant-numeric: tabular-nums;
}

.stat-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.tenant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 14px;
}

.tenant-card {
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.tenant-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  background: var(--surface-solid);
}

.tenant-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.tenant-card-title {
  min-width: 0;
}

.tenant-card-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  font-size: 15.5px;
  font-weight: 660;
  letter-spacing: -0.015em;
  color: var(--ink-strong);
}

.tenant-card-name:hover {
  color: var(--accent);
}

.tenant-slug {
  display: block;
  margin-top: 3px;
  color: var(--faint);
  font-size: 11px;
  font-family: var(--font-mono);
}

.tenant-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 15px;
}

.tenant-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10.5px;
}

.tenant-mini-status {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.mini-status {
  min-width: 0;
}

.mini-status-key {
  display: block;
  color: var(--faint);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mini-status-val {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tenant-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
}

.tenant-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tenant-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  transition: 0.15s ease;
}

.tenant-link:hover {
  background: var(--surface-2);
  color: var(--accent);
}

.tenant-link svg {
  width: 13px;
  height: 13px;
}

.tenant-expiry {
  color: var(--faint);
  font-size: 10.5px;
  white-space: nowrap;
}

.tenant-expiry[data-state="soon"] {
  color: var(--warn);
}

.tenant-expiry[data-state="expired"] {
  color: var(--danger);
}

/* ── Hosting ──────────────────────────────────────────── */

.hosting-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.hosting-summary .badge {
  min-height: 27px;
  padding: 4px 10px;
  font-size: 11px;
}

.expiry-banner {
  margin-bottom: 18px;
}

.kernel-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.kernel-option {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 12px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  cursor: pointer;
  transition: 0.15s ease;
}

.kernel-option:hover {
  border-color: var(--line-strong);
}

.kernel-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.kernel-option.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent) inset;
}

.kernel-option input:focus-visible + .kernel-body {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.kernel-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.kernel-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink);
}

.kernel-tag {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.kernel-desc {
  color: var(--faint);
  font-size: 10px;
  line-height: 1.45;
}

.kernel-option.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.auth-token-block {
  margin-top: 14px;
}

.inline-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mt-14 { margin-top: 14px; }
.mt-18 { margin-top: 18px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-14 { margin-bottom: 14px; }
.mb-18 { margin-bottom: 18px; }

.status-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 4px;
  border-top: 1px solid var(--line);
}

.status-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.status-row:last-child {
  border-bottom: 0;
}

.status-key {
  color: var(--faint);
  font-size: 11.5px;
  flex: none;
}

.status-val {
  min-width: 0;
  text-align: right;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.status-val.muted {
  color: var(--muted);
}

.status-val .mono {
  color: var(--ink);
}

.status-val[data-tone="ok"] { color: var(--ok); }
.status-val[data-tone="warn"] { color: var(--warn); }
.status-val[data-tone="danger"] { color: var(--danger); }

.qr-trigger-row {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.qr-trigger-copy {
  flex: 1;
  min-width: 150px;
}

.qr-trigger-copy strong {
  display: block;
  font-size: 12px;
  font-weight: 620;
}

.qr-trigger-copy span {
  display: block;
  margin-top: 2px;
  color: var(--faint);
  font-size: 10.5px;
}

.bili-account {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.bili-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: linear-gradient(140deg, var(--coral-soft), var(--blue-soft));
  color: var(--coral);
  font-size: 14px;
  font-weight: 700;
}

.bili-account-copy {
  min-width: 0;
  flex: 1;
}

.bili-account-copy strong {
  display: block;
  font-size: 13px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bili-account-copy small {
  display: block;
  margin-top: 2px;
  color: var(--faint);
  font-size: 10.5px;
  font-family: var(--font-mono);
}

.subscription-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.subscription-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 13px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}

.subscription-row:last-child {
  border-bottom: 0;
}

.subscription-copy {
  flex: 1;
  min-width: 0;
}

.subscription-copy strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
}

.subscription-copy span {
  display: block;
  margin-top: 2px;
  color: var(--faint);
  font-size: 10.5px;
  line-height: 1.45;
}

.switch {
  position: relative;
  display: inline-flex;
  flex: none;
  width: 38px;
  height: 22px;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.switch-track {
  position: absolute;
  inset: 0;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-3);
  transition: 0.18s ease;
  pointer-events: none;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.18s ease, background 0.18s ease;
}

.switch input:checked + .switch-track {
  border-color: var(--accent);
  background: var(--accent);
}

.switch input:checked + .switch-track::after {
  transform: translateX(16px);
  background: var(--accent-ink);
}

[data-theme="light"] .switch input:checked + .switch-track::after {
  background: #ffffff;
}

.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.switch input:disabled {
  cursor: not-allowed;
}

.switch input:disabled + .switch-track {
  opacity: 0.5;
}

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

.dirty-hint {
  color: var(--warn);
  font-size: 11px;
}

/* ── Relay ────────────────────────────────────────────── */

.relay-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 18px;
  align-items: start;
}

.quota-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.quota-block {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.quota-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.quota-label {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}

.quota-value {
  color: var(--ink);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.quota-value strong {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-strong);
}

.progress {
  position: relative;
  height: 7px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--blue));
  transition: width 0.5s ease;
}

.progress-bar[data-tone="warn"] {
  background: linear-gradient(90deg, var(--warn), var(--coral));
}

.progress-bar[data-tone="danger"] {
  background: linear-gradient(90deg, var(--coral), var(--danger));
}

.quota-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
  color: var(--faint);
  font-size: 10px;
}

.key-display {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.14);
  min-width: 0;
}

[data-theme="light"] .key-display {
  background: var(--surface-2);
}

.key-display svg {
  width: 16px;
  height: 16px;
  color: var(--faint);
}

.key-display code {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
}

.key-display .badge {
  flex: none;
}

.relay-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.model-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 250px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.model-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  cursor: pointer;
  transition: 0.15s ease;
}

.model-option:hover {
  border-color: var(--line-strong);
}

.model-option.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.model-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.model-radio {
  width: 13px;
  height: 13px;
  flex: none;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  position: relative;
}

.model-option.is-selected .model-radio {
  border-color: var(--accent);
}

.model-option.is-selected .model-radio::after {
  content: "";
  position: absolute;
  inset: 2.5px;
  border-radius: 50%;
  background: var(--accent);
}

.model-copy {
  flex: 1;
  min-width: 0;
}

.model-name {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-meta {
  display: block;
  margin-top: 1px;
  color: var(--faint);
  font-size: 9.5px;
  font-family: var(--font-mono);
}

.model-price {
  flex: none;
  color: var(--faint);
  font-size: 9.5px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.billing-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.billing-stat {
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.billing-stat .stat-key {
  font-size: 9.5px;
}

.billing-stat .stat-val {
  margin-top: 5px;
  font-size: 20px;
}

.billing-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
}

.segmented button {
  min-height: 26px;
  padding: 3px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
}

.segmented button.is-active {
  background: var(--surface-solid);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.billing-days {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.billing-day {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
}

.billing-day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.billing-day-date {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 650;
  color: var(--ink);
}

.billing-day-total {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--faint);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

.billing-day-total strong {
  color: var(--ink);
  font-weight: 650;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
}

.billing-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
  font-size: 11.5px;
}

.billing-table th {
  padding: 9px 12px;
  text-align: right;
  color: var(--faint);
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}

.billing-table th:first-child,
.billing-table td:first-child {
  text-align: left;
  padding-left: 15px;
}

.billing-table td {
  padding: 9px 12px;
  text-align: right;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

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

.billing-table tr:hover td {
  background: rgba(255, 255, 255, 0.018);
}

.billing-table .cell-model {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.billing-table .cell-cost {
  color: var(--ink);
  font-weight: 650;
}

.billing-footnote {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--faint);
  font-size: 10.5px;
  line-height: 1.6;
}

.billing-footnote strong {
  color: var(--muted);
}

.local-estimate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 11px;
}

.local-estimate span {
  color: var(--faint);
}

.local-estimate strong {
  color: var(--warn);
  font-weight: 650;
}

/* ── 弹窗 ─────────────────────────────────────────────── */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(3, 10, 15, 0.66);
  backdrop-filter: blur(6px);
  animation: fade-in 0.16s ease;
}

.modal {
  width: min(520px, 100%);
  max-height: min(86vh, 780px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xl);
  background: var(--surface-solid);
  box-shadow: var(--shadow-md);
  animation: modal-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.modal-wide {
  width: min(720px, 100%);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 22px 14px;
}

.modal-head-main {
  flex: 1;
  min-width: 0;
}

.modal-kicker {
  color: var(--faint);
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.modal-title {
  margin-top: 4px;
  font-size: 18px;
  font-weight: 690;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--ink-strong);
}

.modal-sub {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
}

.modal-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--faint);
}

.modal-close:hover {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--ink);
}

.modal-close svg {
  width: 16px;
  height: 16px;
}

.modal-body {
  padding: 4px 22px 20px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 22px 20px;
  border-top: 1px solid var(--line);
}

.modal-foot-split {
  justify-content: space-between;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

@keyframes fade-in {
  from { opacity: 0; }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
}

/* ── 二维码 ───────────────────────────────────────────── */

.qr-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 10px 0 2px;
  text-align: center;
}

.qr-frame {
  position: relative;
  display: grid;
  place-items: center;
  width: 232px;
  height: 232px;
  padding: 12px;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.22);
}

.qr-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: auto;
}

.qr-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 100%;
  border-radius: 10px;
  background: #f2f4f3;
  color: #6a7a78;
  font-size: 11px;
}

.qr-frame .qr-overlay {
  position: absolute;
  inset: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 10px;
  background: rgba(4, 14, 18, 0.82);
  color: #eaf5f2;
  font-size: 12px;
  font-weight: 600;
  backdrop-filter: blur(3px);
}

.qr-state {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
}

.qr-state .status-dot {
  width: 6px;
  height: 6px;
}

.qr-countdown {
  color: var(--faint);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.qr-steps {
  width: 100%;
  margin-top: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  text-align: left;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.qr-steps strong {
  color: var(--ink);
}

.qr-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.modal-error {
  width: 100%;
}

/* ── 提示条 ───────────────────────────────────────────── */

.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(370px, calc(100vw - 36px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--surface-solid);
  box-shadow: var(--shadow-md);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.5;
  pointer-events: auto;
  animation: toast-in 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: none;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.toast[data-tone="danger"] {
  border-color: rgba(255, 125, 146, 0.35);
}

.toast[data-tone="danger"]::before {
  background: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-soft);
}

.toast[data-tone="warn"]::before {
  background: var(--warn);
  box-shadow: 0 0 0 3px var(--warn-soft);
}

.toast.is-leaving {
  animation: toast-out 0.18s ease forwards;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(6px);
  }
}

.noscript {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
  color: var(--ink);
}

/* ── 响应式 ───────────────────────────────────────────── */

@media (max-width: 1180px) {
  :root {
    --sidebar-w: 238px;
  }

  .login-shell {
    gap: 36px;
  }
}

@media (max-width: 1020px) {
  .hosting-grid,
  .relay-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .feature-list {
    grid-template-columns: 1fr;
  }

  .billing-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(var(--sidebar-w), 84vw);
    transform: translateX(-105%);
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-md);
    background: var(--surface-solid);
  }

  .app-shell.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-scrim {
    display: block;
  }

  .menu-btn {
    display: inline-grid;
  }

  .login-shell {
    grid-template-columns: minmax(0, 1fr);
    max-width: 560px;
  }

  .login-hero {
    padding-bottom: 0;
  }

  .login-brand {
    margin-bottom: 24px;
  }

  .login-title {
    font-size: clamp(34px, 7vw, 48px);
  }

  .feature-list {
    display: none;
  }

  .login-sub {
    margin-top: 12px;
  }

  .topbar {
    padding: 12px 18px;
  }
}

@media (max-width: 680px) {
  .view-root {
    padding: 18px 14px 44px;
  }

  .topbar {
    min-height: 66px;
  }

  .overview-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .stat {
    padding: 12px;
  }

  .stat-val {
    font-size: 21px;
  }

  .tenant-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .kernel-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .kernel-option {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .kernel-body {
    flex-direction: row;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px;
  }

  .kernel-desc {
    display: none;
  }

  .form-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .page-head-actions {
    width: 100%;
  }

  .page-head-actions .btn {
    flex: 1;
  }

  .billing-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .billing-stat {
    padding: 11px 12px;
  }

  .modal-backdrop {
    padding: 10px;
    align-items: flex-end;
  }

  .modal {
    width: 100%;
    max-height: 90vh;
    border-radius: 20px 20px 14px 14px;
  }

  .modal-head {
    padding: 17px 17px 12px;
  }

  .modal-body {
    padding: 4px 17px 16px;
  }

  .modal-foot {
    padding: 12px 17px 16px;
  }

  .toast-region {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
  }

  .status-row {
    gap: 8px;
  }

  .status-key {
    font-size: 11px;
  }

  .status-val {
    font-size: 11.5px;
  }

  .tenant-mini-status {
    gap: 6px;
  }

  .qr-frame {
    width: 208px;
    height: 208px;
  }
}

@media (max-width: 480px) {
  .login-root {
    padding: 16px;
  }

  .login-card {
    padding: 22px 18px;
    border-radius: 20px;
  }

  .login-title {
    font-size: 33px;
  }

  .login-sub {
    font-size: 13px;
  }

  .overview-strip {
    grid-template-columns: 1fr;
  }

  .stat {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
  }

  .stat-val {
    margin-top: 0;
  }

  .stat-meta {
    display: none;
  }

  .billing-summary {
    grid-template-columns: minmax(0, 1fr);
  }

  .topbar-actions .icon-btn {
    width: 33px;
    height: 33px;
  }

  .page-title {
    font-size: 18px;
  }
}

.user-two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.user-filter-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 18px;
}

.user-filter-actions { display: flex; gap: 8px; }
.user-log-table, .user-recharge-table { min-width: 850px; }
.user-log-error, .user-recharge-note { overflow-wrap: anywhere; }

@media (max-width: 900px) {
  .user-two-column { grid-template-columns: minmax(0, 1fr); }
  .user-filter-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 540px) {
  .user-filter-form { grid-template-columns: minmax(0, 1fr); }
}

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