/* 域名投资组合看板 — Architectural Swiss Financial Ledger
 * 双主题：Daylight Alabaster（默认亮色纸感） / Obsidian Ink（可选深墨）
 * 严格遵循 DESIGN.md：单一克制主色 Ledger Cobalt、tabular-nums 数字对齐、零霓虹紫蓝渐变
 */

:root {
  --bg: #F5F6F3;
  --surface: #FFFFFF;
  --surface-subtle: #F9FAF8;
  --surface-hover: #F2F4F7;
  --surface-active: #EDF2FF;
  --header-bg: rgba(255, 255, 255, 0.9);
  --border: #E5E7EB;
  --border-strong: #D1D5DB;
  --text: #14171A;
  --text-secondary: #4B5563;
  --muted: #6B7280;

  /* Single restrained brand accent */
  --accent: #1D4ED8;
  --accent-hover: #1E40AF;
  --accent-soft: #EFF6FF;
  --accent-border: #BFDBFE;
  --accent-ink: #FFFFFF;

  /* Semantic status palette (expiry & price verification only) */
  --ok: #15803D;
  --ok-soft: #ECFDF3;
  --ok-border: #BBF7D0;

  --warn: #B45309;
  --warn-soft: #FFFBEB;
  --warn-border: #FDE68A;

  --danger: #B91C1C;
  --danger-soft: #FEF2F2;
  --danger-border: #FECACA;

  --ref: #334155;
  --ref-soft: #F1F5F9;
  --ref-border: #CBD5E1;

  --member: #0F766E;
  --member-soft: #F0FDFA;
  --member-border: #99F6E4;

  --shadow-sm: 0 1px 2px rgba(20, 23, 26, 0.04);
  --shadow-md: 0 8px 24px rgba(20, 23, 26, 0.08);
  --shadow-lg: 0 20px 52px rgba(20, 23, 26, 0.16);
  --overlay: rgba(20, 23, 26, 0.42);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  --bg: #111316;
  --surface: #181B20;
  --surface-subtle: #1D2128;
  --surface-hover: #222730;
  --surface-active: rgba(91, 141, 239, 0.14);
  --header-bg: rgba(24, 27, 32, 0.9);
  --border: #282D36;
  --border-strong: #373E4A;
  --text: #EDEFF2;
  --text-secondary: #B4BCC8;
  --muted: #8B95A5;

  --accent: #5B8DEF;
  --accent-hover: #74A0F4;
  --accent-soft: rgba(91, 141, 239, 0.14);
  --accent-border: rgba(91, 141, 239, 0.36);
  --accent-ink: #0F141C;

  --ok: #4ADE80;
  --ok-soft: rgba(74, 222, 128, 0.12);
  --ok-border: rgba(74, 222, 128, 0.28);

  --warn: #FBBF24;
  --warn-soft: rgba(251, 191, 36, 0.12);
  --warn-border: rgba(251, 191, 36, 0.32);

  --danger: #F87171;
  --danger-soft: rgba(248, 113, 113, 0.13);
  --danger-border: rgba(248, 113, 113, 0.32);

  --ref: #CBD5E1;
  --ref-soft: rgba(148, 163, 184, 0.12);
  --ref-border: rgba(148, 163, 184, 0.28);

  --member: #2DD4BF;
  --member-soft: rgba(45, 212, 191, 0.12);
  --member-border: rgba(45, 212, 191, 0.3);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.24);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.36);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.56);
  --overlay: rgba(8, 10, 14, 0.68);
}

[hidden] {
  display: none !important;
}

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

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

[data-theme="dark"] html,
html[data-theme="dark"] {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100dvh;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background-color: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
  color: var(--text);
}

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

/* ---------- 顶部单行导航 ---------- */

.page-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 clamp(16px, 2.5vw, 32px);
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  background-color: var(--text);
  color: var(--surface);
}

.brand-mark svg {
  width: 19px;
  height: 19px;
}

.brand-text {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.page-header h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  white-space: nowrap;
}

.brand-en {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  background-color: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 5px 10px;
  white-space: nowrap;
}

