/* ============================================================
   设计系统 - 所有组件类名以 ds- 为前缀
   新代码必须用设计系统类名，禁止写 inline style
   风格：Apple 磨砂玻璃 (Glassmorphism) —— 2026-07-07
   仅改视觉，未改动任何类名/结构，JS 依赖不受影响
   ============================================================ */

:root {
  --primary: #1B2A4A;
  --primary-2: #34507f;         /* 主色渐变亮端 */
  --accent: #E63946;
  --success: #2E7D32;
  --warning: #FF9800;
  --danger: #c0392b;

  --text: #1d2433;
  --muted: #6b7280;

  /* —— 磨砂玻璃体系 —— */
  --glass-bg: rgba(255, 255, 255, 0.34);      /* 玻璃面板底色（更通透） */
  --glass-bg-strong: rgba(255, 255, 255, 0.52);
  --glass-border: rgba(255, 255, 255, 0.5);   /* 高光边 */
  --glass-hairline: rgba(17, 24, 51, 0.07);   /* 分隔细线 */
  --blur: saturate(190%) blur(26px);
  --blur-lg: saturate(190%) blur(38px);

  --card-bg: var(--glass-bg);
  --bg: #eef1f7;
  --border: var(--glass-hairline);
  --hover: rgba(120, 150, 255, 0.08);

  --radius: 14px;
  --radius-lg: 20px;
  --shadow-glass: 0 8px 32px rgba(31, 38, 90, 0.12);
  --shadow-soft: 0 2px 10px rgba(31, 38, 90, 0.06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  /* 彩色柔光背景：给磨砂玻璃提供“被虚化”的内容，越滚越有层次 */
  background:
    radial-gradient(1200px 800px at 8% -12%, rgba(120, 150, 255, 0.28), transparent 60%),
    radial-gradient(1000px 720px at 100% 0%, rgba(255, 120, 170, 0.20), transparent 55%),
    radial-gradient(900px 900px at 50% 118%, rgba(80, 205, 190, 0.20), transparent 60%),
    linear-gradient(180deg, #eef1f7, #e7ebf4);
  background-attachment: fixed;
}

/* ---------- 导航栏（深色磨砂） ---------- */
.ds-navbar {
  display: flex;
  align-items: center;
  background: rgba(24, 37, 66, 0.55);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  color: #fff;
  padding: 0 1.5em;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
}
.ds-navbar-brand { font-size: 18px; font-weight: 700; margin-right: 2em; letter-spacing: .01em; }
.ds-navbar-menu { display: flex; gap: .4em; flex: 1; }
.ds-navbar-menu a {
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  padding: .5em 1em;
  border-radius: 999px;
  transition: all .22s ease;
}
.ds-navbar-menu a:hover,
.ds-navbar-menu a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.ds-navbar-user { font-size: 13px; color: rgba(255, 255, 255, 0.82); }

/* ---------- 主内容 ---------- */
.ds-main { padding: 1.5em; max-width: 1400px; margin: 0 auto; }

/* ---------- 卡片（磨砂玻璃面板） ---------- */
.ds-card {
  background: var(--card-bg);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.3em 1.6em;
  box-shadow: var(--shadow-glass);
  margin-bottom: 1.1em;
}
.ds-card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: .8em;
  padding-bottom: .5em;
  border-bottom: 1px solid var(--glass-hairline);
}

/* ---------- 按钮 ---------- */
.ds-btn {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  padding: .55em 1.3em;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  transition: all .2s ease;
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}
.ds-btn-primary {
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
  color: #fff;
  box-shadow: 0 4px 14px rgba(27, 42, 74, 0.28);
}
.ds-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(27, 42, 74, 0.34); }
.ds-btn-danger {
  background: linear-gradient(135deg, #ff5a67, var(--accent));
  color: #fff;
  box-shadow: 0 4px 14px rgba(230, 57, 70, 0.28);
}
.ds-btn-danger:hover { transform: translateY(-1px); }
.ds-btn-outline {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text);
}
.ds-btn-outline:hover { background: var(--glass-bg-strong); }

