/* ============================================================
   Step 9 个股透视页：高级金融数据仪表盘风格
   前缀 sdt- 避免与 stock-drawer.css (sd-) 冲突
   ============================================================ */

.stock-detail-page {
  padding: 0 0 80px;
  animation: rise .35s ease both;
}

/* ---- Sticky Header ---- */
.sdt-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0 12px;
  margin-bottom: 20px;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--line-soft);
}

.sdt-back {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line-soft);
  background: var(--bg-card);
  color: var(--ink-2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all .2s;
}
.sdt-back:hover { background: var(--bg-soft); color: var(--ink-1); border-color: var(--line-strong); }

.sdt-info { flex: 1; min-width: 0; }
.sdt-name {
  font-size: 16px; font-weight: 700; color: var(--ink-1);
  display: flex; align-items: center; gap: 8px;
}
.sdt-code { font-size: 12px; color: var(--ink-3); font-weight: 500; }

.sdt-price-wrap { text-align: right; flex-shrink: 0; }
.sdt-price { font-size: 20px; font-weight: 900; color: var(--ink-1); font-family: var(--font-num); letter-spacing: -.02em; }
.sdt-chg { font-size: 13px; font-weight: 800; font-family: var(--font-num); }
.sdt-chg.up { color: var(--up); }
.sdt-chg.down { color: var(--down); }

/* ---- 综合诊断横幅 ---- */
.sdt-verdict {
  display: flex; align-items: center; gap: 18px;
  padding: 16px 18px; margin-bottom: 20px;
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  flex-wrap: wrap;
}
.sdt-verdict-score {
  display: flex; flex-direction: column; align-items: center;
  min-width: 74px;
}
.sdt-verdict-num {
  font-size: 42px; font-weight: 900; font-family: var(--font-num);
  line-height: 1;
}
.sdt-verdict-label {
  font-size: 12px; font-weight: 700; color: var(--ink-3);
  margin-top: 4px; white-space: nowrap;
}
.sdt-verdict-summary { flex: 1; min-width: 0; }
.sdt-verdict-line {
  font-size: 13.5px; color: var(--ink-2); line-height: 1.8;
  display: flex; align-items: baseline; gap: 7px;
}
.sdt-verdict-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
  margin-top: 7px;
}
.sdt-verdict-actions {
  display: flex; flex-direction: column; gap: 7px;
  flex-shrink: 0;
}
.sdt-va-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 700;
  background: var(--grad-brand); color: #fff;
  border: none; cursor: pointer;
  box-shadow: var(--shadow-pop);
  transition: transform .18s;
  white-space: nowrap;
}
.sdt-va-btn:hover { transform: scale(1.04); }
.sdt-va-btn svg { width: 14px; height: 14px; }
.sdt-va-btn.star {
  background: var(--bg-soft); color: var(--c-gold);
  border: 1.5px solid rgba(247,169,37,0.3);
  box-shadow: none;
}
.sdt-va-btn.star:hover { background: rgba(247,169,37,0.12); }
.sdt-va-btn.starred {
  background: rgba(247,169,37,0.15); color: var(--c-gold);
  border-color: rgba(247,169,37,0.5);
}

/* ---- Section ---- */
.sdt-section {
  margin-bottom: 24px;
}
.sdt-sec-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 16px; font-weight: 700; color: var(--ink-1);
  margin-bottom: 14px;
}
.sdt-sec-title svg { width: 18px; height: 18px; color: var(--c-gold); }

/* ---- Metrics Grid ---- */
.sdt-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.sdt-metric {
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  padding: 14px 16px;
  text-align: center;
}
.sdt-metric-label {
  font-size: 12px; color: var(--ink-3); font-weight: 600; cursor: help;
  position: relative;
}
/* 指标悬浮解释 */
.sdt-metric-label[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%);
  background: var(--ink-1); color: var(--bg-base);
  font-size: 11px; font-weight: 500;
  padding: 5px 10px; border-radius: 8px;
  white-space: nowrap; z-index: 20;
  pointer-events: none;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}
.sdt-metric-value {
  font-size: 24px; font-weight: 900; font-family: var(--font-num);
  display: block; line-height: 1.2;
}
.sdt-metric-value small { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-left: 1px; }
.sdt-metric-sub { font-size: 12px; color: var(--ink-3); display: block; margin-top: 2px; }

/* ---- Valuation Gauges ---- */
.sdt-valuation-grid {
  display: flex; gap: 16px; justify-content: center;
}
.sdt-val-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  padding: 16px 20px;
  min-width: 90px;
}
.sdt-val-num {
  font-size: 28px; font-weight: 900; font-family: var(--font-num);
  line-height: 1;
}
.sdt-val-label {
  font-size: 13px; color: var(--ink-2); font-weight: 600;
}
.sdt-mini-gauge {
  display: block; width: 52px; height: auto;
  margin-top: 2px; opacity: 0.7;
}
.sdt-val-note {
  margin-top: 14px; font-size: 12.5px; color: var(--ink-3); text-align: center;
  line-height: 1.6;
}