/* ---------- 按钮系统（扁平克制，无霓虹渐变） ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 13px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  color: var(--text);
  background-color: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease), color 160ms var(--ease), transform 140ms var(--ease);
}

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

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

.btn-ghost {
  background-color: transparent;
  border-color: var(--border-strong);
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background-color: var(--surface-hover);
  color: var(--text);
}

.btn-primary {
  background-color: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--accent-ink);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 12.5px;
}

.btn-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.btn-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  background-color: rgba(255, 255, 255, 0.22);
  color: inherit;
}

.btn-theme .icon-sun {
  display: none;
}

[data-theme="dark"] .btn-theme .icon-sun {
  display: block;
}

[data-theme="dark"] .btn-theme .icon-moon {
  display: none;
}

/* ---------- 主体容器 ---------- */

.page-main {
  max-width: 1380px;
  margin: 0 auto;
  padding: 20px clamp(16px, 2.5vw, 32px) 48px;
}

.notice {
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--warn-border);
  background-color: var(--warn-soft);
  color: var(--warn);
  font-size: 13.5px;
  line-height: 1.55;
}

/* ---------- 非对称资产总览账本 ---------- */

.overview-ledger {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}

.ledger-command,
.ledger-dist {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.ledger-command {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.command-top {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  border-bottom: 1px solid var(--border);
}

.cost-block {
  padding: 20px 22px;
  border-right: 1px solid var(--border);
  min-width: 0;
}

.metric-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.cost-primary {
  margin-top: 8px;
  font-size: clamp(1.625rem, 2.3vw, 2rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.cost-primary-meta {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
}

.cost-breakdown {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}

.cost-item {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.cost-item-val {
  font-weight: 600;
  color: var(--text);
}

.cost-item-cnt {
  color: var(--muted);
  font-size: 12.5px;
}

.metric-footnote {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
}

.holdings-block {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.holding-stat {
  padding: 20px 18px;
  min-width: 0;
}

.holding-stat:first-child {
  border-right: 1px solid var(--border);
}

.metric-value {
  margin-top: 8px;
  font-size: clamp(1.5rem, 2vw, 1.85rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.metric-sub {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

.metric-sub + .metric-sub {
  margin-top: 2px;
}

/* 下部 3 格细线状态条（无嵌套卡片） */

.command-strip {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 0.9fr) minmax(0, 1.45fr);
}

.strip-cell {
  padding: 15px 18px;
  text-align: left;
  background: transparent;
  border: none;
  border-right: 1px solid var(--border);
  font-family: inherit;
  color: inherit;
  min-width: 0;
}

.strip-cell:last-child {
  border-right: none;
}

button.strip-cell {
  cursor: pointer;
  transition: background-color 150ms var(--ease);
}

button.strip-cell:hover {
  background-color: var(--surface-subtle);
}

.strip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.strip-action {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  opacity: 0;
  transition: opacity 150ms var(--ease);
}

button.strip-cell:hover .strip-action,
button.strip-cell:focus-visible .strip-action {
  opacity: 1;
}

.strip-num-row {
  margin-top: 6px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.strip-value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.strip-danger .strip-value {
  color: var(--danger);
}

.strip-warn .strip-value {
  color: var(--warn);
}

.strip-sub {
  font-size: 12.5px;
  color: var(--muted);
}

.card-meter {
  margin-top: 9px;
  height: 4px;
  border-radius: 999px;
  background-color: var(--surface-hover);
  overflow: hidden;
}

.meter-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width 320ms var(--ease);
}

.fill-danger {
  background-color: var(--danger);
}

.fill-warn {
  background-color: var(--warn);
}

.audit-bar {
  margin-top: 10px;
  height: 6px;
  border-radius: 999px;
  background-color: var(--surface-hover);
  overflow: hidden;
  display: flex;
  gap: 2px;
}

.audit-seg {
  height: 100%;
  min-width: 3px;
}

.audit-seg-renewal { background-color: var(--ok); }
.audit-seg-manual { background-color: var(--accent); }
.audit-seg-registry { background-color: var(--ref); }
.audit-seg-unverified { background-color: var(--warn); }
.audit-seg-pending { background-color: var(--danger); }

.audit-legend {
  margin-top: 9px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.audit-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 140ms var(--ease);
}

.audit-item:hover {
  color: var(--accent);
}

.audit-dot {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ---------- 右侧组合分布面板（TLD / 注册商切换） ---------- */

.ledger-dist {
  display: flex;
  flex-direction: column;
}

.dist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.panel-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
}

.seg-tabs {
  display: inline-flex;
  padding: 2px;
  background-color: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.seg-tab {
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-xs);
  padding: 5px 11px;
  cursor: pointer;
  transition: background-color 150ms var(--ease), color 150ms var(--ease);
}

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

.seg-tab.active {
  background-color: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.dist-body {
  padding: 12px 18px;
  flex: 1;
}

.tld-dist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 18px;
  max-height: 198px;
  overflow-y: auto;
  padding-right: 4px;
}

#registrar-dist {
  grid-template-columns: 1fr;
}

.tld-row {
  display: grid;
  grid-template-columns: minmax(58px, auto) 1fr 26px;
  align-items: center;
  gap: 8px;
  padding: 3.5px 6px;
  margin: 0 -6px;
  border-radius: var(--radius-xs);
  font-size: 13px;
  cursor: pointer;
  transition: background-color 140ms var(--ease);
}

#registrar-dist .tld-row {
  grid-template-columns: minmax(110px, 1.3fr) 1fr 30px;
}

.tld-row:hover {
  background-color: var(--surface-hover);
}

.tld-row.is-selected {
  background-color: var(--accent-soft);
}

.tld-name {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#registrar-dist .tld-name {
  font-family: var(--sans);
}

.tld-bar {
  height: 6px;
  border-radius: 999px;
  background-color: var(--surface-hover);
  overflow: hidden;
}

.tld-bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background-color: var(--accent);
  opacity: 0.78;
  transition: opacity 150ms var(--ease);
}

.tld-row:hover .tld-bar > span,
.tld-row.is-selected .tld-bar > span {
  opacity: 1;
}

.tld-count {
  text-align: right;
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}

.dist-foot {
  padding: 9px 18px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--muted);
}

/* ---------- 筛选与排序工具栏 ---------- */

.toolbar {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.toolbar-primary {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-wrap {
  position: relative;
  flex: 1 1 260px;
  min-width: 200px;
}

.search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--muted);
  pointer-events: none;
}

#search-box {
  width: 100%;
  height: 38px;
  padding: 0 54px 0 34px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background-color: var(--surface-subtle);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 150ms var(--ease), background-color 150ms var(--ease), box-shadow 150ms var(--ease);
}

#search-box::-webkit-search-cancel-button {
  display: none;
}

#search-box::placeholder {
  color: var(--muted);
}

#search-box:focus {
  background-color: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-clear {
  position: absolute;
  right: 30px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 999px;
  background-color: var(--surface-hover);
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.search-clear:hover {
  color: var(--text);
}

.search-kbd {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  pointer-events: none;
}

.select-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.select-group select {
  appearance: none;
  -webkit-appearance: none;
  height: 38px;
  padding: 0 32px 0 12px;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text);
  background-color: var(--surface-subtle);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  max-width: 196px;
  transition: border-color 150ms var(--ease), background-color 150ms var(--ease);
}

.select-group select:hover {
  background-color: var(--surface);
  border-color: var(--muted);
}

.select-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.toolbar-secondary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.chip-group {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 3px;
  background-color: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background-color: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: background-color 140ms var(--ease), color 140ms var(--ease), border-color 140ms var(--ease);
}

.filter-chip:hover {
  color: var(--text);
  background-color: var(--surface-hover);
}

.filter-chip.active {
  background-color: var(--surface);
  border-color: var(--border-strong);
  color: var(--accent);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.chip-count {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.filter-chip.active .chip-count {
  color: var(--accent);
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.link-reset {
  padding: 4px 8px;
  border: none;
  border-radius: var(--radius-xs);
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  transition: background-color 140ms var(--ease);
}

.link-reset:hover {
  background-color: var(--accent-soft);
}

.row-count {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  white-space: nowrap;
}

/* ---------- 域名清单表格（瑞士账本风格） ---------- */

.table-wrap {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow-sm);
}

#domains-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}

#domains-table thead th {
  position: sticky;
  top: 58px;
  z-index: 20;
  text-align: left;
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background-color: var(--surface-subtle);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border-strong);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: color 140ms var(--ease), background-color 140ms var(--ease);
}

#domains-table thead th:hover {
  color: var(--text);
  background-color: var(--surface-hover);
}

