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

:root {
  --primary: #1B2A4A;
  --primary-2: #24406e;      /* 导航渐变亮端 */
  --cyan: #4ecdd4;           /* 与登录页同源的青，用作交互强调 */
  --cyan-ink: #0f8b92;       /* 青的深色，浅底上的文字/描边 */
  --accent: #E63946;
  --success: #2E7D32;
  --warning: #FF9800;
  --danger: #c0392b;
  --bg: #eef1f6;
  --card-bg: #fff;
  --text: #2a3342;
  --muted: #8a94a6;
  --border: #e6e9f0;
  --hover: #f5f7fb;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow-sm: 0 1px 2px rgba(16,26,48,0.05);
  --shadow-md: 0 6px 20px -10px rgba(16,26,48,0.22), 0 1px 2px rgba(16,26,48,0.05);
  --mono: "SFMono-Regular", "Roboto Mono", ui-monospace, Menlo, monospace;
}

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

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  background:
    radial-gradient(90% 55% at 100% 0%, rgba(78,205,212,0.06), transparent 60%),
    radial-gradient(70% 50% at 0% 0%, rgba(27,42,74,0.05), transparent 55%),
    var(--bg);
  background-attachment: fixed;
}

/* ---------- 导航栏 ---------- */
.ds-navbar {
  display: flex;
  align-items: center;
  background: linear-gradient(100deg, var(--primary), var(--primary-2));
  color: #fff;
  padding: 0 1.5em;
  height: 58px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset, 0 6px 18px -12px rgba(11,21,38,0.7);
  border-bottom: 1px solid rgba(78,205,212,0.22);
}
.ds-navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: .55em;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-right: 2em;
}
.ds-navbar-brand::before {
  content: "";
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 3px rgba(78,205,212,0.18);
}
.ds-navbar-menu { display: flex; gap: .3em; flex: 1; }
.ds-navbar-menu a {
  position: relative;
  color: rgba(255,255,255,0.72);
  text-decoration: none;
  padding: .55em .9em;
  border-radius: var(--radius-sm);
  transition: color .2s, background .2s;
}
.ds-navbar-menu a:hover { color: #fff; background: rgba(255,255,255,0.09); }
.ds-navbar-menu a.active { color: #fff; }
.ds-navbar-menu a.active::after {
  content: "";
  position: absolute;
  left: .9em; right: .9em;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(78,205,212,0.6);
}
.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: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2em 1.5em;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1em;
}
.ds-card-title {
  display: flex;
  align-items: center;
  gap: .5em;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: .8em;
  padding-bottom: .6em;
  border-bottom: 1px solid var(--border);
}
.ds-card-title::before {
  content: "";
  width: 3px;
  height: 15px;
  border-radius: 2px;
  background: linear-gradient(var(--cyan), var(--primary));
}

/* ---------- 按钮 ---------- */
.ds-btn {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  padding: .5em 1.2em;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: transform .15s ease, box-shadow .2s ease, background .2s, color .2s, border-color .2s;
}
.ds-btn:active { transform: translateY(1px); }
.ds-btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.ds-btn[disabled] { opacity: .5; cursor: default; transform: none; box-shadow: none; }
.ds-btn-primary {
  background: linear-gradient(180deg, var(--primary-2), var(--primary));
  color: #fff;
  box-shadow: 0 8px 18px -10px rgba(27,42,74,0.7);
}
.ds-btn-primary:hover { box-shadow: 0 12px 24px -10px rgba(27,42,74,0.85); }
.ds-btn-danger { background: var(--accent); color: #fff; }
.ds-btn-outline { background: #fff; border: 1px solid var(--border); color: var(--text); }
.ds-btn-outline:hover { border-color: var(--cyan); color: var(--cyan-ink); }

/* ---------- 表格 ---------- */
.ds-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.ds-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f0f3f9;
  color: var(--muted);
  text-align: left;
  padding: .65em .8em;
  font-weight: 700;
  font-size: 11.5px;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.ds-table td {
  padding: .55em .8em;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.ds-table tbody tr { transition: background .12s; }
.ds-table tbody tr:hover { background: var(--hover); }
.ds-table tbody tr:last-child td { border-bottom: none; }

/* ---------- KPI 指标卡 ---------- */
.ds-stat {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.05em 1.2em 1.1em;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .22s ease, border-color .2s ease;
}
.ds-stat::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--stat-accent, var(--primary));
  opacity: .9;
}
.ds-stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: rgba(78,205,212,0.4); }
.ds-stat-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--muted);
}
.ds-stat-value {
  margin-top: .35em;
  font-size: 27px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--stat-accent, var(--primary));
  font-variant-numeric: tabular-nums;
}
.ds-stat-sub {
  margin-top: .45em;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.ds-stat--muted .ds-stat-value { color: var(--muted); }
/* 强调色变体 */
.ds-stat--primary { --stat-accent: var(--primary); }
.ds-stat--cyan    { --stat-accent: var(--cyan-ink); }
.ds-stat--success { --stat-accent: var(--success); }
.ds-stat--warning { --stat-accent: #e08600; }
.ds-stat--danger  { --stat-accent: var(--danger); }
/* 涨跌小标 */
.ds-delta { font-weight: 700; font-variant-numeric: tabular-nums; }
.ds-delta-up { color: var(--success); }
.ds-delta-down { color: var(--danger); }

/* ---------- 拖拽把手 ---------- */
.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; }

/* ============================================================
   登录 · 运营指挥台入口（全屏 dark console）
   调色板取自产品自有世界：深藏青(近 --primary) + 报表的青/柠檬
   ============================================================ */
:root {
  --login-ink:    #0b1526;
  --login-ink-2:  #12213c;
  --login-line:   rgba(150,180,220,0.09);
  --login-cyan:   #4ecdd4;
  --login-lime:   #c3d640;
  --login-fg:     #eaf1f8;
  --login-muted:  #8497b3;
  --login-mono:   "SFMono-Regular", "Roboto Mono", ui-monospace, Menlo, monospace;
}

.ds-login {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  padding: clamp(1.5rem, 6vw, 7rem);
  overflow: hidden;
  color: var(--login-fg);
  background:
    radial-gradient(120% 80% at 12% -10%, rgba(78,205,212,0.10), transparent 55%),
    radial-gradient(90% 90% at 108% 120%, rgba(27,42,74,0.85), transparent 60%),
    linear-gradient(158deg, var(--login-ink-2), var(--login-ink));
}
/* 细网格 data-field，向左上聚焦淡出 */
.ds-login::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--login-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--login-line) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(125% 95% at 18% 28%, #000 38%, transparent 86%);
          mask-image: radial-gradient(125% 95% at 18% 28%, #000 38%, transparent 86%);
  pointer-events: none;
}
/* 缓慢漂移的青色极光 */
.ds-login::after {
  content: "";
  position: absolute;
  inset: -25%;
  background: radial-gradient(38% 38% at 32% 42%, rgba(78,205,212,0.13), transparent 70%);
  pointer-events: none;
}

/* 背景幽灵字：产品自己的模块名作为纹理 */
.ds-login-ghost {
  position: absolute;
  right: clamp(-1rem, 1vw, 2rem);
  bottom: 8vh;
  text-align: right;
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.02em;
  font-size: clamp(3rem, 10vw, 8.5rem);
  color: rgba(255,255,255,0.028);
  white-space: nowrap;
  user-select: none;
  pointer-events: none;
}

.ds-login-panel {
  position: relative;
  z-index: 1;
  max-width: 31rem;
}

.ds-login-status {
  display: inline-flex;
  align-items: center;
  gap: .6em;
  margin-bottom: 2.4rem;
  font-family: var(--login-mono);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--login-muted);
}
.ds-login-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--login-lime);
  box-shadow: 0 0 0 0 rgba(195,214,64,0.5);
}

