/* 策略回測快照（深色、紅漲綠跌） */
.sp-strat { --bg: #131722; --card: #1c2030; --line: #2f354b; --grid: #272d42; --text: #e6e8ee; --mute: #848e9c; --sub: #b7bdc8; --up: #f0443a; --dn: #16b36b; --acc: #4e8cff; --gold: #f5c542;
	color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans TC", sans-serif; margin-bottom: 30px;
	background: var(--bg); border-radius: 14px; padding: 20px 22px; }
@media (max-width: 760px) { .sp-strat { padding: 14px 12px; border-radius: 10px; } }
.sp-strat * { box-sizing: border-box; }
.sp-strat-loading, .sp-strat-wait { color: var(--mute); }
.sp-strat .up { color: var(--up); } .sp-strat .dn { color: var(--dn); }
.sp-strat-bar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; margin-bottom: 8px; }
.sp-strat-seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; flex: 1; min-width: 260px; max-width: 480px; }
.sp-strat-seg.sm { grid-template-columns: repeat(2, 1fr); max-width: 260px; min-width: 200px; }
.sp-strat-seg button { background: var(--bg); color: var(--text); border: 1px solid rgba(245,197,66,.7); border-radius: 999px; padding: 7px 4px; font: inherit; font-size: 14px; cursor: pointer; }
.sp-strat-seg.sm button { border-color: var(--line); color: var(--sub); }
.sp-strat-seg button.on, .sp-strat-seg button.on:hover { background: var(--acc); border-color: var(--acc); color: #fff; font-weight: 600; }
.sp-strat-seg button:hover { background: var(--bg); color: var(--text); }
.sp-strat-sub, .sp-strat-desc { color: var(--sub); font-size: 13.5px; line-height: 1.7; margin: 6px 0 12px; }
.sp-strat-tw { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sp-strat-tbl, .sp-strat-yr { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; margin: 0; }
.sp-strat-tbl th, .sp-strat-tbl td, .sp-strat-yr th, .sp-strat-yr td { padding: 9px 10px; border: 0; border-bottom: 1px solid var(--grid); text-align: right; background: transparent; }
.sp-strat-tbl th:first-child, .sp-strat-tbl td:first-child, .sp-strat-yr th:first-child, .sp-strat-yr td:first-child { text-align: left; }
.sp-strat-tbl th { color: var(--mute); font-weight: 500; font-size: 13px; }
.sp-strat-tbl th.sortable { cursor: pointer; }
.sp-strat-tbl th.on { color: var(--text); }
.sp-strat-tbl tbody tr[data-k] { cursor: pointer; }
.sp-strat-tbl tbody tr[data-k]:hover td { background: rgba(78,140,255,.06); }
.sp-strat-tbl tbody tr.sel td { background: rgba(78,140,255,.13); }
.sp-strat-tbl tr.bench td { color: var(--mute); font-size: 13px; }
.sp-strat-det { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; margin-top: 16px; }
.sp-strat-det h3 { margin: 0; font-size: 20px; color: var(--text); }
.sp-strat-det h3 small { margin-left: 10px; font-size: 13px; color: var(--mute); font-weight: 400; }
.sp-strat-cards { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 12px; }
.sp-strat-cards > div { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; }
.sp-strat-cards span { display: block; color: var(--mute); font-size: 12px; }
.sp-strat-cards b { font-size: 17px; font-variant-numeric: tabular-nums; }
.sp-strat-cards b small { display: block; font-size: 11px; color: var(--mute); font-weight: 400; }
.sp-strat-legend { font-size: 12.5px; color: var(--mute); margin-bottom: 4px; }
.sp-strat-legend i, .sp-strat-tip i { display: inline-block; width: 14px; height: 3px; vertical-align: middle; margin-right: 5px; border-radius: 2px; }
.sp-strat i.s { background: var(--acc); } .sp-strat i.b { background: #9aa3b2; }
.sp-strat-chart { position: relative; margin-bottom: 12px; }
.sp-strat-chart svg { width: 100%; height: 260px; display: block; }
.sp-strat-chart text { fill: var(--mute); font-size: 11px; }
.sp-strat-chart .grid { stroke: var(--grid); stroke-width: 1; }
.sp-strat-chart .strat { fill: none; stroke: var(--acc); stroke-width: 2; vector-effect: non-scaling-stroke; }
.sp-strat-chart .bench { fill: none; stroke: #9aa3b2; stroke-width: 1.5; vector-effect: non-scaling-stroke; opacity: .8; }
.sp-strat-chart .cur { stroke: var(--mute); stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.sp-strat-tip { position: absolute; top: 8px; background: rgba(19,23,34,.95); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 12.5px; line-height: 1.6; pointer-events: none; white-space: nowrap; }
.sp-strat-yr { font-size: 13px; margin-bottom: 14px; }
.sp-strat-hold h4 { margin: 4px 0 8px; font-size: 15px; color: var(--text); }
.sp-strat-hl { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.sp-strat-hl a { display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; text-decoration: none; color: var(--text) !important; }
.sp-strat-hl a:hover { border-color: var(--acc); }
.sp-strat-hl b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-strat-hl span { color: var(--mute); font-size: 12px; }
.sp-strat-hl em { font-style: normal; font-size: 12px; }
.sp-strat-lock { background: var(--bg); border: 1px dashed var(--gold); color: var(--gold); border-radius: 8px; padding: 12px 14px; font-size: 14px; }
.sp-strat-lock a { color: var(--acc); margin: 0 4px; }
.sp-strat-note { margin-top: 18px; color: var(--mute); font-size: 13px; line-height: 1.7; }
.sp-strat-note ul { margin: 6px 0; padding-left: 20px; }
.sp-strat-note b { color: var(--sub); }
@media (max-width: 760px) {
	.sp-strat-cards { grid-template-columns: repeat(3, 1fr); }
	.sp-strat-det { padding: 14px; }
	.sp-strat-chart svg { height: 200px; }
}