#domains-table thead th.num {
  text-align: right;
}

#domains-table thead th::after {
  content: "";
  display: inline-block;
  margin-left: 5px;
  font-size: 11px;
  color: var(--muted);
}

#domains-table thead th.sorted-asc {
  color: var(--accent);
}

#domains-table thead th.sorted-asc::after {
  content: "▲";
  color: var(--accent);
}

#domains-table thead th.sorted-desc {
  color: var(--accent);
}

#domains-table thead th.sorted-desc::after {
  content: "▼";
  color: var(--accent);
}

#domains-table tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}

#domains-table tbody tr:last-child td {
  border-bottom: none;
}

#domains-table tbody tr {
  cursor: pointer;
  transition: background-color 130ms var(--ease);
}

#domains-table tbody tr:nth-child(even) {
  background-color: var(--surface-subtle);
}

#domains-table tbody tr:hover {
  background-color: var(--surface-hover);
}

/* 到期紧迫度：克制的左侧 3px 竖线标识，不滥用大片荧光底色 */

#domains-table tbody tr.expired td:first-child {
  box-shadow: inset 3px 0 0 var(--danger);
}

#domains-table tbody tr.expired {
  background-color: var(--danger-soft);
}

#domains-table tbody tr.warn-30 td:first-child {
  box-shadow: inset 3px 0 0 var(--danger);
}

