/* xin622 · 动量选档回测前端样式 (复用 paper dashboard 暗色主题) */
:root {
  --bg: #1a1a2e; --card-bg: #16213e; --border: #0f3460;
  --text: #e0e0e0; --dim: #888; --green: #4caf50; --red: #ef5350;
  --accent: #4fc3f7; --chip-bg: rgba(79,195,247,.12);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, monospace;
       background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }

header { display: flex; align-items: center; gap: 12px; padding: 12px 20px;
         background: var(--card-bg); border-bottom: 1px solid var(--border); }
header h1 { font-size: 16px; font-weight: 600; }
header h1 .tag { font-size: 11px; opacity: .7; font-weight: 400; }
.meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--dim); margin-left: auto; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); display: inline-block; }

main { max-width: 1100px; margin: 0 auto; padding: 16px 20px; }

.card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; padding: 16px; margin-bottom: 16px; }
.card h2 { font-size: 14px; font-weight: 600; margin-bottom: 12px; }

/* 参数表单 */
.params { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.params label { display: flex; flex-direction: column; font-size: 12px; gap: 4px; }
.params select, .params input { background: #0d1117; border: 1px solid var(--border); color: var(--text);
                                padding: 6px 8px; border-radius: 4px; font-size: 13px; }
.params button { grid-column: 1 / -1; padding: 8px; background: var(--accent); color: #000;
                 border: none; border-radius: 4px; font-weight: 600; cursor: pointer; font-size: 13px; }
.params button:hover { opacity: .9; }
.params button:disabled { opacity: .5; cursor: not-allowed; }
.hint { font-size: 11px; color: var(--dim); margin-top: 10px; }

.chip { display: inline-block; background: var(--chip-bg); color: var(--accent);
        padding: 2px 7px; border-radius: 3px; font-size: 11px; margin-right: 4px; }
.k-badge { display: inline-block; background: var(--accent); color: #000;
           padding: 3px 10px; border-radius: 12px; font-size: 13px; font-weight: 700; }
.selectors-list { margin-top: 10px; font-size: 12px; }

.dim { color: var(--dim); font-size: 12px; }

.status { padding: 8px 12px; border-radius: 4px; font-size: 13px; margin-bottom: 12px; }
.status.loading { background: rgba(79,195,247,.1); color: var(--accent); }
.status.error   { background: rgba(239,83,80,.1); color: var(--red); }

/* KPI 行 */
.grid.kpi-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-bottom: 16px; }
.kpi { background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; text-align: center; }
.kpi .label { font-size: 11px; color: var(--dim); }
.kpi .value { font-size: 20px; font-weight: 700; margin-top: 4px; }
.positive { color: var(--green); }
.negative { color: var(--red); }

/* 图表 */
.chart-wrap { position: relative; width: 100%; height: 320px; }
.chart-wrap canvas { width: 100% !important; height: 100% !important; }

/* 表格 */
.table-wrap { max-height: 480px; overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { padding: 6px 8px; text-align: right; white-space: nowrap; }
th { position: sticky; top: 0; background: var(--card-bg); z-index: 1;
     font-size: 11px; color: var(--dim); border-bottom: 1px solid var(--border); }
td { border-bottom: 1px solid rgba(15,52,96,.4); }
tbody tr:hover { background: rgba(79,195,247,.04); }
table thead th:first-child, table tbody td:first-child { text-align: left; }

@media (max-width: 600px) {
  .params { grid-template-columns: 1fr 1fr; }
  .chart-wrap { height: 240px; }
}

/* ============== 纸面交易监控页 ============== */
.topnav { display: flex; gap: 4px; margin-left: 16px; }
.topnav a { font-size: 12px; color: var(--dim); text-decoration: none;
            padding: 4px 10px; border-radius: 4px; }
.topnav a:hover { color: var(--text); background: rgba(79,195,247,.08); }
.topnav a.active { color: var(--accent); background: var(--chip-bg); }

.ctrl-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.ctrl-row label { display: flex; flex-direction: column; font-size: 12px; gap: 4px; }
.ctrl-row select { background: #0d1117; border: 1px solid var(--border); color: var(--text);
                   padding: 6px 8px; border-radius: 4px; font-size: 13px; }
.grow { flex: 1; }
.updated { font-size: 11px; color: var(--dim); }

.countdown-box { font-size: 12px; color: var(--dim); display: flex; align-items: center; gap: 8px; }
.countdown { font-size: 18px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }

.selection-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip.big { font-size: 14px; padding: 6px 12px; font-weight: 600; }

@media (max-width: 600px) {
  .ctrl-row { gap: 10px; }
  .topnav { margin-left: 0; }
}
