:root{
 --bg:#06101f;--panel:#0b1729;--panel2:#0e1d32;--text:#e9f1ff;--muted:#8495ad;
 --line:#263650;--gold:#ffc93c;--blue:#44d9ff;--red:#ff4f7b;--purple:#8f78ff;--orange:#ffad1f;
}
*{box-sizing:border-box} body{margin:0;background:var(--bg);color:var(--text);font-family:Inter,"Noto Sans TC","Microsoft JhengHei",sans-serif}
body.light{--bg:#eef3f9;--panel:#fff;--panel2:#f7f9fc;--text:#16243a;--muted:#66758a;--line:#d8e0eb}
button,select,input{font:inherit} button{cursor:pointer}
header{height:74px;padding:0 24px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);background:var(--panel)}
header h1{font-size:20px;margin:0} header p{font-size:12px;color:var(--muted);margin:4px 0 0}
.header-actions{display:flex;align-items:center;gap:12px}.header-actions span{font-size:12px;color:var(--muted)}
button,select{background:var(--panel2);color:var(--text);border:1px solid var(--line);border-radius:7px;padding:9px 11px}
main{display:grid;grid-template-columns:320px minmax(600px,1fr) 280px;min-height:calc(100vh - 110px)}
.controls,.watchlist{padding:18px;border-right:1px solid var(--line);background:var(--panel)}.watchlist{border-right:0;border-left:1px solid var(--line)}
h2{font-size:16px;margin:0 0 18px}label{display:block;font-size:12px;color:var(--muted);margin:18px 0 8px}
.segmented{display:flex}.segmented button{flex:1;border-radius:0}.segmented button:first-child{border-radius:7px 0 0 7px}.segmented button:last-child{border-radius:0 7px 7px 0}
button.active,.segmented button.active{background:var(--gold);color:#182033;font-weight:800}
.preset-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.hint{font-size:11px;color:var(--muted);line-height:1.5}
.controls select{width:100%}.controls input[type=range]{width:100%;accent-color:var(--gold)}
details{margin-top:20px;border:1px solid var(--line);border-radius:9px;padding:12px}summary{cursor:pointer;font-size:13px}.check{margin:12px 0;color:var(--text)}
.legend{margin-top:20px;font-size:12px;color:var(--muted);line-height:2}.legend i{display:inline-block;width:9px;height:9px;border-radius:50%;margin-right:8px}
.lead{background:var(--red)}.improve{background:var(--blue)}.lag{background:var(--purple)}.weak{background:var(--orange)}
.content{min-width:0;padding:14px}.top-controls{height:44px;display:flex;justify-content:flex-end;align-items:center;gap:8px}.top-controls #status{margin-right:auto;color:var(--muted);font-size:12px}
.chart-wrap{height:calc(100vh - 190px);min-height:580px;border:1px solid var(--line);border-radius:10px;overflow:hidden;background:var(--panel)}
#chart{width:100%;height:100%}.timeline{height:48px;display:flex;align-items:center;gap:15px}.timeline input{flex:1;accent-color:var(--gold)}.timeline strong{min-width:95px}
.watch-head{display:flex;align-items:center;justify-content:space-between}.watch-head h2{margin:0}.watch-head button{font-size:11px;padding:6px}
#search{width:100%;margin:14px 0;background:var(--panel2);border:1px solid var(--line);border-radius:7px;padding:9px;color:var(--text)}
#sectorList{height:calc(100vh - 230px);overflow:auto}.sector{display:grid;grid-template-columns:18px 1fr auto;gap:7px;align-items:center;padding:7px 2px;border-bottom:1px solid rgba(128,145,170,.12);font-size:12px}
.sector small{color:var(--muted)}.warnings{font-size:11px;color:#ffca65;line-height:1.5;margin-top:10px}
footer{text-align:center;padding:10px;color:var(--muted);font-size:11px;border-top:1px solid var(--line)}
@media(max-width:1150px){main{grid-template-columns:250px 1fr}.watchlist{display:none}}
@media(max-width:760px){main{display:block}.controls{border-right:0}.content{padding:8px}.chart-wrap{height:580px}.controls{display:none}}
