/* ============================================================
   网格大师 C端 H5 全局样式
   主色 #DE2F26（亮红）/ 副色 #E9A23B（琥珀金）/ 涨 #DE2F26 / 跌 #12855A / 背景 #FAFBFC
   ============================================================ */
:root {
  /* 亮红主色 + 清新白底色；琥珀金作副色，红绿仍表达涨跌 */
  --brand: #DE2F26;
  --brand-2: #F0554B;
  --brand-3: #F8BFB9;
  --accent: #E9A23B;
  --accent-ink: #8A5A12;
  --accent-bg: #FFF5E3;
  --red: #DE2F26;
  --red-2: #F0554B;
  --red-bg: rgba(222, 47, 38, 0.08);
  --green: #12855A;
  --green-bg: rgba(18, 133, 90, 0.1);
  --bg: #FAFBFC;
  --card: #FFFFFF;
  --t1: #1C1D22;
  --t2: #5A5D66;
  --t3: #979AA3;
  --line: #ECEDF1;
  --line-2: #F4F5F8;
  --chip-bg: #F5F6F8;
  --warn-bg: #FFF6E6;
  --warn-t: #B07515;
  --orange: #E2842C;
  --yellow: #E9A23B;
  --blue: #2F5D8A;
  --danger: #C0281F;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  background: #EEF0F3;
  color: var(--t1);
  font-size: 14px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; border: none; background: none; cursor: pointer; }
input, select { font-family: inherit; outline: none; border: none; background: none; }
ul, li { list-style: none; }

/* ---------- 页面骨架 ---------- */
#app { min-height: 100%; }
.page {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
}
.page.has-bottombar { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }

