:root {
  --bg: #fdf6f9;                 /* 樱花奶白底 */
  --card: #ffffff;
  --ink: #4a3b47;                /* 柔和深莓色文字 */
  --muted: #a893a3;
  --line: #f3dfe9;
  --up: #ef5d7f;                 /* 红涨（草莓粉红） */
  --down: #3cb98d;               /* 绿跌（薄荷绿） */
  --brand: #b57edc;              /* 香芋紫 */
  --brand-d: #9a5fc9;
  --peach: #ffd9c4;
  --shadow: 0 2px 8px rgba(181, 126, 220, .08), 0 8px 24px rgba(239, 93, 127, .06);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  background-image: radial-gradient(circle at 12% 8%, rgba(255, 214, 231, .35) 0, transparent 30%),
                    radial-gradient(circle at 88% 20%, rgba(214, 231, 255, .35) 0, transparent 30%),
                    radial-gradient(circle at 50% 90%, rgba(255, 240, 214, .3) 0, transparent 35%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  font-size: 14px; line-height: 1.5;
}
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px; background: rgba(255,255,255,.9); backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo { font-size: 24px; }
.topbar h1 { font-size: 18px; margin: 0; letter-spacing: .5px; }
.sub { color: var(--muted); font-size: 12px; }
.actions { display: flex; align-items: center; gap: 10px; }
.btn {
  border: 1.5px solid var(--line); background: #fff; color: var(--ink);
  padding: 7px 14px; border-radius: 999px; cursor: pointer; font-size: 13px;
  transition: .18s;
}
.btn:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-1px); }
.btn.primary { background: linear-gradient(135deg, var(--brand), #e88fb7); border-color: transparent; color: #fff; box-shadow: 0 3px 10px rgba(181,126,220,.35); }
.btn.primary:hover { filter: brightness(1.06); color: #fff; }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 12px; font-size: 12px; }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.status { color: var(--muted); font-size: 12px; }
.nav {
  display: flex; gap: 6px; padding: 8px 24px; background: rgba(255,255,255,.85);
  border-bottom: 2px solid var(--line); flex-wrap: wrap;
}
.nav a { color: var(--ink); text-decoration: none; padding: 6px 12px; border-radius: 999px; font-size: 13px; transition: .15s; }
.nav a:hover { background: #f7ecf6; color: var(--brand-d); }
.tip { max-width: 1280px; margin: 14px auto 0; padding: 0 18px; color: var(--muted); font-size: 12.5px; }
main { max-width: 1280px; margin: 10px auto 18px; padding: 0 18px; display: flex; flex-direction: column; gap: 14px; }

/* ── 可折叠卡片 ── */
.card { background: var(--card); border: 2px solid var(--line); border-radius: 20px; padding: 0; box-shadow: var(--shadow); overflow: hidden; transition: border-color .2s, box-shadow .2s; }
.card.open { border-color: #ecc8e2; box-shadow: 0 4px 14px rgba(181,126,220,.14), 0 10px 30px rgba(239,93,127,.08); }
.sec-toggle {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; cursor: pointer; user-select: none;
  transition: background .15s;
}
.sec-toggle:hover { background: #fdf3fa; }
.sec-toggle h2 { margin: 0; font-size: 15.5px; display: flex; align-items: center; gap: 8px; font-weight: 600; }
.sec-toggle .emoji { font-size: 18px; }
.sec-right { display: flex; align-items: center; gap: 10px; }
.sec-status { color: var(--muted); font-size: 12px; }
.sec-toggle .chev { color: var(--brand); font-size: 14px; width: 18px; text-align: center; transition: transform .2s; }
.card.open .sec-toggle { border-bottom: 2px dashed var(--line); }
.sec-body { padding: 16px 20px 20px; animation: bloom .25s ease; }
@keyframes bloom { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.card.loading .sec-toggle .chev { animation: spinny 1s linear infinite; }
@keyframes spinny { to { transform: rotate(360deg); } }

.card h3 { font-size: 14px; margin: 0 0 10px; color: var(--ink); }
.hint { color: var(--muted); font-size: 12px; font-weight: normal; }

/* 大盘 */
.grid.indices { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: 12px; }
.idx { border: 2px solid var(--line); border-radius: 16px; padding: 12px 14px; background: #fffdfe; transition: .15s; }
.idx:hover { transform: translateY(-2px); border-color: #ecc8e2; }
.idx .nm { color: var(--muted); font-size: 12px; }
.idx .px { font-size: 20px; font-weight: 700; margin: 4px 0 2px; }

/* 表格 */
.table-wrap { overflow-x: auto; border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 9px 10px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 500; background: #fbf3f8; position: sticky; top: 0; }
td:first-child, th:first-child, td:nth-child(2), th:nth-child(2) { text-align: left; }
tbody tr:hover { background: #fdf3fa; }
.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--muted); }

/* 连扳梯队 */
.limit-tiers { display: flex; gap: 12px; flex-wrap: wrap; }
.tier { flex: 1 1 150px; min-width: 140px; border: 2px solid var(--line); border-radius: 16px; overflow: hidden; background: #fffdfe; }
.tier .head { background: linear-gradient(135deg, #ff8fab, #ffb37e); color: #fff; padding: 8px 12px; font-weight: 600; text-align: center; }
.tier .body { padding: 8px 10px; }
.tier .stk { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.tier .stk:last-child { border-bottom: none; }
.tier .stk .nm { color: var(--ink); }
.tier .stk .pc { font-size: 12px; }

/* 板块两列 */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 900px){ .two-col { grid-template-columns: 1fr; } }

/* 均线控制 */
.ma-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.ma-controls .custom { display: inline-flex; align-items: center; gap: 6px; }
.ma-controls input { width: 56px; padding: 4px 6px; border: 1.5px solid var(--line); border-radius: 8px; text-align: center; background: #fffdfe; color: var(--ink); }

/* 弹窗 */
.modal { position: fixed; inset: 0; background: rgba(74,59,71,.35); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal.hidden { display: none; }
.modal-box { background: #fff; border-radius: 20px; padding: 22px; width: 460px; max-width: 92vw; box-shadow: var(--shadow); border: 2px solid var(--line); }
.modal-box textarea { width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.modal-actions { display: flex; gap: 10px; align-items: center; margin-top: 12px; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 24px; }

/* 连扳模式切换 */
.toggle { display: flex; gap: 14px; font-size: 13px; color: var(--muted); }
.toggle label { cursor: pointer; display: flex; align-items: center; gap: 4px; }
.toggle input { accent-color: var(--brand); }

/* 连扳原因小标签 */
.reason-tag {
  display: inline-block; margin-left: 6px; padding: 1px 8px; font-size: 11px;
  color: #a06a12; background: #fff2d1; border-radius: 999px; vertical-align: middle;
  max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 龙虎榜可展开行 */
.dt-row { cursor: pointer; }
.dt-row:hover { background: #fdf3fa; }
.dt-row .chev { color: var(--muted); width: 18px; text-align: center; }
.dt-detail-box { padding: 14px 18px; background: #fdf8fc; border-radius: 12px; }
.inst-summary { margin-bottom: 12px; font-size: 14px; }
.seat-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.seat-cols h4 { margin: 0 0 8px; font-size: 13px; color: var(--ink); }
.seat-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.seat-table th, .seat-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: right; }
.seat-table th:first-child, .seat-table th:nth-child(2),
.seat-table td:first-child, .seat-table td:nth-child(2) { text-align: left; }
.seat-inst { background: #fff7e6; }
.seat-inst td:nth-child(2) { font-weight: 600; }
.seat-hk td:nth-child(2) { color: var(--brand); }
.badge { display: inline-block; margin-left: 6px; padding: 0 8px; font-size: 10.5px; border-radius: 999px; vertical-align: middle; }
.badge.inst { color: #fff; background: #f5a742; }
.badge.hk { color: #fff; background: var(--brand); }
@media (max-width: 720px) { .seat-cols { grid-template-columns: 1fr; } }

/* 涨停原因分类 */
.lr-themes { display: flex; gap: 8px; flex-wrap: wrap; }
.lr-chip { background: #f6effc; color: var(--brand-d); border: 1.5px solid #e8d8f5; border-radius: 999px; padding: 5px 12px; font-size: 12px; }
.lr-chip b { color: var(--brand-d); }
.tag { display: inline-block; background: #f7ecf6; color: var(--ink); border-radius: 999px; padding: 2px 10px; font-size: 12px; }

/* 连扳题材聚合 - 可折叠 */
.limit-themes { margin-top: 14px; border-top: 2px dashed var(--line); padding-top: 12px; }
.lt-collapse { border: 2px solid var(--line); border-radius: 14px; overflow: hidden; }
.lt-collapse-head { cursor: pointer; padding: 9px 12px; font-size: 13px; color: var(--ink); background: #fbf3f8; user-select: none; display: flex; align-items: center; gap: 6px; }
.lt-collapse-head:hover { background: #f7e9f3; }
.lt-collapse-head .chev { color: var(--brand); width: 14px; text-align: center; }
.lt-collapse-body { padding: 10px 12px; }
.lt-group { margin-bottom: 10px; }
.lt-group-head { font-size: 13px; margin-bottom: 5px; }
.lt-group-head .tag { margin-right: 6px; }
.lt-stocks { display: flex; flex-wrap: wrap; gap: 6px; }
.stk-inline { display: inline-flex; align-items: baseline; gap: 4px; background: #f6effc; border: 1.5px solid #e8d8f5; border-radius: 999px; padding: 3px 10px; font-size: 12px; }
.stk-inline b { color: var(--ink); font-weight: 600; }
.stk-inline small { color: var(--muted); }

/* 龙虎榜明细 - 上榜原因（按类型着色） */
.dt-reason { margin-bottom: 12px; font-size: 13px; border-radius: 12px; padding: 8px 12px; border: 1.5px solid var(--line); background: #fdf8fc; }
.dt-reason b { color: var(--brand-d); }
.dt-reason .type-badge { display: inline-block; margin-right: 6px; padding: 1px 10px; border-radius: 999px; font-size: 11px; color: #fff; vertical-align: middle; }
.dt-reason.type-dev { border-color: #f8c9d4; background: #fdf1f4; }
.dt-reason.type-dev .type-badge { background: var(--up); }
.dt-reason.type-turn { border-color: #d5c9f0; background: #f5f1fc; }
.dt-reason.type-turn .type-badge { background: var(--brand); }
.dt-reason.type-amp { border-color: #f5ddc0; background: #fdf7ee; }
.dt-reason.type-amp .type-badge { background: #f5a742; }
.dt-reason.type-other { border-color: #e6dee4; background: #f9f6f8; }
.dt-reason.type-other .type-badge { background: var(--muted); }

/* 北向资金 历史条 */
.nb-history { margin-top: 6px; }
.nb-bars { display: flex; align-items: flex-end; gap: 4px; height: 120px; overflow-x: auto; padding-top: 8px; }
.nb-bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-width: 22px; height: 110px; }
.nb-bar-fill { width: 14px; border-radius: 6px 6px 0 0; min-height: 2px; }
.nb-bar-fill.up { background: var(--up); }
.nb-bar-fill.down { background: var(--down); }
.nb-bar-lab { font-size: 9px; color: var(--muted); margin-top: 2px; white-space: nowrap; }

/* 解禁/研报 表头间距 */
.card h3 { margin-top: 4px; }

/* ── 彭道富 AI 模拟盘 ── */
.ai-overview { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin-bottom: 16px; }
.ai-stat { border: 2px solid var(--line); border-radius: 16px; padding: 12px 14px; background: #fffdfe; transition: .15s; }
.ai-stat:hover { transform: translateY(-2px); border-color: #ecc8e2; }
.ai-stat .nm { color: var(--muted); font-size: 12px; }
.ai-stat .v { font-size: 19px; font-weight: 700; margin-top: 4px; }
.ai-stat .v.phase { color: var(--brand-d); font-size: 17px; }

/* 权益曲线 */
.ai-equity { margin-bottom: 6px; }
.ai-eq-bars { display: flex; align-items: flex-end; gap: 5px; height: 130px; overflow-x: auto; padding-top: 8px; border-bottom: 2px dashed var(--line); }
.ai-eq-bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-width: 26px; height: 120px; }
.ai-eq-fill { width: 16px; border-radius: 6px 6px 0 0; min-height: 3px; transition: height .3s; background: var(--brand); }
.ai-eq-fill.up { background: var(--up); }
.ai-eq-fill.down { background: var(--down); }
.ai-eq-lab { font-size: 9px; color: var(--muted); margin-top: 3px; white-space: nowrap; }

/* 决策留痕 */
.ai-decisions { display: flex; flex-direction: column; gap: 10px; }
.ai-dec { border: 2px solid var(--line); border-radius: 14px; padding: 11px 14px; background: #fffdfe; }
.ai-dec-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.ai-dec-time { color: var(--muted); font-size: 12px; }
.ai-dec-tag { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 11px; color: #fff; }
.ai-dec-tag.src-deepseek { background: linear-gradient(135deg, #f5a742, #ef5d7f); }
.ai-dec-tag.src-rule { background: var(--muted); }
.ai-dec-phase { font-size: 12px; font-weight: 600; color: var(--brand-d); background: #f6effc; border: 1.5px solid #e8d8f5; border-radius: 999px; padding: 1px 9px; }
.ai-dec-trig { color: var(--muted); font-size: 12px; }
.ai-dec-view { font-size: 13px; line-height: 1.55; margin-bottom: 6px; color: var(--ink); }
.ai-dec-acts, .ai-dec-exec { font-size: 12.5px; color: var(--ink); margin-top: 3px; }
.ai-dec-acts b, .ai-dec-exec b { color: var(--brand-d); }
.ai-dec-analogy { font-size: 13px; line-height: 1.55; margin: 6px 0; padding: 8px 11px; border-radius: 10px;
  background: linear-gradient(135deg, #fff6ef, #fdeef7); border: 1.5px solid #f3d6c4; color: var(--ink); }
.ai-dec-analogy b, .ai-dec-match b { color: #d8742f; }
.ai-dec-match { font-size: 12px; color: var(--muted); margin-top: 3px; }
.ai-dec-match .chip { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px;
  color: #fff; background: linear-gradient(135deg, #f5a742, #ef5d7f); margin-left: 4px; }
