* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #0f1420; color: #d8dee9; min-height: 100vh;
}
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; background: #161d2e; border-bottom: 1px solid #232b40;
  flex-wrap: wrap; gap: 10px;
}
.title { font-size: 20px; font-weight: 700; color: #fff; }
.title span { font-size: 13px; font-weight: 400; color: #8892b0; margin-left: 10px; }
nav { display: flex; gap: 6px; }
.tab {
  background: transparent; border: 1px solid #2a3450; color: #a8b3cf;
  padding: 8px 18px; border-radius: 6px; cursor: pointer; font-size: 14px;
}
.tab:hover { border-color: #4a5a85; }
.tab.active { background: #2563eb; border-color: #2563eb; color: #fff; }

main { padding: 20px 24px; max-width: 1280px; margin: 0 auto; }
.panel { display: none; }
.panel.active { display: block; }

.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
button {
  background: #1e2740; color: #d8dee9; border: 1px solid #2a3450;
  padding: 9px 16px; border-radius: 6px; cursor: pointer; font-size: 14px;
}
button:hover { border-color: #4a5a85; }
button.primary { background: #2563eb; border-color: #2563eb; color: #fff; }
button.primary:hover { background: #1d4ed8; }
button:disabled { opacity: .5; cursor: wait; }
.msg { color: #8892b0; font-size: 13px; }
label { color: #a8b3cf; font-size: 14px; }
input[type="date"] {
  background: #1e2740; border: 1px solid #2a3450; color: #d8dee9;
  padding: 7px 10px; border-radius: 6px; font-size: 14px;
}
.hidden { display: none !important; }
.warn {
  background: #453412; border: 1px solid #a16207; color: #fbbf24;
  padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; font-size: 14px;
}

/* 决策卡 */
.decision-card {
  background: #161d2e; border: 1px solid #232b40; border-radius: 10px;
  padding: 18px 20px; margin-bottom: 22px;
}
.d-row { display: flex; align-items: baseline; gap: 10px; padding: 8px 0; flex-wrap: wrap; }
.d-label { color: #8892b0; font-size: 13px; min-width: 84px; }
.d-val { font-size: 15px; }
.d-action { font-size: 24px; font-weight: 700; }
.d-action.buy { color: #16a34a; }
.d-action.sell { color: #dc2626; }
.d-action.hold { color: #60a5fa; }

h3 { font-size: 15px; color: #a8b3cf; margin: 18px 0 10px; font-weight: 600; }
.tbl { width: 100%; border-collapse: collapse; background: #161d2e; border-radius: 8px; overflow: hidden; }
.tbl th, .tbl td { padding: 10px 14px; text-align: left; font-size: 14px; border-bottom: 1px solid #232b40; }
.tbl th { background: #1e2740; color: #a8b3cf; font-weight: 600; }
.tbl tr:last-child td { border-bottom: none; }
.st-pass { color: #16a34a; font-weight: 600; }
.st-block { color: #dc2626; font-weight: 600; }
.st-ok { color: #16a34a; }
.st-warn { color: #f59e0b; font-weight: 600; }

.ind-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.ind-item { background: #161d2e; border: 1px solid #232b40; border-radius: 8px; padding: 12px 14px; }
.ind-item .k { font-size: 12px; color: #8892b0; margin-bottom: 4px; }
.ind-item .v { font-size: 17px; font-weight: 600; }
.up { color: #dc2626; }   /* A股习惯红涨绿跌 → 本站跟随港股/国际习惯：绿涨红跌？ */
.down { color: #16a34a; }

/* 回测 */
.metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.metric { background: #161d2e; border: 1px solid #232b40; border-radius: 8px; padding: 12px 14px; }
.metric .k { font-size: 12px; color: #8892b0; margin-bottom: 4px; }
.metric .v { font-size: 18px; font-weight: 700; }
#bt-yearly { margin-bottom: 14px; font-size: 13px; color: #a8b3cf; line-height: 1.8; }
#bt-yearly b { color: #d8dee9; }
.chart { width: 100%; height: 640px; background: #161d2e; border: 1px solid #232b40; border-radius: 10px; }

/* 策略文档 */
.doc { background: #161d2e; border: 1px solid #232b40; border-radius: 10px; padding: 28px 34px; line-height: 1.75; font-size: 14.5px; }
.doc h1 { font-size: 22px; margin: 10px 0 16px; color: #fff; }
.doc h2 { font-size: 18px; margin: 26px 0 12px; color: #e5e9f0; border-bottom: 1px solid #232b40; padding-bottom: 8px; }
.doc h3 { font-size: 15.5px; margin: 18px 0 8px; color: #cdd6ea; }
.doc p { margin: 8px 0; }
.doc table { border-collapse: collapse; margin: 12px 0; }
.doc th, .doc td { border: 1px solid #2a3450; padding: 6px 12px; font-size: 13.5px; }
.doc th { background: #1e2740; }
.doc code { background: #1e2740; padding: 2px 6px; border-radius: 4px; font-size: 13px; color: #7ee787; }
.doc pre { background: #0b0f1a; border: 1px solid #232b40; border-radius: 8px; padding: 14px 16px; overflow-x: auto; margin: 12px 0; }
.doc pre code { background: none; padding: 0; color: #d8dee9; }
.doc ul, .doc ol { padding-left: 22px; margin: 8px 0; }
.doc li { margin: 4px 0; }
.doc strong { color: #fff; }
.doc a { color: #60a5fa; }
