:root {
  --primary: #4f8cff;
  --primary-d: #2f6bf0;
  --ink: #1d2230;
  --ink-2: #59617a;
  --ink-3: #98a0af;
  --glass: rgba(255, 255, 255, 0.5);
  --glass-strong: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.65);
  --line: rgba(120, 140, 180, 0.22);
  --success: #168457;
  --success-soft: rgba(214, 245, 232, 0.85);
  --warning: #9a6411;
  --warning-soft: rgba(255, 244, 216, 0.9);
  --danger: #c33c45;
  --danger-soft: rgba(255, 230, 232, 0.9);
  --focus: rgba(79, 140, 255, 0.22);
  --shadow: 0 18px 50px rgba(50, 69, 108, 0.14);
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: #e8ecf5;
  position: relative;
  overflow-x: hidden;
}

/* ===== 流线极光背景（与控制台一致） ===== */
body::before {
  content: '';
  position: fixed;
  inset: -10%;
  z-index: -2;
  background:
    radial-gradient(640px 520px at 12% 8%, rgba(110, 145, 255, 0.6), transparent 65%),
    radial-gradient(720px 620px at 88% 18%, rgba(255, 150, 200, 0.45), transparent 65%),
    radial-gradient(680px 580px at 78% 88%, rgba(100, 220, 255, 0.5), transparent 65%),
    radial-gradient(520px 470px at 18% 85%, rgba(150, 255, 205, 0.45), transparent 65%),
    linear-gradient(160deg, #eef1f8, #e4e9f4);
  animation: aurora 26s ease-in-out infinite alternate;
}
body::after {
  content: '';
  position: fixed;
  inset: -20%;
  z-index: -1;
  pointer-events: none;
  background: conic-gradient(from 120deg at 50% 40%, transparent 0deg, rgba(120, 160, 255, 0.08) 90deg, transparent 180deg, rgba(255, 170, 210, 0.07) 270deg, transparent 360deg);
  animation: swirl 40s linear infinite;
}
@keyframes aurora {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(-2%, 1.5%) scale(1.04); }
  100% { transform: translate(2%, -1.5%) scale(1.02); }
}
@keyframes swirl { to { transform: rotate(360deg); } }

button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.58; }
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--primary-d);
  outline-offset: 2px;
}
[hidden] { display: none !important; }

