/* =========================================================
   AI 复盘中心 · Global Stylesheet v3.0
   ========================================================= */

/* ── CSS 变量 ── */
:root {
  /* 主色系 */
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-soft: #eff6ff;
  --blue-mid: #dbeafe;
  /* 辅助色 */
  --green: #10b981;
  --green-soft: #ecfdf5;
  --orange: #f59e0b;
  --orange-soft: #fffbeb;
  --red: #ef4444;
  --red-soft: #fef2f2;
  --purple: #7c3aed;
  --purple-soft: #f5f3ff;
  /* 中性色 */
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --muted-light: #94a3b8;
  --line: #e2e8f0;
  --line-soft: #f1f5f9;
  /* 背景 */
  --bg: #f8fafc;
  --card: #ffffff;
  --card-soft: #f8fafc;
  /* 阴影 */
  --shadow-sm: 0 1px 3px rgba(15,23,42,.06), 0 4px 12px rgba(15,23,42,.04);
  --shadow: 0 4px 16px rgba(15,23,42,.07), 0 1px 4px rgba(15,23,42,.04);
  --shadow-md: 0 8px 28px rgba(15,23,42,.09), 0 2px 8px rgba(15,23,42,.05);
  --shadow-lg: 0 16px 48px rgba(15,23,42,.12), 0 4px 14px rgba(15,23,42,.06);
  --shadow-blue: 0 8px 24px rgba(37,99,235,.22);
}

/* ── 重置 & 基础 ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  min-height: 100vh;
  color: var(--text);
  font-family: "Inter", "PingFang SC", "Noto Sans SC", "Microsoft YaHei UI", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  background:
    radial-gradient(ellipse 70% 40% at 10% 0%, rgba(37,99,235,.07) 0%, transparent 70%),
    radial-gradient(ellipse 50% 35% at 90% 5%, rgba(124,58,237,.06) 0%, transparent 60%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 35%, #eef5ff 100%);
}

a { color: var(--blue); text-decoration: none; transition: color .15s; }
a:hover { color: var(--blue-dark); }
button, input, select, textarea { font: inherit; }
img { max-width: 100%; display: block; }

/* ── 品牌 ── */
.brand {
  display: flex; align-items: center; gap: 12px;
  font-weight: 900; font-size: 17px; letter-spacing: -0.03em; color: var(--text);
  text-decoration: none;
}
.brand-mark {
  width: 40px; height: 40px;
  border-radius: 13px;
  box-shadow: 0 8px 20px rgba(200,0,0,.28);
  flex-shrink: 0;
  object-fit: cover;
}
.brand small {
  display: block; font-size: 11.5px; font-weight: 600;
  color: var(--muted); letter-spacing: 0; margin-top: 1px;
}
.brand:hover .brand-mark { box-shadow: 0 10px 24px rgba(37,99,235,.42); }

/* ── 顶栏 ── */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  width: min(1100px, calc(100% - 40px)); margin: 18px auto 0;
  padding: 12px 18px;
  border: 1px solid rgba(226,232,240,.9); border-radius: 18px;
  background: rgba(255,255,255,.88); backdrop-filter: blur(20px) saturate(160%);
  box-shadow: var(--shadow-sm);
}
.topbar nav { display: flex; gap: 16px; align-items: center; }
.topbar nav a {
  color: var(--text-2); font-weight: 700; font-size: 14px;
  padding: 6px 10px; border-radius: 9px; transition: .15s;
}
.topbar nav a:hover, .topbar nav a.active {
  color: var(--blue); background: var(--blue-soft);
}

/* 顶部下拉 */
.nav-more { position: relative; }
.nav-drop {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 190px;
  display: grid; gap: 2px; padding: 6px;
  border: 1px solid var(--line); border-radius: 14px; background: #fff;
  box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(-6px); transition: .15s; z-index: 30;
}
.nav-more:hover .nav-drop, .nav-more:focus-within .nav-drop {
  opacity: 1; visibility: visible; transform: none;
}
.nav-drop a {
  padding: 8px 12px; border-radius: 9px; color: var(--text-2);
  font-weight: 700; font-size: 13.5px; white-space: nowrap; transition: .12s;
}
.nav-drop a:hover { color: var(--blue); background: var(--blue-soft); }