#domains-table tbody tr.warn-60 td:first-child {
  box-shadow: inset 3px 0 0 var(--warn);
}

/* 域名列 */

.domain-cell {
  white-space: nowrap;
}

.domain-name {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text);
  letter-spacing: -0.01em;
}

.domain-tld {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}

.note-flag {
  display: inline-block;
  margin-left: 7px;
  padding: 1px 6px;
  font-size: 11.5px;
  font-weight: 500;
  border-radius: 4px;
  background-color: var(--surface-hover);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: middle;
}

.col-tld {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.registrar-cell {
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
}

.date-cell {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--text-secondary);
  font-size: 13.5px;
}

.date-cell.col-registered {
  color: var(--muted);
}

.date-cell.unknown {
  color: var(--muted);
}

/* 价格列与价格口径徽章 */

.price-cell {
  text-align: right;
  white-space: nowrap;
  cursor: pointer;
  border-radius: var(--radius-xs);
  transition: background-color 140ms var(--ease);
}

.price-cell:hover {
  background-color: var(--accent-soft);
}

.price-amount {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

.price-amount.muted {
  color: var(--muted);
  font-weight: 400;
}

.price-meta-row {
  margin-top: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.price-chip {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.5;
  border-radius: 5px;
  border: 1px solid transparent;
}

.chip-renewal {
  color: var(--ok);
  background-color: var(--ok-soft);
  border-color: var(--ok-border);
}

.chip-member {
  color: var(--member);
  background-color: var(--member-soft);
  border-color: var(--member-border);
}

.chip-registry {
  color: var(--ref);
  background-color: var(--ref-soft);
  border-color: var(--ref-border);
}

.chip-unknown {
  color: var(--warn);
  background-color: var(--warn-soft);
  border-color: var(--warn-border);
}

/* 待核价：虚线边框区分「有价但未证实」 */
.chip-unverified {
  color: var(--warn);
  background-color: var(--warn-soft);
  border: 1px dashed var(--warn);
}

.chip-manual {
  color: var(--accent);
  background-color: var(--accent-soft);
  border-color: var(--accent-border);
}

.price-hint {
  order: -1;
  font-size: 11.5px;
  color: var(--accent);
  opacity: 0;
  transition: opacity 140ms var(--ease);
}

.price-cell:hover .price-hint,
.price-cell:focus-visible .price-hint {
  opacity: 1;
}

/* 行内价格编辑器 */

.price-editor {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 5px;
  min-width: 240px;
}

.price-input {
  width: 90px;
  height: 30px;
  padding: 0 8px;
  font-family: inherit;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  background-color: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius-xs);
  outline: none;
}

.price-currency {
  height: 30px;
  padding: 0 6px;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--text);
  background-color: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
}

.price-editor button {
  height: 30px;
  padding: 0 9px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: var(--radius-xs);
  cursor: pointer;
  border: 1px solid var(--border-strong);
  background-color: var(--surface);
  color: var(--text-secondary);
}