/* ---------- 表格 ---------- */
.ds-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.ds-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(245, 247, 252, 0.62);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  text-align: left;
  padding: .7em .8em;
  font-weight: 600;
  font-size: 13px;
  border-bottom: 1px solid var(--glass-hairline);
}
.ds-table td {
  padding: .55em .8em;
  border-bottom: 1px solid var(--glass-hairline);
  font-size: 13px;
}
.ds-table tr:hover { background: var(--hover); }

/* ---------- 拖拽把手 ---------- */
.col-resize-handle {
  position: absolute;
  right: 0;
  top: 0;
  width: 4px;
  height: 100%;
  cursor: col-resize;
  background: rgba(17, 24, 51, 0.08);
}

/* ---------- 输入框清空按钮 ---------- */
.inp-clear-wrap { position: relative; display: inline-flex; align-items: center; }
.inp-clear-btn {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: #aaa;
  cursor: pointer;
  font-size: 16px;
  display: none;
}
.inp-clear-wrap input:not(:placeholder-shown) + .inp-clear-btn { display: block; }

/* ---------- 徽章 ---------- */
.ds-badge {
  display: inline-block;
  padding: .18em .7em;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
}
.ds-badge-success { background: rgba(46, 125, 50, 0.12); color: var(--success); border-color: rgba(46, 125, 50, 0.22); }
.ds-badge-warning { background: rgba(255, 152, 0, 0.14); color: #e65100; border-color: rgba(255, 152, 0, 0.28); }
.ds-badge-danger  { background: rgba(192, 57, 43, 0.12); color: var(--danger); border-color: rgba(192, 57, 43, 0.24); }

/* ---------- 提示 ---------- */
.ds-toast {
  position: fixed;
  top: 72px;
  right: 1.5em;
  background: rgba(24, 37, 66, 0.62);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  color: #fff;
  padding: .85em 1.5em;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: var(--shadow-glass);
  z-index: 9999;
  animation: slideIn .3s ease;
}
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } }

/* ---------- 布局工具类 ---------- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: .5em; }
.gap-md { gap: 1em; }
.gap-lg { gap: 1.5em; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1em; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1em; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1em; }
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
}

/* ---------- 看板组件 ---------- */
.ds-toolbar {
  display: flex; align-items: center; flex-wrap: wrap; gap: .8em;
  margin-bottom: 1em;
}
.ds-toolbar label { font-size: 13px; color: var(--muted); }
.ds-select {
  padding: .5em .8em; border: 1px solid var(--glass-border);
  border-radius: var(--radius); background: var(--glass-bg); color: var(--text);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  font-size: 14px; cursor: pointer;
}
.ds-toolbar-spacer { flex: 1; }
.ds-updated { font-size: 12px; color: var(--muted); }
.ds-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--success); margin-right: 4px; vertical-align: middle;
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.18);
  animation: pulse 1.6s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

.ds-kpi {
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.2em 1.3em;
  box-shadow: var(--shadow-soft);
  transition: transform .2s ease, box-shadow .2s ease;
}
.ds-kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-glass); }
.ds-kpi-label { font-size: 13px; color: var(--muted); margin-bottom: .3em; }
.ds-kpi-value { font-size: 26px; font-weight: 700; line-height: 1.2; }
.ds-kpi-sub { font-size: 12px; color: var(--muted); margin-top: .3em; }
.ds-kpi-cur { font-size: 14px; font-weight: 500; color: var(--muted); }

.ds-chart-box { position: relative; height: 300px; }
.ds-chip {
  display: inline-flex; align-items: center; gap: .4em;
  padding: .35em .75em; margin: .25em; border-radius: 999px;
  background: var(--glass-bg); font-size: 13px; border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}
.ds-chip b { color: var(--primary); }
.ds-empty { text-align: center; color: var(--muted); padding: 2.5em 0; }
.ds-skeleton { color: var(--muted); text-align: center; padding: 2em 0; }