/* ── 按钮 ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; border: 0; border-radius: 12px; padding: 11px 20px;
  font-size: 14px; font-weight: 800; color: #fff; letter-spacing: .01em;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  box-shadow: var(--shadow-blue);
  transition: transform .15s, box-shadow .15s, opacity .15s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(37,99,235,.28); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.secondary {
  color: var(--blue); background: var(--blue-soft);
  box-shadow: none; border: 1px solid var(--blue-mid);
}
.btn.secondary:hover { background: var(--blue-mid); box-shadow: none; }
.btn.ghost {
  color: var(--muted); background: transparent; box-shadow: none;
  border: 1px solid var(--line);
}
.btn.ghost:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); box-shadow: none; }
.btn.danger {
  background: linear-gradient(135deg, #f87171, var(--red));
  box-shadow: 0 6px 16px rgba(239,68,68,.22);
}
.btn.block { width: 100%; }

/* ── 卡片 / 容器 ── */
.container { width: min(1100px, calc(100% - 40px)); margin: 24px auto 64px; }
.card {
  border: 1px solid var(--line); border-radius: 20px; padding: 24px;
  background: var(--card);
  box-shadow: var(--shadow);
  transition: box-shadow .2s;
}
.card:hover { box-shadow: var(--shadow-md); }
.muted { color: var(--muted); font-size: 14px; line-height: 1.7; }

/* ── 表单 ── */
.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 6px; font-weight: 700; font-size: 13.5px; color: var(--text-2); }
.input {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--line); border-radius: 11px;
  background: var(--card-soft); outline: none; font-size: 14.5px;
  color: var(--text); transition: border-color .15s, box-shadow .15s, background .15s;
}
.input::placeholder { color: var(--muted-light); }
.input:focus {
  border-color: var(--blue); background: #fff;
  box-shadow: 0 0 0 3px rgba(37,99,235,.14);
}
.code-row { display: flex; gap: 10px; }
.code-row .input { flex: 1; }
.code-row .btn { white-space: nowrap; }

