/* TradingRadar v0.6 · OKX-inspired design
 * 深色为默认,浅色可切。极简 / 高密度 / 数字字体
 */
*, *::before, *::after { box-sizing: border-box; }

:root,
:root[data-theme="dark"] {
  /* Background — 紫调暗黑 */
  --bg:           #0e0c18;
  --bg-1:         #16132a;
  --bg-2:         #1c1838;
  --bg-hover:     #251f48;

  --border:       #2c2548;
  --border-2:     #3d3464;

  --text:         #f3f0fa;
  --text-2:       #b6aed4;
  --text-3:       #877da6;
  --text-4:       #5a5277;

  /* 科技紫 主色 */
  --primary:      #8b5cf6;        /* violet-500 */
  --primary-hover:#a78bfa;        /* violet-400 */
  --primary-fg:   #ffffff;
  --primary-bg:   rgba(139,92,246,0.12);

  --link:         #a78bfa;
  --link-hover:   #c4b5fd;

  /* 状态 */
  --up:           #22c55e;        /* 涨绿 / 多头 */
  --up-bg:        rgba(34,197,94,0.10);
  --down:         #ef4444;        /* 跌红 / 空头 */
  --down-bg:      rgba(239,68,68,0.10);
  --warn:         #f59e0b;
  --warn-bg:      rgba(245,158,11,0.12);
  --info:         #8b5cf6;
  --info-bg:      rgba(139,92,246,0.12);

  --shadow-1:     0 1px 0 rgba(0,0,0,0.3);
  --shadow-2:     0 8px 32px rgba(124,58,237,0.18);

  --radius:       10px;
  --radius-sm:    6px;
  --radius-lg:    14px;
}

:root[data-theme="light"] {
  --bg:           #ffffff;
  --bg-1:         #faf9ff;
  --bg-2:         #ffffff;
  --bg-hover:     #f1edff;

  --border:       #ebe5fa;
  --border-2:     #d6cdef;

  --text:         #1a1530;
  --text-2:       #4a4267;
  --text-3:       #6c6486;
  --text-4:       #9b94b3;

  --primary:      #7c3aed;
  --primary-hover:#6d28d9;
  --primary-fg:   #ffffff;
  --primary-bg:   rgba(124,58,237,0.10);

  --link:         #7c3aed;
  --link-hover:   #6d28d9;

  --up:           #16a34a;
  --up-bg:        rgba(22,163,74,0.08);
  --down:         #dc2626;
  --down-bg:      rgba(220,38,38,0.08);
  --warn:         #d97706;
  --warn-bg:      rgba(217,119,6,0.10);
  --info:         #7c3aed;
  --info-bg:      rgba(124,58,237,0.10);

  --shadow-1:     0 1px 0 rgba(0,0,0,0.04);
  --shadow-2:     0 8px 24px rgba(124,58,237,0.12);
}

html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  /* 全站环境光:顶部一抹紫色光晕,给"平面黑"加纵深(随主题用 --primary-bg) */
  background:
    radial-gradient(1100px 480px at 50% -120px, var(--primary-bg), transparent 70%),
    var(--bg);
  color: var(--text);
  /* 数字等宽:价格/PNL 刷新时不抖动,表格列天然对齐 */
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); }

/* Mono 数字 */
.mono, .num, td.num, th.num { font-variant-numeric: tabular-nums;
  font-family: 'SF Mono', 'JetBrains Mono', 'Roboto Mono', ui-monospace, Menlo, Consolas, monospace; }

/* ===== Header ===== */
.header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  height: 56px;
  display: flex; align-items: center;
  padding: 0 20px; gap: 24px;
}
.header .brand {
  font-weight: 700; font-size: 16px;
  color: var(--text); display: flex; align-items: center; gap: 6px;
}
.header .brand .dot { width: 8px; height: 8px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  border-radius: 50%; box-shadow: 0 0 8px var(--primary); }
.header nav { display: flex; gap: 4px; flex: 1; align-items: center; }
.header nav a {
  color: var(--text-2); font-size: 14px; font-weight: 500;
  padding: 6px 12px; border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
}
.header nav a:hover { background: var(--bg-hover); color: var(--text); }
.header nav a.active { color: var(--text); background: var(--bg-1); }