.price-editor .price-save {
  background-color: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.price-editor .price-clear {
  color: var(--danger);
  border-color: var(--danger-border);
}

.price-error {
  width: 100%;
  text-align: right;
  font-size: 12px;
  color: var(--danger);
}

/* 剩余天数与迷你进度条 */

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

.days-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  min-width: 72px;
}

.days-num {
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.days-ok { color: var(--ok); }
.days-warn { color: var(--warn); }
.days-danger { color: var(--danger); }
.days-unknown { color: var(--muted); }

.days-bar {
  width: 68px;
  height: 4px;
  border-radius: 999px;
  background-color: var(--surface-hover);
  overflow: hidden;
}

.days-bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
}

.days-bar > span.days-ok { background-color: var(--ok); }
.days-bar > span.days-warn { background-color: var(--warn); }
.days-bar > span.days-danger { background-color: var(--danger); }
.days-bar > span.days-unknown { background-color: var(--border-strong); }

/* 状态列徽章 */

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.status-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
}

.status-ok {
  color: var(--ok);
  background-color: var(--ok-soft);
  border-color: var(--ok-border);
}

.status-warn {
  color: var(--warn);
  background-color: var(--warn-soft);
  border-color: var(--warn-border);
}

.status-danger {
  color: var(--danger);
  background-color: var(--danger-soft);
  border-color: var(--danger-border);
}

.status-muted {
  color: var(--ref);
  background-color: var(--ref-soft);
  border-color: var(--ref-border);
}

/* 空状态 */

.empty {
  padding: 52px 24px;
  text-align: center;
}

.empty-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.empty-sub {
  margin: 6px auto 16px;
  max-width: 42ch;
  font-size: 13.5px;
  color: var(--muted);
}

/* ---------- 页脚 ---------- */

.page-footer {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 clamp(16px, 2.5vw, 32px) 36px;
}

.footer-inner {
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

.footer-sep {
  color: var(--border-strong);
}

/* ---------- 右侧域名详情抽屉 ---------- */

.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background-color: var(--overlay);
  backdrop-filter: blur(3px);
  display: flex;
  justify-content: flex-end;
}

.drawer {
  width: min(460px, 100%);
  height: 100%;
  background-color: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: drawer-in 200ms var(--ease);
}

