:root{--bg: #0e1117;--panel: #161b22;--panel-2: #1c2430;--border: #2a3340;--text: #e6edf3;--muted: #8b949e;--pos: #2ec27e;--neg: #f0506e;--accent: #58a6ff;--leader: #d29922}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font-family:-apple-system,Segoe UI,PingFang TC,Microsoft JhengHei,sans-serif;font-size:14px}.app{max-width:1600px;margin:0 auto;padding:16px}.topbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}.topbar h1{font-size:20px;margin:0}.updated{color:var(--muted);font-size:12px}.refresh-status{display:inline-flex;align-items:center;margin-top:4px;color:var(--muted);font-size:12px;font-variant-numeric:tabular-nums}.refresh-status.ok{color:var(--pos)}.refresh-status.warn{color:var(--leader)}.refresh-status.running{color:var(--accent)}.topbar-actions{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:10px}.view-toggle{display:inline-flex;border:1px solid var(--border);border-radius:6px;overflow:hidden}.view-toggle button{background:var(--panel);color:var(--muted);border:none;padding:7px 14px;font-size:13px;cursor:pointer}.view-toggle button+button{border-left:1px solid var(--border)}.view-toggle button.on{background:var(--accent);color:#0b1220;font-weight:600}.refresh-btn{background:var(--accent);color:#0b1220;border:none;padding:8px 16px;border-radius:6px;font-weight:600;cursor:pointer}.refresh-btn.quote-refresh{background:var(--panel-2);color:var(--accent);border:1px solid var(--accent)}.refresh-btn:disabled{opacity:.6;cursor:default}.error{background:#3d1f25;color:var(--neg);padding:10px;border-radius:6px;margin-bottom:12px}.empty{color:var(--muted);padding:24px;text-align:center}.legend{background:var(--panel);border:1px solid var(--border);border-radius:8px;padding:10px 14px;margin-bottom:16px}.legend summary{cursor:pointer;font-weight:600}.legend-body{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px;margin-top:10px}.legend-body ul{margin:6px 0;padding-left:18px;color:var(--muted)}.legend .note{grid-column:1 / -1;color:var(--muted);font-size:12px}.tier-title{font-size:17px;border-left:4px solid var(--accent);padding-left:8px;margin:20px 0 8px}.highlights .tier-title{border-left-color:var(--leader)}.highlights{padding:8px 12px;border:1px solid var(--border);border-radius:10px;background:#d299220d;margin-bottom:8px}.cohort{margin:10px 0}.cohort-title{font-size:13px;margin:6px 0;color:var(--text)}.cohort-count{color:var(--muted);font-weight:400}.cohort-empty{color:var(--muted);font-size:12px;padding:4px 0 8px}.cat-title{font-size:14px;color:var(--muted);margin:14px 0 8px}.keyfocus{padding:8px 12px;border:1px solid var(--border);border-radius:10px;background:#e148480d;margin-bottom:8px}.keyfocus .tier-title{border-left-color:var(--neg)}.keyfocus-note{color:var(--muted);font-size:12px;line-height:1.5;margin:6px 0 12px}.budget{padding:8px 12px;border:1px solid var(--border);border-radius:10px;background:#2ec27e0d;margin-bottom:8px}.budget .tier-title{border-left-color:var(--pos)}.budget-bar{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:8px 0 12px}.budget-bar label{color:var(--muted);font-size:13px}.budget-input{width:110px;background:var(--panel-2);color:var(--text);border:1px solid var(--border);border-radius:6px;padding:6px 8px;font-size:14px;font-variant-numeric:tabular-nums}.budget-unit{color:var(--muted);font-size:13px}.budget-hint{color:var(--muted);font-size:12px}.afford-note{font-size:12px;color:var(--pos);padding:4px 8px;margin-bottom:4px;background:#2ec27e1a;border:1px solid rgba(46,194,126,.3);border-radius:6px;font-variant-numeric:tabular-nums}.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:12px}.card{background:var(--panel);border:1px solid var(--border);border-radius:10px;padding:12px}.card-head{display:flex;justify-content:space-between;align-items:flex-start;gap:8px}.title{display:flex;align-items:center;flex-wrap:wrap;gap:6px;min-width:0}.score{flex:none}.name{font-weight:700;font-size:15px}.code{color:var(--muted);font-size:12px}.favorites .tier-title{border-left-color:var(--leader)}.fav-btn{background:none;border:none;padding:0;cursor:pointer;font-size:16px;line-height:1;color:var(--muted);transition:color .12s}.fav-btn:hover,.fav-btn.on{color:var(--leader)}.badge{font-size:11px;padding:1px 6px;border-radius:4px}.badge.leader{background:#d299222e;color:var(--leader);border:1px solid var(--leader)}.badge.rev-ok{background:#2ec27e26;color:var(--pos);border:1px solid rgba(46,194,126,.4)}.badge.rev-warn{background:#d2992226;color:var(--leader);border:1px solid rgba(210,153,34,.4)}.badge.rev-bad{background:#f0506e26;color:var(--neg);border:1px solid rgba(240,80,110,.4)}.badge.rs{background:#788cc826;color:#9fb0e0;border:1px solid rgba(120,140,200,.4)}.badge.trend-up{background:#2ec27e26;color:var(--pos);border:1px solid rgba(46,194,126,.4)}.badge.trend-down{background:var(--panel-2);color:var(--muted);border:1px solid var(--muted)}.badge.entry{background:#2ec27e38;color:var(--pos);border:1px solid var(--pos)}.badge.danger{background:#f0506e33;color:var(--neg);border:1px solid var(--neg);font-weight:600}.badge.leading{background:#f0506e29;color:#ff8a64;border:1px solid rgba(255,138,100,.5);margin-left:6px}.badge.rotation{background:#788cc829;color:#9fb0e0;border:1px solid rgba(120,140,200,.45);margin-left:6px}.badge.data-warn{background:#d2992224;color:var(--leader);border:1px solid rgba(210,153,34,.45)}.score{display:flex;align-items:center;gap:6px;min-width:92px}.score-bar{width:56px;height:6px;background:var(--panel-2);border-radius:3px;overflow:hidden}.score-fill{height:100%;background:var(--pos)}.score-num{font-size:12px;color:var(--muted)}.metrics{display:grid;grid-template-columns:1fr 1fr;gap:4px 12px;margin:10px 0}.metric{display:flex;justify-content:space-between;font-size:13px}.metric .label{color:var(--muted)}.metric .value{font-variant-numeric:tabular-nums;font-weight:600}.value.pos{color:var(--pos)}.value.neg{color:var(--neg)}.value.muted{color:var(--muted)}.flow-pos{color:var(--neg)}.flow-neg{color:var(--pos)}.flow-streak{font-size:10px;font-weight:400;margin-left:1px}.checks{display:flex;flex-wrap:wrap;gap:4px;margin-top:6px}.chk{font-size:11px;padding:2px 6px;border-radius:4px;border:1px solid var(--border)}.chk.on{color:var(--pos);border-color:#2ec27e66;background:#2ec27e1a}.chk.off{color:var(--muted)}.card-foot{margin-top:8px}.src{font-size:11px;color:var(--muted)}.table-wrap{overflow-x:auto;border:1px solid var(--border);border-radius:8px}table.stk{width:100%;border-collapse:collapse;font-size:13px;font-variant-numeric:tabular-nums}table.stk th,table.stk td{padding:6px 8px;text-align:left;white-space:nowrap}table.stk th.num,table.stk td.num{text-align:right}table.stk thead th{position:sticky;top:0;z-index:1;background:var(--panel-2);color:var(--muted);font-weight:600;cursor:pointer;-webkit-user-select:none;user-select:none;border-bottom:1px solid var(--border);white-space:normal;max-width:64px;line-height:1.15;vertical-align:bottom}table.stk thead th:hover{color:var(--text)}table.stk thead th.sorted,.sort-ind{color:var(--accent)}table.stk tbody tr{border-top:1px solid var(--border)}table.stk tbody tr:nth-child(2n){background:#ffffff05}table.stk tbody tr:hover{background:#58a6ff12}table.stk td .pos,table.stk td.num .pos,table.stk .pos{color:var(--pos)}table.stk .neg{color:var(--neg)}table.stk .muted{color:var(--muted)}table.stk .stk-name{font-weight:600;display:inline-flex;align-items:center;gap:6px}table.stk .chg{color:var(--muted);font-weight:400}table.stk .fav-col{width:28px;text-align:center;padding:6px 4px}table.stk .fav-btn{font-size:15px}table.stk-2row thead th{white-space:nowrap;max-width:none}table.stk-2row tbody tr{border-top:none;background:none}table.stk-2row tbody tr:hover{background:none}table.stk-2row tbody tr.stk-primary{border-top:1px solid var(--border)}table.stk-2row tbody tr.stk-primary:hover,table.stk-2row tbody tr.stk-primary:hover+tr.stk-detail{background:#58a6ff12}table.stk-2row tbody tr.stk-detail td{padding-top:0;padding-bottom:8px;white-space:normal}.stk2{display:flex;flex-direction:column;gap:4px;font-size:12px;color:var(--text)}.stk2-group{display:flex;align-items:baseline;gap:10px}.stk2-grouplabel{flex:0 0 auto;width:3.2em;color:var(--accent);font-weight:600;letter-spacing:.5px;text-align:right;opacity:.85}.stk2-items{display:flex;flex-wrap:wrap;gap:3px 14px;padding-left:10px;border-left:1px solid var(--border);flex:1 1 auto}.stk2-item{display:inline-flex;align-items:baseline;gap:4px;white-space:nowrap}.stk2-label{color:var(--muted)}.stk2-val{font-variant-numeric:tabular-nums}.stk2 small{color:var(--muted);font-weight:400}.score{min-width:110px}.score-col{display:flex;flex-direction:column;gap:3px;align-items:flex-start}.sparkline,.per-band{display:block}.per-band-metric .value{display:flex;align-items:center}.ctrl-select{background:var(--panel-2);color:var(--text);border:1px solid var(--border);border-radius:6px;padding:6px 8px;font-size:13px}.ctrl-check{display:inline-flex;align-items:center;gap:4px;cursor:pointer;color:var(--muted);font-size:13px}.ctrl-reset{background:var(--panel-2);color:var(--muted);border:1px solid var(--border);border-radius:6px;padding:8px 12px;cursor:pointer;font-size:13px}.ctrl-reset:hover{color:var(--text)}.market-banner{display:flex;align-items:center;flex-wrap:wrap;gap:16px;padding:10px 14px;margin-bottom:16px;background:var(--panel);border:1px solid var(--border);border-radius:10px}.market-taiex{display:flex;align-items:baseline;gap:8px}.mb-label{color:var(--muted);font-size:12px}.mb-price{font-size:18px;font-weight:700;font-variant-numeric:tabular-nums}.mb-change{font-size:14px;font-weight:600;font-variant-numeric:tabular-nums}.mb-change.pos,.sector-chip.pos .sc-chg{color:var(--pos)}.mb-change.neg,.sector-chip.neg .sc-chg{color:var(--neg)}.mb-change.muted,.sc-chg{color:var(--muted)}.market-sectors{display:flex;flex-wrap:wrap;gap:6px}.market-caveat{flex-basis:100%;margin:4px 0 0;padding:0;color:var(--muted);font-size:11px;line-height:1.5}.sector-chip{display:inline-flex;align-items:center;gap:6px;font-size:12px;padding:3px 8px;border-radius:6px;border:1px solid var(--border);background:var(--panel-2);font-variant-numeric:tabular-nums}.sector-chip.pos{border-color:#2ec27e66;background:#2ec27e14}.sector-chip.neg{border-color:#f0506e66;background:#f0506e14}.sc-cat{color:var(--text)}.sc-score{color:var(--muted)}.modal-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:#0009;display:flex;align-items:flex-start;justify-content:center;padding:48px 16px;z-index:50}.modal{background:var(--panel);border:1px solid var(--border);border-radius:12px;padding:16px;width:100%;max-width:640px;max-height:80vh;overflow:auto}.modal-head{display:flex;justify-content:space-between;align-items:center}.modal-head h2{font-size:17px;margin:0}.modal-close{background:none;border:none;color:var(--muted);font-size:18px;cursor:pointer}.wl-form{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:12px 0}.wl-form .ctrl-select{width:120px}.wl-warn{color:var(--leader);font-size:12px;margin-bottom:6px}.wl-list{list-style:none;padding:0;margin:8px 0 0}.wl-item{display:flex;align-items:center;gap:8px;padding:6px 0;border-bottom:1px solid var(--border);font-size:13px}.wl-code{color:var(--muted);font-variant-numeric:tabular-nums;width:48px}.wl-name{font-weight:600;min-width:80px}.wl-cat{color:var(--muted);flex:1}.wl-remove{background:none;border:none;color:var(--neg);cursor:pointer;font-size:14px}.market-toggle{margin-right:4px}.regime{border:1px solid var(--border);border-radius:12px;padding:16px 18px;margin-bottom:16px}.regime-safe{background:#2ec27e1a;border-color:var(--pos)}.regime-wait{background:#d299221a;border-color:var(--leader)}.regime-headline{display:flex;flex-direction:column;gap:2px}.regime-verdict{font-size:22px;font-weight:700}.regime-safe .regime-verdict{color:var(--pos)}.regime-wait .regime-verdict{color:var(--leader)}.regime-sub{color:var(--muted);font-size:13px}.regime-lights{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:8px;margin-top:14px}.regime-light{display:flex;align-items:baseline;gap:6px;flex-wrap:wrap;background:var(--panel);border:1px solid var(--border);border-radius:8px;padding:8px 10px}.regime-light-mark{font-weight:700;font-size:15px}.regime-light.on .regime-light-mark{color:var(--pos)}.regime-light.off .regime-light-mark{color:var(--neg)}.regime-light-label{font-size:13px;font-weight:600}.regime-light-detail{color:var(--muted);font-size:12px;margin-left:auto;font-variant-numeric:tabular-nums}