.header .user-area {
  display: flex; align-items: center; gap: 8px; font-size: 13px;
}
.header .user-area .badge {
  background: var(--primary); color: var(--primary-fg);
  padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600;
}
.header .user-area .badge.warn { background: var(--warn); color: #000; }
.header .user-area .badge.danger { background: var(--down); color: #fff; }
.header .user-area .email { color: var(--text-2); max-width: 160px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.header .theme-toggle {
  cursor: pointer; padding: 6px 10px; border-radius: var(--radius-sm);
  color: var(--text-2); background: transparent; border: 1px solid var(--border);
  font-size: 13px; white-space: nowrap;
  box-shadow: none; /* 不吃主按钮的渐变阴影 */
}
.header .theme-toggle:hover { background: var(--bg-1); color: var(--text); filter: none; box-shadow: none; }

/* Search box */
.search-box { position: relative; width: 260px; max-width: 30vw; }
.search-box input {
  width: 100%; padding: 7px 12px 7px 32px;
  background: var(--bg-1); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-size: 13px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23877da6' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 10px center;
}
.search-box input:focus { border-color: var(--primary); }
.search-box input::placeholder { color: var(--text-4); }
.search-results {
  position: absolute; top: 100%; left: 0; right: 0; margin-top: 4px;
  background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-2); max-height: 360px; overflow-y: auto; z-index: 60;
}
.search-results .sr-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  text-decoration: none; color: var(--text); border-bottom: 1px solid var(--border);
}
.search-results .sr-item:last-child { border-bottom: 0; }
.search-results .sr-item:hover { background: var(--bg-hover); }
.search-results .sr-item.sr-sym { color: var(--primary); }
.search-results .sr-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.search-results .sr-ico { width: 28px; height: 28px; border-radius: 50%; background: var(--primary-bg);
  color: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.search-results .sr-title { font-size: 14px; font-weight: 500; }
.search-results .sr-sub { font-size: 11px; color: var(--text-3); }

/* Refresh pulse */
.refresh-pulse {
  position: absolute; right: 14px; top: 14px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--up);
  opacity: 0; pointer-events: none;
  box-shadow: 0 0 8px var(--up);
}
.refresh-pulse.on { animation: pulse 1s ease-out; }
@keyframes pulse {
  0% { opacity: 1; transform: scale(0.5); }
  100% { opacity: 0; transform: scale(1.8); }
}

/* + Follow button */
.btn-follow {
  background: var(--primary-bg); color: var(--primary); border: 1px solid var(--primary);
  padding: 4px 10px; font-size: 12px; border-radius: var(--radius-sm); cursor: pointer;
  font-weight: 600;
}
.btn-follow:hover { background: var(--primary); color: var(--primary-fg); }
.btn-follow.followed { background: var(--bg-2); color: var(--text-3); border-color: var(--border); }

.header .menu-toggle { display: none; background: transparent; border: 0;
  color: var(--text); cursor: pointer; padding: 6px; font-size: 22px; }

/* ===== Layout ===== */
.container {
  max-width: 1280px; margin: 0 auto; padding: 24px 20px;
}
.hero {
  text-align: center; padding: 60px 20px 40px;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(ellipse 900px 500px at 50% 0%, var(--primary-bg), transparent),
    radial-gradient(ellipse 420px 240px at 78% 18%, rgba(34,197,94,0.06), transparent),
    var(--bg);
}
/* 标题渐变字:白→紫,低成本高级感 */
.hero h1 {
  background: linear-gradient(120deg, var(--text) 30%, var(--primary-hover) 80%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero h1 { font-size: 36px; margin: 0 0 10px; font-weight: 700; letter-spacing: -0.5px; }
.hero p  { color: var(--text-3); margin: 0; font-size: 15px; }

/* ===== Card ===== */
.card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-1);
  transition: border-color 0.2s, box-shadow 0.2s;
}
/* hover 时描边提亮 + 柔和紫晕,给"平面卡"加层次(不位移,避免大容器卡晃动) */
.card:hover {
  border-color: var(--border-2);
  box-shadow: 0 4px 24px rgba(124, 58, 237, 0.10), var(--shadow-1);
}
.card-tight { padding: 14px 16px; }
.card h2 { margin: 0 0 14px; font-size: 16px; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: 8px; }
.card h2 .sub { font-size: 13px; color: var(--text-3); font-weight: 400; }
.card h3 { margin: 16px 0 8px; font-size: 14px; color: var(--text-2); font-weight: 600; }

/* ===== KPI ===== */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.kpi {
  padding: 16px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius);
}
.kpi .label { font-size: 12px; color: var(--text-3); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.kpi .value { font-size: 28px; font-weight: 700; line-height: 1.2; }
.kpi .delta { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.kpi .delta.up { color: var(--up); }
.kpi .delta.down { color: var(--down); }

/* ===== Buttons ===== */
.btn, button {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 16px; border: 1px solid transparent; border-radius: var(--radius-sm);
  /* 渐变主按钮(页面自定义按钮覆盖 background 即自动退出渐变) */
  background: linear-gradient(135deg, var(--primary-hover), var(--primary));
  color: var(--primary-fg);
  font-weight: 600; font-size: 13px; cursor: pointer;
  transition: opacity 0.15s, background 0.15s, border-color 0.15s, transform 0.1s, box-shadow 0.15s, filter 0.15s;
  font-family: inherit;
  white-space: nowrap;
}
/* 紫晕投影只给 .btn:裸 <button> 常被页面自定义(K线周期/菜单等),
 * 它们覆盖 background 但不会覆盖 box-shadow → 会泄漏光晕,故不下放到裸 button */
.btn { box-shadow: 0 2px 10px rgba(124, 58, 237, 0.25); }
.btn:hover, button:hover { filter: brightness(1.12); }
.btn:hover { box-shadow: 0 4px 16px rgba(124, 58, 237, 0.35); }
.btn:active, button:active { transform: scale(0.98); }
.btn:disabled, button:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-ghost {
  background: transparent; color: var(--text); border-color: var(--border);
  box-shadow: none;
}
.btn-ghost:hover { background: var(--bg-hover); filter: none; box-shadow: none; }
.btn-link {
  background: transparent; color: var(--link); border: 0; box-shadow: none;
}
.btn-link:hover { filter: none; box-shadow: none; }
.btn-danger { background: var(--down); color: #fff; box-shadow: 0 2px 10px rgba(239,68,68,0.25); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-block { width: 100%; }

/* ===== Form ===== */
label { display: block; font-size: 12px; color: var(--text-3); margin-bottom: 6px; font-weight: 500; }
input[type=text], input[type=email], input[type=password], select, textarea {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text); font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--text-2);
}
input::placeholder { color: var(--text-4); }
.form-row { margin-bottom: 14px; }

/* ===== Auth pages ===== */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  /* 修正:旧绿色光晕是 v0.5 绿主题残留,统一成紫 */
  background:
    radial-gradient(ellipse 600px 400px at 50% 0%, var(--primary-bg), transparent),
    var(--bg);
}
.auth-card {
  width: 100%; max-width: 380px;
  background: var(--bg-1); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
}
.auth-card h1 { margin: 0 0 6px; text-align: center; font-size: 22px; }
.auth-card .sub { text-align: center; color: var(--text-3); margin-bottom: 24px; font-size: 13px; }
.auth-card .tabs { display: flex; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.auth-card .tabs .tab { flex: 1; text-align: center; padding: 10px 0; cursor: pointer;
  color: var(--text-3); border-bottom: 2px solid transparent; font-weight: 500; font-size: 14px; }
.auth-card .tabs .tab.active { color: var(--text); border-bottom-color: var(--text); }
.auth-card button { width: 100%; padding: 11px; margin-top: 6px; }
.auth-msg { margin-top: 12px; padding: 8px 12px; border-radius: var(--radius-sm); font-size: 13px;
  text-align: center; min-height: 18px; }
.auth-msg.ok { background: var(--up-bg); color: var(--up); }
.auth-msg.err { background: var(--down-bg); color: var(--down); }
.auth-msg.warn { background: var(--warn-bg); color: var(--warn); }

/* ===== Table ===== */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg-2); }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 11px 14px; text-align: left; vertical-align: middle;
  border-bottom: 1px solid var(--border); }