.sdt-diary-btn {
  display: block; width: 100%; margin-top: 14px;
  padding: 10px 0; border-radius: 10px;
  border: 1px solid var(--c-gold, #F7A925);
  background: rgba(247,169,37,.08); color: var(--c-gold, #F7A925);
  font-size: 14px; font-weight: 700; cursor: pointer;
  transition: background .2s; font-family: inherit;
  text-align: center;
}
.sdt-diary-btn:hover { background: rgba(247,169,37,.18); }

/* ---- Strategy Fit Cards ---- */
.sdt-sds-grid {
  display: flex; flex-direction: column; gap: 8px;
}
.sdt-sds-card {
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  transition: all .2s;
}
.sdt-sds-card:hover { box-shadow: var(--shadow-card); }
.sdt-sds-card .persona .avatar { width: 34px; height: 34px; }
.sdt-sds-fit {
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  display: flex; align-items: center; gap: 12px;
}
.sdt-sds-fit .fit-ring { width: 62px; }
.sdt-sds-fit-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sdt-sds-factors { font-size: 11px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sdt-lock-tip {
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--bg-soft);
  border-radius: var(--r-sm);
  font-size: 12.5px; color: var(--ink-3);
  display: flex; align-items: center; gap: 6px;
}

/* ---- Health Grid ---- */
.sdt-health-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.sdt-health-card {
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  padding: 14px;
}
.sdt-card-head {
  display: flex; align-items: center; gap: 6px;
  font-size: 13.5px; font-weight: 700; color: var(--ink-1);
  margin-bottom: 10px;
}
.sdt-card-head .dot { width: 8px; height: 8px; border-radius: 50%; }

/* Progress rows */
.sdt-progress-row {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px;
}
.sdt-progress-label { font-size: 12px; color: var(--ink-2); width: 74px; flex-shrink: 0; white-space: nowrap; }
.sdt-progress-track {
  flex: 1; height: 6px; background: var(--bg-sunk); border-radius: 3px; overflow: hidden;
}
.sdt-progress-track i { display: block; height: 100%; border-radius: 3px; transition: width .5s ease; }
.sdt-progress-val { font-size: 12px; font-weight: 700; color: var(--ink-1); font-family: var(--font-num); width: 44px; text-align: right; }

/* ---- Grade Badge ---- */
.sdt-grade {
  font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 100px;
  margin-left: auto;
}
.sdt-grade.gold { background: rgba(247,169,37,0.12); color: var(--c-gold); }
.sdt-grade.sky { background: rgba(78,168,255,0.12); color: var(--c-sky); }

/* ---- Backtest Grid ---- */
.sdt-bt-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

/* ---- Snapshot ---- */
.sdt-snapshot {
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  padding: 4px 0;
}
.sdt-snap-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line-soft);
}
.sdt-snap-row:last-child { border-bottom: none; }
.sdt-snap-row span { font-size: 13.5px; color: var(--ink-2); }
.sdt-snap-row b { font-size: 13.5px; font-weight: 700; color: var(--ink-1); }
.sdt-snap-row b.up { color: var(--up); }

/* ---- Empty / Loading State ---- */
.sdt-empty-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: 60dvh; text-align: center;
  padding: 40px 20px;
}
.sdt-empty-icon {
  margin-bottom: 16px; opacity: 0.35;
}
.sdt-empty-icon svg { width: 48px; height: 48px; }
.sdt-empty-title {
  font-size: 16px; font-weight: 700;
  color: var(--ink-1); margin-bottom: 8px;
}
.sdt-empty-sub {
  font-size: 13px; color: var(--ink-3);
  max-width: 280px; line-height: 1.7; margin-bottom: 24px;
}
.sdt-empty-actions {
  display: flex; gap: 10px; flex-wrap: wrap;
  justify-content: center;
}
.sdt-empty-btn {
  padding: 9px 22px; border-radius: 10px;
  font-size: 14px; font-weight: 700; cursor: pointer;
  border: 1.5px solid var(--line-2);
  background: var(--bg-card); color: var(--ink-1);
  transition: transform 0.15s, box-shadow 0.15s;
}
.sdt-empty-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-pop); }
.sdt-empty-btn.primary {
  background: var(--c-gold); color: #fff;
  border-color: var(--c-gold);
}
.sdt-loading .ls-spinner { display: flex; gap: 8px; justify-content: center; }
.sdt-loading .ls-spinner i {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--c-gold); animation: ls-bounce 1.2s infinite; display: inline-block;
}
.sdt-loading .ls-spinner i:nth-child(2) { animation-delay: .2s; }
.sdt-loading .ls-spinner i:nth-child(3) { animation-delay: .4s; }