/* ---------- 顶部导航（红） ---------- */
.navbar {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(180deg, var(--red-2), var(--red));
  color: #fff;
}
.navbar.plain { padding-top: env(safe-area-inset-top); }
/* 红色头部内含 hero/行情区的页面：整块随页面滚动（不吸顶） */
.navbar.flow { position: static; }
.nav-row {
  height: 48px;
  display: flex; align-items: center;
  padding: 0 12px;
  gap: 8px;
}
.nav-back {
  width: 30px; height: 30px; flex: none;
  font-size: 22px; line-height: 30px; text-align: center;
  color: #fff; opacity: .95;
}
.nav-title {
  flex: 1; text-align: center;
  font-size: 17px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-right {
  min-width: 30px; flex: none;
  display: flex; justify-content: flex-end; align-items: center;
  font-size: 13px; color: #fff;
}
.nav-link {
  position: relative;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, .85);
  border-radius: 14px;
  font-size: 12px; line-height: 1.2;
  display: flex; align-items: center; gap: 3px;
}
.badge-new {
  background: linear-gradient(135deg, #FFD34D, #FF9D00);
  color: #7A3C00; font-size: 9px; font-style: normal;
  border-radius: 6px 6px 6px 0;
  padding: 0 3px; line-height: 12px; font-weight: 600;
}
.nav-icon { font-size: 18px; padding: 4px 6px; color: #fff; }

/* ---------- 首页英雄区（总览卡） ---------- */
.hero { padding: 4px 12px 14px; }
.hero-tabs { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.hero-tab {
  background: #fff; color: var(--red);
  font-size: 12px; font-weight: 600;
  border-radius: 12px; padding: 3px 10px;
}
.hero-range { font-size: 10px; opacity: .85; }
.hero-main { display: flex; align-items: flex-end; justify-content: space-between; }
.hero-big-label { font-size: 11px; opacity: .9; margin-bottom: 2px; }
.hero-big-num { font-size: 34px; font-weight: 700; letter-spacing: .5px; font-variant-numeric: tabular-nums; }
.hero-side { text-align: right; display: grid; gap: 3px; }
.hero-side-item { font-size: 10px; opacity: .92; display: flex; gap: 6px; justify-content: flex-end; align-items: baseline; }
.hero-side-item b { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.hero-foot {
  margin-top: 12px; padding-top: 8px;
  border-top: 1px dashed rgba(255, 255, 255, .35);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 10px; opacity: .95;
}
.btn-outline-white {
  border: 1px solid rgba(255, 255, 255, .9); color: #fff;
  font-size: 11px; border-radius: 11px; padding: 2px 12px; line-height: 18px;
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border-radius: 8px;
  margin: 8px 12px;
  padding: 12px;
}
.card.big { border-radius: 12px; }
.card-title {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 15px; font-weight: 500; color: var(--t1);
  margin-bottom: 10px;
}
.card-title .t-icon { color: var(--red); margin-right: 5px; font-style: normal; }
.card-title .more { font-size: 12px; color: var(--t3); font-weight: 400; }
.section-gap { height: 4px; }

/* ---------- 胶囊 / 标签 ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 2px;
  border-radius: 12px; padding: 2px 8px;
  font-size: 11px; line-height: 18px;
  white-space: nowrap;
}
.pill.buy { background: var(--red-bg); color: var(--red); }
.pill.sell { background: var(--green-bg); color: var(--green); }
.pill .strong { font-weight: 700; }
.tag-mini {
  font-size: 10px; color: var(--red);
  border: 1px solid var(--red); border-radius: 4px;
  padding: 0 4px; line-height: 14px;
}

/* ---------- 涨跌颜色 ---------- */
.up { color: var(--red); }
.down { color: var(--green); }
.flat { color: var(--t2); }

/* ---------- 内容 Tab（横向滚动） ---------- */
.content-tabs {
  display: flex; gap: 22px; align-items: center;
  padding: 10px 12px 0; overflow-x: auto; white-space: nowrap;
  scrollbar-width: none;
}
.content-tabs::-webkit-scrollbar { display: none; }
.content-tab { font-size: 14px; color: var(--t2); padding: 6px 0 8px; position: relative; flex: none; }
.content-tab.active { color: var(--red); font-weight: 600; }
.content-tab.active::after {
  content: ""; position: absolute; left: 50%; transform: translateX(-50%);
  bottom: 2px; width: 16px; height: 3px; border-radius: 2px; background: var(--red);
}

/* ---------- 筛选 chips ---------- */
.chips {
  display: flex; gap: 8px; padding: 8px 12px;
  overflow-x: auto; white-space: nowrap; scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 26px; line-height: 24px;
  border-radius: 13px; padding: 0 12px;
  font-size: 12px; color: var(--t2); background: var(--chip-bg);
  border: 1px solid transparent;
}
.chip.active { background: var(--red); color: #fff; }

/* ---------- 搜索行 ---------- */
.search-row {
  display: flex; align-items: center; gap: 8px;
  padding: 2px 12px 8px;
}
.search-box {
  flex: 1; height: 30px; border-radius: 15px;
  background: var(--chip-bg);
  display: flex; align-items: center; padding: 0 12px; gap: 6px;
}
.search-box input { flex: 1; font-size: 12px; color: var(--t1); }
.search-box input::placeholder { color: var(--t3); }
.search-box .s-icon { color: var(--t3); font-size: 13px; font-style: normal; }
.cycle-select { font-size: 12px; color: var(--t2); display: flex; align-items: center; gap: 2px; flex: none; }
.cycle-select select { font-size: 12px; color: var(--t2); appearance: none; }

/* ---------- 排序条 ---------- */
.sort-bar {
  display: flex; align-items: center; gap: 18px;
  padding: 4px 12px 8px; font-size: 12px; color: var(--t2);
  overflow-x: auto; white-space: nowrap; scrollbar-width: none;
}
.sort-bar::-webkit-scrollbar { display: none; }
.sort-item { flex: none; }
.sort-item.active { color: var(--red); font-weight: 600; }
.sort-item.active .arrow { font-size: 10px; }

/* ---------- 策略列表行 ---------- */
.st-list { padding: 0 12px; }
.st-row {
  background: var(--card); border-radius: 8px;
  padding: 12px; margin-bottom: 8px;
  display: flex; align-items: center; gap: 10px;
}
.st-row:active { background: #FBFBFB; }
.rank-badge {
  width: 20px; height: 20px; flex: none; border-radius: 5px;
  font-size: 12px; font-weight: 700; color: #fff;
  background: #C4C7CC; text-align: center; line-height: 20px;
}
.rank-badge.r1 { background: var(--red); }
.rank-badge.r2 { background: var(--orange); }
.rank-badge.r3 { background: var(--yellow); color: #4A3410; }
.st-main { flex: 1; min-width: 0; }
.st-name { font-size: 15px; font-weight: 500; display: flex; align-items: center; gap: 5px; }
.st-name .code { font-size: 11px; color: var(--t3); font-weight: 400; }
.st-tags { display: flex; gap: 4px; margin-top: 3px; }
.st-tag { font-size: 10px; color: var(--t3); background: var(--chip-bg); border-radius: 3px; padding: 0 4px; line-height: 15px; }
.st-metrics { display: flex; gap: 18px; text-align: right; flex: none; }
.st-metric b { display: block; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.st-metric span { font-size: 10px; color: var(--t3); }
.st-metric.trades b { font-size: 14px; color: var(--t1); }
.st-metric.trades b i { font-style: normal; }
.st-metric.trades b i.buy-cnt { color: var(--red); }
.st-metric.trades b i.sell-cnt { color: var(--green); }
.st-actions { flex: none; display: flex; flex-direction: column; gap: 5px; }
.btn-mini {
  width: 52px; height: 24px; line-height: 22px;
  border-radius: 12px; font-size: 11px; text-align: center;
  border: 1px solid var(--red); color: var(--red); background: #fff;
}
.btn-mini:active { background: var(--red-bg); }
.btn-mini.green { border-color: var(--green); color: var(--green); }
.btn-capsule-red {
  background: var(--red); color: #fff;
  border-radius: 14px; font-size: 12px;
  padding: 4px 12px; flex: none;
}

/* ---------- 推荐卡 / 精选池入口 ---------- */
.reco-top { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--t3); }
.reco-badge { color: var(--red); font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 3px; }
.reco-main { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.reco-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.reco-right { text-align: right; flex: none; }
.reco-right .num { font-size: 16px; font-weight: 700; }
.reco-right .lbl { font-size: 10px; color: var(--t3); }
.reco-foot {
  margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 10px; color: var(--t3);
}
.btn-follow {
  border: 1px solid var(--red); color: var(--red);
  border-radius: 13px; font-size: 12px; background: #fff;
  padding: 3px 14px;
}
.pool-entry { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.pool-entry .p-name { font-size: 15px; font-weight: 500; flex: none; }
.pool-entry .p-code { font-size: 11px; color: var(--t3); }

/* ---------- 案例横滑 / 课程 banner ---------- */
.h-scroll { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.h-scroll::-webkit-scrollbar { display: none; }
.case-card {
  flex: none; width: 47%;
  background: linear-gradient(135deg, #FFF3F3, #FFE9E9);
  border-radius: 8px; padding: 10px 12px;
}
.case-card .c-name { font-size: 14px; font-weight: 500; }
.case-card .c-num { font-size: 20px; font-weight: 700; color: var(--red); margin: 3px 0 1px; }
.case-card .c-lbl { font-size: 10px; color: var(--t3); }
.case-card .c-time { font-size: 10px; color: var(--t3); margin-top: 4px; }
.lesson-banner {
  border-radius: 10px; overflow: hidden;
  background: linear-gradient(120deg, var(--red-2), var(--red) 55%, #C22430);
  color: #fff; display: flex; align-items: center;
  padding: 14px 12px; gap: 10px;
}
.lesson-banner .l-info { flex: 1; }
.lesson-banner .l-title { font-size: 15px; font-weight: 500; }
.lesson-banner .l-sub { font-size: 10px; opacity: .85; margin-top: 4px; }
.lesson-banner .l-art { font-size: 30px; }
.btn-learn {
  border: 1px solid rgba(255, 255, 255, .9); color: #fff;
  border-radius: 14px; padding: 3px 12px; font-size: 12px; margin-top: 8px;
  display: inline-block;
}
.lesson-cover { width: 84px; height: 56px; border-radius: 6px; object-fit: cover; flex: none; }

/* ---------- FAQ ---------- */
.faq-item { padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; color: #333; display: flex; gap: 6px; }
.faq-item:last-child { border-bottom: none; }
.faq-item .q { color: var(--red); font-weight: 600; flex: none; }

/* ---------- 提示条（黄） ---------- */
.notice-bar {
  margin: 8px 12px; background: var(--warn-bg); color: var(--warn-t);
  font-size: 11px; line-height: 1.5; border-radius: 6px; padding: 7px 10px;
  display: flex; gap: 5px; align-items: flex-start;
}

/* ---------- 风险提示 ---------- */
.disclaimer { padding: 12px 14px 4px; font-size: 10px; color: var(--t3); line-height: 1.6; }
.disclaimer h5 { font-size: 10px; color: var(--t3); font-weight: 500; margin-bottom: 3px; }

/* ---------- 底部固定操作栏 ---------- */
.bottom-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: #fff; border-top: 1px solid var(--line);
  padding: 9px 12px calc(9px + env(safe-area-inset-bottom));
  display: flex; gap: 10px; align-items: center;
  max-width: 480px; margin: 0 auto;
}
.btn-block {
  height: 44px; border-radius: 22px;
  font-size: 16px; font-weight: 500;
  display: flex; align-items: center; justify-content: center;
  flex: 1;
}
.btn-block.primary { background: var(--red); color: #fff; }
.btn-block.primary:active { opacity: .9; }
.btn-block.ghost { border: 1px solid var(--red); color: var(--red); background: #fff; }
.btn-block:disabled { opacity: .5; }

/* ---------- 表单内操作区（右对齐，区别于底部 CTA） ---------- */
.form-actions {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 8px; margin-top: 12px;
}
.btn-submit {
  height: 38px; min-width: 128px; padding: 0 22px;
  border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--t1);
  font-size: 14px; font-weight: 500; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: opacity .15s ease, background .15s ease;
}
.btn-submit.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-submit.primary:active { opacity: .9; }
.btn-submit:disabled { opacity: .55; cursor: default; }
.btn-submit:focus-visible { outline: 2px solid rgba(222, 47, 38, .35); outline-offset: 2px; }
.pf-form .form-actions { margin-top: 0; }
.cta-wrap { position: relative; margin: 12px; }
.cta-badge {
  position: absolute; top: -16px; right: 8px;
  background: #FFE9C8; color: #B26A00;
  font-size: 10px; border-radius: 8px 8px 8px 0; padding: 1px 8px;
}

/* ---------- P4 详情 ---------- */
.quote-hero { padding: 6px 12px 10px; display: flex; align-items: center; justify-content: space-between; }
.quote-hero .q-name { font-size: 17px; font-weight: 700; }
.quote-hero .q-code { font-size: 12px; opacity: .9; margin-top: 2px; }
.quote-hero .q-nums { display: flex; gap: 22px; text-align: right; align-items: center; }
.quote-hero .q-item span { font-size: 10px; opacity: .85; display: block; }
.quote-hero .q-item b { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.quote-hero .q-more { font-size: 18px; opacity: .8; margin-left: 2px; }
.seg-tabs { display: flex; gap: 8px; padding: 2px 12px 12px; }
.seg-tab {
  font-size: 13px; color: #fff; opacity: .92;
  border: 1px solid transparent; border-radius: 14px; padding: 4px 14px;
}
.seg-tab.active { background: #fff; color: var(--red); font-weight: 600; opacity: 1; }
/* 周期选择：独立的整行分段控件；回测区间作为图表脚注单独一行 */
.cycle-bar { margin: 2px 0 10px; }
.cycle-range {
  margin-top: 8px; font-size: 11px; color: var(--t3);
  font-variant-numeric: tabular-nums; letter-spacing: .2px;
}
.c-chips { display: flex; gap: 6px; }
.c-chip {
  flex: 1; text-align: center; font-size: 11px; line-height: 1; white-space: nowrap;
  padding: 7px 0; border-radius: 8px;
  background: var(--chip-bg); color: var(--t2);
  border: 1px solid transparent; transition: background .15s ease, color .15s ease;
}
.c-chip.active {
  background: var(--brand); border-color: var(--brand);
  color: #fff; font-weight: 600;
}
.cond-pills { display: flex; gap: 8px; margin-top: 8px; }
.cond-pills .pill { font-size: 12px; padding: 4px 10px; border-radius: 14px; }

/* 指标对比表：本策略 / 同期基准 / 差值 */
.metric-grid { display: block; }
.mg-tr {
  display: grid; grid-template-columns: 76px 1fr 1fr 92px;
  align-items: center; gap: 6px; padding: 10px 0;
  border-bottom: 1px solid var(--line-2);
}
.mg-body .mg-tr:last-child { border-bottom: none; }
.mg-tr.mg-head { padding: 0 0 8px; border-bottom: 1px solid var(--line); }
.mg-head span { font-size: 11px; color: var(--t3); font-weight: 400; }
.mg-head .mg-strat { color: var(--brand); font-weight: 600; }
.mg-label { font-size: 12px; color: var(--t2); }
.mg-strat { font-size: 16px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.mg-head .mg-strat { font-size: 11px; }
.mg-dd { color: var(--t1); }
.mg-bench, .mg-diff { text-align: right; font-variant-numeric: tabular-nums; }
.mg-bench { font-size: 13px; color: var(--t2); }
.mg-head .mg-bench, .mg-head .mg-diff { font-size: 11px; }
.mg-diff { font-size: 11px; font-weight: 600; color: var(--t3); white-space: nowrap; }
.mg-red { color: var(--red); }
.mg-green { color: var(--green); }
.mg-diff.up { color: var(--red); }
.mg-diff.down { color: var(--green); }
.mg-foot {
  display: flex; gap: 8px;
  margin-top: 10px; padding-top: 12px;
  border-top: 1px solid var(--line);
}
.mg-foot > div { flex: 1; text-align: center; }
.mg-foot b {
  display: block; font-size: 14px; font-weight: 600; color: var(--t1);
  font-variant-numeric: tabular-nums;
}
.mg-foot em { font-style: normal; font-size: 10px; color: var(--t3); margin-left: 2px; }
.mg-foot span { display: block; margin-top: 3px; font-size: 10px; color: var(--t3); }

/* 图表容器 */
.chart-box { position: relative; }
.chart-box canvas { width: 100%; display: block; }
.chart-tip {
  position: absolute; pointer-events: none;
  background: rgba(26, 26, 26, .88); color: #fff;
  font-size: 10px; line-height: 1.5; border-radius: 6px;
  padding: 5px 8px; white-space: nowrap; z-index: 5; display: none;
}
.chart-legend { display: flex; gap: 12px; font-size: 10px; color: var(--t2); margin-bottom: 4px; flex-wrap: wrap; }
.chart-legend .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 3px; vertical-align: 1px; }
.kline-slider { margin-top: 6px; }
.kline-slider input[type=range] { width: 100%; accent-color: var(--red); height: 18px; }
.kline-range-lbl { display: flex; justify-content: space-between; font-size: 10px; color: var(--t3); }

/* 子 Tab 胶囊（交易记录） */
.sub-tabs { display: flex; gap: 8px; margin-bottom: 10px; }
.sub-tab {
  font-size: 12px; padding: 3px 12px; border-radius: 13px;
  background: var(--chip-bg); color: var(--t2); border: 1px solid transparent;
}
.sub-tab.active { background: #fff; color: var(--red); border-color: var(--red); font-weight: 600; }
.trade-summary { display: flex; gap: 40px; margin-bottom: 8px; }
.trade-summary .ts-item b { font-size: 20px; font-weight: 700; }
.trade-summary .ts-item span { font-size: 11px; color: var(--t3); display: block; }

/* 成交明细表 */
.dtable { width: 100%; border-collapse: collapse; font-size: 12px; }
.dtable th { font-size: 11px; color: var(--t3); font-weight: 400; text-align: right; padding: 6px 2px; border-bottom: 1px solid var(--line-2); }
.dtable th:first-child, .dtable td:first-child { text-align: left; }
.dtable td { text-align: right; padding: 7px 2px; border-bottom: 1px solid var(--line-2); font-variant-numeric: tabular-nums; }
.dtable tr:last-child td { border-bottom: none; }
.dtable .side-buy { color: var(--red); }
.dtable .side-sell { color: var(--green); }
.dtable .side-init { color: var(--t3); }

/* 键值列表 */
.kv-list .kv-row {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 40px; padding: 6px 0; border-bottom: 1px solid var(--line-2);
  font-size: 14px;
}
.kv-list .kv-row:last-child { border-bottom: none; }
.kv-list .kv-label { color: var(--t2); flex: none; display: flex; align-items: center; gap: 4px; }
.kv-list .kv-value { color: var(--t1); font-weight: 500; text-align: right; }
.kv-list .kv-value .sub { display: block; font-size: 12px; margin-top: 2px; }

/* ---------- 表单（P5/P7） ---------- */
.mode-toggle { display: flex; gap: 0; border: 1px solid var(--red); border-radius: 6px; overflow: hidden; }
.mode-toggle button { font-size: 12px; padding: 4px 10px; color: var(--red); background: #fff; }
.mode-toggle button.active { background: var(--red); color: #fff; }
.big-input { display: flex; align-items: baseline; gap: 6px; padding: 6px 0 2px; }
.big-input input {
  font-size: 28px; font-weight: 700; color: var(--t1);
  width: 100%; font-variant-numeric: tabular-nums;
}
.big-input .unit { font-size: 14px; color: var(--t2); flex: none; }
.quick-chips { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.quick-chip {
  height: 30px; line-height: 28px; padding: 0 12px;
  border: 1px solid #E5E5E5; border-radius: 6px; font-size: 13px; color: var(--t1); background: #fff;
}
.quick-chip.active { border-color: var(--red); color: var(--red); }
.calc-line { font-size: 12px; color: var(--t2); margin-top: 8px; display: flex; align-items: center; gap: 4px; }
.calc-line b { color: var(--t1); }
.warn-line { font-size: 12px; color: var(--red); margin-top: 6px; }
.help-gray { font-size: 12px; color: var(--t3); line-height: 1.6; margin-top: 8px; }

/* 步进器 */
.stepper { display: flex; align-items: center; border: 1px solid #E5E5E5; border-radius: 6px; overflow: hidden; }
.stepper button { width: 34px; height: 30px; font-size: 16px; color: var(--t1); background: #FAFAFA; }
.stepper input {
  width: 74px; text-align: center; font-size: 14px; font-weight: 600; color: var(--t1);
  border-left: 1px solid #E5E5E5; border-right: 1px solid #E5E5E5; height: 30px;
}
.form-row {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 44px; border-bottom: 1px solid var(--line-2); gap: 10px;
}
.form-row:last-child { border-bottom: none; }
.form-row .f-label { color: var(--t2); font-size: 14px; display: flex; align-items: center; gap: 4px; flex: none; }
.form-row .f-label .req { color: var(--red); }
.form-row .f-ctrl { display: flex; align-items: center; gap: 8px; flex: 1; justify-content: flex-end; }
.form-row .f-ctrl .suffix { font-size: 12px; color: var(--t3); flex: none; }
.info-dot { color: var(--t3); font-size: 12px; font-style: normal; }

/* 开关 */
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { display: none; }
.switch .track {
  position: absolute; inset: 0; border-radius: 13px; background: #E5E5E5; transition: .2s;
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px;
  border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}
.switch input:checked + .track { background: var(--red); }
.switch input:checked + .track::after { transform: translateX(18px); }

/* 日期胶囊 */
.date-capsule {
  border: 1px solid #E5E5E5; border-radius: 6px; background: #fff;
  font-size: 13px; color: var(--t1); padding: 5px 8px;
  display: flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums;
}

/* 高级设置折叠 */
.collapse-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 0; }
.collapse-head .arr { color: var(--t3); transition: .2s; }
.collapse-head.open .arr { transform: rotate(180deg); }
.collapse-body { display: none; }
.collapse-body.open { display: block; }
.range-inputs { display: flex; align-items: center; gap: 6px; }
.range-inputs input {
  width: 70px; height: 30px; border: 1px solid #E5E5E5; border-radius: 6px;
  text-align: center; font-size: 13px; background: #fff;
}

/* 脚注编号 */
.footnotes { padding: 10px 14px; font-size: 10px; color: var(--t3); line-height: 1.6; }

/* ---------- P8 自选机会 ---------- */
.chance-hero { padding: 2px 12px 14px; display: flex; justify-content: space-between; }
.chance-left { display: flex; gap: 8px; }
.ai-avatar {
  width: 38px; height: 38px; border-radius: 10px; flex: none;
  background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .5);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; color: #fff;
}
.chance-info .ai-name { font-size: 13px; display: flex; align-items: center; gap: 6px; }
.chance-info .ai-name .followed-pill { font-size: 9px; border: 1px solid rgba(255,255,255,.8); border-radius: 8px; padding: 0 6px; line-height: 14px; opacity: .95; }
.chance-info .ch-title { font-size: 20px; font-weight: 700; margin-top: 8px; }
.chance-info .ch-sub { font-size: 11px; opacity: .9; margin-top: 4px; }
.date-card {
  flex: none; background: #fff; border-radius: 10px; color: var(--red);
  width: 74px; text-align: center; padding: 8px 4px; align-self: flex-start;
}
.date-card .d1 { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.date-card .d2 { font-size: 11px; font-weight: 600; margin-top: 2px; }
.date-card .d3 { font-size: 10px; color: var(--t3); margin-top: 1px; }
.own-row { padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.own-row:last-child { border-bottom: none; }
.own-top { display: flex; align-items: center; justify-content: space-between; }
.own-top .o-name { font-size: 15px; font-weight: 500; }
.own-top .o-code { font-size: 11px; color: var(--t3); margin-left: 4px; }
.own-mid { display: flex; align-items: center; justify-content: space-between; margin-top: 7px; gap: 8px; }
.own-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 7px; font-size: 10px; color: var(--t3); }
.lock-card {
  flex: none; width: 44%;
  background: linear-gradient(135deg, #FFF3F3, #FFECEC);
  border-radius: 8px; padding: 10px;
}
.lock-card .lk-name { font-size: 14px; font-weight: 500; }
.lock-card .lk-code { font-size: 11px; color: var(--t3); }
.lock-card .lk-num { font-size: 20px; font-weight: 700; color: var(--red); margin: 4px 0 1px; }
.lock-card .lk-lbl { font-size: 10px; color: var(--t3); }
.lock-card .lk-time { font-size: 10px; color: var(--t3); margin-top: 5px; }

/* ---------- 空态 / 骨架 / 加载 ---------- */
.empty {
  text-align: center; padding: 36px 0 30px; color: var(--t3); font-size: 13px;
}
.empty .e-art { font-size: 34px; margin-bottom: 8px; opacity: .55; }
.empty .e-act { margin-top: 10px; display: inline-block; color: var(--red); font-size: 13px; }
.skeleton-block { background: var(--chip-bg); border-radius: 6px; overflow: hidden; position: relative; }
.skeleton-block::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .65), transparent);
  animation: shimmer 1.1s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.sk-hero { height: 150px; margin: 8px 12px; border-radius: 12px; }
.sk-card { height: 86px; margin: 8px 12px; border-radius: 8px; }
.sk-row { height: 74px; margin: 8px 12px; border-radius: 8px; }
.load-more { text-align: center; color: var(--t3); font-size: 13px; padding: 12px 0 2px; }
.loading-inline { text-align: center; color: var(--t3); font-size: 12px; padding: 14px 0; }

/* ---------- Toast / Modal ---------- */
.toast {
  position: fixed; left: 50%; bottom: 18%; transform: translateX(-50%) translateY(8px);
  background: rgba(26, 26, 26, .88); color: #fff;
  font-size: 13px; border-radius: 8px; padding: 9px 16px;
  max-width: 78vw; text-align: center; line-height: 1.5;
  opacity: 0; pointer-events: none; transition: .22s; z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.modal-mask {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 30px;
}
.modal {
  background: #fff; border-radius: 12px; width: 100%; max-width: 330px;
  padding: 20px 16px 16px; max-height: 80vh; overflow-y: auto;
}
.modal .m-title { text-align: center; font-size: 16px; font-weight: 600; margin-bottom: 10px; }
.modal .m-body { font-size: 13px; color: var(--t2); line-height: 1.7; }
.modal .m-btns { display: flex; gap: 10px; margin-top: 16px; }
.modal .m-btn {
  flex: 1; height: 40px; border-radius: 20px; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
}
.modal .m-btn.primary { background: var(--red); color: #fff; }
.modal .m-btn.plain { border: 1px solid #DDD; color: var(--t2); }
.receipt-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; }
.receipt-row .k { color: var(--t3); flex: 0 0 auto; white-space: nowrap; margin-right: 12px; }
.receipt-row .v { color: var(--t1); font-weight: 500; text-align: right; }
.modal .m-close { position: absolute; }

/* ============================================================
   网格产品体系 · 亮红 + 清新白 + 琥珀金 视觉
   ============================================================ */
body { background: var(--bg); font-variant-numeric: tabular-nums; }
.tnum, .wb-num, .plan-num, .hl-num {
  font-family: "IBM Plex Mono", "SF Mono", ui-monospace, Menlo, monospace;
  font-variant-numeric: tabular-nums;
}

/* 品牌色替换：导航 / 头部 / 选中态 / 主按钮 */
.navbar { background: linear-gradient(180deg, var(--brand-2), var(--brand)); }
.hero { background: linear-gradient(150deg, #F0554B 0%, #DE2F26 62%, #C92820 100%); }
.chip.active, .sub-tab.active,
.rank-badge.r1, .btn-block.primary, .modal .m-btn.primary,
.mode-toggle button.active, .switch input:checked + .track { background: var(--brand); color: #fff; }
/* 详情/沙盘页顶部 Tab 位于红色头部之上：选中态保持白底红字，避免红底红字 */
.seg-tab.active { background: #fff; color: var(--brand); }
.content-tab.active, .sort-item.active, .card-title .t-icon, .empty .e-act,
.lock-card .lk-num, .case-card .c-num { color: var(--brand); }
/* 行情头右侧箭头在红色头部上，保持白色 */
.quote-hero .q-more { color: #fff; }
.content-tab.active::after { background: var(--brand); }
.btn-block.ghost, .btn-mini, .btn-capsule-red, .btn-follow, .mode-toggle,
.quick-chip.active, .faq-item .q, .disclaimer h5 { border-color: var(--brand); color: var(--brand); }
.btn-mini.green { border-color: var(--green); color: var(--green); }
.btn-capsule-red { background: var(--brand); color: #fff; }
.nav-link { background: rgba(255, 255, 255, .14); }
.badge-new { background: var(--accent); color: #4A3410; }
.btn-outline-white { border-color: rgba(255, 255, 255, .55); }

/* 区块与卡片 */
.sec { padding: 14px 14px 0; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.sec-head h3 { font-size: 14px; font-weight: 600; color: var(--t1); letter-spacing: .3px; }
.sec-head .more { font-size: 12px; color: var(--t3); }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.panel + .panel { margin-top: 10px; }
.muted { color: var(--t3); font-size: 12px; }
.hint { color: var(--t2); font-size: 12px; line-height: 1.6; }
.divider { height: 1px; background: var(--line-2); margin: 10px 0; }

/* 网格卡片（我的） */
.grid-card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.grid-card + .grid-card { margin-top: 10px; }
.grid-card .top { display: flex; align-items: center; justify-content: space-between; }
.grid-card .name { font-size: 15px; font-weight: 600; }
.grid-card .code { font-size: 11px; color: var(--t3); margin-left: 5px; }
.grid-card .metrics { display: flex; gap: 18px; margin-top: 10px; }
.grid-card .metrics > div { flex: 1; }
.grid-card .metrics span { display: block; font-size: 10px; color: var(--t3); }
.grid-card .metrics b { font-size: 15px; }
.grid-card .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--t3); }
.grid-card .foot .acts { display: flex; gap: 8px; }
.grid-card .foot button { height: 28px; padding: 0 12px; border-radius: 6px; border: 1px solid var(--brand); color: var(--brand); font-size: 12px; background: #fff; }

/* 状态 / 健康度 */
.status-pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 11px; font-size: 11px; }
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-pill.good { color: var(--green); background: var(--green-bg); }
.status-pill.warn { color: var(--warn-t); background: var(--warn-bg); }
.status-pill.danger { color: var(--danger); background: rgba(155, 28, 28, .08); }
.status-pill.idle { color: var(--t3); background: var(--chip-bg); }
.health-row { display: flex; align-items: center; gap: 10px; }
.health-ring { width: 52px; height: 52px; flex: none; }
.health-ring text { font-family: "IBM Plex Mono", ui-monospace, monospace; }
.health-dims { flex: 1; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.health-dims .d { text-align: center; }
.health-dims .d b { display: block; font-size: 12px; color: var(--t1); }
.health-dims .d span { font-size: 9px; color: var(--t3); }
.health-dims .bar { height: 3px; border-radius: 2px; background: var(--line-2); margin: 4px 4px 0; overflow: hidden; }
.health-dims .bar i { display: block; height: 100%; background: var(--brand-2); }

/* 首页 · 今日状态（位于红色 navbar 内） */
.home-hero { padding: 0 14px 14px; color: #fff; }
.hh-brand { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: rgba(255, 255, 255, .8); }
.hh-market { display: inline-flex; align-items: center; gap: 4px; height: 18px; padding: 0 8px; border-radius: 9px; background: rgba(255, 255, 255, .16); font-size: 10px; color: #fff; }
.hh-market::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: rgba(255, 255, 255, .55); }
.hh-market.open { background: #fff; color: var(--brand); font-weight: 600; }
.hh-market.open::before { background: var(--brand); }
.hh-main { display: flex; align-items: flex-end; justify-content: space-between; margin-top: 9px; }
.hh-label { font-size: 11px; color: rgba(255, 255, 255, .8); }
.hh-big { margin-top: 2px; font-size: 34px; line-height: 1.1; font-weight: 700; letter-spacing: -.5px; font-family: "IBM Plex Mono", "SF Mono", ui-monospace, Menlo, monospace; }
.hh-big small { margin-left: 3px; font-size: 12px; font-weight: 400; opacity: .8; }
.hh-side { display: flex; gap: 16px; padding-bottom: 4px; }
.hh-side > div { text-align: right; }
.hh-side span { display: block; font-size: 10px; color: rgba(255, 255, 255, .76); }
.hh-side b { display: block; margin-top: 2px; font-size: 16px; font-family: "IBM Plex Mono", ui-monospace, monospace; }
.hh-insight { display: flex; align-items: center; gap: 6px; margin-top: 11px; padding: 7px 10px; border-radius: 8px; background: rgba(255, 255, 255, .14); font-size: 11px; color: #fff; }
.hh-insight i { flex: none; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.hh-cta { display: flex; gap: 8px; margin-top: 10px; }
.hh-btn { flex: 1; height: 38px; border-radius: 9px; background: #fff; color: var(--brand); font-size: 13px; font-weight: 600; }
.hh-btn.ghost { background: rgba(255, 255, 255, .16); color: #fff; border: 1px solid rgba(255, 255, 255, .42); font-weight: 500; }

/* 首页 · 可布网标的 */
.sort-row { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.sort-tab { height: 24px; line-height: 22px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-size: 11px; color: var(--t2); }
.sort-tab.on { border-color: var(--brand); background: var(--red-bg); color: var(--brand); font-weight: 600; }
.sort-note { margin-left: auto; font-size: 10px; color: var(--t3); }
.pick-panel { padding: 2px 12px; }
.pick-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.pick-row:last-child { border-bottom: 0; }
.pick-main { flex: 1; min-width: 0; }
.pick-top { display: flex; align-items: center; gap: 6px; }
.pick-name { font-size: 14px; font-weight: 600; color: var(--t1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-row .code { flex: none; font-size: 10px; color: var(--t3); font-family: "IBM Plex Mono", ui-monospace, monospace; }
.fit-pill { flex: none; margin-left: auto; height: 18px; line-height: 18px; padding: 0 7px; border-radius: 9px; font-size: 10px; font-weight: 600; }
.fit-pill.hi { color: var(--accent-ink); background: var(--accent-bg); }
.fit-pill.mid { color: var(--brand); background: var(--red-bg); }
.fit-pill.lo { color: var(--t3); background: var(--chip-bg); }
.pick-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.range { margin-top: 8px; }
.range-track { position: relative; height: 4px; margin: 0 4px; border-radius: 2px; background: var(--line-2); }
.range-track i { display: block; height: 100%; border-radius: 2px; background: var(--brand-3); }
.range-track i.low { background: rgba(18, 133, 90, .45); }
.range-track i.high { background: rgba(222, 47, 38, .45); }
.range-track .dot { position: absolute; top: 50%; width: 8px; height: 8px; border-radius: 50%; transform: translate(-50%, -50%); background: var(--accent); box-shadow: 0 0 0 2px var(--card); }
.range-track .dot.low { background: var(--green); }
.range-track .dot.high { background: var(--brand); }
.range-lbl { display: flex; align-items: baseline; justify-content: space-between; margin-top: 5px; font-size: 10px; color: var(--t3); font-family: "IBM Plex Mono", ui-monospace, monospace; }
.range-lbl .cur { color: var(--t2); font-family: inherit; }
.pick-side { flex: none; width: 62px; text-align: right; }
.pick-side b { display: block; font-size: 14px; line-height: 1.35; font-family: "IBM Plex Mono", ui-monospace, monospace; }
.pick-side span { display: block; margin-bottom: 3px; font-size: 9px; color: var(--t3); }
.pick-side b.trig { font-size: 12px; color: var(--t2); }

/* 首页 · 产品系列 */
.series-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.series-card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 10px 11px; cursor: pointer; transition: background .15s; }
.series-card:active { background: var(--chip-bg); }
.series-card .sc-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.series-card .tag {
  flex: none; font-size: 9px; line-height: 15px; color: var(--accent-ink);
  background: var(--accent-bg); padding: 0 5px; border-radius: 4px;
}
.series-card .arrow { font-size: 13px; line-height: 1; color: var(--t3); margin-left: 1px; }
.series-card h4 {
  min-width: 0; font-size: 14px; font-weight: 600; color: var(--t1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.series-card p {
  margin-top: 4px;
  font-size: 10px; color: var(--t3); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.series-card.off { opacity: .72; }
.series-card.wide { grid-column: 1 / -1; border-color: var(--brand-3); background: linear-gradient(135deg, #FFF8F7, var(--card)); }

/* 首页 · 精选方案横滑 */
.hscroll { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.feat-card { flex: none; width: 190px; padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); cursor: pointer; }
.fc-top { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.fc-top b { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-top .code { flex: none; font-size: 10px; color: var(--t3); font-family: "IBM Plex Mono", ui-monospace, monospace; }
.fc-name { margin-top: 3px; font-size: 11px; color: var(--t3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-metrics { display: flex; gap: 16px; margin-top: 9px; }
.fc-metrics span { display: block; font-size: 9px; color: var(--t3); }
.fc-metrics b { font-size: 14px; font-family: "IBM Plex Mono", ui-monospace, monospace; }
.fc-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 9px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 10px; color: var(--t3); }
.fc-foot .go { color: var(--brand); }

/* 寻优实验室 */
.lab-form .row { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.lab-form .row:last-child { border-bottom: 0; }
.lab-form label { font-size: 13px; color: var(--t2); }
.lab-form input, .lab-form select {
  text-align: right; font-size: 14px; color: var(--t1); font-weight: 500;
  background: transparent; max-width: 58%;
}
.lab-form select { direction: rtl; }
.lab-risk { display: flex; gap: 6px; }
.lab-risk span { padding: 5px 12px; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; color: var(--t2); }
.lab-risk span.on { border-color: var(--brand); color: var(--brand); background: var(--red-bg); font-weight: 600; }
.plan-list { display: flex; flex-direction: column; gap: 10px; }
.plan-card { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 12px; position: relative; }
.plan-card.reco { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.plan-card .badge { position: absolute; top: -1px; right: 12px; background: var(--accent); color: #3D2C0B; font-size: 10px; padding: 2px 8px; border-radius: 0 0 6px 6px; }
.plan-card .head { display: flex; align-items: center; gap: 8px; }
.plan-card .head b { font-size: 15px; }
.plan-card .metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0; }
.plan-card .metrics span { display: block; font-size: 10px; color: var(--t3); }
.plan-card .metrics b { font-size: 13px; }
.plan-card .params { font-size: 11px; color: var(--t2); line-height: 1.7; background: var(--bg); border-radius: 6px; padding: 8px 10px; }
.plan-card .why { font-size: 11px; color: var(--t3); margin-top: 6px; line-height: 1.6; }
.plan-card .btn-adopt { width: 100%; height: 36px; margin-top: 10px; border-radius: 6px; background: var(--brand); color: #fff; font-size: 13px; font-weight: 500; }
.plan-actions { display: flex; gap: 8px; margin-top: 10px; }
.plan-actions .btn-adopt { flex: 1; margin-top: 0; }
.plan-actions .btn-sandbox {
  flex: none; height: 36px; padding: 0 14px; border-radius: 6px;
  border: 1px solid var(--brand); color: var(--brand); background: #fff; font-size: 13px;
}
.pareto-box { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.pareto-box canvas { width: 100%; height: 190px; display: block; }
.pareto-legend { display: flex; gap: 12px; font-size: 11px; color: var(--t3); margin-top: 6px; }
.pareto-legend i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 4px; }

/* 我的 / 监控 */
.mine-tabs { display: flex; gap: 6px; padding: 10px 14px 0; }
.mine-tabs span { padding: 5px 12px; font-size: 12px; border-radius: 6px; color: var(--t2); background: var(--chip-bg); }
.mine-tabs span.on { background: var(--brand); color: #fff; }
.monitor-hero { background: linear-gradient(150deg, #F0554B, #DE2F26); color: #fff; padding: 14px 16px; }
.monitor-hero .price { font-size: 28px; font-weight: 700; }
.monitor-hero .sub { font-size: 11px; opacity: .82; }
.ladder { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.ladder-row { display: flex; align-items: center; gap: 8px; height: 22px; font-size: 10px; color: var(--t3); }
.ladder-row .bar { height: 2px; flex: 1; background: var(--line-2); position: relative; }
.ladder-row .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand-3); }
.ladder-row.now { color: var(--accent-ink); font-weight: 600; }
.ladder-row.now .bar { background: var(--accent); height: 3px; }
.attr-list .attr-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 12px; }
.attr-list .attr-row .k { width: 68px; color: var(--t2); flex: none; }
.attr-list .attr-row .bar { flex: 1; height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.attr-list .attr-row .bar i { display: block; height: 100%; background: var(--brand-2); }
.attr-list .attr-row .bar i.neg { background: var(--brand-3); }
.attr-list .attr-row .v { width: 76px; text-align: right; font-family: "IBM Plex Mono", ui-monospace, monospace; }

/* 三栏底部导航 */
.page.has-tabbar { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  max-width: 480px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line);
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
  backdrop-filter: blur(10px);
}
.tab-item { text-align: center; font-size: 10px; color: var(--t3); }
.tab-item .ico { display: block; font-size: 17px; line-height: 22px; }
.tab-item.on { color: var(--brand); font-weight: 600; }

/* 表单 / 空态微调 */
.btn-gold { background: var(--accent); color: #3D2C0B; font-weight: 600; }
.tag-gold { color: var(--accent-ink); background: var(--accent-bg); border-radius: 4px; padding: 1px 6px; font-size: 10px; }


/* ---------- 网格档案时间线 ---------- */
.tl-row { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.tl-row:last-child { border-bottom: none; }
.tl-dot { flex: none; width: 7px; height: 7px; margin-top: 6px; border-radius: 50%; background: var(--brand-3); }
.tl-main { min-width: 0; }
.tl-t { font-size: 13px; color: var(--t1); }
.tl-s { font-size: 11px; color: var(--t3); margin-top: 2px; }

/* ---------- 矩阵网格 ---------- */
.pf-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pf-chip {
  display: inline-flex; align-items: center; gap: 5px; max-width: 100%;
  padding: 6px 6px 6px 9px; border: 1px solid var(--brand-3);
  border-radius: 16px; background: var(--red-bg);
}
.pf-chip b { font-size: 12px; font-weight: 600; color: var(--t1); max-width: 108px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-chip i { font-size: 10px; font-style: normal; color: var(--t3);
  font-family: "IBM Plex Mono", ui-monospace, monospace; }
.pf-chip em {
  width: 16px; height: 16px; border-radius: 50%; background: rgba(222, 47, 38, .12);
  color: var(--brand); font-style: normal; font-size: 12px; line-height: 15px; text-align: center;
}
.pf-chip-empty { font-size: 12px; color: var(--t3); padding: 4px 0; }
.pf-add {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  width: 100%; margin-top: 8px; padding: 9px;
  border: 1px dashed var(--line); border-radius: 10px;
  background: var(--card); color: var(--brand); font-size: 13px; font-weight: 600;
}
.pf-add i { font-style: normal; font-size: 14px; }
.pf-add:disabled { color: var(--t3); }
.pf-add:active { background: var(--chip-bg); }

.pf-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.pf-head-main h3 { font-size: 15px; font-weight: 600; color: var(--t1); letter-spacing: .3px; }
.pf-head-main p { font-size: 11px; color: var(--t3); margin-top: 3px; line-height: 1.45; }
.pf-head-tag {
  flex: none; font-size: 10px; line-height: 18px; padding: 0 7px; border-radius: 9px;
  color: var(--brand); background: var(--red-bg); border: 1px solid var(--brand-3);
}
.pf-form { display: flex; flex-direction: column; gap: 12px; }
.pf-field { display: flex; flex-direction: column; gap: 6px; }
.pf-flabel { font-size: 11px; color: var(--t3); }
.pf-money {
  display: flex; align-items: baseline; gap: 6px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--bg);
}
.pf-money i { font-style: normal; font-size: 15px; color: var(--brand); font-weight: 600; }
.pf-money input {
  flex: 1; min-width: 0; border: 0; background: transparent; outline: none;
  font-size: 20px; font-weight: 600; color: var(--t1);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}
.pf-money em { font-style: normal; font-size: 11px; color: var(--t3); }
.pf-quick { display: flex; gap: 6px; margin-top: -6px; }
.pf-quick span {
  flex: 1; text-align: center; padding: 5px 0; border-radius: 7px;
  font-size: 11px; color: var(--t2); background: var(--chip-bg); cursor: pointer;
}
.pf-quick span.on { color: var(--brand); background: var(--red-bg); font-weight: 600; }
.pf-risk { padding-top: 2px; }
.pf-risk span { flex: 1; text-align: center; }

.pf-kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 8px; }
.pf-kpis > div { display: flex; flex-direction: column; gap: 3px; }
.pf-kpis span { font-size: 10px; color: var(--t3); }
.pf-kpis b { font-size: 17px; }

.pf-leg { padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.pf-leg:last-child { border-bottom: none; }
.pf-leg-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.pf-leg-name { display: flex; align-items: baseline; gap: 5px; min-width: 0; }
.pf-leg-name b { font-size: 13px; font-weight: 600; color: var(--t1);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-leg-name i { flex: none; font-size: 10px; font-style: normal; color: var(--t3);
  font-family: "IBM Plex Mono", ui-monospace, monospace; }
.pf-leg-top .muted { flex: none; font-size: 11px; }
.pf-leg-metrics { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 5px; font-size: 11px; color: var(--t2); }
.pf-leg-metrics b { font-family: "IBM Plex Mono", ui-monospace, monospace; }
.pf-leg-acts { margin-top: 6px; text-align: right; }
.pf-leg-acts button { font-size: 11px; color: var(--brand); padding: 2px 8px; border: 1px solid var(--line); border-radius: 10px; }

.corr-grid {
  display: grid; gap: 4px; align-items: stretch;
  grid-template-columns: 52px repeat(var(--cols, 3), minmax(0, 1fr));
}
.corr-corner { display: block; }
.corr-col, .corr-rowhead {
  display: flex; align-items: center; font-size: 9.5px; color: var(--t3);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  letter-spacing: -.2px; white-space: nowrap;
}
.corr-col { justify-content: center; }
.corr-rowhead { justify-content: flex-end; padding-right: 3px; }
.corr-cell {
  display: flex; align-items: center; justify-content: center;
  height: 34px; border-radius: 5px; font-size: 11px; color: var(--t1);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}
.corr-cell.diag { color: var(--t3); }
.corr-legend { display: flex; flex-wrap: wrap; gap: 3px 10px; margin-top: 8px; }
.corr-legend span { font-size: 10px; color: var(--t3); }
.corr-legend i { font-style: normal; color: var(--t2); margin-right: 3px;
  font-family: "IBM Plex Mono", ui-monospace, monospace; }

/* 标的多选弹层 */
.modal.pf-modal { display: flex; flex-direction: column; max-height: 78vh; padding: 16px 14px 14px; }
.pk-head { display: flex; align-items: baseline; justify-content: space-between; }
.pk-head b { font-size: 15px; font-weight: 600; }
.pk-head span { font-size: 11px; color: var(--t3); }
.pk-search { margin: 10px 0 4px; }
.pk-search input {
  width: 100%; height: 36px; padding: 0 10px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--bg);
  font-size: 13px; color: var(--t1); outline: none;
}
.pk-search input:focus { border-color: var(--brand-3); background: #fff; }
.pk-list { flex: 1; min-height: 0; overflow-y: auto; margin: 6px -4px 0; padding: 0 4px; }
.pk-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 2px; border-bottom: 1px solid var(--line-2); text-align: left;
}
.pk-item:last-child { border-bottom: none; }
.pk-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.pk-main b { font-size: 13px; font-weight: 500; color: var(--t1);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-main i { font-size: 10px; font-style: normal; color: var(--t3);
  font-family: "IBM Plex Mono", ui-monospace, monospace; }
.pk-check {
  flex: none; width: 20px; height: 20px; border-radius: 50%;
  border: 1px solid var(--line); font-size: 11px; color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.pk-item.on .pk-main b { color: var(--brand); font-weight: 600; }
.pk-item.on .pk-check { background: var(--brand); border-color: var(--brand); }
.modal.pf-modal .m-btns { flex: none; margin-top: 10px; }

/* 标的选择弹层：右侧行情（最新价 + 今日涨跌幅） */
.pk-quote {
  flex: none; text-align: right; display: flex; flex-direction: column; gap: 2px;
}
.pk-quote b {
  font-size: 13px; font-weight: 600; color: var(--t1);
  font-variant-numeric: tabular-nums;
}
.pk-quote i { font-size: 10px; font-style: normal; font-variant-numeric: tabular-nums; }
.pk-quote i.up { color: var(--red); }
.pk-quote i.down { color: var(--green); }
.pk-quote i.flat { color: var(--t3); }
.pk-arrow { flex: none; color: var(--t3); font-size: 16px; }

/* ---------- 实时回测参数表单（紧凑版） ---------- */
.card.pick-card { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pick-left { min-width: 0; cursor: pointer; }
.pick-name {
  font-size: 15px; font-weight: 600; color: var(--t1);
  display: flex; align-items: baseline; gap: 6px;
}
.pick-code {
  font-size: 11px; font-weight: 400; color: var(--t3);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}
.pick-sub { font-size: 11px; color: var(--t3); margin-top: 3px; font-variant-numeric: tabular-nums; }
.pick-sub b { color: var(--t1); font-weight: 600; }
.pick-sub b.up { color: var(--red); }
.pick-sub b.down { color: var(--green); }

/* 网格参数：一行一个参数，左标签 + 折算说明，右侧步进器 */
.form-row.compact.param-row { min-height: 46px; }
.param-row .pr-left { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.param-row .pr-hint { font-size: 11px; color: var(--t3); font-variant-numeric: tabular-nums; }
.param-row .f-ctrl { flex: none; }
.param-row .stepper.sm { width: 132px; flex: none; }
.stepper.sm { flex: 1; min-width: 0; }
.stepper.sm button { width: 28px; height: 28px; font-size: 15px; }
.stepper.sm input { flex: 1; width: auto; min-width: 0; height: 28px; font-size: 13px; }

.f-divider { height: 1px; background: var(--line-2); margin: 9px 0; }
.quick-chips.tight { margin-top: 8px; gap: 6px; }
.quick-chips.tight .quick-chip { height: 26px; line-height: 24px; padding: 0 10px; font-size: 12px; }
.row-label { font-size: 12px; color: var(--t2); margin-bottom: 6px; }
.form-row.compact { min-height: 38px; }
.mode-toggle.wide button { flex: 1; padding: 7px 0; }
.disclaimer-mini {
  padding: 6px 16px 0; font-size: 11px; color: var(--t3);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.disclaimer-mini i { font-style: normal; font-size: 13px; }

/* 回测周期：标签与 chips 同行，省一行高度 */
.cycle-row { display: flex; align-items: center; gap: 10px; margin-top: 2px; }
.cycle-row .row-label { margin: 0; flex: none; }
.cycle-row .c-chips { flex: 1; min-width: 0; }

/* 波动建议行：宽度/点位一键套用 */
.vol-line { margin-top: 8px; }
.vol-line[hidden] { display: none; }
.vol-apply {
  margin-left: auto; flex: none; padding: 0 8px; height: 22px; line-height: 20px;
  border: 1px solid var(--red); border-radius: 4px;
  background: #fff; color: var(--red); font-size: 11px;
}

/* ---------- 事件网格 ---------- */
.cal-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 0;
  border-bottom: 1px solid var(--line-2); font-size: 12px;
}
.cal-row:last-child { border-bottom: none; }
.cal-row.on { padding-left: 8px; border-left: 2px solid var(--accent); background: var(--accent-bg); border-radius: 4px; }
.cal-date { flex: none; width: 84px; color: var(--t2); font-family: "IBM Plex Mono", ui-monospace, monospace; }
.cal-main { flex: 1; color: var(--t1); }
.cal-yield { flex: none; color: var(--brand); font-family: "IBM Plex Mono", ui-monospace, monospace; }

/* ---------- 套餐与权益 ---------- */
.pkg-list { display: flex; flex-direction: column; gap: 10px; }
.pkg-card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.pkg-card.on { border-color: var(--brand-3); box-shadow: 0 2px 10px rgba(222, 47, 38, .07); }
.pkg-head { display: flex; justify-content: space-between; align-items: center; }
.pkg-head b { font-size: 14px; }
.pkg-item { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--t2); padding: 3px 0; }
.pkg-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--brand-3); flex: none; }

/* ============================================================
   产品体系（基石 / 灵动）
   #/{series} → 产品首页
   #/{series}/plan/:key → 详情（方案画像）
   #/{series}/backtest/:key → 回测
   ============================================================ */

/* 首页系列卡：适合场景标签 */
.sc-scenes { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.sc-scene {
  font-size: 9px; line-height: 15px; padding: 0 5px; border-radius: 4px;
  color: var(--t2); background: var(--chip-bg); white-space: nowrap;
}
.series-card.wide .sc-scene { color: var(--accent-ink); background: var(--accent-bg); }

/* 产品首页 banner */
.prod-hero {
  margin: 8px 12px 0; padding: 16px 16px 14px;
  border-radius: 12px; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(150deg, #F0554B 0%, #DE2F26 62%, #C92820 100%);
}
.prod-hero::after {
  content: ""; position: absolute; right: -30px; top: -46px;
  width: 140px; height: 140px; border-radius: 50%;
  background: rgba(255, 255, 255, .08);
}
.prod-hero.adaptive {
  background: linear-gradient(150deg, #3B4152 0%, #262A36 62%, #1B1E27 100%);
}
.prod-hero.adaptive::after { background: rgba(233, 162, 59, .16); }
.prod-hero .ph-tag {
  display: inline-block; font-size: 10px; line-height: 17px; padding: 0 7px;
  border-radius: 9px; background: rgba(255, 255, 255, .2); color: #fff;
}
.prod-hero.adaptive .ph-tag { background: rgba(233, 162, 59, .22); color: #F5C578; }
.prod-hero h2 { font-size: 21px; font-weight: 700; letter-spacing: .4px; margin-top: 8px; }
.prod-hero p {
  font-size: 12px; line-height: 1.6; opacity: .92; margin-top: 6px;
  position: relative; z-index: 1;
}
.prod-hero .ph-scenes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; position: relative; z-index: 1; }
.prod-hero .ph-scenes span {
  font-size: 10px; line-height: 20px; padding: 0 8px; border-radius: 10px;
  background: rgba(255, 255, 255, .16); color: #fff;
}
.prod-hero.adaptive .ph-scenes span { background: rgba(233, 162, 59, .16); color: #F5C578; }
.prod-hero .ph-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 14px; padding-top: 10px; font-size: 10px; opacity: .85;
  border-top: 1px dashed rgba(255, 255, 255, .28); position: relative; z-index: 1;
}
/* 卡片内的场景标签（浅底） */
.card .ph-scenes { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 6px; }
.card .ph-scenes span {
  font-size: 10px; line-height: 19px; padding: 0 8px; border-radius: 10px;
  background: var(--chip-bg); color: var(--t2);
}

/* 工具入口 */
.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tool-card {
  position: relative; background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 10px 12px; cursor: pointer; transition: background .15s;
}
.tool-card:active { background: var(--chip-bg); }
.tool-card b { display: block; font-size: 13px; font-weight: 600; color: var(--t1); }
.tool-card span {
  display: block; margin-top: 5px; font-size: 10px; line-height: 1.5; color: var(--t3);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tool-card .arrow {
  position: absolute; right: 9px; bottom: 8px;
  font-size: 12px; line-height: 1; color: var(--brand-3); font-style: normal;
}

/* 精选方案卡（三列指标） */
.plan-card .metrics.m3 { grid-template-columns: repeat(3, 1fr); }
.plan-card .head .muted { margin-left: auto; font-size: 10px; }

/* 数字格 */
.stat-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 4px; margin-top: 10px;
}
.stat-cell { text-align: center; border-left: 1px solid var(--line-2); }
.stat-cell:first-child { border-left: none; }
.stat-cell b {
  display: block; font-size: 16px; font-weight: 700; color: var(--t1);
  font-family: "IBM Plex Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums;
}
.stat-cell span { display: block; margin-top: 3px; font-size: 10px; color: var(--t3); }

/* 箱体可视化：区间带 + 等距档位 + 现价点 */
.box-viz { padding: 14px 0 4px; }
.box-track {
  position: relative; height: 10px; border-radius: 5px;
  background: var(--line-2); overflow: visible;
}
.box-zone {
  position: absolute; inset: 0; border-radius: 5px;
  background: linear-gradient(90deg, rgba(18, 133, 90, .16), rgba(222, 47, 38, .16));
}
.box-tick {
  position: absolute; top: 0; width: 1px; height: 10px;
  background: rgba(255, 255, 255, .85);
}
.box-dot {
  position: absolute; top: 50%; width: 12px; height: 12px; border-radius: 50%;
  background: var(--brand); border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(222, 47, 38, .45);
  transform: translate(-50%, -50%);
}
.box-lbl {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-top: 9px; font-size: 10px; color: var(--t3);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}
.box-lbl .cur { color: var(--brand); font-weight: 600; font-family: inherit; }

/* 方案切换（分段控件） */
.plan-switch {
  display: inline-flex; gap: 2px; padding: 3px; margin-bottom: 12px;
  background: var(--chip-bg); border-radius: 9px;
}
.ps-item {
  font-size: 12px; line-height: 22px; padding: 0 14px; border-radius: 7px;
  color: var(--t2); cursor: pointer; white-space: nowrap;
}
.ps-item.active {
  background: #fff; color: var(--brand); font-weight: 600;
  box-shadow: 0 1px 3px rgba(28, 29, 34, .1);
}

/* 越界预案对比表 */
.pb-table { margin-top: 2px; }
.pb-row {
  display: grid; grid-template-columns: 1.5fr 1fr .85fr .7fr .7fr;
  align-items: center; gap: 4px; padding: 8px 0;
  border-bottom: 1px solid var(--line-2); font-size: 12px; color: var(--t2);
}
.pb-row:last-child { border-bottom: none; }
.pb-row > b, .pb-row > span:nth-child(n+2) {
  text-align: right; font-variant-numeric: tabular-nums;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}
.pb-row > span:first-child { color: var(--t1); }
.pb-row.head { padding: 0 0 6px; border-bottom: 1px solid var(--line); }
.pb-row.head span {
  font-size: 10px; color: var(--t3); font-weight: 400; text-align: right;
  font-family: inherit;
}
.pb-row.head span:first-child { text-align: left; }
.pb-row.on {
  padding-left: 8px; padding-right: 8px; border-radius: 7px;
  background: var(--accent-bg);
}
.pb-badge {
  display: inline-block; margin-left: 4px; padding: 0 4px;
  font-size: 9px; line-height: 14px; font-style: normal; border-radius: 3px;
  background: var(--accent); color: #3D2C0B; vertical-align: 1px;
}

/* 回测页方案标签 */
.bt-scene { display: flex; align-items: baseline; gap: 8px; }
.bts-tag {
  font-size: 11px; line-height: 19px; padding: 0 8px; border-radius: 10px;
  background: var(--red-bg); color: var(--brand); font-weight: 600;
}
.bts-note { font-size: 11px; color: var(--t3); }