.table thead th { color: var(--text-3); font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.5px; background: var(--bg-1); position: sticky; top: 0; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--bg-hover); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums;
  font-family: 'SF Mono', 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace; }
.num.up, .num.pos { color: var(--up); }
.num.down, .num.neg { color: var(--down); }
.num.neutral { color: var(--text-4); }

/* ROI 视觉强度 — 大涨/大跌时高亮 */
.num.up.huge { background: linear-gradient(90deg, var(--up-bg), transparent);
  padding: 0 6px; border-radius: 4px; font-weight: 700; }
.num.down.huge { background: linear-gradient(90deg, var(--down-bg), transparent);
  padding: 0 6px; border-radius: 4px; font-weight: 700; }
.num.up.huge::before { content: '🔥 '; }
.num.down.huge::before { content: '⚠ '; }

/* Sparkline 通用容器 */
.spark { display: inline-block; vertical-align: middle; line-height: 0; }

/* 全局头像基础尺寸:防裸 .avatar(黑马卡/对比/看板等)无约束渲染成原图撑爆布局 */
img.avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  background: var(--bg-2); border: 1px solid var(--border); }

/* ===== Trader cell ===== */
.row-trader { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row-trader .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg-hover); object-fit: cover; flex-shrink: 0;
  border: 1px solid var(--border);
}
.row-trader .meta { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.row-trader .name { font-weight: 600; color: var(--text); font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.row-trader .uid { font-size: 11px; color: var(--text-4); font-family: 'SF Mono', monospace;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }

/* Trader source tag */
.tag-src {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; font-size: 11px; border-radius: 4px; font-weight: 600;
  background: var(--bg-2); border: 1px solid var(--border); color: var(--text-2);
  white-space: nowrap;
}
.tag-src.copy { color: var(--primary); border-color: var(--primary); background: var(--primary-bg); }
.tag-src.smart { color: var(--up); border-color: var(--up); background: var(--up-bg); }
.tag-src.okx    { color: #06b6d4; border-color: #06b6d4; background: rgba(6,182,212,.10); }
.tag-src.gate   { color: #ec4899; border-color: #ec4899; background: rgba(236,72,153,.10); }
.tag-src.bitget { color: #14b8a6; border-color: #14b8a6; background: rgba(20,184,166,.10); }
.tag-src.hl     { color: #f59e0b; border-color: #f59e0b; background: rgba(245,158,11,.10); }

/* Rank highlight */
.rank-1 { color: #ffd700; font-weight: 700; }
.rank-2 { color: #c0c0c0; font-weight: 700; }
.rank-3 { color: #cd7f32; font-weight: 700; }
.rank-n { color: var(--text-4); }

/* ===== Filters bar ===== */
.filters {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: center;
  padding: 12px 14px; background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.filters label { margin: 0; color: var(--text-3); font-size: 12px; font-weight: 500; }
.filters select, .filters input {
  padding: 6px 10px; font-size: 13px; width: auto;
  background: var(--bg-1); border: 1px solid var(--border);
}

/* ===== Status pill ===== */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 500;
  background: var(--bg-hover); color: var(--text-2);
}
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.up { background: var(--up-bg); color: var(--up); }
.pill.down { background: var(--down-bg); color: var(--down); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }

/* ===== Empty / loading ===== */
.empty {
  text-align: center; padding: 48px 20px; color: var(--text-3); font-size: 13px;
}
.spinner {
  width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--text);
  border-radius: 50%; animation: spin 0.6s linear infinite; display: inline-block; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Toast ===== */
#toast-host {
  position: fixed; top: 16px; right: 16px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 9999; pointer-events: none;
}
.toast {
  background: var(--bg-1); border: 1px solid var(--border);
  padding: 10px 14px; border-radius: var(--radius-sm);
  font-size: 13px; min-width: 220px; max-width: 360px;
  box-shadow: var(--shadow-2);
  pointer-events: auto; cursor: pointer;
  animation: toast-in 0.18s ease-out;
}
.toast.ok { border-left: 3px solid var(--up); }
.toast.err { border-left: 3px solid var(--down); }
.toast.warn { border-left: 3px solid var(--warn); }
.toast.info { border-left: 3px solid var(--link); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ===== K线 marker popup ===== */
#marker-popup {
  position: fixed; z-index: 1000; display: none;
  background: var(--bg-1); border: 1px solid var(--border-2);
  border-radius: var(--radius); padding: 14px 16px;
  font-size: 13px; line-height: 1.6; max-width: 320px;
  box-shadow: var(--shadow-2);
}
#marker-popup .close { float: right; cursor: pointer; color: var(--text-3); margin-left: 8px; font-size: 16px; }
#marker-popup .title { font-weight: 600; color: var(--text); margin-bottom: 4px; font-size: 14px; }

/* ===== Resonance card ===== */
.reso-card {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px;
  padding: 14px 16px; background: var(--bg-2);
  border: 1px solid var(--border); border-radius: var(--radius);
  border-left: 3px solid var(--primary);
  align-items: center;
}
.reso-card.up { border-left-color: var(--up); }
.reso-card.down { border-left-color: var(--down); }
.reso-card .sym { font-weight: 700; font-size: 16px; color: var(--text); }
.reso-card .side-label { font-size: 11px; padding: 2px 8px; border-radius: 4px; font-weight: 600;
  display: inline-block; margin-top: 2px; }
.reso-card .side-label.long { background: var(--up-bg); color: var(--up); }
.reso-card .side-label.short { background: var(--down-bg); color: var(--down); }
.reso-card .center .info { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.reso-card .avatars { display: flex; gap: -8px; margin-top: 4px; }
.reso-card .avatars img, .reso-card .avatars .more {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid var(--bg-2); margin-left: -8px;
  background: var(--bg-hover); object-fit: cover;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--text-3); font-weight: 600;
}
.reso-card .avatars img:first-child, .reso-card .avatars .more:first-child { margin-left: 0; }
.reso-card .right { text-align: right; }
.reso-card .right .count { font-size: 18px; font-weight: 700; color: var(--primary); }
.reso-card .right .when { font-size: 11px; color: var(--text-3); }

/* ===== Signal flow card ===== */
.sig-card {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
  padding: 12px 14px; background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--info);
}
.sig-card.long-open { border-left-color: var(--up); }
.sig-card.long-close { border-left-color: var(--up); opacity: 0.85; }
.sig-card.short-open { border-left-color: var(--down); }
.sig-card.short-close { border-left-color: var(--down); opacity: 0.85; }
.sig-card .avatar { width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg-hover); border: 1px solid var(--border); object-fit: cover; }
.sig-card .body { min-width: 0; font-size: 13px; line-height: 1.5; }
.sig-card .body .who { font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sig-card .body .desc { color: var(--text-2); font-size: 12px; }
.sig-card .when { font-size: 11px; color: var(--text-3); white-space: nowrap; text-align: right; }

/* ===== Sidebar drawer (mobile) ===== */
.drawer-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 90;
  display: none;
}
.drawer-mask.open { display: block; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 260px;
  background: var(--bg-1); border-left: 1px solid var(--border);
  padding: 60px 16px 16px; z-index: 91;
  transform: translateX(100%); transition: transform 0.2s;
  display: flex; flex-direction: column; gap: 8px;
}
.drawer.open { transform: translateX(0); }
.drawer a { padding: 12px 14px; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 500; }
.drawer a:hover { background: var(--bg-hover); color: var(--text); }
.drawer a.active { background: var(--bg-2); color: var(--text); }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .header .menu-toggle { display: block; margin-left: auto; }
  .header nav { display: none; }
  .header .user-area .email { display: none; }
}

@media (max-width: 640px) {
  .header .search-box { display: none; }
}

@media (max-width: 640px) {
  .header { padding: 0 12px; gap: 8px; }
  .hero { padding: 40px 16px 28px; }
  .hero h1 { font-size: 26px; }
  .container { padding: 16px 12px; }
  .card { padding: 14px 12px; }
  .kpi { padding: 12px; }
  .kpi .value { font-size: 22px; }
  .filters { padding: 10px; }
  .table th, .table td { padding: 8px 10px; font-size: 12px; }
  #chart-wrap { height: 50vh !important; min-height: 320px; }
  .form-add-grid { grid-template-columns: 1fr !important; }
}

/* ---------- 移动端底部导航 ---------- */
.bottom-nav { display: none; }
@media (max-width: 700px) {
  .bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 150;
    background: var(--bg-1); border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .bottom-nav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 7px 0 6px; color: var(--text-4); text-decoration: none; font-size: 10px;
  }
  .bottom-nav a.active { color: var(--accent, #7c5cff); }
  .bottom-nav .bn-ico { font-size: 18px; line-height: 1; }
  .bottom-nav .bn-lbl { font-size: 10px; }
  body { padding-bottom: 60px; } /* 给底栏留位,防遮挡 */
  /* H5 端隐藏 hamburger + drawer,统一用底栏 */
  .header .menu-toggle { display: none !important; }
}

/* ---------- 骨架屏 ---------- */
.sk { display: block; border-radius: 6px; background: var(--bg-2); position: relative; overflow: hidden; }
.sk::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent);
  transform: translateX(-100%); animation: sk-shimmer 1.3s infinite;
}
@keyframes sk-shimmer { 100% { transform: translateX(100%); } }
.sk-row { height: 14px; margin: 8px 0; }
.sk-line { height: 40px; margin: 6px 0; }

/* ---------- 新事件闪入高亮 ---------- */
@keyframes ev-flash {
  0% { background: var(--accent, #7c5cff); opacity: 0; transform: translateY(-4px); }
  10% { opacity: 1; }
  100% { transform: translateY(0); }
}
.ev-flash { animation: ev-flash 1.1s ease-out; }

/* ============ 新手引导(聚光灯)============ */
.tour-backdrop { position: fixed; inset: 0; z-index: 9998; background: transparent; }
.tour-hole { position: fixed; z-index: 9999; border-radius: 10px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(8,10,20,.62), 0 0 0 2px var(--accent, #7c5cff) inset;
  transition: all .25s ease; }
.tour-pop { position: fixed; z-index: 10000; background: var(--bg-1); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px 16px 12px; box-shadow: 0 16px 50px rgba(0,0,0,.45);
  max-width: 340px; animation: tourIn .2s ease; }
@keyframes tourIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.tour-title { font-size: 16px; font-weight: 800; margin-bottom: 6px; }
.tour-text { font-size: 13px; line-height: 1.6; color: var(--text-2); margin-bottom: 14px; }
.tour-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tour-dots { display: flex; gap: 5px; }
.tour-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border); transition: all .2s; }
.tour-dot.on { background: var(--accent, #7c5cff); width: 16px; border-radius: 3px; }
.tour-btns { display: flex; gap: 6px; }
.tour-btns button { font-size: 12px; padding: 6px 12px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border); background: var(--bg-2); color: var(--text-2); font-weight: 600; }
.tour-btns .tour-next { background: var(--accent, #7c5cff); color: #fff; border-color: transparent; }
.tour-btns .tour-skip:empty { display: none; }
.tour-btns button:hover { filter: brightness(1.08); }

/* ===== 模块权限锁占位 ===== */
.lock-card { display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 40px 20px; text-align: center;
  border: 1px dashed var(--border); border-radius: var(--radius);
  background: radial-gradient(120% 140% at 50% 0%, rgba(124,92,255,.06), transparent 60%); }
.lock-card .lock-ico { font-size: 34px; opacity: .8; }
.lock-card .lock-tip { font-size: 14px; color: var(--text-3); max-width: 420px; line-height: 1.6; }
.lock-card .lock-btn { display: inline-block; margin-top: 4px; text-decoration: none; font-weight: 700; font-size: 14px;
  padding: 9px 20px; border-radius: 10px; color: #fff;
  background: linear-gradient(90deg, var(--accent, #7c5cff), #9d7bff); box-shadow: 0 4px 14px rgba(124,92,255,.32); }
.lock-card .lock-btn:hover { transform: translateY(-1px); }
