/* ============================================================
   设计系统 - 所有组件类名以 ds- 为前缀
   新代码必须用设计系统类名，禁止写 inline style
   ============================================================ */

:root {
  --primary: #1B2A4A;
  --accent: #E63946;
  --success: #2E7D32;
  --warning: #FF9800;
  --danger: #c0392b;
  --bg: #f5f6fa;
  --card-bg: #fff;
  --text: #333;
  --muted: #888;
  --border: #e8e8e8;
  --hover: #f8f9fa;
  --radius: 8px;
}

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

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

/* ---------- 导航栏 ---------- */
.ds-navbar {
  display: flex;
  align-items: center;
  background: var(--primary);
  color: #fff;
  padding: 0 1.5em;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.ds-navbar-brand { font-size: 18px; font-weight: 700; margin-right: 2em; }
.ds-navbar-menu { display: flex; gap: .5em; flex: 1; }
.ds-navbar-menu a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  padding: .5em 1em;
  border-radius: var(--radius);
  transition: all .2s;
}
.ds-navbar-menu a:hover,
.ds-navbar-menu a.active { color: #fff; background: rgba(255,255,255,0.15); }
.ds-navbar-user { font-size: 13px; color: rgba(255,255,255,0.8); }

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

/* ---------- 卡片 ---------- */
.ds-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.2em 1.5em;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  margin-bottom: 1em;
}
.ds-card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: .8em;
  padding-bottom: .5em;
  border-bottom: 1px solid var(--border);
}

/* ---------- 按钮 ---------- */
.ds-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4em;
  padding: .5em 1.2em;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  transition: all .2s;
}
.ds-btn-primary { background: var(--primary); color: #fff; }
.ds-btn-primary:hover { opacity: .85; }
.ds-btn-danger { background: var(--accent); color: #fff; }
.ds-btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
/* 深色背景（如导航栏）上的按钮：浅色描边 + 半透明底，保证可见 */
.ds-btn-light { background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.45); color: #fff; }
.ds-btn-light:hover { background: rgba(255,255,255,.28); }

/* ---------- 表格 ---------- */
.ds-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.ds-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--hover);
  text-align: left;
  padding: .6em .8em;
  font-weight: 600;
  font-size: 13px;
  border-bottom: 2px solid var(--border);
}
.ds-table td {
  padding: .5em .8em;
  border-bottom: 1px solid var(--border);
  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(0,0,0,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: .15em .6em;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}
.ds-badge-success { background: #e8f5e9; color: var(--success); }
.ds-badge-warning { background: #fff3e0; color: #e65100; }
.ds-badge-danger { background: #fef2f2; color: var(--danger); }

/* ---------- 提示 ---------- */
.ds-toast {
  position: fixed;
  top: 72px;
  right: 1.5em;
  background: var(--primary);
  color: #fff;
  padding: .8em 1.5em;
  border-radius: var(--radius);
  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; }