/* ── 登录页 ── */
.auth-wrap { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.auth-card { width: min(420px, 100%); }
.auth-card h1 { margin: 8px 0 4px; font-size: 26px; font-weight: 900; letter-spacing: -0.03em; }
.tabs { display: flex; gap: 6px; margin: 18px 0; background: var(--line-soft); border-radius: 12px; padding: 4px; }
.tab {
  flex: 1; text-align: center; padding: 9px; border-radius: 9px; cursor: pointer;
  font-weight: 800; font-size: 14px; color: var(--muted); transition: .15s;
}
.tab.active { color: var(--blue); background: #fff; box-shadow: var(--shadow-sm); }

/* ── 提示条 ── */
.toast {
  position: fixed; top: 22px; left: 50%; transform: translateX(-50%) translateY(-8px);
  padding: 11px 22px; border-radius: 12px; color: #fff; font-weight: 700; font-size: 14px;
  background: var(--text); box-shadow: var(--shadow-md);
  z-index: 999; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { background: var(--green); }
.toast.err { background: var(--red); }

/* ── 套餐卡 ── */
.plan-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.plan {
  border: 1.5px solid var(--line); border-radius: 18px; padding: 20px;
  background: var(--card); cursor: pointer; transition: .2s; position: relative;
}
.plan:hover { border-color: rgba(37,99,235,.4); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.plan.active {
  border-color: var(--blue); background: var(--blue-soft);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12), var(--shadow-md);
}
.plan h3 { margin: 0 0 8px; font-size: 16px; font-weight: 800; }
.plan .price { font-size: 32px; font-weight: 900; color: var(--blue); letter-spacing: -0.03em; }
.plan .price small { font-size: 13px; color: var(--muted); font-weight: 600; }
.plan .feat { margin: 12px 0 0; color: var(--muted); font-size: 13px; line-height: 1.75; }

/* ── 数据网格（个人中心/管理后台） ── */
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 10px; }
.info-item {
  padding: 15px 16px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--card-soft); transition: box-shadow .15s;
}
.info-item:hover { box-shadow: var(--shadow-sm); }
.info-item b { display: block; font-size: 22px; font-weight: 900; margin-bottom: 4px; letter-spacing: -0.02em; }
.badge { padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 800; letter-spacing: .02em; }
.badge.member { color: #92400e; background: #fef3c7; }
.badge.free { color: var(--muted); background: var(--line-soft); border: 1px solid var(--line); }

/* ── 表格 ── */
table { width: 100%; border-collapse: collapse; }
thead { background: var(--line-soft); }
th {
  padding: 11px 12px; text-align: left;
  color: var(--muted); font-size: 12.5px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 12px; text-align: left; font-size: 14px;
  border-bottom: 1px solid var(--line-soft); color: var(--text-2);
}
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--blue-soft); }
tbody tr:last-child td { border-bottom: 0; }
.status { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.status.paid { color: #065f46; background: #d1fae5; }
.status.pending { color: #92400e; background: #fef3c7; }
.status.closed { color: var(--muted); background: var(--line-soft); }
.status.refunded { color: #6b21a8; background: var(--purple-soft); }

/* ── 弹窗 ── */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15,23,42,.5); display: none;
  place-items: center; z-index: 500; padding: 20px; backdrop-filter: blur(4px);
}
.modal-mask.show { display: grid; }
.modal { width: min(390px, 100%); text-align: center; }
.qr-box {
  width: 240px; height: 240px; margin: 12px auto; border-radius: 16px;
  display: grid; place-items: center; background: var(--card-soft);
  border: 1.5px solid var(--line); color: var(--muted); font-size: 13px;
  word-break: break-all; padding: 8px; overflow: hidden;
}
.disclaimer {
  margin-top: 18px; padding: 12px 14px; border-radius: 12px;
  font-size: 12.5px; line-height: 1.7; color: var(--muted);
  background: var(--line-soft); border: 1px solid var(--line);
}

/* ── AI 复盘模块 ── */
.ai-console {
  display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 16px; align-items: stretch;
  border: 1px solid rgba(37,99,235,.18); border-radius: 20px; padding: 18px;
  background: linear-gradient(135deg, #ffffff 0%, #f0f7ff 100%);
  box-shadow: var(--shadow); margin-bottom: 18px;
}
.console-box { border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 16px; }
.console-box h3 { margin: 0 0 10px; font-size: 15.5px; font-weight: 800; }
.stock-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-bottom: 12px; }
.persona-btns { display: flex; flex-wrap: wrap; gap: 7px; }
.persona-btn {
  cursor: pointer; border: 1.5px solid var(--line); border-radius: 999px; padding: 7px 13px;
  color: var(--muted); background: #fff; font-size: 13px; font-weight: 700; transition: .15s;
}
.persona-btn:hover { color: var(--blue); border-color: rgba(37,99,235,.4); background: var(--blue-soft); }
.persona-btn.active { color: var(--blue); border-color: var(--blue); background: var(--blue-soft); }

.result-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.result-pill { padding: 5px 12px; border-radius: 999px; color: #065f46; background: #d1fae5; font-size: 12px; font-weight: 800; white-space: nowrap; }
.result-pill.live { color: var(--blue-dark); background: var(--blue-mid); }
.report-rows { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.report-rows li {
  padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px;
  color: var(--text-2); background: var(--card-soft); line-height: 1.65; font-size: 13.5px;
}
.report-rows .good { color: var(--green); font-weight: 800; }
.report-rows .risk { color: var(--red); font-weight: 800; }

/* ── Hero ── */
.hero { text-align: center; margin: 24px 0 28px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 14px;
  border-radius: 999px; background: var(--blue-soft); color: var(--blue-dark);
  font-weight: 800; font-size: 13px; border: 1px solid var(--blue-mid);
}
.hero-title {
  font-size: clamp(26px, 4vw, 42px); letter-spacing: -0.04em;
  line-height: 1.16; margin: 16px 0 0; font-weight: 900;
}
.hero-title .grad {
  background: linear-gradient(135deg, var(--blue), #7c3aed);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { color: var(--muted); max-width: 600px; margin: 12px auto 0; font-size: 15.5px; line-height: 1.65; }

/* ── Tabs ── */
.tabs-line { display: flex; gap: 28px; align-items: center; margin: 8px 0 18px; border-bottom: 1.5px solid var(--line); }
.tab-chip {
  cursor: pointer; padding: 0 2px 12px; border: 0; background: none;
  font-size: 15.5px; font-weight: 800; color: var(--muted); position: relative; transition: color .15s;
}
.tab-chip:hover { color: var(--text-2); }
.tab-chip.active { color: var(--blue); }
.tab-chip.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1.5px;
  height: 2.5px; border-radius: 99px; background: var(--blue);
}

/* ── 数据卡格 ── */
.card-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }

/* ── 大盘每日复盘 ── */
.market-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 14px; }
.market-head h3 { font-size: 17.5px; font-weight: 800; }
#marketGrid { grid-template-columns: 1fr; gap: 16px; }
.daily-card { text-align: left; padding: 22px 24px; }
.dc-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.dc-score {
  flex-shrink: 0; width: 64px; height: 64px; display: grid; place-items: center; line-height: 1;
  border-radius: 16px; color: #fff; font-size: 26px; font-weight: 900;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  box-shadow: var(--shadow-blue);
}
.dc-score small { font-size: 11px; font-weight: 700; opacity: .85; }
.dc-head-tx { flex: 1; min-width: 0; }
.dc-head-tx h3 { margin: 0; font-size: 20px; font-weight: 900; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dc-verdict { font-size: 12.5px; font-weight: 800; color: var(--blue-dark); background: var(--blue-mid); padding: 4px 12px; border-radius: 999px; }
.dc-title { margin: 7px 0 0; font-size: 17px; font-weight: 800; color: var(--text); line-height: 1.5; }
.dc-rows { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.dc-row {
  padding: 15px 16px; border: 1px solid var(--line); border-radius: 13px;
  background: var(--card-soft); transition: box-shadow .15s;
}
.dc-row:hover { box-shadow: var(--shadow-sm); }
.dc-row b { display: block; margin-bottom: 7px; font-size: 15px; font-weight: 900; color: var(--text-2); }
.dc-row b.good { color: var(--green); }
.dc-row b.risk { color: var(--red); }
.dc-row p { margin: 0; color: var(--text-2); font-size: 14.5px; line-height: 1.75; }
.dc-foot { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 12px; }
.dv-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.dv-head button { white-space: nowrap; }
.dc-foot .mini-card b { font-size: 14.5px; }
.dc-foot .mini-card p { font-size: 13.5px; line-height: 1.7; }
.market-head .muted, #marketMeta { font-size: 14px; }
@media (max-width: 860px) { .dc-rows, .dc-foot { grid-template-columns: 1fr; } }

/* ── 工具卡 ── */
.tool-card {
  position: relative; cursor: pointer; text-align: left; min-height: 120px; padding: 16px;
  border: 1.5px solid var(--line); border-radius: 16px; color: var(--text); background: #fff;
  box-shadow: var(--shadow-sm); transition: .18s;
}
.tool-card:hover, .tool-card.active {
  transform: translateY(-2px);
  border-color: rgba(37,99,235,.45);
  box-shadow: var(--shadow-md);
}
.tool-card .ic { width: 40px; height: 40px; display: grid; place-items: center; margin-bottom: 12px; border-radius: 12px; font-size: 18px; }
.tool-card h4 { margin: 0 0 5px; font-size: 14.5px; font-weight: 800; }
.tool-card p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.corner { position: absolute; top: 0; right: 0; padding: 3px 9px; border-radius: 0 14px 0 10px; color: #fff; background: linear-gradient(135deg,#fb7185,var(--red)); font-size: 11px; font-weight: 900; }
.ic.blue { color: var(--blue); background: var(--blue-soft); }
.ic.orange { color: var(--orange); background: var(--orange-soft); }
.ic.purple { color: var(--purple); background: var(--purple-soft); }
.ic.green { color: var(--green); background: var(--green-soft); }
.ic.red { color: var(--red); background: var(--red-soft); }
.ic.yellow { color: #b58a00; background: #fffbe8; }

/* ── 分析输出 ── */
.output-2col { display: grid; grid-template-columns: 0.75fr 1.25fr; gap: 16px; margin-top: 20px; }
.score-ring {
  width: 96px; height: 96px; display: grid; place-items: center; margin: 0 auto 14px;
  border-radius: 24px; color: #fff; font-size: 32px; font-weight: 900;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  box-shadow: var(--shadow-blue);
}
.metric-line { display: flex; justify-content: space-between; margin: 11px 0 7px; color: var(--text-2); font-size: 13px; font-weight: 700; }
.bar { height: 7px; border-radius: 999px; background: var(--line); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--green)); }
.mini-grid3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-top: 14px; }
.mini-card { padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--card-soft); }
.mini-card b { display: block; margin-bottom: 5px; font-size: 13px; font-weight: 800; }
.mini-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }

/* ── 分析输入栏 ── */
.analyze-bar {
  display: grid; grid-template-columns: minmax(180px, 0.85fr) minmax(420px, 1.25fr) auto;
  gap: 16px; align-items: end; padding: 20px; margin-bottom: 20px;
  border: 1.5px solid rgba(37,99,235,.14); border-radius: 20px;
  background: linear-gradient(135deg, #ffffff 0%, #f3f8ff 100%);
  box-shadow: var(--shadow);
}
.ab-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.ab-field label { font-weight: 800; font-size: 13px; color: var(--text-2); }
.analyze-bar .input { height: 48px; border-radius: 12px; font-size: 15px; background: #fff; }
.analyze-bar .input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.14); }
.ab-btn { height: 48px; padding: 0 30px; font-size: 15px; white-space: nowrap; border-radius: 12px; }

/* ── 战法选择下拉 ── */
.vw-dd { position: relative; }
.vw-trigger {
  width: 100%; height: 48px; display: flex; align-items: center; gap: 10px;
  padding: 0 14px; cursor: pointer; text-align: left;
  border: 1.5px solid var(--line); border-radius: 12px; background: #fff; transition: .15s;
}
.vw-trigger:hover { border-color: rgba(37,99,235,.4); }
.viewDD.open .vw-trigger, .vw-dd.open .vw-trigger {
  border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.14);
}
.vw-cur { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.vw-cur b { font-size: 15px; line-height: 1.2; font-weight: 800; }
.vw-cur small { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vw-caret {
  flex-shrink: 0; width: 26px; height: 26px; display: grid; place-items: center;
  border-radius: 8px; color: #fff; background: var(--blue); font-size: 12px;
  box-shadow: 0 3px 8px rgba(37,99,235,.3); transition: transform .18s;
}
.vw-dd.open .vw-caret { transform: rotate(180deg); }
.vw-ic {
  width: 34px; height: 34px; flex-shrink: 0; display: grid; place-items: center;
  border-radius: 10px; font-weight: 900; font-size: 15px;
}
.vw-ic.blue { color: var(--blue); background: var(--blue-soft); }
.vw-ic.orange { color: var(--orange); background: var(--orange-soft); }
.vw-ic.purple { color: var(--purple); background: var(--purple-soft); }
.vw-ic.green { color: var(--green); background: var(--green-soft); }
.vw-ic.red { color: var(--red); background: var(--red-soft); }
.vw-ic.yellow { color: #b58a00; background: #fffbe8; }
.vw-panel {
  position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 8px);
  max-height: 360px; overflow-y: auto; padding: 6px;
  border: 1.5px solid var(--line); border-radius: 14px; background: #fff;
  box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(-6px); transition: .15s;
}
.vw-dd.open .vw-panel { opacity: 1; visibility: visible; transform: none; }
.vw-opt {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  border: 0; border-radius: 10px; background: transparent; cursor: pointer; text-align: left; transition: .12s;
}
.vw-opt:hover { background: var(--card-soft); }
.vw-opt.active { background: var(--blue-soft); }
.vw-opt-tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vw-opt-name { font-weight: 800; font-size: 14px; display: flex; align-items: center; gap: 7px; }
.vw-opt-tx small { color: var(--muted); font-size: 12px; line-height: 1.45; }
.tagpill { font-size: 10.5px; font-weight: 800; color: #fff; background: linear-gradient(135deg,#fb7185,var(--red)); padding: 1px 7px; border-radius: 999px; }

/* ── 个股联想 ── */
.ab-stock { position: relative; }
.ac-panel {
  position: absolute; z-index: 45; left: 0; right: 0; top: calc(100% + 8px);
  max-height: 320px; overflow-y: auto; padding: 6px;
  border: 1.5px solid var(--line); border-radius: 13px; background: #fff;
  box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(-6px); transition: .14s;
}
.ac-panel.open { opacity: 1; visibility: visible; transform: none; }
.ac-opt {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 0; border-radius: 9px; background: transparent; cursor: pointer; text-align: left; transition: .1s;
}
.ac-opt:hover, .ac-opt.active { background: var(--blue-soft); }
.ac-opt b { font-size: 14.5px; font-weight: 800; }
.ac-opt .ac-code { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.ac-opt .ac-ind { margin-left: auto; font-size: 11.5px; color: var(--blue-dark); background: var(--blue-mid); padding: 2px 9px; border-radius: 999px; }

/* ── 空态 / 加载 ── */
.result-empty {
  padding: 44px 24px; text-align: center;
  border: 1.5px dashed rgba(37,99,235,.22); border-radius: 20px;
  background: linear-gradient(135deg, #ffffff 0%, #f3f8ff 100%);
}
.an-spin {
  width: 42px; height: 42px; border: 3.5px solid var(--line);
  border-top-color: var(--blue); border-radius: 50%;
  animation: an-rot .9s linear infinite; margin: 4px auto 20px;
}
@keyframes an-rot { to { transform: rotate(360deg); } }
.re-title { margin: 0 0 24px; font-size: clamp(20px, 2.4vw, 28px); font-weight: 900; letter-spacing: -.02em; color: var(--text); }
.re-title .grad { background: linear-gradient(135deg, var(--blue), var(--purple)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.re-steps { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
.re-step {
  display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 14px 18px; border-radius: 15px; background: #fff;
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.re-num {
  width: 30px; height: 30px; flex-shrink: 0; display: grid; place-items: center;
  border-radius: 9px; font-weight: 900; font-size: 15px; color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--purple));
}
.re-step b { display: block; font-size: 15.5px; font-weight: 800; }
.re-step small { color: var(--muted); font-size: 12.5px; }
.re-arrow { color: var(--blue); font-size: 20px; font-weight: 900; }
@media (max-width: 760px) {
  .re-steps { flex-direction: column; align-items: stretch; }
  .re-arrow { transform: rotate(90deg); }
}
@media (max-width: 760px) { .analyze-bar { grid-template-columns: 1fr; } .ab-btn { width: 100%; } }

/* ── 侧边栏布局 ── */
.layout { display: flex; align-items: flex-start; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; align-self: stretch;
  width: 244px; flex-shrink: 0; min-height: 100vh;
  display: flex; flex-direction: column; gap: 4px;
  padding: 18px 14px;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(20px) saturate(160%);
  border-right: 1px solid var(--line);
}
.sidebar .brand { padding: 6px 8px 14px; color: var(--text); }
.sidebar .brand:hover { color: var(--text); }
.side-nav { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
.side-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  cursor: pointer; padding: 10px 11px; border: 0; border-radius: 12px;
  background: transparent; color: var(--text-2); font-size: 14.5px;
  text-decoration: none; transition: .15s;
}
.side-item:hover { background: var(--blue-soft); color: var(--blue); }
.side-item.active { background: var(--blue-soft); color: var(--blue); font-weight: 800; }
.side-item .si-ic {
  width: 32px; height: 32px; flex-shrink: 0; display: grid; place-items: center;
  border-radius: 9px; background: #fff; border: 1px solid var(--line); font-size: 15px;
  transition: .15s;
}
.side-item.active .si-ic { border-color: rgba(37,99,235,.3); background: #fff; box-shadow: 0 2px 8px rgba(37,99,235,.12); }
.side-item .si-tx { display: flex; flex-direction: column; gap: 1px; min-width: 0; font-weight: 700; }
.side-item .si-tx small { font-weight: 500; font-size: 11px; color: var(--muted); line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-sep { height: 1px; background: var(--line); margin: 8px 6px; }
.side-foot { margin-top: auto; padding: 12px 8px 4px; color: var(--muted-light); font-size: 11px; line-height: 1.7; }

.main-area { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.main-area .topbar { width: auto; margin: 16px 20px 0; }
.page-title { font-size: 19px; font-weight: 900; letter-spacing: -0.02em; }
.main-area .container { width: min(1080px, calc(100% - 44px)); margin: 20px auto 56px; }
.main-area .hero { margin: 12px 0 20px; }

/* ── 响应式 ── */
@media (max-width: 980px) {
  .ai-console, .output-2col { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 880px) {
  .layout { flex-direction: column; }
  .sidebar {
    position: static; width: 100%; min-height: 0; flex-direction: column;
    border-right: 0; border-bottom: 1px solid var(--line);
    padding: 12px 10px 8px; gap: 4px;
  }
  .sidebar .brand { padding: 4px 6px 10px; }
  .side-sep { display: none; }
  .side-nav { flex-direction: row; flex-wrap: wrap; gap: 5px; margin-top: 0; }
  .side-item { width: auto; flex: 1 1 130px; min-width: 0; padding: 8px 10px; gap: 7px; border-radius: 10px; }
  .side-item.active { box-shadow: none; border: 1.5px solid rgba(37,99,235,.3); }
  .side-item .si-ic { width: 28px; height: 28px; font-size: 14px; border-radius: 8px; }
  .side-item .si-tx { font-size: 13px; }
  .side-item .si-tx small { display: none; }
  .side-foot { display: none; }
  .main-area .topbar { margin: 10px 12px 0; }
  .page-title { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55vw; }
}
@media (max-width: 760px) {
  .plan-grid, .info-grid { grid-template-columns: 1fr; }
  .topbar nav { gap: 10px; }
  .card-grid, .mini-grid3 { grid-template-columns: 1fr; }
  .card { padding: 18px; }
}

/* ── 打印 ── */
@media print {
  .topbar, .no-print { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #ddd; }
}

/* ── Markdown 渲染 ── */
.md-body { color: var(--text); line-height: 1.8; font-size: 15px; word-break: break-word; }
.md-body h3 { margin: 22px 0 9px; font-size: 18px; font-weight: 900; color: var(--text); }
.md-body h4 { margin: 18px 0 7px; font-size: 16px; font-weight: 800; color: var(--text-2); }
.md-body h5, .md-body h6 { margin: 14px 0 6px; font-size: 15px; font-weight: 700; }
.md-body p { margin: 10px 0; }
.md-body ul, .md-body ol { margin: 10px 0; padding-left: 24px; }
.md-body li { margin: 7px 0; }
.md-body strong { color: var(--blue-dark); font-weight: 800; }
.md-body em { color: var(--text-2); font-style: italic; }
.md-body del { color: var(--muted); text-decoration: line-through; }
.md-body code { background: var(--blue-soft); color: var(--blue-dark); border-radius: 6px; padding: 2px 7px; font-size: 13px; font-family: "Fira Code", "JetBrains Mono", monospace; }
.md-body blockquote {
  margin: 14px 0; padding: 11px 16px;
  border-left: 3px solid var(--blue); background: var(--blue-soft);
  border-radius: 0 10px 10px 0; color: var(--text-2);
}
.md-body hr { border: 0; border-top: 1.5px solid var(--line); margin: 20px 0; }
.md-body table { width: 100%; border-collapse: collapse; margin: 14px 0; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow-sm); }
.md-body th { background: var(--line-soft); color: var(--muted); font-size: 12.5px; letter-spacing: .04em; text-transform: uppercase; }
.md-body td { border-bottom: 1px solid var(--line-soft); }
.md-body tbody tr:hover { background: var(--blue-soft); }
.md-body h3:first-child, .md-body h4:first-child, .md-body p:first-child { margin-top: 0; }