.ds-login-eyebrow {
  font-family: var(--login-mono);
  font-size: 12px;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--login-cyan);
  margin-bottom: 1rem;
}
.ds-login-title {
  font-size: clamp(2.3rem, 5.4vw, 3.9rem);
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.03;
  margin-bottom: 1.1rem;
}
.ds-login-rule {
  width: 46px;
  height: 2px;
  border-radius: 2px;
  background: var(--login-cyan);
  margin-bottom: 1.2rem;
}
.ds-login-sub {
  max-width: 25rem;
  font-size: 15px;
  line-height: 1.75;
  color: var(--login-muted);
  margin-bottom: 2.6rem;
}

.ds-login-cta {
  display: inline-flex;
  align-items: center;
  gap: .65em;
  padding: .95em 1.5em;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff, #e9f0f5);
  color: #0d1b30;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 30px -12px rgba(78,205,212,0.55), inset 0 1px 0 rgba(255,255,255,0.6);
  transition: transform .18s ease, box-shadow .25s ease;
}
.ds-login-cta:hover { transform: translateY(-2px); box-shadow: 0 18px 42px -14px rgba(78,205,212,0.8); }
.ds-login-cta:active { transform: translateY(0); }
.ds-login-cta:focus-visible { outline: 2px solid var(--login-cyan); outline-offset: 3px; }
.ds-login-cta[disabled] { opacity: .55; cursor: default; transform: none; box-shadow: none; }
.ds-login-cta svg { width: 18px; height: 18px; }

