/* ============================================================
   页面模块：指数编辑、复盘情绪、分时、泡泡图、交易表单
   （基础令牌与组件在 style.css）
   ============================================================ */

/* index editor */
.index-wrap { min-width: 0; display: flex; flex-direction: column; }
.index-wrap .index-grid { flex: 1; align-content: stretch; }
.index-tools { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 0 2px 10px; }
.index-tools h3 { margin: 0; font-size: 17px; font-weight: 600; color: var(--text); letter-spacing: .03em; }
.index-preset-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.index-preset { display: flex; align-items: center; gap: 9px; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius-tile); cursor: pointer; transition: border-color .15s, background .15s; }
.index-preset:hover { border-color: var(--line-strong); }
.index-preset:has(input:checked) { border-color: rgba(201, 163, 90, .5); background: rgba(201, 163, 90, .07); }
.index-preset input { accent-color: var(--gold); }
.index-preset span { display: flex; flex-direction: column; font-size: 14px; line-height: 1.35; }
.index-preset em { font-style: normal; font-size: 12px; color: var(--dim); font-family: var(--num-font); letter-spacing: .03em; }
@media (max-width: 700px) { .index-preset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* collapsible history */
.history-day-row td { background: var(--panel-2); border-top: 1px solid var(--line); padding: 9px 12px !important; font-size: 13.5px; }
.history-day-row b { font-family: var(--num-font); font-size: 16px; font-weight: 600; letter-spacing: .04em; color: var(--gold-2); }
.history-day-row .hint { margin-left: 8px; }
#toggle-history-days { white-space: nowrap; }

/* dashboard sentiment / breadth / compare */
.sent-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, .7fr); gap: 20px; padding: 0 0 16px; }
.sent-grid .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sent-chart-wrap { min-width: 0; display: flex; flex-direction: column; justify-content: space-between; }
.sent-chart { height: 190px; width: 100%; }
.sent-extra { display: grid; grid-template-columns: 1.15fr .85fr 1fr; gap: 0; border-top: 1px solid var(--line-soft); }
.sent-block { padding: 16px 20px 2px; border-right: 1px solid var(--line-soft); }
.sent-block:first-child { padding-left: 0; }
.sent-block:last-child { border-right: 0; padding-right: 0; }
.sent-block .k { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.sent-list { display: flex; flex-direction: column; gap: 6px; }
.sent-row { display: flex; align-items: baseline; gap: 10px; font-size: 13px; color: var(--muted); }
.sent-row b { color: var(--text); font-size: 14.5px; font-weight: 600; }
.sent-panic { font-family: var(--serif); font-size: 24px; font-weight: 700; margin: 2px 0 6px; letter-spacing: .06em; }
.sent-panic.bad, .sent-expect.down { color: var(--green); }
.sent-panic.warn { color: var(--gold); }
.sent-panic.ok, .sent-expect.up { color: var(--red); }
.sent-expect { font-size: 38px; font-weight: 600; font-family: var(--num-font); line-height: 1.1; }
.sent-expect span { font-family: var(--sans); font-size: 13px; margin-left: 10px; font-weight: 600; color: var(--muted); }
.exp-bar { height: 6px; border-radius: 3px; background: linear-gradient(90deg, rgba(61, 187, 140, .7), rgba(201, 163, 90, .6) 50%, rgba(242, 84, 61, .75)); position: relative; margin: 12px 0 6px; }
.exp-bar i { position: absolute; top: -4px; width: 4px; height: 14px; border-radius: 1px; background: var(--text); box-shadow: 0 0 0 2px var(--panel); transform: translateX(-50%); }
.exp-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--dim); }
.breadth-numbers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; padding: 2px 0 0; }
.breadth-num { display: flex; flex-direction: column; align-items: center; border-right: 1px solid var(--line-soft); }
.breadth-num:last-child { border-right: 0; }
.breadth-num b { font-family: var(--num-font); font-size: 64px; font-weight: 600; line-height: 1; letter-spacing: .01em; }
.breadth-num span { font-size: 13.5px; color: var(--muted); margin-top: 4px; letter-spacing: .1em; }
.breadth-bottom { display: flex; justify-content: space-between; gap: 12px; padding: 0; font-size: 13.5px; color: var(--muted); }
.breadth-bottom b { font-size: 22px; font-family: var(--num-font); font-weight: 600; }
.compare-table { min-width: 820px; }
.compare-table td { padding: 10px 12px; }
.compare-table tbody tr:first-child td { color: var(--text); background: rgba(201, 163, 90, .05); }
@media (max-width: 900px) {
  .sent-grid { grid-template-columns: 1fr; }
  .sent-chart-wrap { border-top: 1px solid var(--line-soft); padding: 14px 0 0; }
  .sent-grid .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sent-extra { grid-template-columns: 1fr; }
  .sent-block, .sent-block:first-child, .sent-block:last-child { padding: 14px 0; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .sent-block:last-child { border-bottom: 0; }
  .breadth-num b { font-size: 44px; }
}

/* intraday panel */
.intraday-panel { border-top: 1px solid var(--line-soft); padding: 16px 0 4px; }
.card-head + #dash-intraday-panel .intraday-panel { border-top: 0; padding-top: 0; }
.modal .intraday-panel { border-top: 0; padding-top: 0; }
.pos-detail .intraday-panel { margin-top: 14px; }
.intraday-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.intraday-head h4 { margin: 0; font-size: 15px; font-weight: 600; }
.intraday-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.intraday-chart { height: 340px; width: 100%; }
.intraday-empty { height: 160px; display: grid; place-items: center; color: var(--muted); font-size: 14px; border: 1px dashed var(--line); border-radius: var(--radius-tile); }
.intraday-image { max-width: 100%; max-height: 280px; border-radius: var(--radius-tile); border: 1px solid var(--line); margin-top: 10px; }
.intraday-upload { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.intraday-upload input { display: none; }
.file-pill { font-size: 12px; color: var(--dim); }

/* bubble page */
.bubble-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(320px, .75fr); gap: 16px; align-items: stretch; }
.bubble-card { min-height: 560px; display: flex; flex-direction: column; }
.bubble-chart { width: 100%; flex: 1; min-height: 480px; height: 480px; }
.bubble-side { display: flex; flex-direction: column; gap: 16px; }
.bubble-side .card { flex: 1; }
.bubble-legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--muted); padding: 10px 0 0 !important; border-top: 1px solid var(--line-soft); }
.bubble-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.bubble-legend span:nth-child(1) i { background: var(--red) !important; }
.bubble-legend span:nth-child(2) i { background: var(--gold) !important; }
.bubble-legend span:nth-child(3) i { background: var(--green) !important; }
.bubble-legend span:last-child { margin-left: auto; color: var(--dim); }
.bubble-list { display: flex; flex-direction: column; }
.bubble-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) 66px 62px 64px; gap: 8px; align-items: center; padding: 9px 8px; border-radius: 0; cursor: pointer; border: 0; border-bottom: 1px solid var(--line-soft); border-left: 2px solid transparent; transition: background .12s; }
.bubble-row:last-child { border-bottom: 0; }
.bubble-row:hover { background: var(--panel-2); }
.bubble-row.active { background: rgba(201, 163, 90, .08); border-left-color: var(--gold); }
.bubble-row .name { font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bubble-row .num { font-size: 15px; text-align: right; font-family: var(--num-font); font-weight: 500; letter-spacing: .02em; white-space: nowrap; }
.bubble-row .heat { font-family: var(--num-font); font-size: 16px; font-weight: 600; color: var(--gold); }
#bubble-detail { padding: 20px 6px 6px; }
#bubble-detail > .card-head { padding: 0 16px; }
#bubble-detail .ml-meta { color: var(--muted); }
@media (max-width: 980px) {
  .bubble-layout { grid-template-columns: 1fr; }
  .bubble-card { min-height: 440px; }
  .bubble-chart { min-height: 380px; }
}

/* trade split form */
.trade-split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.trade-side { border: 1px solid var(--line); border-top: 3px solid var(--line); border-radius: var(--radius-tile); padding: 14px 16px; background: var(--inset); }
.trade-side.buy { border-top-color: var(--red); }
.trade-side.sell { border-top-color: var(--green); }
.trade-side h4 { margin: 0 0 10px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.trade-side h4 .dot { width: 7px; height: 7px; border-radius: 1px; }
.trade-side.buy h4 .dot { background: var(--red); }
.trade-side.sell h4 .dot { background: var(--green); }
.emotion-sliders { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 6px; }
.emotion-slider { border: 1px solid var(--line-soft); border-radius: var(--radius-tile); padding: 10px 12px; background: var(--inset); }
.emotion-slider label { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.emotion-slider b { color: var(--gold-2); font-family: var(--num-font); font-size: 22px; font-weight: 600; line-height: 1; }
.emotion-slider input[type=range] { width: 100%; accent-color: var(--gold); }
@media (max-width: 900px) {
  .trade-split { grid-template-columns: 1fr; }
  .emotion-sliders { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.pnl-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.pnl-switch button { border: 0; background: transparent; color: var(--dim); font-size: 12px; padding: 3px 9px; cursor: pointer; }
.pnl-switch button:hover { color: var(--text-2); }
.pnl-switch button.active { background: rgba(201, 163, 90, .16); color: var(--gold-2); }
.trade-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.trade-tabs .btn { border-color: var(--line); color: var(--muted); }
.trade-tabs .btn.active { border-color: var(--gold); color: var(--gold-2); background: rgba(201, 163, 90, .1); }
.trade-history-table td { white-space: nowrap; }
.trade-history-table .reason-cell { white-space: normal; min-width: 200px; max-width: 340px; font-size: 13.5px; line-height: 1.6; color: var(--muted); }
.side-buy { color: var(--red); font-weight: 600; }
.side-sell { color: var(--green); font-weight: 600; }

.review-history-row { display:flex; gap:6px; align-items:center; }
.review-history-row .btn { min-width:0; }

.shot-preview { display:flex; gap:8px; flex-wrap:wrap; }
.shot-preview img { width:92px; height:150px; object-fit:cover; border:1px solid var(--line); border-radius:8px; }
