/* =========================================================
   车辆管理系统 — UI Design System v2
   纯 CSS / 零依赖 · 设计 Token 驱动 · 保留全部旧类名
   方向：现代靛蓝 + 中性灰 · 柔和阴影 · 8pt 间距 · 微交互
   ========================================================= */

:root {
  /* —— 品牌主色（靛蓝紫 · 参考 PNG 微调）—— */
  --primary-50:  #eef0ff;
  --primary-100: #e3e6ff;
  --primary-200: #cdd2fe;
  --primary-300: #a9b0fc;
  --primary-400: #8088f6;
  --primary-500: #6060f0;   /* 主色（PNG 参考：更紫的靛蓝） */
  --primary-600: #5050e0;
  --primary-700: #3f3fce;
  --primary-800: #3333a8;

  /* —— 中性色（带极轻冷调）—— */
  --ink-900: #101020;
  --ink-800: #1c1c2e;
  --ink-700: #2e2e44;
  --ink-600: #4a4a63;
  --ink-500: #5b6172;
  --ink-400: #8a8fa3;
  --ink-300: #c3c7d6;
  --ink-200: #e2e3ec;
  --ink-100: #f1f1f6;
  --ink-50:  #f7f7fa;
  --white:   #ffffff;

  /* —— 语义色 —— */
  --green-50: #e7f8ef; --green-500: #15b877; --green-600: #0fa06b; --green-700: #0b8056;
  --red-50:   #fdecec; --red-500:   #ef4444; --red-600:   #e23b3b; --red-700:   #c22f2f;
  --amber-50: #fff5e6; --amber-500: #f0a020; --amber-600: #d98a00; --amber-700: #b06e00;
  --sky-500:  #1aa3c9;
  --violet-400:#a78bfa; --violet-600:#7c3aed;

  /* —— 表面 —— */
  --bg:        #f1f0f5;
  --surface:   #ffffff;
  --sidebar-bg: #ffffff;
  --sidebar-ink: var(--ink-600);
  --sidebar-active-bg: var(--primary-50);

  --line: var(--ink-200);
  --line-soft: var(--ink-100);

  /* —— 文本 —— */
  --text:       var(--ink-900);
  --text-soft:  var(--ink-600);
  --text-muted: var(--ink-500);

  /* —— 阴影层级 —— */
  --shadow-xs: 0 1px 2px rgba(15,23,42,.04);
  --shadow-sm: 0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
  --shadow-md: 0 4px 12px -2px rgba(15,23,42,.08), 0 2px 6px -2px rgba(15,23,42,.05);
  --shadow-lg: 0 16px 40px -12px rgba(15,23,42,.18), 0 6px 16px -8px rgba(15,23,42,.10);
  --shadow-focus: 0 0 0 4px rgba(99,102,241,.16);

  /* —— 圆角 —— */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-full: 999px;

  /* —— 间距（8pt 网格）—— */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px;

  /* —— 动效 —— */
  --ease: cubic-bezier(.4,0,.2,1);
  --t-fast: 120ms var(--ease);
  --t-normal: 200ms var(--ease);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
}

/* ============ 基础 ============ */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background:
    radial-gradient(1200px 600px at 100% -10%, var(--primary-50), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, #f0fdfa, transparent 55%),
    var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--primary-600); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--primary-700); text-decoration: none; }

/* 线性 SVG 图标（统一描边，随文字色变色） */
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg.ic { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; display: inline-block; vertical-align: middle; }

/* ============ 布局 ============ */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 248px; flex: 0 0 248px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  position: sticky; top: 0; align-self: flex-start; height: 100vh;
  box-shadow: var(--shadow-sm);
}
.sidebar .brand {
  height: 66px; display: flex; align-items: center; gap: 12px;
  padding: 0 22px; font-size: 16px; font-weight: 700; color: var(--ink-900);
  letter-spacing: .2px; border-bottom: 1px solid var(--line-soft);
}
.sidebar .brand .logo {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary-400), var(--primary-600));
  display: flex; align-items: center; justify-content: center; font-size: 18px;
  box-shadow: 0 4px 10px -2px rgba(99,102,241,.5);
}
.sidebar nav { padding: 14px 12px; flex: 1; overflow-y: auto; }
.sidebar nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; margin-bottom: 4px;
  color: var(--sidebar-ink); font-size: 14px; font-weight: 500;
  border-radius: var(--r-sm); position: relative;
  transition: background var(--t-fast), color var(--t-fast);
}
.sidebar nav a:hover { background: var(--ink-100); color: var(--ink-900); text-decoration: none; }
.sidebar nav a.active {
  background: var(--sidebar-active-bg); color: var(--primary-700); font-weight: 600;
}
.sidebar nav a.active::before {
  content: ""; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 22px; border-radius: var(--r-full); background: var(--primary-500);
}
.sidebar nav a .ic {
  width: 20px; height: 20px; flex: 0 0 20px; color: var(--ink-400);
  transition: color var(--t-fast), transform var(--t-fast);
}
.sidebar nav a:hover .ic { color: var(--ink-700); transform: scale(1.08); }
.sidebar nav a.active .ic { color: var(--primary-600); }

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