/* 账号密码登录表单：与 .ds-login-cta 同一视觉语言，深色玻璃输入框 + 亮色主按钮 */
.ds-login-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .7em;
}
.ds-login-input {
  flex: 1 1 10rem;
  min-width: 0;
  padding: .95em 1.1em;
  border: 1px solid rgba(150,180,220,0.22);
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  color: var(--login-fg);
  font-family: var(--login-mono);
  font-size: 15px;
  letter-spacing: .08em;
  transition: border-color .18s ease, background .18s ease, box-shadow .25s ease;
}
.ds-login-input::placeholder {
  color: var(--login-muted);
  letter-spacing: normal;
  font-family: inherit;
}
.ds-login-input:focus {
  outline: none;
  border-color: var(--login-cyan);
  background: rgba(255,255,255,0.08);
  box-shadow: 0 0 0 3px rgba(78,205,212,0.16);
}
.ds-login-input[disabled] { opacity: .55; }

.ds-login-foot {
  position: absolute;
  left: clamp(1.5rem, 6vw, 7rem);
  bottom: 2.2rem;
  z-index: 1;
  font-family: var(--login-mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.26);
}

/* 动效：仅在用户未要求减弱动画时启用 */
@media (prefers-reduced-motion: no-preference) {
  .ds-login::after { animation: ds-login-drift 20s ease-in-out infinite alternate; }
  .ds-login-dot   { animation: ds-login-pulse 2.4s ease-out infinite; }
  .ds-login-panel > * { animation: ds-login-rise .7s cubic-bezier(.2,.7,.2,1) backwards; }
  .ds-login-panel > *:nth-child(1) { animation-delay: .04s; }
  .ds-login-panel > *:nth-child(2) { animation-delay: .10s; }
  .ds-login-panel > *:nth-child(3) { animation-delay: .16s; }
  .ds-login-panel > *:nth-child(4) { animation-delay: .22s; }
  .ds-login-panel > *:nth-child(5) { animation-delay: .28s; }
  .ds-login-panel > *:nth-child(6) { animation-delay: .34s; }
}
@keyframes ds-login-drift { from { transform: translate(-4%, -2%); } to { transform: translate(6%, 4%); } }
@keyframes ds-login-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(195,214,64,0.5); }
  70%  { box-shadow: 0 0 0 9px rgba(195,214,64,0); }
  100% { box-shadow: 0 0 0 0 rgba(195,214,64,0); }
}
@keyframes ds-login-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

@media (max-width: 720px) {
  .ds-login { align-items: flex-start; padding-top: 13vh; }
  .ds-login-ghost { display: none; }
}

/* ---------- 登录后：导航栏用户区 ---------- */
.ds-user { display: inline-flex; align-items: center; gap: .6em; }
.ds-user-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.28);
}
.ds-user-name { font-size: 13px; color: #fff; }
.ds-navbar .ds-btn-outline {
  padding: .35em .9em;
  font-size: 12px;
  border-color: rgba(255,255,255,0.28);
  color: rgba(255,255,255,0.9);
}
.ds-navbar .ds-btn-outline:hover { background: rgba(255,255,255,0.12); }
