:root{--bg:#f4f5f2;--ink:#1b302e;--muted:#76847e;--accent:#146b54;--border:#dfe5df;--paper:#fff;--gold:#b9db7f}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font-family:"PingFang SC","Microsoft YaHei",sans-serif;font-size:14px}button,input,select,textarea{font:inherit}button{cursor:pointer;border:1px solid var(--border);border-radius:7px;padding:10px 15px;background:white;color:var(--ink);transition:background .15s}button:hover{background:#e9eee8}button:disabled{opacity:.5;cursor:wait}.primary{background:var(--accent);color:#fff;border-color:var(--accent)}.primary:hover{background:#0c5140}h1,h2,h3,p{margin-top:0}h1{font-size:28px;letter-spacing:-1px;font-weight:600}h2{font-size:19px;font-weight:600}small,.eyebrow,.nav-label{font-size:11px;letter-spacing:1.5px}.brand{font-size:26px;font-weight:600;letter-spacing:2px}.brand small{display:block;font-size:10px;margin:8px 0 0 30px;color:var(--muted);letter-spacing:2px}aside{width:216px;position:fixed;height:100vh;padding:32px 22px;background:#fcfdfa;border-right:1px solid var(--border);display:flex;flex-direction:column}.nav-label{margin:54px 14px 14px;color:var(--muted)}nav{display:grid;gap:9px}nav button{text-align:left;background:none;border:0;padding:13px 14px;color:#64746a;font-size:17px}nav span{font-size:14px;margin-left:12px}nav .active{color:var(--accent);background:#e6eee5;font-weight:600}.aside-bottom{margin-top:auto;font-size:11px;line-height:2;color:var(--accent);letter-spacing:1px}.aside-bottom span{color:var(--muted)}.aside-bottom button{display:block;padding:4px 0;background:none;border:0;color:var(--muted);margin-top:20px}.aside-bottom i{display:inline-block;width:6px;height:6px;background:var(--accent);border-radius:50%;margin-right:5px}main{margin-left:216px;padding:36px 42px;max-width:1800px}header{display:flex;justify-content:space-between;align-items:center;margin-bottom:32px;gap:20px}.eyebrow{color:var(--muted);margin-bottom:12px}header h1{margin:0}.header-actions{display:flex;gap:10px;align-items:center}#clock{color:var(--muted);font-size:12px;margin-right:10px}.hero{border-radius:12px;padding:34px 38px;background:#193e35;color:#f3f5e9;display:flex;justify-content:space-between;align-items:center;overflow:hidden}.hero .eyebrow{color:#a6be9f;font-size:10px}.hero h2{font-size:29px;line-height:1.5;letter-spacing:1px;font-weight:500;margin-bottom:16px}.hero p{color:#adc1b5;font-size:12px;margin:0}.line-art{width:40%;text-align:right}.line-art svg{width:100%;overflow:visible}.line-art path{fill:none;stroke:#bee484;stroke-width:3}.line-art path:nth-child(2){stroke:#65a88e;stroke-width:2}.line-art path:nth-child(3){stroke:#819991;stroke-dasharray:4 5;stroke-width:1}.line-art circle{fill:#d4eead}.line-art span{font-size:10px;color:#9aafa2}.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin:24px 0 34px}.stat,.panel,.channel-card{background:var(--paper);border:1px solid var(--border);border-radius:10px;padding:24px}.stat label{color:var(--muted);font-size:12px}.stat strong{display:block;font-size:32px;font-weight:500;font-family:"SFMono-Regular",Consolas,monospace;margin-top:14px}.stat small{color:var(--muted);letter-spacing:0}.section-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:20px}.section-head h2{margin:0}.section-head>span{font-size:12px;color:var(--muted)}.table-wrap{overflow:auto;border:1px solid var(--border);border-radius:10px;background:white}table{border-collapse:collapse;width:100%;white-space:nowrap}th{text-align:left;font-size:11px;font-weight:500;background:#fafbf8;color:var(--muted);padding:15px 20px}td{padding:18px 20px;border-top:1px solid #edf0eb;font-size:13px}td strong{display:block;margin-bottom:5px;font-weight:600}td small{color:var(--muted);letter-spacing:0}td button{padding:6px 9px;margin-right:5px;font-size:12px}.number{font-family:"SFMono-Regular",Consolas,monospace}.badge{padding:5px 8px;border-radius:5px;font-size:11px;display:inline-block;background:#edf3e9;color:var(--accent)}.badge.warn{background:#fcf0dd;color:#9b6524}.badge.bad{background:#fbeae7;color:#ae4d3b}.muted,.footnote{color:var(--muted);font-size:12px;line-height:1.9}.footnote{margin-top:18px}.empty{background:#fff;border:1px dashed #ccd7cc;border-radius:10px;padding:64px 24px;text-align:center;color:var(--muted);line-height:2}.empty strong{display:block;color:var(--ink);font-size:18px}.channel-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:20px}.channel-card h3{margin-bottom:8px}.channel-card p{color:var(--muted);line-height:1.8}.channel-card button{margin:12px 6px 0 0}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}label{display:flex;flex-direction:column;gap:8px;font-size:12px;color:#52665c}input,select,textarea{width:100%;border:1px solid #cfd9cf;background:#fff;padding:10px 12px;border-radius:6px;color:var(--ink);min-height:40px}input:focus,select:focus,textarea:focus{outline:2px solid #a8c9ae;outline-offset:1px}label.check{flex-direction:row;align-items:center}.check input{width:16px;min-height:16px;accent-color:var(--accent)}fieldset{border:1px solid var(--border);border-radius:7px;padding:12px}legend{font-size:12px;color:var(--muted)}#ruleChannels{display:flex;flex-wrap:wrap;gap:16px}.wide{grid-column:1/-1}dialog{border:1px solid var(--border);border-radius:14px;width:min(720px,94vw);padding:28px;max-height:92vh;color:var(--ink)}dialog::backdrop{background:#112b2399;backdrop-filter:blur(3px)}.dialog-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:20px}dialog .muted{margin:18px 0 0}#webhookFields{display:grid;gap:18px}[hidden]{display:none!important}.login{min-height:100vh;display:grid;place-items:center;background:radial-gradient(ellipse at 70% 10%,#dce9d2,transparent 60%),#f0f3ec}.login-card{width:min(460px,90vw);background:#fff;padding:42px;border:1px solid var(--border);border-radius:16px}.login h1{margin-top:42px;font-size:27px}.login p{color:var(--muted);line-height:1.8}.login .primary{width:100%;margin:20px 0 4px}.login #loginError{color:#ab4137}.pager{display:flex;gap:18px;align-items:center;justify-content:center;margin:24px}#notice{position:fixed;right:28px;bottom:24px;z-index:20;padding:14px 22px;border:1px solid #bed0bd;border-radius:8px;background:#e8f1e0;box-shadow:0 8px 36px #172b2220;max-width:min(580px,90vw)}#notice.error{background:#fceee7;border-color:#edc3b7}pre{white-space:pre-wrap;word-break:break-word;font-size:12px;line-height:1.8}.record-message{max-width:300px;white-space:normal;line-height:1.7}#settingsForm{max-width:850px}#settingsForm>button{margin-top:16px}.page{animation:arrive .25s ease-out}@keyframes arrive{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}@media(max-width:1100px){main{padding:28px 24px}aside{width:190px}main{margin-left:190px}header{align-items:flex-start;flex-direction:column}.stats{gap:10px}.stat{padding:20px}.hero{padding:28px}.hero h2{font-size:25px}}@media(max-width:700px){aside{position:static;width:100%;height:auto;padding:18px;border-bottom:1px solid var(--border)}aside .brand{font-size:22px}aside .brand small,.nav-label,.aside-bottom{display:none}nav{display:flex;overflow:auto;margin-top:18px;gap:5px}nav button{flex-shrink:0;padding:10px;font-size:0}nav span{font-size:12px;margin:0}main{margin:0;padding:24px 16px}header{margin-bottom:24px}h1{font-size:25px}.header-actions{flex-wrap:wrap}#clock{display:none}.hero{padding:24px}.hero h2{font-size:22px}.line-art{display:none}.stats{grid-template-columns:repeat(2,1fr);margin:18px 0 28px}.form-grid,.channel-grid{grid-template-columns:1fr}.stat strong{font-size:28px}.section-head>span{display:none}dialog{padding:20px}.wide{grid-column:auto}td,th{padding:14px}.login-card{padding:28px}}
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
/* 买卖记账沿用现有配色，以B/S文字和金额符号同时表达方向。 */
.ledger-tools{display:flex;gap:10px;align-items:center}.ledger-tools select{width:auto}.profit{color:#b54738}.loss{color:#147153}.stat strong{overflow-wrap:anywhere}.record-trade-actions{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:10px;max-width:220px}.buy-button,.buy-tag{background:#faeae5;color:#aa4934;border-color:#ebcabe}.sell-button,.sell-tag{background:#e7f1ed;color:#146b54;border-color:#bbd6c9}.trade-reference{white-space:pre-line;line-height:1.8;background:#edf2e9;border-left:3px solid var(--accent);padding:14px;margin:0 0 22px;border-radius:4px}.void-trade{opacity:.55}.form-error{color:#a83c2f;line-height:1.7}.trade-chart-panel{margin:26px 0}.trade-chart-panel .section-head{align-items:flex-start}.trade-chart-panel .muted{margin:8px 0 0}#tradeChart{overflow:auto}#tradeChartSymbol{max-width:260px}.trade-baseline{stroke:#dfe5df;stroke-width:1}.trade-connection{fill:none;stroke:#afbab3;stroke-width:1.5;stroke-dasharray:5 5}.trade-point{cursor:pointer}.trade-point circle{fill:#b95842;stroke:white;stroke-width:2}.trade-point.sell circle{fill:#216b55}.trade-point text{fill:white;font-size:12px;font-family:"SFMono-Regular",Consolas,monospace}.trade-point .point-price{fill:#273d32;font-size:13px}.trade-point .point-date{fill:#76847e;font-size:10px}.trade-point:focus{outline:none}.trade-point:focus circle{stroke:#e7b34c;stroke-width:4}#portfolioStats strong{font-size:26px}#portfolioStats small{line-height:1.7}#tradeDialog .muted,#tradingSettingsDialog .muted{line-height:1.9}@media(max-width:700px){.ledger-tools{flex-wrap:wrap}.ledger-tools select{width:100%}#trading>.section-head{align-items:flex-start;flex-direction:column}.trade-chart-panel .section-head{flex-direction:column}.trade-chart-panel{padding:16px}#tradeChartSymbol{max-width:100%}#portfolioStats strong{font-size:22px}.record-trade-actions{min-width:150px}}

/* 回测图表与长记录保持独立滚动，移动端沿用表格横向滚动。 */
.backtest-chart{width:100%;height:auto;max-height:280px}.equity-line{fill:none;stroke:var(--accent,#24634d);stroke-width:2}.backtest-chart text{fill:currentColor;font-size:12px}.backtest-scroll{max-height:440px;overflow:auto}#backtestResult{margin-top:28px}#backtestResult h2{margin-top:24px}#backtestResult pre{white-space:pre-wrap;overflow-wrap:anywhere}
@media(max-width:600px){#backtestResult .stat strong{font-size:clamp(16px,4.6vw,22px);letter-spacing:-.6px;white-space:nowrap;overflow-x:auto}#backtestResult .stat{min-width:0}}
.database-panel{margin-top:24px}.database-backups{max-height:360px;overflow:auto}#clearDatabaseDialog label{margin-top:18px}#confirmClearDatabase{background:#a43f35;color:white;border-color:#a43f35}
.database-panel .section-head{gap:16px;flex-wrap:wrap}.database-panel .section-head>div{flex:1 1 240px}.database-panel .section-head:last-of-type{margin-top:24px}#openClearDatabase{white-space:nowrap;flex-shrink:0}
#currentAccount{margin-top:18px;font-size:12px;overflow-wrap:anywhere}.user-audit{max-height:400px;overflow:auto}#passwordForm label{margin-top:16px}#userAudit td:last-child{white-space:normal;min-width:200px}
aside{overflow-y:auto}#users>.section-head:not(:first-child){margin-top:24px}@media(max-width:700px){.aside-bottom{display:block;margin-top:14px}.engine-badge{display:none}.account-controls{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.account-controls #currentAccount{flex:1 1 140px;margin:0}.account-controls button{display:inline-block;margin:0;padding:6px 8px;font-size:12px}}
.security-picker{position:relative;padding:16px;background:#f0f5ee;border:1px solid #d5e3d4;border-radius:10px}.security-picker>label{font-weight:600;display:block;margin-bottom:8px}.security-picker>input{width:100%;background:white}.security-helper{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:8px}.security-helper span{font-size:12px;color:var(--muted);line-height:1.6}.security-helper button{flex-shrink:0;font-size:12px;padding:6px 10px}#securityOptions{max-height:270px;overflow-y:auto;background:white;border:1px solid var(--border);border-radius:8px;margin-top:6px;box-shadow:0 8px 20px #163b2810}#securityOptions [role=option]{display:flex;align-items:center;justify-content:space-between;padding:12px 14px;cursor:pointer;border-bottom:1px solid var(--border)}#securityOptions [role=option]:last-child{border:0}#securityOptions [role=option]:hover,#securityOptions [aria-selected=true]{background:#e6f0df}#securityOptions small{display:block;margin-top:3px;color:var(--muted);font-variant-numeric:tabular-nums}@media(max-width:700px){.security-picker{padding:12px}.security-helper{align-items:flex-start}#securityOptions{max-height:220px}}
/* 图文帮助沿用表单配色，内容集中配置，窄屏保持自然换行。 */
.help-field{min-width:0}.help-field>label{height:auto}.field-help{font-size:12px;line-height:1.75;color:#52665c;margin:7px 0 0}.field-help p{margin:0}.field-help summary{color:var(--accent);cursor:pointer;width:fit-content;padding:5px 0;font-weight:500}.field-help figure{margin:5px 0 0;padding:12px;border:1px solid var(--border);background:#f6f8f2;border-radius:8px}.field-help figcaption{line-height:1.8}.guide-chart{width:100%;max-height:185px;display:block;margin-bottom:8px}.guide-chart path{fill:none;stroke-width:3}.guide-chart .guide-fast{stroke:var(--accent)}.guide-chart .guide-slow{stroke:#ae7534}.guide-chart .guide-dash{stroke:#b6c8b9;stroke-dasharray:5 5;stroke-width:1}.guide-chart text{fill:#40564a;font-size:12px}.guide-chart circle,.guide-chart rect{fill:var(--accent)}.guide-flow{display:flex;align-items:center;gap:7px;justify-content:space-between;padding:12px 0}.guide-flow span{flex:1;text-align:center;background:#e8efe2;border:1px solid #ceddc6;border-radius:8px;padding:10px 4px;font-size:11px;color:#244f3d}.guide-flow b{display:block;font-size:17px;font-weight:500;margin-bottom:5px}.guide-flow i{color:#6a836c;font-style:normal}.channel-guide{border:1px solid #cbdcc8;border-radius:10px;background:#f4f8ef;margin:0 0 22px;overflow:hidden}.channel-guide>summary{cursor:pointer;padding:16px 18px;color:var(--accent);font-weight:600}.channel-guide>summary small{display:block;margin:7px 0 0 16px;letter-spacing:0;color:#61775d;font-weight:400}.guide-body{padding:0 18px 18px;line-height:1.85;font-size:12px}.guide-caption{color:#657560;font-size:11px;margin:12px 0}.guide-steps{list-style:none;margin:14px 0;padding:0;display:grid;grid-template-columns:1fr 1fr;gap:12px}.guide-steps li{display:flex;gap:10px;background:white;border:1px solid var(--border);border-radius:8px;padding:14px;align-items:flex-start}.step-number{display:grid;place-items:center;flex:0 0 26px;height:26px;border-radius:50%;background:var(--accent);color:white}.guide-steps h3{font-size:13px;margin:2px 0 7px}.guide-steps p{margin:0;color:#52665c}.guide-address{background:#e4eddc;padding:12px;border-radius:7px;overflow-wrap:anywhere}.guide-address span{display:block;color:#52665c;font-size:11px;margin-bottom:5px}.guide-address code{font-size:12px}.guide-mapping{margin:16px 0}.guide-mapping>div{display:grid;grid-template-columns:135px 1fr;gap:14px;border-bottom:1px solid var(--border);padding:9px 0}.guide-mapping dt{font-weight:600}.guide-mapping dd{margin:0;overflow-wrap:anywhere}.guide-check{background:white;border:1px solid var(--border);padding:12px;border-radius:8px;margin:16px 0}.guide-check p{margin:0}.guide-links{display:flex;flex-wrap:wrap;gap:12px}.guide-links a{color:var(--accent);text-underline-offset:3px}.field-help summary:focus-visible,.channel-guide summary:focus-visible{outline:2px solid var(--accent);outline-offset:3px}#channelDialog{width:min(860px,94vw)}@media(max-width:700px){.guide-steps{grid-template-columns:1fr}.guide-body{padding:0 12px 14px}.guide-mapping>div{grid-template-columns:1fr;gap:3px}.channel-guide>summary{padding:14px 12px}.guide-flow{gap:4px}}
/* 长SMTP服务名不能撑开移动端步骤卡片。 */
.channel-guide,.guide-steps li,.guide-steps li>div{min-width:0}.guide-steps{grid-template-columns:repeat(2,minmax(0,1fr))}.guide-steps p{overflow-wrap:anywhere}@media(max-width:700px){.guide-steps{grid-template-columns:minmax(0,1fr)}}
/* 寻优操作在手机换行，结果与当前标的、周期保持同一区域。 */
.security-helper{flex-wrap:wrap}.security-helper #securityStatus{flex:1 1 180px}
#ruleOptimizationStatus{margin-top:12px;padding:12px;border:1px solid var(--border);border-radius:8px;background:white;font-size:13px;line-height:1.7;overflow-wrap:anywhere}
#ruleOptimizationStatus p{margin:0 0 10px}#ruleOptimizationStatus button{margin:4px 8px 0 0}
