/* ═══════════════════════════════════════════════════════════
   板块个股明细 — 暗色大表格 (跟 sector 看板 #0f172a / #1e293b 对齐)
   ═══════════════════════════════════════════════════════════ */
:root {
  --fire:    #10b981;     /* ≥70 绿 */
  --strong:  #3b82f6;     /* ≥55 蓝 */
  --mid:     #f59e0b;     /* ≥40 黄 */
  --weak:    #ef4444;     /* <40 红 */
  --bg-card: rgba(15,23,42,0.85);          /* 默认暗色,跟 sector 看板一致 */
  --bg-dim:  rgba(30,41,59,0.85);
  --bg-head: #0f172a;
  --bg-table-stripe: rgba(255,255,255,0.025);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-soft: rgba(255,255,255,0.06);
  --border-mid:  rgba(255,255,255,0.12);
}

.sd-wrap { width: 100%; }

/* ── head ── */
.sd-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin: 18px 0 12px; padding: 16px 20px;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border-radius: 12px;
  border: 1px solid var(--border-soft);
}
.sd-title { font-size: 20px; font-weight: 800; letter-spacing: -.3px; color: var(--text-primary); }
.sd-title .dot {
  display: inline-block; width: 8px; height: 8px;
  background: linear-gradient(135deg,#10b981,#3b82f6);
  border-radius: 50%; margin-right: 8px;
}
.sd-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.sd-meta { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-muted); }
.sd-pill {
  padding: 2px 10px; border-radius: 12px;
  background: rgba(239,68,68,0.18); color: #fca5a5;
  font-weight: 700;
}

/* ── 筛选 ── */
.sd-filters {
  display: flex; flex-direction: column; gap: 12px;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border-radius: 12px;
  border: 1px solid var(--border-soft);
}
.sd-filter { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sd-flabel { font-size: 12px; font-weight: 700; color: var(--text-secondary); min-width: 80px; }
.sd-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sd-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  border-radius: 16px;
  background: #f4f7fb;
  border: 1px solid var(--border-soft);
  font-size: 12px; cursor: pointer;
  user-select: none;
  color: var(--text-secondary);
  transition: all .15s;
}
.sd-chip input { display: none; }
.sd-chip:has(input:checked) {
  background: rgba(59,130,246,0.22);
  border-color: rgba(59,130,246,0.55);
  color: #2058a5; font-weight: 700;
}
.sd-chip .cnt {
  display: inline-block; padding: 0 5px;
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
  font-size: 10px; font-weight: 700;
  color: var(--text-secondary);
}

