/* ============================================================
   基础样式：reset / 排版 / 氛围背景 / 通用组件
   ============================================================ */

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--ink-1);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.35s ease, color 0.35s ease;
}

button { font-family: inherit; border: none; background: none; cursor: pointer; color: inherit; }
input { font-family: inherit; border: none; outline: none; background: none; color: inherit; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
svg { display: block; }

.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }

/* 涨跌色（A股红涨绿跌） */
.up { color: var(--up); }
.down { color: var(--down); }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 9px; }
::-webkit-scrollbar-track { background: transparent; }

::selection { background: rgba(247, 169, 37, 0.28); }

/* ---------- 氛围背景：糖果光斑 + 深色星野 ---------- */
.ambient { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.ambient i { position: absolute; border-radius: 50%; filter: blur(72px); will-change: transform; }
.ambient .b1 { width: 44vw; height: 44vw; min-width: 320px; min-height: 320px; background: var(--blob-1); top: -12%; left: -10%; animation: drift 26s ease-in-out infinite alternate; }
.ambient .b2 { width: 36vw; height: 36vw; min-width: 280px; min-height: 280px; background: var(--blob-2); bottom: -14%; right: -8%; animation: drift 32s ease-in-out infinite alternate-reverse; }
.ambient .b3 { width: 26vw; height: 26vw; min-width: 220px; min-height: 220px; background: var(--blob-3); top: 34%; right: 16%; animation: drift 38s ease-in-out infinite alternate; }
.ambient .b4 { width: 22vw; height: 22vw; min-width: 180px; min-height: 180px; background: var(--blob-4); bottom: 22%; left: 12%; animation: drift 30s ease-in-out infinite alternate-reverse; }

[data-theme="dark"] .ambient {
  background-image:
    radial-gradient(1.4px 1.4px at 12% 22%, rgba(255,255,255,0.55) 50%, transparent 51%),
    radial-gradient(1px 1px at 68% 12%, rgba(255,255,255,0.4) 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 84% 38%, rgba(255,255,255,0.5) 50%, transparent 51%),
    radial-gradient(1px 1px at 32% 64%, rgba(255,255,255,0.35) 50%, transparent 51%),
    radial-gradient(1.3px 1.3px at 52% 84%, rgba(255,255,255,0.45) 50%, transparent 51%),
    radial-gradient(1px 1px at 90% 76%, rgba(255,255,255,0.3) 50%, transparent 51%);
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(4vw, 3vh, 0) scale(1.12); }
}

/* ---------- 卡片 ---------- */
.card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-card);
  padding: 22px;
  overflow: hidden;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.28s ease;
}
.card::before { /* hover 边缘光效 */
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: linear-gradient(135deg, rgba(255,143,177,0.55), rgba(247,169,37,0.55));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-float); }
.card:hover::before { opacity: 1; }

.card-head { display: flex; align-items: center; gap: 13px; margin-bottom: 18px; }
.card-head .titles { min-width: 0; flex: 1; }
.kicker {
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.14em;
  color: var(--ink-3); text-transform: uppercase;
}
.card-title { font-size: 19px; font-weight: 800; letter-spacing: 0.01em; margin-top: 2px; }

/* 卡片图标徽章（色彩节奏） */
.card-badge {
  width: 48px; height: 48px; border-radius: 16px; flex: none;
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 6px 16px -4px rgba(27, 35, 64, 0.3);
}
.card-badge svg { width: 24px; height: 24px; }

/* 聊一聊 幽灵按钮 */
.btn-chat {
  flex: none;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 700;
  color: var(--c-gold);
  background: rgba(247, 169, 37, 0.10);
  border: 1.5px solid rgba(247, 169, 37, 0.35);
  padding: 9px 16px; border-radius: 999px;
  transition: background 0.2s, transform 0.2s;
}
.btn-chat:hover { background: rgba(247, 169, 37, 0.22); transform: scale(1.05); }
.btn-chat svg { width: 16px; height: 16px; }

