/* ============================================================
   Step 3 个股透视抽屉
   PC: 右侧滑出面板（420px）  Mobile: 底部上滑面板（92vh）
   ============================================================ */

/* ---------- 遮罩 ---------- */
.sd-mask {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(12, 16, 38, 0.38);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.32s ease;
}
.sd-mask.open { opacity: 1; pointer-events: auto; }

/* ---------- 面板 ---------- */
.sd-panel {
  position: fixed; z-index: 71;
  display: flex; flex-direction: column;
  background: var(--bg-card);
  box-shadow: var(--shadow-float);
  transition: transform 0.38s cubic-bezier(0.32, 0.9, 0.3, 1);
}

/* PC: 右侧滑出 */
@media (min-width: 1024px) {
  .sd-panel {
    top: 0; right: 0; bottom: 0;
    width: 440px; max-width: 92vw;
    border-left: 1px solid var(--line-soft);
    transform: translateX(110%);
  }
  .sd-panel.open { transform: translateX(0); }
  .sd-grabber { display: none; }
}

/* Mobile: 底部上滑 */
@media (max-width: 1023px) {
  .sd-panel {
    left: 0; right: 0; bottom: 0;
    max-height: 92dvh;
    border-radius: 24px 24px 0 0;
    transform: translateY(102%);
    padding-top: 0;
  }
  .sd-panel.open { transform: translateY(0); }
  .sd-grabber {
    position: sticky; top: 0; z-index: 2;
    display: flex; justify-content: center;
    padding: 10px 0 4px;
    background: var(--bg-card);
    border-radius: 24px 24px 0 0;
  }
  .sd-grabber::after {
    content: "";
    width: 36px; height: 4.5px; border-radius: 999px;
    background: var(--line-strong);
  }
}

/* ---------- 头部 ---------- */
.sd-head {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--line-soft);
  flex: none;
}
.sd-close {
  width: 36px; height: 36px; border-radius: 11px; flex: none;
  display: grid; place-items: center;
  background: var(--bg-soft); color: var(--ink-2);
  border: 1px solid var(--line-soft);
  transition: transform 0.2s;
}
.sd-close:hover { transform: scale(1.08); }
.sd-close svg { width: 16px; height: 16px; }
.sd-head-left { flex: 1; min-width: 0; }
.sd-stock-name { font-size: 20px; font-weight: 900; }
.sd-stock-code { font-size: 12.5px; color: var(--ink-3); font-family: var(--font-num); font-weight: 600; margin-top: 2px; }
.sd-head-right { text-align: right; flex: none; }
.sd-price { font-size: 26px; font-weight: 900; font-family: var(--font-num); }
.sd-chg { font-size: 14px; font-weight: 800; font-family: var(--font-num); margin-top: 1px; }

/* ---------- 内容区 ---------- */
.sd-body {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 18px 16px 34px;
  display: flex; flex-direction: column; gap: 24px;
}

/* ---------- 分区 ---------- */
.sd-section {
  background: var(--bg-soft);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  padding: 16px 18px;
}
.sd-sec-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.sd-sec-head h3 {
  font-size: 16px; font-weight: 900;
  display: flex; align-items: center; gap: 8px;
}
.sd-sec-head h3 svg { width: 17px; height: 17px; color: var(--c-gold); }

/* ---------- 1. 估值温度计 ---------- */
.sd-gauges {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.sd-gauge-item { text-align: center; }
.sd-gauge-label { font-size: 11px; color: var(--ink-3); font-weight: 700; display: block; margin-top: -8px; }
.sd-gauge-note {
  font-size: 12.5px; color: var(--ink-2); line-height: 1.8;
  margin-top: 12px; padding: 10px 12px;
  background: var(--bg-card); border-radius: 12px;
  border: 1px dashed var(--line-soft);
}

/* ---------- 2. 策略兼容罗盘 ---------- */
.sd-radar-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.sd-radar { width: 100%; max-width: 280px; }
.sd-radar-legend {
  width: 100%;
  display: grid; gap: 8px;
}
.sd-rl-item {
  display: grid; grid-template-columns: 30px 1fr 40px; align-items: center; gap: 10px;
  padding: 7px 10px; background: var(--bg-card); border-radius: 12px;
  border: 1px solid var(--line-soft);
}
.sd-rl-item .avatar { width: 30px; height: 30px; box-shadow: none; }
.sd-rl-name { font-size: 13px; font-weight: 800; }
.sd-rl-bar { height: 5px; border-radius: 5px; background: var(--bg-soft); overflow: hidden; margin-top: 4px; }
.sd-rl-bar i { display: block; height: 100%; border-radius: 5px; }
.sd-rl-score { font-size: 13px; font-weight: 800; font-family: var(--font-num); text-align: right; }
.sd-consensus { margin-top: 10px; }
.sd-consensus-tag { display: flex; flex-direction: column; gap: 5px; }
.sd-consensus-tag .tag { align-self: flex-start; }
.sd-consensus-list { font-size: 12px; color: var(--ink-2); font-weight: 600; margin-top: 2px; }

/* ---------- 3. 因子体检 ---------- */
.sd-bars { display: grid; gap: 16px; }
.sd-bar-row {
  display: grid; gap: 4px;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: 13px;
}
.sd-bar-label { font-size: 13px; font-weight: 800; color: var(--ink-2); }
.sd-bar-val { font-size: 22px; font-weight: 900; font-family: var(--font-num); }
.sd-bar-track {
  height: 12px; border-radius: 6px;
  background: var(--bg-soft); overflow: hidden;
  margin: 4px 0 6px;
}
.sd-bar-track i { display: block; height: 100%; border-radius: 6px; min-width: 2px; transition: width 0.7s ease; }
.sd-bar-ref {
  display: flex; gap: 16px; flex-wrap: wrap;
  font-size: 11px; color: var(--ink-3); font-weight: 600;
}
.sd-bar-ref span { display: flex; align-items: center; gap: 4px; }
.sd-bar-ref i {
  display: inline-block; width: 36px; height: 4px; border-radius: 4px;
  background: var(--line-strong);
}

/* ---------- 4. 快捷操作 ---------- */
.sd-actions-sec { background: none; border: none; padding: 0; }
.sd-action-btn {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px; border-radius: 16px;
  font-size: 15px; font-weight: 800;
  transition: transform 0.2s;
}
.sd-action-btn:hover { transform: scale(1.02); }
.sd-action-btn svg { width: 17px; height: 17px; }
.sd-action-btn.primary {
  background: var(--grad-brand); color: #fff;
  box-shadow: var(--shadow-pop);
}
.sd-action-btn:not(.primary) {
  background: var(--bg-soft); color: var(--ink-1);
  border: 1px solid var(--line-soft);
  margin-top: 8px;
}

/* body 状态 */
body.sd-open { overflow: hidden; }

/* 小屏适配 */
@media (max-width: 560px) {
  .sd-panel { max-height: 88dvh; }
  .sd-gauges { grid-template-columns: repeat(3, 1fr); gap: 4px; }
  .sd-gauge-label { font-size: 10px; }
  .sd-stock-name { font-size: 18px; }
  .sd-price { font-size: 22px; }
}