/* ---- Mobile ---- */
@media (max-width: 768px) {
  .sdt-header { padding: 8px 0 8px; margin-bottom: 14px; }
  .sdt-name { font-size: 15px; }
  .sdt-price { font-size: 18px; }
  .sdt-metrics-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .sdt-metric { padding: 10px 12px; }
  .sdt-metric-value { font-size: 20px; }
  .sdt-health-grid { grid-template-columns: 1fr; }
  .sdt-bt-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .sdt-valuation-grid { gap: 10px; }
  .sdt-val-item { padding: 12px 14px; min-width: 70px; }
  .sdt-val-num { font-size: 24px; }
  .sdt-mini-gauge { width: 44px; }
  .sdt-progress-label { width: 60px; font-size: 10px; }
  .sdt-verdict { flex-direction: column; align-items: stretch; gap: 12px; }
  .sdt-verdict-score { flex-direction: row; gap: 10px; align-items: baseline; }
  .sdt-verdict-num { font-size: 32px; }
  .sdt-verdict-actions { flex-direction: row; }
}

/* --- 信号回溯 --- */
.sdt-bt-list {
  display: flex; flex-direction: column; gap: 8px;
}
.sdt-bt-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all .2s;
}
.sdt-bt-row:hover {
  border-color: var(--c-gold);
  box-shadow: var(--shadow-card);
  transform: translateX(3px);
}
.sdt-bt-info { flex: 1; min-width: 0; }
.sdt-bt-info b {
  display: block; font-size: 14px; font-weight: 800;
}
.sdt-bt-info span {
  font-size: 11.5px; color: var(--ink-3); font-weight: 600;
}
.sdt-bt-arrow { color: var(--ink-3); flex: none; }
.sdt-bt-arrow svg { width: 14px; height: 14px; }

@media (max-width: 560px) {
  .sdt-bt-row { padding: 10px 12px; }
  .sdt-bt-info b { font-size: 13px; }
}

/* ============================================================
   双栏联动：骨架屏 / 空态三级兜底 / 来自对话高亮
   ============================================================ */

/* ---------- 骨架屏（加载中） ---------- */
.sdt-skel { padding: 16px 18px 40px; max-width: 860px; margin: 0 auto; }
.sk {
  display: block; border-radius: 10px;
  background: linear-gradient(90deg, var(--bg-soft) 25%, var(--bg-tint) 50%, var(--bg-soft) 75%);
  background-size: 200% 100%;
  animation: skShimmer 1.4s ease-in-out infinite;
}
@keyframes skShimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}
.sdt-skel-head { display: flex; align-items: center; gap: 14px; padding: 6px 0 16px; }
.sk-circle { width: 46px; height: 46px; border-radius: 14px; flex: none; }
.sdt-skel-lines { flex: 1; display: grid; gap: 8px; }
.sk-line { height: 14px; }
.sk-pill { width: 86px; height: 30px; border-radius: 999px; flex: none; }
.sk-banner { height: 96px; border-radius: 16px; margin-bottom: 14px; }
.sdt-skel-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.sk-cell { height: 64px; border-radius: 13px; }
.sk-block { height: 150px; border-radius: 16px; }
.sdt-skel-note { margin-top: 16px; text-align: center; font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
@media (max-width: 720px) { .sdt-skel-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- 空态：基础行情条 + 推荐 ---------- */
.sdt-empty-code { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.sdt-empty-quote {
  margin: 4px auto 14px; padding: 12px 18px;
  display: inline-block; text-align: center;
  background: var(--bg-card); border: 1px solid var(--line-soft);
  border-radius: 14px; box-shadow: var(--shadow-card);
}
.sdt-eq-price { display: flex; align-items: baseline; justify-content: center; gap: 8px; }
.sdt-eq-price b { font-size: 24px; font-weight: 900; font-family: var(--font-num); }
.sdt-eq-price .up { color: var(--up); font-weight: 800; }
.sdt-eq-price .down { color: var(--down); font-weight: 800; }
.sdt-eq-meta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 6px; font-size: 12px; color: var(--ink-3); font-weight: 600; }
.sdt-empty-recs { margin-top: 22px; }
.sdt-empty-recs-t { font-size: 12px; color: var(--ink-3); font-weight: 700; margin-bottom: 9px; }
.sdt-empty-recs-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.sdt-rec-chip {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 8px 14px; border-radius: 12px; cursor: pointer;
  background: var(--bg-card); border: 1px solid var(--line-soft);
  transition: border-color .18s, transform .18s;
}
.sdt-rec-chip:hover { border-color: var(--c-gold); transform: translateY(-1px); }
.sdt-rec-chip b { font-size: 13px; font-weight: 800; }
.sdt-rec-chip span { font-size: 11px; color: var(--ink-3); font-family: var(--font-num); }

/* ---------- 来自对话：个股页头部金色脉冲 ---------- */
@keyframes sdtFromChat {
  0%   { box-shadow: 0 0 0 0 rgba(247,169,37,.55); }
  100% { box-shadow: 0 0 0 16px rgba(247,169,37,0); }
}
.from-chat-nav .sdt-header { animation: sdtFromChat 1.6s ease-out 2; }
