:root {
  --brand: #5b6cff;
  --brand-soft: #eef0ff;
  --ok: #18a058;
  --warn: #f0a020;
  --danger: #d03050;
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #1f2333;
  --text-2: #6b7280;
  --border: #e8ebf3;
  --radius: 12px;
  --shadow: 0 8px 28px rgba(24, 32, 74, 0.06);
  --surface-2: #fafbff;
  --warn-soft: #fff8e6;
  --warn-border: #ffe4a3;
  --warn-text: #8a5a00;
}

/* 深色主题：只覆盖设计令牌，组件跟随 Naive UI darkTheme */
html[data-theme='dark'] {
  --bg: #0f111a;
  --card: #181b26;
  --text: #e8eaf3;
  --text-2: #98a0b4;
  --border: #2a2f3e;
  --brand-soft: #20243a;
  --surface-2: #1e2230;
  --warn-soft: rgba(240, 160, 32, 0.14);
  --warn-border: rgba(240, 160, 32, 0.38);
  --warn-text: #f3ba6a;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.38);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body, #app {
  height: 100%;
  margin: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }

.page {
  padding: 20px 24px 28px;
  max-width: 1320px;
  margin: 0 auto;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.2px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.muted { color: var(--text-2); }
.mono { font-family: 'JetBrains Mono', Consolas, monospace; }

.card-surface {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.fade-enter-active, .fade-leave-active { transition: opacity 0.18s ease; }
.fade-enter-from, .fade-leave-to { opacity: 0; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d5d9e6; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #c2c8da; }

.n-data-table .n-data-table-th { background: var(--surface-2) !important; font-weight: 600; }

/* 深色主题下禁用的主按钮：Naive 会把文字算成黑色，压在蓝色底上几乎看不清 */
html[data-theme='dark'] .n-button--primary-type.n-button--disabled {
  color: rgba(255, 255, 255, 0.72) !important;
  background-color: rgba(91, 108, 255, 0.42) !important;
  border-color: rgba(91, 108, 255, 0.42) !important;
}