.sd-cascader { display: flex; align-items: center; gap: 4px; }
.sd-cascader select {
  padding: 5px 8px; border-radius: 8px;
  border: 1px solid var(--border-soft);
  background: #f4f7fb;
  color: var(--text-primary);
  font-size: 12px;
}
.sd-cascader .arr { color: #64748b; font-size: 12px; }

/* ── 引擎 Δ 级联 ── */
#sdDeltaRules { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.sd-delta-row {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 6px;
  background: #f4f7fb;
  border-radius: 8px;
}
.sd-delta-row select {
  padding: 4px 6px; border-radius: 6px;
  border: 1px solid var(--border-soft);
  background: #f4f7fb;
  color: var(--text-primary);
  font-size: 12px;
}
.sd-arrow { font-size: 12px; color: #64748b; }
.sd-x {
  background: transparent; border: 0; cursor: pointer;
  color: #fca5a5; font-size: 18px; font-weight: 700;
  width: 24px; height: 24px;
  border-radius: 6px;
}
.sd-x:hover { background: rgba(239,68,68,0.18); }

/* ── 按钮 ── */
.sd-btn {
  padding: 6px 14px; border-radius: 8px;
  border: 1px solid var(--border-soft);
  background: #f4f7fb;
  color: var(--text-primary);
  font-size: 12px; cursor: pointer;
  transition: all .15s;
}
.sd-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,0.18); background: rgba(51,65,85,0.85); }
.sd-btn-ghost  { background: #f4f7fb; }
.sd-btn-primary { background: linear-gradient(135deg,#3b82f6,#6366f1); color: white; border-color: transparent; font-weight: 700; }
.sd-btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.sd-btn-sm { padding: 4px 10px; font-size: 11px; }

/* ── 表格 ── */
.sd-table-wrap {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  overflow-x: auto;
  max-width: 100%;
}
.sd-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}
.sd-table thead {
  background: linear-gradient(135deg,#0f172a,#1e293b);
  color: #263751;
}
.sd-table th {
  font-weight: 700;
  padding: 10px 8px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,.12);
  white-space: nowrap;
  font-size: 11px;
  color: #53627a;
}
.sd-table th.sortable { cursor: pointer; user-select: none; }
.sd-table th.sortable:hover { background: rgba(255,255,255,0.08); color: #192942; }
.sd-table td {
  padding: 8px 6px;
  text-align: center;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
  color: var(--text-primary);
}
.sd-table tbody tr:nth-child(even) { background: var(--bg-table-stripe); }
.sd-table tbody tr:hover { background: rgba(59,130,246,0.10); }

/* ── 引擎分 pill + 角标 ── */
.sd-eng-cell { padding: 4px 4px; }
.eng-pip {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 11px;
  border: 1px solid transparent;
  min-width: 32px;
  text-align: center;
}
.eng-pip.s-fire   { background: rgba(251,191,36,.18); color: #a65a10; border-color: rgba(251,191,36,.50); box-shadow: 0 0 0 1px rgba(251,191,36,.18) inset; }
.eng-pip.s-strong { background: rgba(52,211,153,.14); color: #168263; border-color: rgba(52,211,153,.35); }
.eng-pip.s-mid    { background: rgba(147,197,253,.08); color: #2058a5; border-color: rgba(147,197,253,.20); }
.eng-pip.s-weak   { background: rgba(100,116,139,.06); color: #64748b; border-color: transparent; }

.eng-deltas { margin-top: 3px; display: flex; gap: 3px; justify-content: center; }
.d-tag {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
}
.d-tag.d-up   { background: rgba(239,68,68,.18); color: #fca5a5; }
.d-tag.d-dn   { background: rgba(16,185,129,.14);  color: #168263; }
.d-tag.d-id   { background: rgba(255,255,255,.08); color: #64748b; }
.d-tag.d-na   { background: transparent; color: #64748b; }

/* ── 景气度进度条 ── */
.sd-prosperity {
  position: relative;
  display: flex; align-items: center; gap: 5px;
}
.sd-pros-bar {
  flex: 1;
  height: 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
  min-width: 30px;
}
.sd-pros-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .3s ease;
}
.sd-pros-fill.s-fire   { background: linear-gradient(90deg,#34d399,#10b981); }
.sd-pros-fill.s-strong { background: linear-gradient(90deg,#60a5fa,#3b82f6); }
.sd-pros-fill.s-mid    { background: linear-gradient(90deg,#fbbf24,#f59e0b); }
.sd-pros-fill.s-weak   { background: linear-gradient(90deg,#fca5a5,#ef4444); }
.sd-pros-cell {
  text-align: left;
  white-space: nowrap;
}
.sd-pros-cell .sd-prosperity span {
  font-weight: 700; font-size: 11px;
  min-width: 24px;
}
/* 景气度 Δ 角标 */
.sd-pros-deltas { display: flex; gap: 3px; margin-top: 2px; justify-content: flex-start; }

/* ── 战法 ── */
.sd-ma20 { font-size: 11px; line-height: 1.4; }
.sd-ma20 b { font-weight: 700; }
.sd-reason { color: var(--text-muted); font-size: 10px; }

/* ── 涨跌幅: 红涨绿跌(中国习惯) ── */
.sd-ch.d-up { color: #fca5a5; font-weight: 700; }
.sd-ch.d-dn { color: #168263; font-weight: 700; }
.sd-ch.d-id { color: var(--text-muted); }
.sd-ch      { font-family: ui-monospace, SFMono-Regular, monospace; font-size: 11px; }

/* ── 股票代码/名称可点击跳转 ── */
.sd-code, .sd-name-link {
  color: #2058a5;
  cursor: pointer;
  text-decoration: none;
  font-weight: 700;
}
.sd-code:hover, .sd-name-link:hover {
  text-decoration: underline;
  color: #bfdbfe;
}

/* ── 操作列 ── */
.sd-act { text-align: center; }
.sd-add-wrap select {
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid var(--border-soft);
  background: #f4f7fb;
  color: var(--text-primary);
  font-size: 11px;
  cursor: pointer;
}

/* ── 分页 ── */
.sd-pager {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 14px 0;
  padding: 10px 16px;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border-radius: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}
.sd-page-input {
  width: 48px; padding: 2px 4px;
  border-radius: 6px;
  border: 1px solid var(--border-soft);
  background: #f4f7fb;
  color: var(--text-primary);
  text-align: center;
}
.sd-total { color: var(--text-muted); margin-left: auto; }

/* ── empty / loading ── */
.sd-loading, .sd-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 60px 20px;
  background: var(--bg-card); border-radius: 12px;
  margin: 24px 0;
}
.sd-empty-row {
  text-align: center; padding: 40px; color: #64748b;
}
.sd-empty .emoji { font-size: 36px; }

/* ── toast ── */
.sd-toast {
  position: fixed; bottom: 30px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(16,185,129,.95); color: white;
  padding: 10px 18px; border-radius: 24px;
  box-shadow: 0 8px 20px rgba(0,0,0,.18);
  font-size: 13px; font-weight: 700;
  opacity: 0; transition: all .25s ease;
  z-index: 9999;
}
.sd-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.sd-toast.err  { background: rgba(239,68,68,.95); }

/* ── 响应式 ── */
@media (max-width: 1100px) {
  .sd-table { font-size: 11px; }
  .sd-table th, .sd-table td { padding: 6px 3px; }
}