@keyframes drawer-in {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.drawer-head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.drawer-title {
  margin: 0;
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
}

.drawer-head-meta {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.drawer-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.drawer-body {
  padding: 18px 20px 28px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.drawer-section {
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.drawer-section:first-child {
  padding-top: 0;
  border-top: none;
}

.drawer-section-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.drawer-price-box {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background-color: var(--surface-subtle);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.drawer-price-figure {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.drawer-price-desc {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.drawer-kv {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 8px 12px;
  font-size: 13.5px;
}

.drawer-kv dt {
  color: var(--muted);
}

.drawer-kv dd {
  margin: 0;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  word-break: break-word;
}

.drawer-link {
  color: var(--accent);
  text-decoration: none;
  word-break: break-all;
}

.drawer-link:hover {
  text-decoration: underline;
}

.drawer-epp-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.drawer-epp-item {
  font-family: var(--mono);
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 5px;
  background-color: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.drawer-note {
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background-color: var(--surface-subtle);
  border: 1px solid var(--border);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------- 导出覆盖 JSON 弹窗 ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background-color: var(--overlay);
  backdrop-filter: blur(3px);
  padding: 20px;
}

.modal {
  width: min(640px, 100%);
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 20px 22px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.modal-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.modal-close {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  font-family: inherit;
  font-size: 20px;
  line-height: 1;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: background-color 140ms var(--ease), color 140ms var(--ease);
}

.modal-close:hover {
  color: var(--text);
  background-color: var(--surface-hover);
}

.modal-hint {
  margin: 4px 0 14px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
}

#export-textarea {
  width: 100%;
  min-height: 220px;
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text);
  background-color: var(--surface-subtle);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  resize: vertical;
  outline: none;
}

#export-textarea:focus {
  border-color: var(--accent);
}

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

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 120;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background-color: var(--text);
  color: var(--surface);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
}

/* ---------- 响应式断点 ---------- */

@media (max-width: 1080px) {
  .overview-ledger {
    grid-template-columns: 1fr;
  }

  .tld-dist {
    max-height: 160px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #registrar-dist {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .col-registered,
  .col-tld {
    display: none;
  }

  .brand-en {
    display: none;
  }
}

@media (max-width: 768px) {
  .page-header {
    position: static;
  }

  .header-inner {
    padding-top: 10px;
    padding-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .badge {
    width: 100%;
    justify-content: space-between;
  }

  .btn {
    min-height: 44px;
  }

  .command-top {
    grid-template-columns: 1fr;
  }

  .cost-block {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 16px;
  }

  .holding-stat {
    padding: 16px;
  }

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

  .strip-cell {
    border-right: none;
    border-bottom: 1px solid var(--border);
    min-height: 44px;
  }

  .strip-cell.strip-danger {
    border-right: 1px solid var(--border);
  }

  .strip-cell.strip-audit {
    grid-column: 1 / -1;
    border-bottom: none;
  }

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

  #registrar-dist {
    grid-template-columns: 1fr;
  }

  .toolbar {
    border-radius: var(--radius);
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
  }

  .search-wrap {
    flex: 1 1 100%;
  }

  #search-box {
    height: 44px;
  }

  .search-kbd {
    display: none;
  }

  .select-group {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .select-group select {
    max-width: none;
    width: 100%;
    height: 44px;
  }

  .chip-group {
    width: 100%;
  }

  .filter-chip {
    min-height: 36px;
  }

  .toolbar-right {
    width: 100%;
    justify-content: space-between;
    margin-left: 0;
  }

  /* 移动端将表格无缝转化为独立资产卡片，零横向溢出 */
  .table-wrap {
    background: transparent;
    border: none;
    box-shadow: none;
  }

  #domains-table,
  #domains-table tbody {
    display: block;
    width: 100%;
  }

  #domains-table thead {
    display: none;
  }

  #domains-table tbody {
    display: grid;
    gap: 10px;
  }

  #domains-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "domain status"
      "registrar registrar"
      "expires days"
      "price price";
    gap: 8px 12px;
    padding: 14px 15px;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
  }

  #domains-table tbody tr:nth-child(even) {
    background-color: var(--surface);
  }

  #domains-table tbody tr.expired {
    background-color: var(--danger-soft);
    border-color: var(--danger-border);
  }

  #domains-table tbody tr.expired td:first-child,
  #domains-table tbody tr.warn-30 td:first-child,
  #domains-table tbody tr.warn-60 td:first-child {
    box-shadow: none;
  }

  #domains-table tbody tr.warn-30 {
    border-left: 3px solid var(--danger);
  }

  #domains-table tbody tr.warn-60 {
    border-left: 3px solid var(--warn);
  }

  #domains-table tbody td {
    padding: 0;
    border: none;
    min-width: 0;
  }

  #domains-table tbody td.domain-cell {
    grid-area: domain;
    white-space: normal;
    word-break: break-all;
  }

  #domains-table tbody td.col-status {
    grid-area: status;
    justify-self: end;
    align-self: start;
  }

  #domains-table tbody td.registrar-cell {
    grid-area: registrar;
    max-width: none;
    font-size: 13px;
    color: var(--muted);
  }

  #domains-table tbody td.col-expires {
    grid-area: expires;
    align-self: center;
  }

  #domains-table tbody td.col-expires::before {
    content: "到期 ";
    color: var(--muted);
    font-size: 12.5px;
  }

  #domains-table tbody td.col-days {
    grid-area: days;
    justify-self: end;
    align-self: center;
  }

  #domains-table tbody td.price-cell {
    grid-area: price;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
    margin-top: 2px;
    border-radius: var(--radius-sm);
    background-color: var(--surface-subtle);
    border: 1px solid var(--border);
    text-align: left;
    min-height: 44px;
  }

  .price-meta-row {
    margin-top: 0;
  }

  .price-hint {
    order: 0;
    opacity: 0.85;
  }

  .price-editor {
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
  }

  .price-input {
    flex: 1 1 100px;
    height: 38px;
  }

  .price-currency,
  .price-editor button {
    height: 38px;
  }

  .toast {
    left: 16px;
    right: 16px;
    bottom: 16px;
    text-align: center;
  }
}

@media (max-width: 560px) {
  .select-group {
    grid-template-columns: 1fr;
  }

  .tld-dist {
    grid-template-columns: 1fr;
  }
}

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