.topbar {
  height: 66px; background: rgba(255,255,255,.85); backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; position: sticky; top: 0; z-index: 30;
}
.topbar .menu-btn { display: none; background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text); }
.topbar .title { font-weight: 700; font-size: 17px; letter-spacing: .2px; }
.topbar .user { display: flex; align-items: center; gap: 12px; color: var(--text-soft); }
.topbar .avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-400), var(--primary-600));
  color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700;
  box-shadow: var(--shadow-sm);
}
.content { padding: var(--s-6); max-width: 1440px; width: 100%; }

/* ============ 移动遮罩 ============ */
.overlay {
  display: none; position: fixed; inset: 0; background: rgba(15,23,42,.45);
  backdrop-filter: blur(2px); z-index: 35;
}
.overlay.show { display: block; }

/* ============ 卡片 / 统计 ============ */
.cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: var(--s-4); margin-bottom: var(--s-6);
}
.card {
  position: relative; overflow: hidden;
  background: var(--surface); border-radius: var(--r-lg);
  padding: 20px 22px; box-shadow: var(--shadow-sm);
  border: 1px solid var(--line-soft);
  transition: transform var(--t-normal), box-shadow var(--t-normal);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card::after {
  content:""; position:absolute; inset:0 0 auto 0; height:3px;
  background: linear-gradient(90deg, var(--primary-400), var(--primary-600));
  opacity:0; transition: opacity var(--t-normal);
}
.card:hover::after { opacity: 1; }
.card .label { color: var(--text-muted); font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.card .label .ic { width: 16px; height: 16px; flex: 0 0 16px; }
.card .value { font-size: 30px; font-weight: 800; margin-top: 8px; letter-spacing: -.5px; }
.card .sub { font-size: 12.5px; color: var(--text-muted); margin-top: 6px; }
.card.accent-blue   { /* 顶部细色条 */ }
.card.accent-blue::before,
.card.accent-green::before,
.card.accent-orange::before,
.card.accent-red::before,
.card.accent-purple::before {
  content:""; position:absolute; left:0; right:0; top:0; height:3px;
}
.card.accent-blue::before   { background: linear-gradient(90deg,var(--primary-400),var(--primary-600)); }
.card.accent-green::before  { background: linear-gradient(90deg,#34d399,var(--green-600)); }
.card.accent-orange::before { background: linear-gradient(90deg,#fbbf24,var(--amber-600)); }
.card.accent-red::before    { background: linear-gradient(90deg,#f87171,var(--red-600)); }
.card.accent-purple::before { background: linear-gradient(90deg,var(--violet-400),var(--violet-600)); }

/* ============ 面板 ============ */
.panel {
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  border: 1px solid var(--line-soft); margin-bottom: var(--s-6); overflow: hidden;
}
.panel-head {
  padding: 16px 20px; border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  background: linear-gradient(180deg, #fff, var(--ink-50));
}
.panel-head h3 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: .2px; }
.panel-body { padding: 20px; }

/* ============ 表格 ============ */
.table-wrap { overflow-x: auto; border-radius: var(--r-md); }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
table.data th, table.data td {
  padding: 13px 14px; text-align: left;
  border-bottom: 1px solid var(--line-soft); white-space: nowrap;
}
table.data th {
  background: var(--ink-50); color: var(--text-soft);
  font-weight: 600; font-size: 12.5px; letter-spacing: .3px; text-transform: none;
  position: sticky; top: 0;
}
table.data tbody tr { transition: background var(--t-fast); }
table.data tbody tr:hover { background: var(--primary-50); }
table.data tbody tr:last-child td { border-bottom: none; }
table.data td.actions a { margin-right: 10px; font-weight: 600; }
.empty { padding: 40px; text-align: center; color: var(--text-muted); }
/* 表格内重点单元格 */
table.data td.warn { color: var(--amber-700); font-weight: 600; }
table.data td.err  { color: var(--red-700); font-weight: 600; }
table.data tr.row-danger { background: var(--red-50); }
table.data tr.row-danger:hover { background: var(--red-50); }

/* ============ 徽章 ============ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: var(--r-full); font-size: 12px; font-weight: 600;
  line-height: 1.5;
}
.badge-green  { background: var(--green-50); color: var(--green-700); }
.badge-red    { background: var(--red-50);   color: var(--red-700); }
.badge-orange { background: var(--amber-50); color: var(--amber-700); }
.badge-gray   { background: var(--ink-100);  color: var(--ink-600); }
.badge-blue   { background: var(--primary-50); color: var(--primary-700); }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer;
  padding: 9px 16px; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font-size: 13.5px; font-weight: 600;
  font-family: inherit; line-height: 1.4;
  transition: background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}
.btn:hover { background: var(--ink-50); border-color: var(--ink-300); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
  color: #fff; border-color: transparent; box-shadow: 0 4px 12px -4px rgba(79,70,229,.6);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--primary-600), var(--primary-700)); color:#fff; }
.btn-danger { background: var(--surface); color: var(--red-600); border-color: #fecaca; }
.btn-danger:hover { background: var(--red-50); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-link { border: none; background: none; padding: 0; color: var(--primary-600); cursor: pointer; font-size: 13.5px; }
.btn-link:hover { color: var(--primary-700); }

/* ============ 表单 ============ */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 13px; color: var(--text-soft); font-weight: 600; }
.form-group .req::after { content: " *"; color: var(--red-500); }
input, select, textarea {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm);
  font-size: 14px; font-family: inherit; background: var(--surface); color: var(--text);
  width: 100%; transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
input:hover, select:hover, textarea:hover { border-color: var(--ink-300); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary-500); box-shadow: var(--shadow-focus);
}

/* ============ 预警横幅 ============ */
.alert-banner {
  border-radius: var(--r-md); padding: 13px 18px; margin-bottom: var(--s-5);
  display: flex; align-items: center; gap: 12px; font-weight: 600;
  border: 1px solid transparent;
}
.alert-banner.urgent { background: var(--red-50); color: var(--red-700); border-color: #fecaca; }
.alert-banner.warning { background: var(--amber-50); color: var(--amber-700); border-color: #fde68a; }
.alert-banner.ok { background: var(--green-50); color: var(--green-700); border-color: #a7f3d0; }
.alert-banner .ic { width: 20px; height: 20px; flex: 0 0 20px; color: inherit; }

/* ============ 筛选条 ============ */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar select, .toolbar input { width: auto; }

/* ============ 登录页 ============ */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(900px 500px at 15% 10%, rgba(99,102,241,.18), transparent 55%),
    radial-gradient(800px 500px at 90% 90%, rgba(14,165,233,.16), transparent 55%),
    linear-gradient(135deg, #1e1b4b 0%, #312e81 45%, #1e3a8a 100%);
  padding: 20px; position: relative; overflow: hidden;
}
.login-wrap::before {
  content:""; position:absolute; inset:0;
  background-image: radial-gradient(rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 22px 22px; opacity:.5;
}
.login-card {
  position: relative; z-index: 1;
  background: rgba(255,255,255,.96); backdrop-filter: blur(6px);
  border-radius: var(--r-xl); box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,.6);
  width: 100%; max-width: 410px; padding: 40px 34px;
  animation: cardIn .5s var(--ease) both;
}
@keyframes cardIn { from { opacity:0; transform: translateY(14px) scale(.98); } to { opacity:1; transform:none; } }
.login-card h1 { margin: 0 0 4px; font-size: 23px; letter-spacing: .2px; }
.login-brand { display: flex; align-items: center; gap: 12px; font-size: 21px; font-weight: 800; letter-spacing: .3px; margin-bottom: 4px; }
.login-logo {
  width: 40px; height: 40px; border-radius: 12px; flex: 0 0 40px;
  background: linear-gradient(135deg, var(--primary-400), var(--primary-600));
  color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 14px -4px rgba(99,102,241,.6);
}
.login-card .sub { color: var(--text-muted); margin-bottom: 26px; font-size: 13.5px; }
.login-card .form-group { margin-bottom: 18px; }

/* ============ 提示 ============ */
.flash { padding: 12px 16px; border-radius: var(--r-sm); margin-bottom: var(--s-4); font-size: 13.5px; font-weight: 500; }
.flash-ok  { background: var(--green-50); color: var(--green-700); border: 1px solid #a7f3d0; }
.flash-err { background: var(--red-50);   color: var(--red-700);   border: 1px solid #fecaca; }

/* ============ 还款计划：批量操作 ============ */
.amt-input {
  padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--r-sm);
  font-size: 13px; background: var(--surface); color: var(--ink-900);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.amt-input:focus { outline: none; border-color: var(--primary-400); box-shadow: 0 0 0 3px var(--primary-100); }
.rowcheck, .checkall { width: 16px; height: 16px; accent-color: var(--primary-500); cursor: pointer; }
.panel-head .toolbar .btn-sm { margin-left: 6px; }

/* ============ 响应式 ============ */
@media (max-width: 860px) {
  /* 移动端：侧边栏默认隐藏，展开时以 fixed 覆盖层出现（display 切换，兼容性最好） */
  .sidebar {
    display: none;
    position: fixed; top: 0; bottom: 0; left: 0;
    width: 240px; flex-basis: auto; height: 100%;
    z-index: 50; background: var(--sidebar-bg);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { display: flex; }
  /* 内容区在窄屏不再让出侧边栏宽度 */
  .main { margin-left: 0; position: relative; z-index: 10; }
  .topbar .menu-btn { display: block; }
  .content { padding: var(--s-4); }
  /* 遮罩层级在侧边栏之下、内容之上 */
  .overlay { z-index: 45; }
}

/* ============ 统计中心：卡片 ============ */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--s-4); margin-bottom: var(--s-5);
}
.stat-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 18px 20px; box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t-fast), transform var(--t-fast);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-label { font-size: 13px; color: var(--text-soft); font-weight: 600; }
.stat-value { font-size: 26px; font-weight: 800; margin: 8px 0 4px; letter-spacing: -.5px; color: var(--ink-900); }
.stat-value.ok { color: var(--green-700); }
.stat-value.err { color: var(--red-700); }
.stat-sub { font-size: 12.5px; color: var(--text-muted); }

/* ============ 统计中心：键值行 ============ */
.kv {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; background: var(--ink-50); border-radius: var(--r-md);
  font-size: 13.5px;
}
.kv span { color: var(--text-soft); font-weight: 500; }
.kv b { color: var(--ink-900); font-weight: 700; }
.kv b.ok { color: var(--green-700); }
.kv b.err { color: var(--red-700); }

/* ============ 通用辅助 ============ */
.muted { color: var(--text-muted); }
.row-paid { background: var(--green-50); }
.total-row td { font-weight: 700; background: var(--ink-50); border-top: 2px solid var(--line); }

/* ============ 站点页脚 ============ */
.site-footer {
  margin-top: var(--s-8); padding: var(--s-4) 0;
  border-top: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: var(--s-3);
  font-size: 12.5px; color: var(--text-muted);
}
.site-footer-info { display: flex; align-items: center; gap: var(--s-4); flex-wrap: wrap; }
.site-footer-info strong { font-weight: 600; color: var(--text-soft); }
.site-footer-copy { white-space: nowrap; }

/* =========================================================
   暗色主题（JPG 参考：近黑底 + 霓虹春绿/青 强调）
   通过 <html data-theme="dark"> 启用；纯 Token 覆盖层，不改动浅色基础。
   ========================================================= */
html[data-theme="dark"] {
  --primary-50:  #0e2419;
  --primary-100: #123325;
  --primary-200: #18502f;
  --primary-300: #1f7a47;
  --primary-400: #2bbf6e;
  --primary-500: #22e07a;   /* 暗色主色：柔和霓虹绿（由 #00fa00 降饱和） */
  --primary-600: #19c969;
  --primary-700: #12a857;
  --primary-800: #0c7d41;

  --ink-900: #e7fafa;
  --ink-800: #cfe6e6;
  --ink-700: #a9c2c2;
  --ink-600: #7f939f;
  --ink-500: #6a7e8a;
  --ink-400: #55706f;  /* 暗底上图标/次要文字用，保证对比 */
  --ink-300: #2c3338;  /* 暗底分隔线 */
  --ink-200: #23272d;
  --ink-100: #181b21;
  --ink-50:  #13131b;
  --white:   #13131b;

  --green-50: #0e2419; --green-500: #2bbf6e; --green-600: #22e07a; --green-700: #34ff9b;
  --red-50:   #2a1417; --red-500:   #ff6b82; --red-600:   #ff5577; --red-700:   #ff8aa0;
  --amber-50: #2a2410; --amber-500: #e7c23a; --amber-600: #e0c020; --amber-700: #f0d35a;
  --sky-500:  #2bd6ee;

  --bg:        #07070b;
  --surface:   #13131b;
  --sidebar-bg: #0c0c12;
  --sidebar-ink: #7f939f;
  --sidebar-active-bg: #10241b;

  --line: #23272d;
  --line-soft: #1a1d23;

  --text:       #e7fafa;
  --text-soft:  #a9c2c2;
  --text-muted: #6a7e8a;

  --shadow-xs: 0 1px 2px rgba(0,0,0,.4);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.5), 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 4px 12px -2px rgba(0,0,0,.55), 0 2px 6px -2px rgba(0,0,0,.4);
  --shadow-lg: 0 16px 40px -12px rgba(0,0,0,.7), 0 6px 16px -8px rgba(0,0,0,.5);
  --shadow-focus: 0 0 0 4px rgba(34,224,122,.22);
}

/* 暗色：body 背景改为纯净近黑 + 极弱绿光晕（替代浅色径向渐变） */
html[data-theme="dark"] body {
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(34,224,122,.06), transparent 55%),
    radial-gradient(900px 500px at -10% 110%, rgba(43,214,238,.05), transparent 50%),
    #07070b;
  color: var(--text);
}

/* 暗色：侧边栏描边与阴影弱化 */
html[data-theme="dark"] .sidebar { box-shadow: none; border-right: 1px solid var(--line); }
html[data-theme="dark"] .sidebar .brand { border-bottom-color: var(--line-soft); }
html[data-theme="dark"] .sidebar nav a:hover { background: rgba(127,147,159,.10); }
html[data-theme="dark"] .sidebar nav a.active::before { background: var(--primary-500); }

/* 暗色：顶栏毛玻璃降透明，避免亮边 */
html[data-theme="dark"] .topbar {
  background: rgba(12,12,18,.82);
  border-bottom-color: var(--line);
}
html[data-theme="dark"] .topbar .avatar { box-shadow: var(--shadow-sm); }

/* 暗色：卡片/面板用表面色，顶色条照样有效（::after 用主色渐变） */
html[data-theme="dark"] .card:hover { box-shadow: var(--shadow-md); }
html[data-theme="dark"] .card { border-color: var(--line); }

/* 暗色：表格表头底色用表面次级，hover 用主色极淡绿 */
html[data-theme="dark"] table.data th { background: #181b21; color: var(--text-soft); }
html[data-theme="dark"] table.data tbody tr:hover { background: rgba(34,224,122,.08); }
html[data-theme="dark"] .empty { color: var(--text-muted); }

/* 暗色：表单控件 */
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background: #181b21; color: var(--text); border-color: var(--line);
}
html[data-theme="dark"] input:hover,
html[data-theme="dark"] select:hover,
html[data-theme="dark"] textarea:hover { border-color: var(--ink-300); }

/* 暗色：统计中心键值行底色 */
html[data-theme="dark"] .kv { background: #181b21; }
html[data-theme="dark"] .total-row td { background: #181b21; }

/* 暗色：登录页改为近黑科技底（替代浅色紫渐变） */
html[data-theme="dark"] .login-wrap {
  background:
    radial-gradient(900px 500px at 15% 10%, rgba(34,224,122,.12), transparent 55%),
    radial-gradient(800px 500px at 90% 90%, rgba(43,214,238,.10), transparent 55%),
    linear-gradient(135deg, #05060a 0%, #0a1410 45%, #04121a 100%);
}
html[data-theme="dark"] .login-card {
  background: rgba(19,19,27,.92);
  border: 1px solid rgba(34,224,122,.18);
  color: var(--text);
}
html[data-theme="dark"] .login-card .sub { color: var(--text-muted); }

/* 暗色：主题切换按钮视觉（在 layout 内联样式里也定义了 .theme-toggle） */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text-soft);
  cursor: pointer; transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.theme-toggle:hover { color: var(--primary-500); border-color: var(--primary-400); }

/* ============ 站点页脚 ============ */
.site-footer {
  margin-top: var(--s-10); padding: var(--s-4) 0;
  border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: var(--s-3);
  font-size: 12.5px; color: var(--text-muted);
}
.site-footer-info { display: flex; align-items: center; gap: var(--s-4); flex-wrap: wrap; }
.site-footer-info strong { font-weight: 600; color: var(--text-soft); }
.site-footer-copy { white-space: nowrap; }
/* 暗色：页脚 */
html[data-theme="dark"] .site-footer { border-top-color: var(--line); }
html[data-theme="dark"] .site-footer-info strong { color: var(--text-soft); }