/* ===== 登录页 ===== */
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-panel {
  width: min(420px, 100%);
  padding: 36px;
  border-radius: 20px;
  background: var(--glass-strong);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
}
.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, #4f8cff, #6a5cff);
  font-weight: 760;
  font-size: 22px;
  box-shadow: 0 8px 20px rgba(79, 140, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.brand-mark.small { width: 38px; height: 38px; border-radius: 12px; font-size: 17px; }
.login-panel h1 { margin: 24px 0 8px; font-size: 25px; letter-spacing: -0.02em; }
.login-panel > p { margin: 0 0 28px; color: var(--ink-2); line-height: 1.65; }
.login-panel form { display: grid; gap: 10px; }

label, legend { font-size: 13px; font-weight: 650; color: #39445a; }
input {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(140, 160, 200, 0.4);
  border-radius: 12px;
  padding: 10px 13px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.75);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
input::placeholder { color: var(--ink-3); }
input:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 4px var(--focus); background: #fff; }
input:disabled, input:read-only:not(.cal-input) { color: var(--ink-2); background: rgba(240, 244, 250, 0.8); }
input.cal-input { cursor: pointer; }

.domain-preview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(244, 247, 252, 0.72);
}
.domain-preview > div { min-width: 0; padding: 12px 14px; }
.domain-preview > div + div { border-inline-start: 1px solid var(--line); }
.domain-preview span { display: block; margin-bottom: 4px; color: var(--ink-3); font-size: 11px; }
.domain-preview output {
  display: block;
  overflow: hidden;
  color: var(--ink-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.domain-preview.ready output { color: #285fae; }

.primary, .quiet, .text-button, .license-action {
  min-height: 44px;
  border-radius: 12px;
  border: 0;
  padding: 9px 16px;
  font-weight: 650;
  transition: background 160ms ease, transform 120ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
.primary {
  color: #fff;
  background: linear-gradient(135deg, #4f8cff, #6a5cff);
  box-shadow: 0 6px 16px rgba(79, 140, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.primary:hover:not(:disabled) { box-shadow: 0 9px 24px rgba(79, 140, 255, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25); transform: translateY(-1px); }
.quiet {
  color: #354159;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--glass-border);
}
.quiet:hover { background: rgba(255, 255, 255, 0.9); border-color: rgba(140, 160, 200, 0.5); }
.wide { width: 100%; }
.form-error, .aside-error { min-height: 20px; margin: 4px 0 0; color: var(--danger); font-size: 13px; line-height: 1.5; }

/* ===== 顶栏 ===== */
.topbar {
  height: 70px;
  padding: 0 max(24px, calc((100vw - 1440px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand-lockup, .topbar-actions, .section-heading, .aside-heading, .form-actions { display: flex; align-items: center; }
.brand-lockup { gap: 12px; }
.brand-lockup h1 { margin: 0; font-size: 16px; }
.brand-lockup p { margin: 3px 0 0; color: var(--ink-3); font-size: 12px; }
.topbar-actions { gap: 16px; }
.topbar-actions a.quiet { text-decoration: none; }
.service-state { display: inline-flex; align-items: center; gap: 7px; color: var(--success); font-size: 13px; font-weight: 650; }
.state-dot { width: 8px; height: 8px; border-radius: 50%; background: #24ae77; box-shadow: 0 0 0 4px rgba(36, 174, 119, 0.12); }

/* ===== 主区卡片 ===== */
.content { width: min(1440px, calc(100% - 48px)); margin: 0 auto; padding: 28px 0 48px; }
.card {
  border-radius: 20px;
  background: var(--glass-strong);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(360px, 0.8fr);
  overflow: hidden;
}
.form-side { padding: 28px 32px 32px; }
.verification-side { padding: 28px; background: rgba(240, 244, 251, 0.55); border-left: 1px solid var(--line); }
.section-heading { justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.section-heading h2, .aside-heading h2 { margin: 0; font-size: 19px; letter-spacing: -0.015em; }
.section-heading p { margin: 7px 0 0; color: var(--ink-2); font-size: 13px; line-height: 1.55; }
.privacy-note { flex: none; color: var(--success); background: var(--success-soft); padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 650; }
.optional-label { color: var(--ink-3); font-size: 12px; font-weight: 500; }
.credential-hint { display: block; margin-top: 7px; color: var(--ink-3); line-height: 1.55; }
.credential-hint.saved { color: var(--success); font-weight: 650; }
.credential-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.credential-row .credential-hint { flex: 1; }
.inline-danger {
  flex: none;
  border: 0;
  padding: 4px 0;
  color: var(--danger);
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.inline-danger:hover { color: #9f2632; }
.inline-danger:focus-visible { outline: 3px solid rgba(208, 61, 76, 0.2); outline-offset: 3px; }

fieldset { margin: 0; padding: 0; border: 0; }
fieldset + fieldset { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
legend { margin-bottom: 14px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { min-width: 0; position: relative; }
.field label { display: block; margin-bottom: 7px; }
.field small { display: block; margin-top: 7px; color: var(--ink-3); font-size: 12px; line-height: 1.55; }
.span-two { grid-column: span 2; }
.server-grid { grid-template-columns: minmax(0, 1.4fr) minmax(120px, 0.6fr); }
.form-actions { gap: 16px; margin-top: 28px; }
.form-actions .primary { min-width: 230px; }
.form-actions > span { color: var(--ink-3); font-size: 12px; line-height: 1.45; }

/* ===== 控制台同款小日历 ===== */
.cal-pop {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 80;
  box-sizing: border-box;
  width: 248px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px 14px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 32px rgba(40, 60, 120, 0.22);
  transform: translateX(var(--cal-shift-x, 0px));
}
.cal-pop.open { display: block; }
.cal-pop[data-placement="top"] { top: auto; bottom: calc(100% + 6px); }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-title { font-size: 13px; font-weight: 600; }
.calNav {
  width: 26px;
  height: 26px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.8);
  user-select: none;
}
.calNav:hover { background: rgba(255, 255, 255, 0.9); color: var(--primary-d); }
.calWk { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 10px; color: var(--ink-3); margin-bottom: 4px; }
.calGrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.calGrid .cd { aspect-ratio: 1; min-height: 0; padding: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; border-radius: 9px; }
.calGrid .cd.on {
  cursor: pointer;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.85);
  font-weight: 500;
  transition: all 0.12s ease;
}
.calGrid .cd.on:hover { background: var(--primary); color: #fff; transform: scale(1.08); }
.calGrid .cd.off { color: rgba(150, 158, 175, 0.45); cursor: default; }
.calGrid .cd.today { box-shadow: inset 0 0 0 1.5px rgba(79, 140, 255, 0.55); }
.calGrid .cd.sel { background: linear-gradient(135deg, #4f8cff, #6a5cff) !important; color: #fff !important; font-weight: 600; }

/* ===== 核验侧栏 ===== */
.aside-heading { justify-content: space-between; gap: 12px; }
.status { padding: 5px 9px; border-radius: 999px; font-size: 12px; font-weight: 650; }
.status.neutral { color: var(--ink-2); background: rgba(231, 235, 242, 0.9); }
.status.checking { color: var(--warning); background: var(--warning-soft); }
.status.ready, .status.success { color: var(--success); background: var(--success-soft); }
.status.failed { color: var(--danger); background: var(--danger-soft); }

.verification-empty { min-height: 360px; display: grid; align-content: center; justify-items: center; text-align: center; color: var(--ink-2); }
.verification-empty p { max-width: 28ch; margin: 20px 0 0; font-size: 13px; line-height: 1.65; }
.server-glyph { width: 82px; padding: 12px; display: grid; gap: 7px; border-radius: 14px; background: rgba(210, 220, 238, 0.7); }
.server-glyph span { height: 8px; border-radius: 4px; background: #8796af; }
.server-glyph span::after { content: ""; display: block; width: 6px; height: 6px; margin: 1px 0 0 4px; border-radius: 50%; background: var(--primary); }

.fingerprint-panel, .progress-panel, .success-panel { margin-top: 24px; }
.host-facts, .result-list { margin: 0; }
.host-facts > div, .result-list > div { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
dt { color: var(--ink-3); font-size: 12px; }
dd { margin: 0; color: var(--ink); font-size: 13px; overflow-wrap: anywhere; }
.fingerprint { margin: 20px 0 14px; padding: 14px; border-radius: 12px; background: rgba(228, 234, 244, 0.8); }
.fingerprint span { display: block; margin-bottom: 8px; color: var(--ink-2); font-size: 12px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; overflow-wrap: anywhere; }
.confirm-line { display: flex; align-items: flex-start; gap: 9px; margin: 14px 0; line-height: 1.5; cursor: pointer; }
.confirm-line input { flex: none; width: 17px; min-height: 17px; margin-top: 2px; accent-color: var(--primary); }
.text-button { width: 100%; margin-top: 8px; color: var(--primary-d); background: transparent; }
.text-button:hover { background: rgba(79, 140, 255, 0.1); }

.progress-panel ol { list-style: none; margin: 0; padding: 0; }
.progress-panel li { position: relative; padding: 0 0 18px 30px; color: var(--ink-3); font-size: 13px; }
.progress-panel li::before { content: ""; position: absolute; left: 3px; top: 2px; width: 12px; height: 12px; border: 2px solid #a8b3c5; border-radius: 50%; background: #f3f6fb; }
.progress-panel li::after { content: ""; position: absolute; left: 10px; top: 17px; bottom: 1px; width: 1px; background: #cbd3e1; }
.progress-panel li:last-child::after { display: none; }
.progress-panel li.active { color: var(--primary-d); font-weight: 650; }
.progress-panel li.active::before { border-color: var(--primary); box-shadow: 0 0 0 4px var(--focus); }
.progress-panel li.done { color: var(--success); }
.progress-panel li.done::before { content: "✓"; display: grid; place-items: center; width: 16px; height: 16px; left: 1px; top: 0; border: 0; color: #fff; background: var(--success); font-size: 10px; }
.progress-message { margin: 6px 0 0; color: var(--ink-2); font-size: 13px; }

.success-panel { text-align: center; }
.success-mark { width: 46px; height: 46px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--success); font-size: 24px; }
.success-panel h3 { margin: 0 0 8px; font-size: 18px; }
.success-panel > p { margin: 0 0 18px; color: var(--ink-2); font-size: 13px; line-height: 1.55; }
.result-list { text-align: left; margin-bottom: 18px; }
.success-panel > .result-note {
  margin: 0 0 18px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #37634f;
  background: var(--success-soft);
  font-size: 12px;
  line-height: 1.55;
  text-align: left;
}
.aside-error { margin-top: 16px; }

.diagnostic-error {
  margin-top: 24px;
  padding: 18px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 14px;
  color: #762d35;
  background: #fff4f4;
  border: 1px solid #efc7cb;
  border-radius: 14px;
}
.diagnostic-symbol {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--danger);
  font-size: 18px;
  font-weight: 750;
}
.diagnostic-content { min-width: 0; }
.diagnostic-content h3 { margin: 1px 0 6px; color: #67252c; font-size: 15px; letter-spacing: -0.01em; }
.diagnostic-content > p { margin: 0; color: #7f3f46; font-size: 13px; line-height: 1.6; }
.diagnostic-facts { margin: 14px 0 0; padding: 10px 12px; background: rgba(255, 255, 255, 0.72); border-radius: 10px; }
.diagnostic-facts > div { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 10px; padding: 4px 0; }
.diagnostic-facts dt { color: #936168; }
.diagnostic-facts dd { color: #5f2f35; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.diagnostic-log {
  margin: 10px 0 0;
  padding: 11px 12px;
  max-height: 176px;
  overflow: auto;
  border: 1px solid #edd5d8;
  border-radius: 10px;
  color: #62383d;
  background: #fffafa;
  font: 11.5px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.diagnostic-actions { margin: 13px 0 0; padding-left: 18px; color: #6f3a40; font-size: 12.5px; line-height: 1.65; }
.diagnostic-actions li + li { margin-top: 3px; }
.diagnostic-retry { margin-top: 14px; width: 100%; color: #67252c; background: #fff; border-color: #e8b9be; }
.diagnostic-retry:hover { background: #fffafa; border-color: #da989f; }

/* ===== 商业包管理与推送更新 ===== */
.package-card { margin-top: 24px; padding: 26px 28px; }
.package-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 28px; }
.package-block h3 { margin: 0 0 6px; font-size: 15px; }
.package-block > p { margin: 0 0 16px; color: var(--ink-2); font-size: 12.5px; line-height: 1.55; }
.package-block {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.package-block + .package-block { padding-left: 28px; border-left: 1px solid var(--line); }
.package-facts { margin: 0 0 16px; }
.package-facts > div { display: grid; grid-template-columns: 76px 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.package-facts > div:last-child { border-bottom: 0; }
.file-row { display: flex; gap: 10px; align-items: center; margin-top: auto; padding-top: 16px; }
.file-row .quiet { flex: none; }
.file-name { flex: 1; min-width: 0; color: var(--ink-2); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.package-block .form-actions { margin-top: 14px; }
.package-block .form-actions .primary { width: 100%; min-width: 0; }
.update-form { display: grid; gap: 14px; flex: 1; }
.update-form .form-actions.compact { margin-top: auto; padding-top: 4px; }
#updateProbeButton { width: 100%; }
.update-form .field label { display: block; margin-bottom: 7px; }
.update-target { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(110px, 0.5fr) minmax(120px, 0.7fr); gap: 12px; }
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(140, 160, 200, 0.4);
  border-radius: 12px;
  padding: 10px 13px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.75);
  font: inherit;
}
select:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 4px var(--focus); }
.update-verify { padding: 14px; border-radius: 12px; background: rgba(228, 234, 244, 0.8); }
.update-verify .fingerprint { margin: 0; padding: 0; background: transparent; }
.update-log {
  margin: 0;
  padding: 12px 14px;
  max-height: 180px;
  overflow-y: auto;
  border-radius: 12px;
  background: rgba(29, 34, 48, 0.88);
  color: #c8d2e4;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ===== 客户远程管理 ===== */
.access-card { margin-top: 24px; padding: 26px 28px; }
.access-grid { display: grid; grid-template-columns: minmax(280px, 0.8fr) minmax(420px, 1.2fr); gap: 28px; }
.access-fields { display: grid; align-content: start; gap: 14px; }
.access-ssh-grid { grid-template-columns: minmax(100px, 0.7fr) minmax(130px, 1fr); }
.access-actions {
  min-width: 0;
  padding-left: 28px;
  border-left: 1px solid var(--line);
}
.access-identity {
  display: grid;
  grid-template-columns: minmax(120px, 0.45fr) minmax(0, 1.55fr);
  gap: 12px;
  margin-bottom: 14px;
}
.access-identity > div { min-width: 0; padding: 12px 14px; border-radius: 12px; background: rgba(235, 240, 248, 0.76); }
.access-identity span { display: block; margin-bottom: 4px; color: var(--ink-3); font-size: 11px; }
.access-identity strong, .access-identity code { display: block; overflow-wrap: anywhere; }
.password-editor { margin-top: 16px; }
.password-editor .primary { margin-top: 14px; }
.lock-editor {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 16px;
  padding: 15px 16px;
  border: 1px solid rgba(199, 66, 74, 0.2);
  border-radius: 12px;
  background: rgba(255, 245, 245, 0.72);
}
.lock-editor p { margin: 4px 0 0; color: var(--ink-2); font-size: 12px; line-height: 1.55; }
.danger-action { flex: none; min-height: 44px; color: #fff; background: var(--danger); }
.danger-action:hover { filter: brightness(0.94); }
.danger-action.unlock { color: #155d45; background: rgba(209, 242, 229, 0.95); }
.ledger-tools { display: flex; align-items: center; gap: 8px; }
.danger-text { color: var(--danger); }

/* ===== 授权账本 ===== */
.ledger { margin-top: 24px; padding: 26px 28px; }
.ledger-heading { margin-bottom: 18px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { padding: 11px 12px; color: var(--ink-3); font-weight: 600; text-align: left; background: rgba(240, 244, 250, 0.8); white-space: nowrap; }
th:first-child { border-radius: 10px 0 0 10px; }
th:last-child { border-radius: 0 10px 10px 0; }
td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
.customer-name { display: block; font-weight: 680; }
.license-id { display: block; margin-top: 4px; color: var(--ink-3); font-family: ui-monospace, monospace; font-size: 11px; }
.license-status { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; }
.license-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.license-status.active { color: var(--success); }
.license-status.locked { color: #b66b00; }
.license-status.revoked { color: var(--danger); }
.row-actions { display: flex; justify-content: flex-end; gap: 6px; }
.license-action { min-height: 34px; padding: 6px 10px; color: #3b4860; background: rgba(238, 242, 248, 0.9); font-size: 12px; white-space: nowrap; }
.license-action:hover { background: rgba(223, 230, 241, 0.95); }
.license-action.danger { color: var(--danger); background: var(--danger-soft); }
.table-loading, .table-empty { padding: 40px 16px; color: var(--ink-2); text-align: center; font-size: 13px; }

.toast {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 50;
  max-width: min(380px, calc(100vw - 36px));
  padding: 12px 16px;
  border-radius: 12px;
  color: #fff;
  background: rgba(29, 34, 48, 0.92);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 30px rgba(24, 33, 52, 0.28);
  transform: translateY(-14px);
  opacity: 0;
  pointer-events: none;
  transition: 180ms ease;
}
.toast.show { transform: translateY(0); opacity: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 900px) {
  .workspace, .package-grid, .access-grid { grid-template-columns: 1fr; }
  .verification-side { border-left: 0; border-top: 1px solid var(--line); }
  .verification-empty { min-height: 220px; }
  .package-block + .package-block { padding-left: 0; border-left: 0; padding-top: 24px; border-top: 1px solid var(--line); }
  .access-actions { padding-left: 0; padding-top: 24px; border-left: 0; border-top: 1px solid var(--line); }
}

@media (max-width: 640px) {
  .topbar { height: auto; min-height: 66px; padding: 12px 16px; }
  .service-state { display: none; }
  .content { width: calc(100% - 24px); padding-top: 12px; }
  .form-side, .verification-side, .ledger, .package-card, .access-card { padding: 20px 16px; }
  .section-heading { align-items: flex-start; margin-bottom: 22px; }
  .privacy-note { display: none; }
  .field-grid, .server-grid, .update-target { grid-template-columns: 1fr; }
  .domain-preview { grid-template-columns: 1fr; }
  .domain-preview > div + div { border-inline-start: 0; border-top: 1px solid var(--line); }
  .span-two { grid-column: auto; }
  .form-actions { align-items: stretch; flex-direction: column; }
  .form-actions .primary { width: 100%; min-width: 0; }
  .ledger, .package-card, .access-card { margin-top: 12px; }
  .ledger-heading { align-items: center; }
  .ledger-tools { align-items: stretch; flex-direction: column-reverse; }
  .access-identity { grid-template-columns: 1fr; }
  .credential-row { align-items: flex-start; flex-direction: column; gap: 4px; }
  .lock-editor { align-items: stretch; flex-direction: column; }
  .danger-action { width: 100%; }
  .row-actions { justify-content: flex-start; }
  .login-panel { padding: 28px 22px; }
  .diagnostic-error { grid-template-columns: 1fr; padding: 16px; }
  .diagnostic-facts > div { grid-template-columns: 1fr; gap: 2px; }
}

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

/* ===== 明暗主题 ===== */
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; }
.theme-toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-icon-sun { display: none; }
html[data-theme="dark"] .theme-icon-moon { display: none; }
html[data-theme="dark"] .theme-icon-sun { display: block; }
.login-panel { position: relative; }
.login-theme-toggle { position: absolute; top: 18px; right: 18px; }

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f4f8fc;
  --ink-2: #b8c8da;
  --ink-3: #8ca2b9;
  --glass: rgba(13, 27, 44, 0.82);
  --glass-strong: rgba(18, 35, 56, 0.94);
  --glass-border: rgba(139, 183, 255, 0.2);
  --line: rgba(139, 183, 255, 0.16);
  --success: #62d9a2;
  --success-soft: rgba(75, 209, 144, 0.14);
  --warning: #f4bd62;
  --warning-soft: rgba(244, 189, 98, 0.14);
  --danger: #ff818b;
  --danger-soft: rgba(255, 111, 121, 0.14);
  --focus: rgba(139, 183, 255, 0.55);
  --shadow: 0 22px 52px rgba(0, 0, 0, 0.38);
}
html[data-theme="dark"] body { background: #071323; }
html[data-theme="dark"] body::before { background: radial-gradient(680px 520px at 12% 8%, rgba(47, 115, 237, 0.28), transparent 66%), radial-gradient(700px 620px at 88% 18%, rgba(76, 141, 255, 0.13), transparent 68%), radial-gradient(620px 560px at 78% 88%, rgba(31, 170, 201, 0.12), transparent 68%), linear-gradient(160deg, #040b14, #071323 55%, #0b1b2c); }
html[data-theme="dark"] body::after { background: conic-gradient(from 120deg at 50% 40%, transparent, rgba(76, 141, 255, 0.07), transparent 48%, rgba(75, 209, 144, 0.04), transparent); }
html[data-theme="dark"] .topbar { background: rgba(7, 19, 35, 0.84); border-color: var(--glass-border); }
html[data-theme="dark"] .login-panel,
html[data-theme="dark"] .card { background: var(--glass-strong); border-color: var(--glass-border); box-shadow: var(--shadow); }
html[data-theme="dark"] .verification-side { background: rgba(7, 19, 35, 0.52); border-color: var(--line); }
html[data-theme="dark"] label,
html[data-theme="dark"] legend { color: #d5e1ee; }
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea { color: var(--ink); background: #091727; border-color: #29405b; }
html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus { background: #0d1b2c; }
html[data-theme="dark"] input:disabled,
html[data-theme="dark"] input:read-only:not(.cal-input) { color: var(--ink-2); background: #101d2e; }
html[data-theme="dark"] .quiet { color: var(--ink-2); background: #122338; border-color: #29405b; }
html[data-theme="dark"] .quiet:hover { color: var(--ink); background: #162a42; border-color: #3d5875; }
html[data-theme="dark"] .domain-preview,
html[data-theme="dark"] .host-facts,
html[data-theme="dark"] .fingerprint,
html[data-theme="dark"] .package-block,
html[data-theme="dark"] .update-target { background: rgba(7, 19, 35, 0.56); border-color: #29405b; }
html[data-theme="dark"] .server-glyph { background: #17283d; }
html[data-theme="dark"] .server-glyph span { background: #66809b; }
html[data-theme="dark"] .update-verify,
html[data-theme="dark"] .access-identity > div { background: #0d1b2c; box-shadow: inset 0 0 0 1px #29405b; }
html[data-theme="dark"] .lock-editor { background: #211923; border-color: rgba(255, 129, 139, 0.34); }
html[data-theme="dark"] .lock-editor p { color: #c7d5e3; }
html[data-theme="dark"] .danger-action.unlock { color: #071f16; background: #8ce3ba; }
html[data-theme="dark"] .progress-panel li::before { background: #122338; border-color: #66809b; }
html[data-theme="dark"] .progress-panel li::after { background: #3d5875; }
html[data-theme="dark"] .success-panel > .result-note { color: #a9ebca; background: rgba(75, 209, 144, 0.14); }
html[data-theme="dark"] .text-button { color: #8bb7ff; }
html[data-theme="dark"] .domain-preview.ready output { color: #8bb7ff; }
html[data-theme="dark"] .privacy-note { color: #8ce3ba; background: var(--success-soft); }
html[data-theme="dark"] .status.neutral,
html[data-theme="dark"] .license-action { color: var(--ink-2); background: #172437; }
html[data-theme="dark"] .license-action:hover { background: #20324a; }
html[data-theme="dark"] .license-action.danger { color: var(--danger); background: var(--danger-soft); }
html[data-theme="dark"] table { color: var(--ink); }
html[data-theme="dark"] th { background: rgba(7, 19, 35, 0.62); color: var(--ink-2); }
html[data-theme="dark"] th,
html[data-theme="dark"] td { border-color: rgba(139, 183, 255, 0.15); }
html[data-theme="dark"] tbody tr:hover { background: rgba(76, 141, 255, 0.07); }
html[data-theme="dark"] .cal-pop { color: var(--ink); background: #122338; border-color: #3d5875; box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4); }
html[data-theme="dark"] .calNav { color: #d5e1ee; background: #17283d; border-color: #3d5875; }
html[data-theme="dark"] .calNav:hover { color: #f4f8fc; background: #1a3352; }
html[data-theme="dark"] .calGrid .cd.on { color: #dce7f2; background: #17283d; border-color: #29405b; }
html[data-theme="dark"] .calGrid .cd.on:hover { color: #fff; background: #2f6bf0; }
html[data-theme="dark"] .calGrid .cd.off { color: #657d96; }
html[data-theme="dark"] .diagnostic-error { color: #ffd4d8; background: #21141d; border-color: rgba(255, 129, 139, 0.36); }
html[data-theme="dark"] .diagnostic-content h3 { color: #ffadb4; }
html[data-theme="dark"] .diagnostic-content > p { color: #efb8bd; }
html[data-theme="dark"] .diagnostic-facts { background: #0d1b2c; box-shadow: inset 0 0 0 1px #3f3442; }
html[data-theme="dark"] .diagnostic-facts dt { color: #d8a2a8; }
html[data-theme="dark"] .diagnostic-facts dd { color: #f4d9dc; }
html[data-theme="dark"] .diagnostic-log { color: #efc8cc; background: #0b1625; border-color: #3f3442; }
html[data-theme="dark"] .diagnostic-actions { color: #e7b2b7; }
html[data-theme="dark"] .diagnostic-retry { color: #ffd4d8; background: #2b1a23; border-color: #6b3b45; }
html[data-theme="dark"] .diagnostic-retry:hover { color: #fff; background: #38202a; border-color: #8c4b58; }
.theme-toggle-preview { position: fixed; z-index: 20; top: 18px; right: 18px; width: auto; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--glass-strong); color: var(--ink); box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12); }
html[data-theme="dark"] .theme-toggle-preview { background: #111e31; box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28); }
@media (max-width: 640px) {
  .topbar .theme-toggle [data-theme-label], .login-theme-toggle [data-theme-label], .theme-toggle-preview [data-theme-label] { display: none; }
  .topbar .theme-toggle, .login-theme-toggle, .theme-toggle-preview { width: 44px; padding: 0; }
  .login-theme-toggle { top: 14px; right: 14px; }
  .theme-toggle-preview { top: 12px; right: 12px; }
}

/* 舒适黑夜模式：提高运维表单、账本和诊断区的层级辨识度 */
html[data-theme="dark"] {
  --ink:#f7f9fc; --ink-2:#d5deea; --ink-3:#aebcce;
  --glass:#1a2333; --glass-strong:#1d2736;
  --glass-border:#3b4b61; --line:#344258;
  --success:#6ee7b7; --success-soft:#12372f;
  --warning:#f8d486; --warning-soft:#3c311d;
  --danger:#ffadb5; --danger-soft:#44232b;
  --focus:rgba(110,168,255,.72);
  --shadow:0 20px 50px rgba(2,6,23,.36);
  scrollbar-color:#52657d #172033;
}
html[data-theme="dark"] body { background:#111827; }
html[data-theme="dark"] body::before { background:radial-gradient(720px 520px at 12% 5%,rgba(96,165,250,.12),transparent 68%),radial-gradient(720px 560px at 88% 18%,rgba(94,129,191,.08),transparent 70%),linear-gradient(155deg,#101724,#141d2d 56%,#182334); }
html[data-theme="dark"] body::after { opacity:.26; }
html[data-theme="dark"] ::selection { color:#fff; background:#315f9f; }
html[data-theme="dark"] .topbar { background:rgba(17,24,39,.9); border-color:#3b4b61; }
html[data-theme="dark"] .login-panel,
html[data-theme="dark"] .card { background:#1d2736; border-color:#3b4b61; box-shadow:0 12px 30px rgba(2,6,23,.24); }
html[data-theme="dark"] .verification-side { background:#202b3c; border-color:#344258; }
html[data-theme="dark"] label,
html[data-theme="dark"] legend { color:#d5deea; }
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea { color:#f7f9fc; background:#131d2b; border-color:#3b4b61; }
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color:#8798ac; opacity:1; }
html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus { background:#182231; border-color:#6ea8ff; box-shadow:0 0 0 3px rgba(110,168,255,.3); }
html[data-theme="dark"] button:focus-visible,
html[data-theme="dark"] a:focus-visible,
html[data-theme="dark"] input:focus-visible,
html[data-theme="dark"] select:focus-visible,
html[data-theme="dark"] textarea:focus-visible { outline:3px solid rgba(110,168,255,.72); outline-offset:2px; }
html[data-theme="dark"] input:disabled,
html[data-theme="dark"] input:read-only:not(.cal-input) { color:#aebcce; background:#182231; border-color:#2e3b4e; }
html[data-theme="dark"] .quiet,
html[data-theme="dark"] .license-action,
html[data-theme="dark"] .status.neutral { color:#d5deea; background:#202b3c; border-color:#3b4b61; }
html[data-theme="dark"] .quiet:hover,
html[data-theme="dark"] .license-action:hover { color:#fff; background:#2c3b52; border-color:#52657d; }
html[data-theme="dark"] .domain-preview,
html[data-theme="dark"] .host-facts,
html[data-theme="dark"] .fingerprint,
html[data-theme="dark"] .package-block,
html[data-theme="dark"] .update-target,
html[data-theme="dark"] .update-verify,
html[data-theme="dark"] .access-identity > div { background:#202b3c; border-color:#3b4b61; }
html[data-theme="dark"] .access-identity > div { box-shadow:inset 0 0 0 1px #3b4b61; }
html[data-theme="dark"] .server-glyph,
html[data-theme="dark"] .progress-panel li::before { background:#273347; border-color:#52657d; }
html[data-theme="dark"] .progress-panel li::after { background:#52657d; }
html[data-theme="dark"] .text-button,
html[data-theme="dark"] .domain-preview.ready output { color:#9bc2ff; }
html[data-theme="dark"] .privacy-note,
html[data-theme="dark"] .success-panel > .result-note { color:#6ee7b7; background:#12372f; }
html[data-theme="dark"] .lock-editor { background:#34222a; border-color:#70404b; }
html[data-theme="dark"] .lock-editor p { color:#d5deea; }
html[data-theme="dark"] .license-action.danger { color:#ffadb5; background:#44232b; border-color:#70404b; }
html[data-theme="dark"] th { color:#d5deea; background:#182231; }
html[data-theme="dark"] th,
html[data-theme="dark"] td { border-color:#344258; }
html[data-theme="dark"] tbody tr:hover { background:#263348; }
html[data-theme="dark"] .cal-pop { color:#f7f9fc; background:#243044; border-color:#52657d; box-shadow:0 18px 42px rgba(2,6,23,.42); }
html[data-theme="dark"] .calNav,
html[data-theme="dark"] .calGrid .cd.on { color:#e3e9f2; background:#1a2536; border-color:#3b4b61; }
html[data-theme="dark"] .calNav:hover,
html[data-theme="dark"] .calGrid .cd.on:hover { color:#fff; background:#2c3b52; }
html[data-theme="dark"] .calGrid .cd.off { color:#8798ac; }
html[data-theme="dark"] .diagnostic-error { color:#ffd9dd; background:#34222a; border-color:#70404b; }
html[data-theme="dark"] .diagnostic-content h3 { color:#ffbcc3; }
html[data-theme="dark"] .diagnostic-content > p,
html[data-theme="dark"] .diagnostic-actions { color:#e8c4c8; }
html[data-theme="dark"] .diagnostic-facts { background:#202b3c; border-color:#5c3d47; box-shadow:inset 0 0 0 1px #5c3d47; }
html[data-theme="dark"] .diagnostic-facts dt { color:#dcaeb3; }
html[data-theme="dark"] .diagnostic-facts dd { color:#f7dfe2; }
html[data-theme="dark"] .diagnostic-log { color:#efcdd1; background:#131821; border-color:#5c3d47; }
html[data-theme="dark"] .diagnostic-retry { color:#ffd9dd; background:#44232b; border-color:#70404b; }
html[data-theme="dark"] .diagnostic-retry:hover { color:#fff; background:#593039; border-color:#92525f; }
html[data-theme="dark"] .theme-toggle-preview { color:#d5deea; background:#202b3c; border-color:#3b4b61; box-shadow:0 12px 30px rgba(2,6,23,.28); }

.listSelect { display: block; min-width: 0; position: relative; }
.listSelect > select { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.listSelectButton { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .88); color: var(--ink); text-align: left; cursor: pointer; }
.listSelectButton::after { content: ''; flex: 0 0 9px; width: 9px; height: 9px; margin: -4px 5px 0 0; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; color: var(--ink-2); transform: rotate(45deg); }
.listSelectButton:hover { border-color: var(--primary); }
.listSelectButton:focus-visible, .listSelectPanel button:focus-visible, .listSelectPanel input:focus-visible { outline: 2px solid var(--primary-d); outline-offset: 2px; }
.listSelectButton:disabled { opacity: .55; cursor: not-allowed; }
.listSelectButton[aria-invalid="true"] { border-color: #c33c45; }
.listSelectError { display: block; margin-top: 4px; color: #c33c45; font-size: 12px; }
.listSelectError[hidden] { display: none; }
.listSelectPanel { position: fixed; z-index: 10000; display: grid; gap: 5px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 18px 48px rgba(40, 59, 100, .2); }
.listSelectPanel[hidden] { display: none; }
.listSelectPanel input { width: 100%; min-height: 36px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
.listSelectOptions { display: grid; gap: 2px; overflow: auto; overscroll-behavior: contain; max-height: 280px; }
.listSelectOptions button { width: 100%; min-height: 36px; padding: 7px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.listSelectOptions button:hover, .listSelectOptions button[aria-pressed="true"] { background: rgba(79, 140, 255, .13); color: var(--primary-d); }
.audit-filters .listSelect { width: 130px; }
@media (max-width: 640px) { .audit-filters .listSelect { width: 100%; } }
html[data-theme="dark"] .listSelectButton, html[data-theme="dark"] .listSelectPanel, html[data-theme="dark"] .listSelectPanel input { background: #182231; color: #f2f6ff; border-color: rgba(179, 196, 222, .25); }
html[data-theme="dark"] .listSelectOptions button { color: #f2f6ff; }
html[data-theme="dark"] .listSelectOptions button:hover, html[data-theme="dark"] .listSelectOptions button[aria-pressed="true"] { background: #24446b; color: #fff; }

/* Match the current console's quiet cards, blue actions, and system dark mode. */
:root {
  --primary: #1f6feb;
  --primary-d: #1759c7;
  --ink: #15181e;
  --ink-2: #4b5261;
  --ink-3: #7b8292;
  --glass: #fff;
  --glass-strong: #fff;
  --glass-border: #e4e7ec;
  --line: #e4e7ec;
  --focus: rgba(31, 111, 235, .2);
  --shadow: 0 3px 16px rgba(20, 32, 55, .055);
}
body { background: #f3f4f6; }
body::before, body::after { display: none; }
.topbar { background: #fff; backdrop-filter: none; border-color: var(--line); }
.login-panel, .card { border-radius: 14px; backdrop-filter: none; box-shadow: var(--shadow); }
.verification-side { background: #f8fafc; }
.brand-mark, .primary { background: #1f6feb; box-shadow: none; }
.primary:hover:not(:disabled) { background: #1759c7; box-shadow: 0 4px 12px rgba(31, 111, 235, .18); transform: none; }
.quiet, .license-action { background: #fff; border: 1px solid var(--line); }
.quiet:hover, .license-action:hover { background: #f7f9fc; border-color: #b9c3d3; }
input, .listSelectButton { background: #fff; border-color: #d5dbe5; }
.ledger-filter { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.ledger-filter label { flex: none; }
.ledger-filter input { width: min(340px, 100%); }
.ledger-filter span { color: var(--ink-2); font-size: 12px; white-space: nowrap; }
.service-state { color: var(--ink-2); }
.service-state .state-dot { background: #9ba5b4; box-shadow: none; }
.service-state.unavailable { color: var(--danger); }
.service-state.unavailable .state-dot { background: var(--danger); }
html[data-theme="dark"] { --glass: #1a202c; --glass-strong: #1a202c; --glass-border: #303846; --line: #303846; --shadow: 0 3px 16px rgba(0, 0, 0, .16); }
html[data-theme="dark"] body { background: #10131a; }
html[data-theme="dark"] body::before, html[data-theme="dark"] body::after { display: none; }
html[data-theme="dark"] .topbar { background: #1a202c; border-color: #303846; }
html[data-theme="dark"] .login-panel, html[data-theme="dark"] .card { background: #1a202c; border-color: #303846; box-shadow: var(--shadow); }
html[data-theme="dark"] .verification-side { background: #171d27; }
html[data-theme="dark"] .primary, html[data-theme="dark"] .brand-mark { background: #1f6feb; box-shadow: none; }
html[data-theme="dark"] .ledger-filter span { color: #b8c8da; }
html[data-theme="dark"] .service-state { color: #b8c8da; }
html[data-theme="dark"] .service-state.unavailable { color: #ffadb5; }
@media (max-width: 640px) {
  .topbar { gap: 8px; }
  .topbar-actions { gap: 6px; }
  .brand-lockup p { display: none; }
  .ledger-heading { align-items: stretch; flex-direction: column; gap: 12px; }
  .ledger-tools { flex-direction: row; flex-wrap: wrap; }
  .ledger-filter { align-items: stretch; flex-direction: column; gap: 6px; }
  .ledger-filter input { width: 100%; }
  .table-wrap { overflow: visible; }
  #licenseTable, #licenseTable tbody, #licenseTable tr, #licenseTable td { display: block; width: 100%; }
  #licenseTable thead { display: none; }
  #licenseTable tr { padding: 12px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 10px; }
  #licenseTable td { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border: 0; text-align: right; overflow-wrap: anywhere; }
  #licenseTable td:first-child { display: block; text-align: left; border-bottom: 1px solid var(--line); padding-bottom: 9px; margin-bottom: 5px; }
  #licenseTable td:nth-child(2)::before { content: "状态"; }
  #licenseTable td:nth-child(3)::before { content: "到期"; }
  #licenseTable td:nth-child(4)::before { content: "设备"; }
  #licenseTable td:nth-child(5)::before { content: "服务器"; }
  #licenseTable td:nth-child(6)::before { content: "最近连接"; }
  #licenseTable td::before { flex: none; color: var(--ink-2); }
  #licenseTable td:last-child { padding-top: 10px; }
  .row-actions { flex-wrap: wrap; justify-content: flex-end; }
}


/* ==========================================================================
   豆薯 UI v3 统一层（2026-10 前端候选，仅视觉）
   与控制台 v2 令牌对齐：去掉持续动画的极光背景与毛玻璃，按钮 / 输入 / 下拉 / 卡片同控制台一致。
   ========================================================================== */
:root {
  --primary: #1f6feb; --primary-d: #195fd0;
  --ink: #15181e; --ink-2: #4b5261; --ink-3: #7b8292;
  --glass: #f8f9fb; --glass-strong: #ffffff; --glass-border: #e4e7ec; --line: #e4e7ec;
  --success: #16803c; --success-soft: #e6f5ec;
  --warning: #b45309; --warning-soft: #fff3df;
  --danger: #c9302c; --danger-soft: #fdecec;
  --focus: rgba(31, 111, 235, .28);
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
  --yb-bg: #f3f4f6; --yb-surface-2: #f8f9fb; --yb-surface-3: #eef0f4; --yb-border-strong: #cfd4dc; --yb-brand-soft: #eaf2fe; --yb-brand-text: #175bc6;
  --yb-ring: 0 0 0 3px rgba(31, 111, 235, .28);
  --yb-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --yb-mono: ui-monospace, "SF Mono", Consolas, "Cascadia Mono", Menlo, monospace;
  --yb-chev: url("data:image/svg+xml,%3Csvg xmlns='http:%2F%2Fwww.w3.org%2F2000%2Fsvg' width='18' height='18' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='m4.5 7.5 5.5 5 5.5-5' stroke='%237b8292' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  scrollbar-color: color-mix(in srgb, var(--ink-3) 42%, transparent) transparent;
}
html[data-theme="dark"] {
  --primary: #4d8dff; --primary-d: #6b9fff;
  --ink: #e9ebf0; --ink-2: #a9b0be; --ink-3: #7e8697;
  --glass: #1b1f27; --glass-strong: #171b24; --glass-border: #282d38; --line: #282d38;
  --success: #3fbf6f; --success-soft: #13291d;
  --warning: #e0a13a; --warning-soft: #2e2413;
  --danger: #f0625d; --danger-soft: #33191a;
  --focus: rgba(77, 141, 255, .4);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  --yb-bg: #10131a; --yb-surface-2: #1b1f27; --yb-surface-3: #232833; --yb-border-strong: #363d4b; --yb-brand-soft: #172640; --yb-brand-text: #8fb6ff;
  --yb-ring: 0 0 0 3px rgba(77, 141, 255, .4);
  --yb-chev: url("data:image/svg+xml,%3Csvg xmlns='http:%2F%2Fwww.w3.org%2F2000%2Fsvg' width='18' height='18' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='m4.5 7.5 5.5 5 5.5-5' stroke='%237e8697' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  scrollbar-color: color-mix(in srgb, var(--ink-3) 42%, transparent) transparent;
}
body, html[data-theme="dark"] body { font: 14px/1.55 var(--yb-font); background: var(--yb-bg); -webkit-font-smoothing: antialiased; }
body::before, body::after, html[data-theme="dark"] body::before, html[data-theme="dark"] body::after { content: none; display: none; animation: none; }
::selection, html[data-theme="dark"] ::selection { color: var(--ink); background: color-mix(in srgb, var(--primary) 24%, transparent); }
h1, h2, h3 { text-wrap: balance; }
code, .fingerprint, .license-id, .domain-preview output, .file-name { font-family: var(--yb-mono); }

/* 品牌：沿用控制台 Logo 家族 */
.brand-mark, .brand-mark.small { width: 44px; height: 44px; border-radius: 0; background: none; box-shadow: none; color: inherit; font-size: 0; }
.brand-mark.small { width: 34px; height: 34px; }
.brand-mark svg { width: 100%; height: 100%; display: block; }

/* 表面：实色卡片，不使用 backdrop-filter */
.login-panel, .card, html[data-theme="dark"] .login-panel, html[data-theme="dark"] .card {
  background: var(--glass-strong); border: 1px solid var(--glass-border); border-radius: 16px; box-shadow: var(--shadow);
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
.login-panel { border-radius: 16px; box-shadow: 0 6px 16px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04); }
.topbar, html[data-theme="dark"] .topbar { height: 60px; background: color-mix(in srgb, var(--glass-strong) 92%, transparent); border-bottom: 1px solid var(--glass-border); -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px); }
.brand-lockup h1 { font-size: 15px; font-weight: 700; }
.verification-side, html[data-theme="dark"] .verification-side { background: var(--yb-surface-2); border-color: var(--line); }
.section-heading h2, .aside-heading h2 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.login-panel h1 { font-size: 23px; font-weight: 700; margin-top: 20px; }

/* 文字 */
label, legend, html[data-theme="dark"] label, html[data-theme="dark"] legend { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
fieldset > legend { font-size: 12px; letter-spacing: .04em; color: var(--ink-3); }

/* 输入与下拉 */
input, select, textarea, html[data-theme="dark"] input, html[data-theme="dark"] select, html[data-theme="dark"] textarea {
  min-height: 40px; border: 1px solid var(--yb-border-strong); border-radius: 8px; padding: 8px 12px;
  color: var(--ink); background-color: var(--glass-strong); font: inherit; font-size: 14px;
}
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--ink-3) 60%, var(--yb-border-strong)); }
input:focus, select:focus, textarea:focus, html[data-theme="dark"] input:focus, html[data-theme="dark"] select:focus, html[data-theme="dark"] textarea:focus {
  outline: 0; border-color: var(--primary); box-shadow: var(--yb-ring); background-color: var(--glass-strong);
}
input:disabled, input:read-only:not(.cal-input), html[data-theme="dark"] input:disabled, html[data-theme="dark"] input:read-only:not(.cal-input) { color: var(--ink-2); background-color: var(--yb-surface-2); border-color: var(--glass-border); }
input::placeholder, textarea::placeholder, html[data-theme="dark"] input::placeholder { color: var(--ink-3); opacity: 1; }
select, html[data-theme="dark"] select { -webkit-appearance: none; appearance: none; padding-right: 40px; cursor: pointer; background-image: var(--yb-chev); background-repeat: no-repeat; background-position: right 12px center; }
input[type=file] { min-height: 0; padding: 6px; }
input[type=checkbox], input[type=radio] { min-height: 0; padding: 0; accent-color: var(--primary); width: 16px; height: 16px; }

/* 按钮：主按钮实色，次按钮有边框，危险按钮语义保留 */
.primary, .quiet, .text-button, .license-action { min-height: 40px; border-radius: 8px; font-weight: 600; font-size: 13.5px; }
.primary, html[data-theme="dark"] .primary { color: #fff; background: var(--primary); border: 1px solid var(--primary); box-shadow: none; }
.primary:hover:not(:disabled) { background: var(--primary-d); border-color: var(--primary-d); box-shadow: none; transform: none; }
.primary:disabled { opacity: 1; color: var(--ink-3); background: var(--yb-surface-3); border-color: var(--yb-surface-3); }
.quiet, html[data-theme="dark"] .quiet { color: var(--ink); background: var(--glass-strong); border: 1px solid var(--yb-border-strong); font-weight: 500; }
.quiet:hover, html[data-theme="dark"] .quiet:hover { color: var(--ink); background: var(--yb-surface-2); border-color: var(--yb-border-strong); }
.topbar .quiet { min-height: 34px; padding: 0 12px; }
.license-action, html[data-theme="dark"] .license-action { min-height: 30px; padding: 0 10px; font-size: 12.5px; font-weight: 500; color: var(--ink); background: var(--glass-strong); border: 1px solid var(--yb-border-strong); }
.license-action:hover, html[data-theme="dark"] .license-action:hover { background: var(--yb-surface-2); }
.license-action.danger, html[data-theme="dark"] .license-action.danger { color: var(--danger); background: var(--glass-strong); border-color: var(--yb-border-strong); }
.license-action.danger:hover { background: var(--danger-soft); }
button:focus-visible, input:focus-visible, select:focus-visible { outline: none; box-shadow: var(--yb-ring); }
.text-button, html[data-theme="dark"] .text-button { color: var(--yb-brand-text); }

/* 状态胶囊 */
.privacy-note, html[data-theme="dark"] .privacy-note { color: var(--success); background: var(--success-soft); border-radius: 6px; padding: 4px 9px; font-weight: 600; }
.service-state { font-weight: 600; font-size: 12.5px; }

/* 域名预览 / 指纹 / 包信息：统一次级面板 */
.domain-preview, .host-facts, .fingerprint, .package-block, .update-target,
html[data-theme="dark"] .domain-preview, html[data-theme="dark"] .host-facts, html[data-theme="dark"] .fingerprint, html[data-theme="dark"] .package-block, html[data-theme="dark"] .update-target {
  background: var(--yb-surface-2); border-color: var(--line); border-radius: 8px;
}
.domain-preview.ready output, html[data-theme="dark"] .domain-preview.ready output { color: var(--yb-brand-text); }

/* 日历：与控制台同款 */
.cal-pop, html[data-theme="dark"] .cal-pop { width: 264px; padding: 12px; border-radius: 12px; color: var(--ink); background: var(--glass-strong); border: 1px solid var(--glass-border); box-shadow: 0 20px 48px rgba(16, 24, 40, .18), 0 6px 12px rgba(16, 24, 40, .06); -webkit-backdrop-filter: none; backdrop-filter: none; }
.calNav, html[data-theme="dark"] .calNav { width: 28px; height: 28px; border: 0; border-radius: 6px; background: transparent; color: var(--ink-2); }
.calNav:hover, html[data-theme="dark"] .calNav:hover { background: var(--yb-surface-3); color: var(--ink); }
.calGrid .cd, .calGrid .cd.on, html[data-theme="dark"] .calGrid .cd.on { border: 0; border-radius: 6px; background: transparent; color: var(--ink); }
.calGrid .cd.on:hover, html[data-theme="dark"] .calGrid .cd.on:hover { background: var(--yb-brand-soft); color: var(--yb-brand-text); transform: none; }
.calGrid .cd.today { box-shadow: inset 0 0 0 2px var(--primary); background: var(--yb-brand-soft); }
.calGrid .cd.sel { background: var(--primary) !important; color: #fff !important; }

/* 表格 */
th, html[data-theme="dark"] th { background: var(--yb-surface-2); color: var(--ink-3); font-size: 12px; font-weight: 600; }
th, td, html[data-theme="dark"] th, html[data-theme="dark"] td { border-color: var(--line); }
tbody tr:hover, html[data-theme="dark"] tbody tr:hover { background: var(--yb-surface-2); }
.toast { border-radius: 12px; }
.theme-toggle-preview, html[data-theme="dark"] .theme-toggle-preview { border-radius: 8px; background: var(--glass-strong); border-color: var(--yb-border-strong); color: var(--ink); box-shadow: none; }
html[data-theme="dark"] .primary:disabled { opacity: 1; color: var(--ink-3); background: var(--yb-surface-3); border-color: var(--yb-surface-3); }
.quiet.danger-text, html[data-theme="dark"] .quiet.danger-text { color: var(--danger); }
.quiet.danger-text:hover, html[data-theme="dark"] .quiet.danger-text:hover { color: var(--danger); background: var(--danger-soft); }
.package-block, html[data-theme="dark"] .package-block { background: transparent; border-radius: 0; }

/* ==========================================================================
   豆薯 UI v4 层（2026-10 前端候选，仅视觉）：品牌头图、分层阴影、主按钮渐变与动效，
   与控制台 / 交单 / 提现一致。回退：删除本注释之后的内容。
   ========================================================================== */
:root {
  --ink: #111827; --ink-2: #475063; --ink-3: #7a8294;
  --yb-bg: #f4f5f7; --yb-surface-2: #f8f9fa; --yb-surface-3: #eef0f3; --glass-border: #e3e6eb; --line: #e3e6eb; --yb-border-strong: #d0d5dd;
  --yb-grad: linear-gradient(135deg, #2b7bff 0%, #1f6feb 45%, #4f5fe0 100%);
  --yb-sh-sm: 0 1px 2px rgba(17, 24, 39, .04);
  --yb-sh-md: 0 2px 4px rgba(17, 24, 39, .04), 0 10px 24px -6px rgba(17, 24, 39, .12);
  --yb-sh-lg: 0 4px 10px rgba(17, 24, 39, .05), 0 24px 56px -12px rgba(17, 24, 39, .24);
  --yb-sh-brand: 0 1px 2px rgba(31, 111, 235, .22), 0 4px 10px -4px rgba(31, 111, 235, .4);
  --yb-hl: inset 0 1px 0 rgba(255, 255, 255, .8);
  --yb-ring: 0 0 0 3px rgba(31, 111, 235, .22), 0 0 0 1px rgba(31, 111, 235, .55);
  --yb-ease: cubic-bezier(.22, 1, .36, 1); --yb-spring: cubic-bezier(.34, 1.4, .64, 1);
  --yb-hero:
    radial-gradient(620px 400px at 8% -12%, rgba(77, 141, 255, .42), transparent 70%),
    radial-gradient(560px 440px at 108% 112%, rgba(139, 108, 255, .36), transparent 70%),
    radial-gradient(420px 260px at 72% -6%, rgba(56, 189, 248, .14), transparent 70%),
    linear-gradient(165deg, #0e1428 0%, #121a36 60%, #19173a 100%);
  --yb-hero-grid: radial-gradient(rgba(255, 255, 255, .085) 1px, transparent 1.2px) 0 0 / 20px 20px;
}
html[data-theme="dark"] {
  --ink: #eceef3; --ink-2: #a6aebd; --ink-3: #7a8293;
  --yb-bg: #0c0f15; --glass-strong: #141820; --glass: #181c25; --yb-surface-2: #181c25; --yb-surface-3: #20252f; --glass-border: #252b36; --line: #252b36; --yb-border-strong: #333a47;
  --yb-grad: linear-gradient(135deg, #4f92ff 0%, #3f7ff5 50%, #5f63e6 100%);
  --yb-sh-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --yb-sh-md: 0 2px 6px rgba(0, 0, 0, .35), 0 14px 30px -8px rgba(0, 0, 0, .6);
  --yb-sh-lg: 0 6px 14px rgba(0, 0, 0, .4), 0 30px 70px -14px rgba(0, 0, 0, .75);
  --yb-sh-brand: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 12px -5px rgba(77, 141, 255, .45);
  --yb-hl: inset 0 1px 0 rgba(255, 255, 255, .045);
  --yb-ring: 0 0 0 3px rgba(77, 141, 255, .3), 0 0 0 1px rgba(77, 141, 255, .7);
}

/* 登录：整屏品牌头图，面板浮起 */
.login-shell { position: relative; isolation: isolate; background: var(--yb-hero); }
.login-shell::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--yb-hero-grid); -webkit-mask-image: radial-gradient(80% 70% at 50% 40%, #000 10%, transparent 80%); mask-image: radial-gradient(80% 70% at 50% 40%, #000 10%, transparent 80%); }
.login-panel, html[data-theme="dark"] .login-panel { border-radius: 20px; box-shadow: var(--yb-sh-lg), var(--yb-hl); animation: ybPop 600ms var(--yb-spring) both; }
.login-panel .brand-mark { animation: ybFade 600ms var(--yb-ease) 200ms both; }
.login-panel h1 { letter-spacing: -.02em; }
.theme-toggle-preview { border-radius: 999px !important; }

/* 应用外壳 */
.topbar, html[data-theme="dark"] .topbar { background: color-mix(in srgb, var(--glass-strong) 78%, transparent); -webkit-backdrop-filter: saturate(1.6) blur(16px); backdrop-filter: saturate(1.6) blur(16px); border-bottom-color: color-mix(in srgb, var(--glass-border) 70%, transparent); }
.brand-mark svg { transition: transform 320ms var(--yb-spring); }
.brand-lockup:hover .brand-mark svg { transform: rotate(-8deg) scale(1.06); }
.card, html[data-theme="dark"] .card { border-radius: 14px; box-shadow: var(--yb-sh-sm), var(--yb-hl); }
.content > * { animation: ybFadeUp 520ms var(--yb-ease) both; }
.content > *:nth-child(2) { animation-delay: 60ms; } .content > *:nth-child(3) { animation-delay: 120ms; } .content > *:nth-child(n+4) { animation-delay: 180ms; }
.section-heading h2, .aside-heading h2 { display: flex; align-items: center; gap: 8px; }
.section-heading h2::before, .aside-heading h2::before { content: ""; width: 3px; height: 14px; border-radius: 2px; background: var(--yb-grad); flex: none; }

/* 控件 */
input, select, textarea { border-radius: 9px; box-shadow: var(--yb-sh-sm); transition: border-color 200ms var(--yb-ease), box-shadow 200ms var(--yb-ease), background-color 200ms; }
.primary, .quiet, .text-button, .license-action { border-radius: 9px; transition: background-color 200ms var(--yb-ease), border-color 200ms var(--yb-ease), box-shadow 200ms var(--yb-ease), transform 120ms var(--yb-ease), filter 200ms; }
.primary:not(:disabled), html[data-theme="dark"] .primary:not(:disabled) { background: var(--yb-grad); border-color: transparent; box-shadow: var(--yb-sh-brand), inset 0 1px 0 rgba(255, 255, 255, .18); }
.primary:hover:not(:disabled) { background: var(--yb-grad); border-color: transparent; filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 1px 2px rgba(31, 111, 235, .25), 0 8px 18px -8px rgba(31, 111, 235, .55), inset 0 1px 0 rgba(255, 255, 255, .2); }
.primary:active:not(:disabled), .quiet:active:not(:disabled), .license-action:active:not(:disabled) { transform: scale(.97); }
.quiet, .license-action { box-shadow: var(--yb-sh-sm); }

/* 状态 / 表格 / 浮层 */
.privacy-note { border-radius: 999px; }
.state-dot { box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 20%, transparent); }
tbody tr { transition: background-color 120ms linear; }
tbody tr:hover, html[data-theme="dark"] tbody tr:hover { background: color-mix(in srgb, var(--primary) 4%, var(--glass-strong)); }
.cal-pop:not([hidden]) { animation: ybDrop 200ms var(--yb-ease) both; transform-origin: top center; }
.toast { box-shadow: var(--yb-sh-lg); transition: transform 360ms var(--yb-spring), opacity 200ms var(--yb-ease); }
dialog[open] { animation: ybPop 360ms var(--yb-spring) both; }
dialog::backdrop { backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.success-mark { animation: ybPop 520ms var(--yb-spring) both; }
.progress-panel, .success-panel { animation: ybFadeUp 420ms var(--yb-ease) both; }

@keyframes ybFadeUp { from { opacity: 0; transform: translateY(12px); } }
@keyframes ybFade { from { opacity: 0; } }
@keyframes ybPop { from { opacity: 0; transform: translateY(14px) scale(.97); } }
@keyframes ybDrop { from { opacity: 0; transform: translateY(-6px) scale(.97); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important; }
}
@media (forced-colors: active) { .login-shell::before { display: none; } }

/* ==========================================================================
   豆薯 UI v5（2026-10-12 候选，仅视觉）：应用顶栏改为与控制台侧栏同源的深蓝品牌栏。
   回退：删除本注释之后的内容。
   ========================================================================== */
.topbar, html[data-theme="dark"] .topbar {
  background:
    radial-gradient(420px 200px at 0% 0%, rgba(77, 141, 255, .30), transparent 70%),
    radial-gradient(360px 220px at 100% 100%, rgba(139, 108, 255, .22), transparent 70%),
    linear-gradient(180deg, #111934, #131331);
  border-bottom: 0; box-shadow: 0 1px 0 rgba(255, 255, 255, .08), 0 10px 30px -18px rgba(15, 22, 48, .8);
  -webkit-backdrop-filter: none; backdrop-filter: none; color: #f4f6fb;
}
.topbar .brand-lockup h1 { color: #f4f6fb; }
.topbar .brand-lockup p, .topbar .brand-lockup small { color: rgba(200, 210, 232, .6); }
.topbar .quiet, html[data-theme="dark"] .topbar .quiet, .topbar .theme-toggle-preview { color: rgba(226, 232, 245, .82); background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .1); box-shadow: none; }
.topbar .quiet:hover, html[data-theme="dark"] .topbar .quiet:hover { color: #fff; background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .18); }
.topbar .service-state { color: #9ae6b8; }
.card, html[data-theme="dark"] .card { border-radius: 16px; }
.section-heading h2, .aside-heading h2 { font-size: 18px; }

/* ==========================================================================
   豆薯 UI v6（2026-10-13 候选，仅视觉）：授权中心光学对齐。回退：删除本注释之后的内容。
   ========================================================================== */
/* 顶栏：状态文字做成与按钮同高的轻量胶囊，四个元素同高同中线 */
.topbar .service-state { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 9px; background: rgba(63, 191, 111, .1); box-shadow: inset 0 0 0 1px rgba(63, 191, 111, .2); }
/* 推送更新：去掉只盖住第一行的灰底条，和左栏表单同一层级 */
.update-target, html[data-theme="dark"] .update-target { background: transparent; border: 0; padding: 0; }
/* 远程管理：右侧检测结果出现前，用同尺寸占位填住右栏，避免左重右空、结果出现时整块跳动 */
.access-grid:has(> .access-actions[hidden])::after { content: "检测服务器并核对指纹后，主机信息与可执行操作显示在这里"; display: grid; place-items: center; min-height: 220px; padding: 24px; border: 1px dashed var(--line); border-radius: 12px; color: var(--ink-3); font-size: 12.5px; text-align: center; }
/* 授权账本：搜索框与标签同一中线 */
.ledger-search, .ledger-tools { align-items: center; }