/* 数据呼吸脉冲点 */
.pulse-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--c-mint); flex: none; }
.pulse-dot::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 1.5px solid var(--c-mint);
  animation: pulse 2.2s ease-out infinite;
}
@keyframes pulse {
  0% { transform: scale(0.5); opacity: 0.9; }
  70% { transform: scale(1.4); opacity: 0; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* 免费用户模糊数据 */
.masked { position: relative; display: inline-block; }
.masked > .blur { filter: blur(5px); user-select: none; pointer-events: none; }
.lock-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 700; color: var(--ink-2);
  background: var(--bg-soft); border: 1px solid var(--line-soft);
  border-radius: 999px; padding: 3px 9px;
}
.lock-chip svg { width: 12px; height: 12px; }

/* 卡片级权益引导行（克制：一句话 + 一个入口） */
.tier-hint {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 12.5px; color: var(--ink-3);
  padding: 10px 14px; margin-top: 10px;
  background: var(--bg-soft); border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
}
.tier-hint-link {
  flex: none; font-size: 12.5px; font-weight: 800; color: var(--c-gold);
  background: none; border: none; cursor: pointer; padding: 0;
}
.tier-hint-link:hover { text-decoration: underline; }

/* 标签 */
.tag {
  display: inline-flex; align-items: center;
  font-size: 12.5px; font-weight: 700;
  padding: 4px 11px; border-radius: 999px;
  background: var(--bg-soft); color: var(--ink-2);
  border: 1px solid var(--line-soft);
  white-space: nowrap;
}
.tag.gold { color: #A96E00; background: rgba(247,169,37,0.14); border-color: rgba(247,169,37,0.32); }
.tag.coral { color: #D94F7E; background: rgba(255,107,157,0.12); border-color: rgba(255,107,157,0.30); }
.tag.mint { color: #0E8F73; background: rgba(34,201,162,0.12); border-color: rgba(34,201,162,0.30); }
.tag.sky { color: #2B7CD9; background: rgba(78,168,255,0.12); border-color: rgba(78,168,255,0.30); }
.tag.lilac { color: #7558C4; background: rgba(155,126,222,0.13); border-color: rgba(155,126,222,0.32); }
[data-theme="dark"] .tag.gold { color: var(--c-gold); }
[data-theme="dark"] .tag.coral { color: var(--c-coral); }
[data-theme="dark"] .tag.mint { color: var(--c-mint); }
[data-theme="dark"] .tag.sky { color: var(--c-sky); }
[data-theme="dark"] .tag.lilac { color: var(--c-lilac); }

/* 图标按钮 */
.icon-btn {
  width: 44px; height: 44px; flex: none;
  display: grid; place-items: center;
  border-radius: 15px;
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-card);
  color: var(--ink-2);
  transition: transform 0.2s, color 0.2s;
}
.icon-btn:hover { transform: translateY(-2px); color: var(--ink-1); }
.icon-btn svg { width: 21px; height: 21px; }

/* 头像通用 */
.avatar { border-radius: 26%; overflow: hidden; flex: none; box-shadow: 0 4px 12px rgba(27,35,64,0.18); }
.avatar.round { border-radius: 50%; }
.avatar svg { width: 100%; height: 100%; }

/* 头像堆叠 */
.avatar-stack { display: flex; align-items: center; }
.avatar-stack .avatar { border: 2.5px solid var(--bg-card); margin-left: -11px; }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* 入场动画 */
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
.rise { animation: rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both; }

/* ============================================================
   大师身份系统 + 共鸣仪（masters.js 配套样式）
   ============================================================ */

/* 风格族 chip */
.fam-chip {
  display: inline-flex; align-items: center; flex: none;
  font-size: 11px; font-weight: 700; line-height: 1;
  padding: 4px 9px; border-radius: 999px;
}
.fam-conservative { color: var(--fam-conservative); background: var(--fam-conservative-soft); }
.fam-steady       { color: var(--fam-steady);       background: var(--fam-steady-soft); }
.fam-balanced     { color: var(--fam-balanced);     background: var(--fam-balanced-soft); }
.fam-aggressive   { color: var(--fam-aggressive);   background: var(--fam-aggressive-soft); }
.fam-radical      { color: var(--fam-radical);      background: var(--fam-radical-soft); }

/* 人格化头部 */
.persona { display: flex; align-items: center; gap: 10px; min-width: 0; }
.persona .avatar { width: 40px; height: 40px; }
.persona-sm .avatar { width: 30px; height: 30px; }
.persona-id { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.persona-id b { font-size: 14px; font-weight: 800; color: var(--ink-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.persona-sm .persona-id b { font-size: 13px; }
.persona-id span { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 共鸣仪：与温度计同一半圆弧语法 */
.fit-ring { position: relative; display: inline-block; width: 56px; flex: none; }
.fit-ring svg { width: 100%; display: block; }
.fit-track { stroke: var(--line-strong); stroke-width: 7; stroke-linecap: round; }
.fit-val { stroke: var(--fit-c, var(--c-gold)); stroke-width: 7; stroke-linecap: round; transition: stroke-dasharray .6s cubic-bezier(0.22,1,0.36,1); }
.fit-num {
  position: absolute; left: 0; right: 0; bottom: -2px;
  text-align: center; font-size: 15px; font-weight: 900;
  font-family: var(--font-num); color: var(--fit-c, var(--c-gold));
}
.fit-masked .fit-num { color: var(--ink-3); letter-spacing: 1px; }

/* 排名徽章（口径感知） */
.fit-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; color: var(--ink-2); font-weight: 600;
}
.fit-badge b { color: var(--ink-1); font-family: var(--font-num); }
.fit-badge-none { color: var(--ink-3); }
.fit-scope {
  font-style: normal; font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 6px; flex: none;
}
.fit-scope-ind { color: var(--c-sky); background: rgba(78,168,255,.12); }
.fit-scope-mkt { color: var(--c-lilac); background: rgba(155,126,222,.12); }

/* 共鸣仪整行 */
.fit-row { display: flex; align-items: center; gap: 10px; }
.fit-row .persona { flex: 1; }
.fit-right { display: inline-flex; align-items: center; gap: 10px; flex: none; }

/* 诚实徽章：数据质量/口径说明的统一容器 */
.honest-note {
  display: flex; align-items: flex-start; gap: 6px;
  font-size: 11px; line-height: 1.6; color: var(--ink-3);
  padding: 8px 12px; border-radius: var(--r-sm);
  background: var(--bg-soft);
}
.honest-note svg { width: 13px; height: 13px; flex: none; margin-top: 2px; opacity: .7; }

/* ============================================================
   模拟数据角标 & 数据时效标注（真实数据不渲染角标）
   ============================================================ */
.sim-badge {
  display: inline-flex; align-items: center; flex: none;
  font-size: 10px; font-weight: 700; line-height: 1;
  color: var(--c-gold, #F7A925);
  background: rgba(247, 169, 37, 0.12);
  border: 1px solid rgba(247, 169, 37, 0.35);
  padding: 3px 6px; border-radius: 6px;
  margin-left: 6px; vertical-align: middle;
  cursor: help; white-space: nowrap;
}

/* 数据截至标注（温度卡内） */
.th-asof {
  font-size: 11px; color: var(--ink-3, #888);
  margin-top: 8px;
  display: flex; align-items: center; gap: 4px;
}

/* 策略卡回测数据日期 */
.sc-bt-date, .wiz-rc-date, .cd-card-date {
  font-size: 10.5px; color: var(--ink-3, #888);
  margin-top: 6px;
}

/* 策略页行业排名模拟说明 */
.sr-mock-note {
  display: block; font-size: 10.5px; color: var(--ink-3, #888);
  font-weight: 400; margin-top: 3px;
}

/* 抽屉/详情页空数据提示 */
.sd-empty-note {
  font-size: 12px; color: var(--ink-3, #888);
  padding: 14px 12px; text-align: center;
  border-radius: var(--r-sm, 10px);
  background: var(--bg-soft, rgba(255,255,255,0.04));
}
