:root{font-family:Arial,"Microsoft YaHei","PingFang SC",sans-serif;color:#111;background:#f6f6f6;font-synthesis:none;--muted:#929292;--green:#2c6d16;--line:#8bb91c}*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button,a,select{ -webkit-tap-highlight-color:transparent}button{cursor:pointer;border:0;background:none;color:inherit}button:focus-visible,a:focus-visible,select:focus-visible,input:focus-visible{outline:2px solid #619e23;outline-offset:4px}svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.svg-library{position:absolute;width:0;height:0;overflow:hidden}.topbar{height:48px;background:#050505;color:#fff;display:flex;align-items:center;padding:0 23px;gap:18px;white-space:nowrap}.brand{color:#fff;text-decoration:none;display:flex;align-items:center;gap:7px;flex-shrink:0}.brand svg{width:25px;height:25px;stroke:none}.brand b{font-size:26px;letter-spacing:-1.5px;font-style:italic}.brand-divider{height:18px;width:1px;background:#393939;margin-left:8px}.global-nav{display:flex;gap:18px;align-items:center}.global-nav button,.asset-menu{padding:0;font-size:13px;display:flex;align-items:center;gap:5px}.global-nav button:hover,.asset-menu:hover{color:#c5ef9b}i{display:inline-block;width:6px;height:6px;border-right:1px solid;border-bottom:1px solid;transform:rotate(45deg);margin-top:-4px}.header-right{margin-left:auto;display:flex;align-items:center;gap:10px}.market-search{width:208px;height:32px;border-radius:8px;background:#222;color:#797979;display:flex;align-items:center;gap:6px;font-size:12px;padding:0 10px;margin-right:14px}.market-search svg{width:15px;height:15px}.header-deposit{border:1px solid #414141;border-radius:22px;padding:7px 14px;font-size:12px}.header-icons{display:flex;gap:17px;align-items:center;margin-left:16px}.header-icons button{display:flex;padding:0}.header-icons svg{width:21px;height:21px}.asset-navigation{background:white;height:48px}.asset-navigation nav{max-width:1212px;margin:auto;height:100%;display:flex;align-items:stretch;gap:26px;overflow:auto;scrollbar-width:none}.asset-navigation button{padding:0;white-space:nowrap;font-size:16px;color:#858585;position:relative}.asset-navigation button.active{color:#111}.asset-navigation button.active:after{content:"";position:absolute;bottom:0;height:2px;background:#111;left:0;right:0}.layout{max-width:1212px;margin:32px auto 72px;display:grid;grid-template-columns:minmax(0,800px) minmax(280px,388px);gap:24px;align-items:start}.left-column{min-width:0;display:flex;flex-direction:column;gap:24px}.card{background:#fff;border-radius:16px}.balance-card{padding:24px;min-height:586px;position:relative}.summary-heading{display:flex;align-items:center;justify-content:space-between;height:36px}.valuation-label{display:flex;align-items:center;gap:7px;font-size:18px;color:#707070}.icon-button{padding:0;display:flex;color:#777}.icon-button svg{width:21px;height:21px}.demo-badge{font-size:10px;line-height:17px;padding:0 5px;background:#f1f1f1;color:#969696;border-radius:3px;margin-left:3px}.shield-button{display:flex;align-items:center;gap:4px;padding:8px 16px;border-radius:24px;background:#eaf5d5;color:#638838;font-size:16px}.shield-button svg{width:19px;height:19px;color:#80b733;fill:#8ac840;stroke:#d8eea9}.shield-button span{margin-left:4px;font-size:21px}.balance-line{display:flex;align-items:baseline;gap:9px;margin-top:3px}.balance-line strong{font-size:32px;font-weight:700;line-height:41px;letter-spacing:-.6px}.currency-label{display:flex;align-items:center;position:relative;gap:3px;color:#777}.currency-label select{border:0;background:transparent;color:#777;font-size:12px;appearance:none;padding:7px 14px 7px 0;cursor:pointer}.currency-label svg{position:absolute;right:0;pointer-events:none;width:13px;height:13px}.profit-line{display:flex;align-items:center;gap:5px;height:26px;font-size:14px;color:#6a8859}.profit-line button{padding:0;color:#777;text-decoration:underline;text-decoration-style:dotted;text-underline-offset:4px}.quick-actions{display:flex;gap:12px;margin-top:18px}.quick-actions button{height:36px;border-radius:24px;background:#f1f1f1;padding:0 27px;font-size:14px;transition:background .15s}.quick-actions button:hover{background:#e5e5e5}.quick-actions .primary{background:var(--green);color:#fff}.quick-actions .primary:hover{background:#3d8524}.period-tabs{display:flex;justify-content:flex-end;gap:5px;margin-top:5px;height:33px;align-items:center}.period-tabs button{font-size:12px;color:#888;padding:7px 9px;border-radius:7px}.period-tabs button.active{color:#111;background:#f1f1f1}.chart-wrap{position:relative;margin-top:20px;height:320px}.chart-wrap>svg{width:100%;height:100%;overflow:visible;stroke:none;touch-action:pan-y}#chart-line{fill:none;stroke:var(--line);stroke-width:2.7;stroke-linejoin:round;stroke-linecap:round}#chart-labels text{font-size:12px;fill:#bbb;font-family:Arial,sans-serif}#chart-crosshair{stroke:#ccc;stroke-dasharray:3 3;stroke-width:1;display:none}#chart-dot{fill:#8bb91c;stroke:white;stroke-width:2;display:none}#chart-tooltip{position:absolute;display:none;pointer-events:none;background:#fff;padding:10px 13px;border:1px solid #eee;border-radius:8px;box-shadow:0 5px 20px #00000012;font-size:12px;z-index:2;white-space:nowrap}.collapse-chart{height:30px;display:flex;justify-content:center;align-items:center;margin:18px auto 0;color:#929292;width:50px}.collapse-chart svg{width:24px;height:24px;transform:rotate(180deg);stroke-width:2.2}.balance-card.collapsed{min-height:0}.balance-card.collapsed .collapse-chart svg{transform:none}.bill-card{padding:24px;min-height:320px}.bill-card h2,.portfolio-card h1{font-size:21px;margin:0;font-weight:700}.bill-empty{display:flex;flex-direction:column;align-items:center;margin-top:64px}.empty-illustration{width:118px;height:93px;stroke:none;margin-bottom:5px}.bill-empty strong{font-size:16px;font-weight:400;margin-top:4px}.bill-empty p{margin:8px 0 0;font-size:14px;color:#999}.portfolio-card{padding:24px}.account-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:18px}.account-card{display:flex;flex-direction:column;text-align:left;position:relative;gap:7px;background:#f7f7f7;border:1px solid transparent;border-radius:16px;padding:16px;min-height:132px}.account-card:hover{background:#f1f1f1}.account-card.selected{border-color:#8db542;background:#f7faef}.account-icon{height:25px;width:25px;border-radius:50%;background:#eee;display:grid;place-items:center}.account-icon svg{height:15px;width:15px}.account-name{font-size:16px;color:#8d8d8d}.account-card strong{font-size:20px;font-weight:500}.account-arrow{position:absolute;right:17px;bottom:16px;color:#aaa;font-size:24px}.table-toolbar{display:flex;justify-content:space-between;align-items:center;margin:28px 0 18px}.token-title{font-size:18px;font-weight:600}.token-title button{font-size:11px;color:#729037;background:#f1f5e9;border-radius:4px;margin-left:8px;padding:4px 6px}.asset-search{width:208px;display:flex;align-items:center;gap:7px;border:1px solid #ddd;border-radius:6px;padding:9px 10px}.asset-search svg{width:17px;height:17px;color:#999;flex-shrink:0}.asset-search input{width:100%;border:0;outline:none;font-size:13px;background:transparent;min-width:0}.asset-table{width:100%;border-collapse:collapse;table-layout:fixed}.asset-table th{font-weight:400;font-size:12px;color:#999;text-align:left;padding:0 0 15px;border-bottom:1px solid #eee}.asset-table th:first-child{width:46%}.asset-table th:nth-child(2){width:27%;text-align:right}.asset-table th:last-child{text-align:right}.asset-table td{height:80px;padding:13px 0;border-bottom:1px solid #f2f2f2;font-size:14px}.asset-table td:nth-child(n+2){text-align:right; font-variant-numeric:tabular-nums}.coin-button{display:flex;align-items:center;gap:12px;padding:0;text-align:left}.coin-logo{width:36px;height:36px;border-radius:50%;display:grid;place-items:center;font-size:22px;color:white;font-weight:600;flex-shrink:0}.coin-name{display:flex;flex-direction:column;gap:5px}.coin-name b{font-size:16px;font-weight:500}.coin-name small{font-size:12px;color:#999}.coin-value{display:flex;flex-direction:column;align-items:flex-end;gap:7px}.coin-profit{font-size:11px;color:#74984a}.coin-profit.negative{color:#db5b51}.empty-search{text-align:center;padding:45px;color:#999;font-size:14px}footer{background:#050505;color:#fff;padding:45px 24px}.footer-inner{max-width:1212px;margin:auto}.footer-brand{font-size:30px}.footer-inner p{font-size:12px;color:#858585;line-height:1.8}.footer-links{display:flex;gap:64px;margin-top:28px;color:#d1d1d1;font-size:14px}.footer-note{margin-top:28px}.support-button{position:fixed;right:24px;bottom:24px;background:#edffb4;border-radius:50%;width:52px;height:52px;display:grid;place-items:center;box-shadow:0 4px 20px #9ec25820;color:#466b2b}.support-button svg{width:25px;height:25px;stroke-width:2.7}dialog{border:0;border-radius:18px;padding:28px;max-width:440px;width:calc(100% - 32px);box-shadow:0 20px 100px #0003}dialog::backdrop{background:#0005;backdrop-filter:blur(3px)}.dialog-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.dialog-heading h2{margin:0;font-size:22px}.dialog-heading button{font-size:27px;color:#777;padding:0 3px}.dialog-heading+div{font-size:14px;color:#888;line-height:1.8;margin:22px 0}.dialog-done{width:100%;border-radius:24px;background:#111;color:white;padding:12px}.modal-details{padding:15px;background:#f6f6f6;border-radius:10px;margin:12px 0;color:#555}.masked .coin-profit{visibility:hidden}[hidden]{display:none!important}@media(min-width:1600px){.topbar{gap:24px}.global-nav{gap:24px}}@media(max-width:1350px){.layout,.asset-navigation nav{margin-left:32px;margin-right:32px}.global-nav{gap:13px}.global-nav button{font-size:12px}.market-search{width:150px;margin-right:0}.header-icons{gap:12px;margin-left:7px}.topbar{gap:13px;padding:0 16px}.brand-divider{margin-left:0}}@media(max-width:1150px){.global-nav button:nth-child(n+5){display:none}.asset-navigation nav{gap:22px}.asset-navigation button{font-size:14px}.header-icons button:nth-child(3),.header-icons button:nth-child(4){display:none}.layout{grid-template-columns:minmax(0,1fr) 300px;gap:18px}.shield-button{font-size:12px;padding:8px 10px}.valuation-label{font-size:16px}.quick-actions{gap:8px}.quick-actions button{padding:0 20px}.balance-card{min-height:550px}.chart-wrap{height:265px}.account-card{padding:13px}.account-card strong{font-size:17px}}@media(max-width:900px){.layout{grid-template-columns:1fr;max-width:800px;margin:24px auto 40px;padding:0 24px}.asset-navigation nav{margin:0 24px}.bill-card{min-height:260px;order:2}.bill-empty{margin-top:25px}.market-search{display:none}.header-icons button:nth-child(n+2){display:none}.bill-empty p{margin-bottom:20px}}@media(max-width:600px){.topbar{padding:0 16px;gap:10px}.brand b{font-size:23px}.brand svg{width:22px;height:22px}.brand-divider,.global-nav,.header-icons{display:none}.asset-menu{font-size:12px}.header-right{gap:10px}.asset-navigation nav{gap:22px;margin:0 18px}.layout{padding:0 12px;margin-top:16px}.left-column{gap:16px}.card{border-radius:13px}.balance-card,.portfolio-card,.bill-card{padding:20px 16px}.balance-card{min-height:475px}.shield-button{font-size:11px;padding:7px 9px;gap:2px}.shield-button svg{width:15px;height:15px}.valuation-label{font-size:14px;gap:5px}.demo-badge{font-size:9px}.balance-line strong{font-size:29px}.quick-actions button{padding:0 19px;font-size:12px}.quick-actions{gap:7px;margin-top:18px}.period-tabs{margin-top:17px}.chart-wrap{height:215px;margin-top:15px}.collapse-chart{margin-top:8px}.account-cards{gap:7px}.account-card{padding:12px 10px;border-radius:10px;min-height:120px}.account-name{font-size:12px}.account-card strong{font-size:14px}.account-arrow{display:none}.portfolio-card h1,.bill-card h2{font-size:20px}.asset-search{width:150px}.asset-table th:first-child{width:41%}.asset-table th:nth-child(2){width:28%}.asset-table td{font-size:12px;height:74px}.coin-logo{width:29px;height:29px;font-size:18px}.coin-button{gap:7px}.coin-name b{font-size:13px}.coin-name small{font-size:10px}.coin-profit{font-size:9px}.footer-links{gap:28px}.support-button{width:45px;height:45px;right:16px;bottom:16px}}@media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}

/* Footer directory mirrors the reference page's public information hierarchy. */
@media(min-width:1151px){.chart-wrap{height:380px}}
.footer-intro{display:flex;align-items:flex-start;justify-content:space-between}.footer-demo{font-size:11px;color:#aaa;border:1px solid #444;border-radius:5px;padding:7px 10px}.footer-links{display:grid;grid-template-columns:repeat(5,minmax(0,1fr)) 1.2fr;gap:26px;margin-top:36px}.footer-links h3{font-size:14px;font-weight:500;margin:0 0 18px;color:#eee}.footer-links span{display:block;font-size:12px;color:#8d8d8d;line-height:1.5;margin:0 0 11px}.footer-links .footer-subheading{margin-top:27px}.footer-app button{border:1px solid #777;border-radius:24px;padding:9px 25px;color:white;font-size:12px}.app-symbol{height:78px;width:78px;border:1px solid #444;border-radius:10px;display:grid;place-items:center;margin:24px 0 12px}.app-symbol svg{height:34px;width:34px;color:#bbb}.social-symbols{font-size:20px}.footer-note{border-top:1px solid #252525;padding-top:24px}@media(max-width:900px){.footer-links{grid-template-columns:repeat(3,1fr);gap:25px}}@media(max-width:600px){.footer-links{grid-template-columns:repeat(2,1fr);gap:25px}.footer-demo{font-size:9px}.footer-intro{gap:12px}}

/* Finance dashboard: live market data, with portfolio quantities kept local. */
.market-search input{width:100%;min-width:0;border:0;outline:0;background:transparent;color:#222;font-size:12px}.header-icons{gap:10px}.header-icons button{width:32px;height:32px;display:grid;place-items:center;border:1px solid #e6e6e6;border-radius:50%;font-size:22px;line-height:1}.market-source-mark{font-size:10px;color:#888;white-space:nowrap}.balance-line{align-items:flex-start;flex-wrap:wrap;gap:12px}.balance-line strong{max-width:100%;display:flex;flex-wrap:wrap;gap:8px 18px;font-size:28px;line-height:1.35}.total-currency{white-space:nowrap}.currency-label{padding-top:8px;font-size:12px;white-space:nowrap}.profit-line{height:auto;min-height:26px;flex-wrap:wrap}.profit-line button{white-space:nowrap}.quick-actions{flex-wrap:wrap;gap:8px}.data-source-chip{padding:7px 11px;border-radius:18px;background:#f4f5f2;color:#656b5f;font-size:12px}.refresh-icon{font-size:19px;line-height:1}.chart-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:20px;color:#555;font-size:13px}.chart-heading label{display:flex;align-items:center;gap:8px;color:#888;font-size:12px}.chart-heading select{max-width:215px;border:1px solid #e6e6e6;border-radius:7px;background:#fff;padding:7px 10px;color:#333;font-size:12px}.period-tabs{margin-top:10px}.chart-wrap{margin-top:8px}.chart-wrap>svg{position:relative;z-index:1}.chart-wrap>svg.chart-unavailable{opacity:.08}.chart-empty{position:absolute;inset:36px 10px 32px;z-index:2;display:grid;place-items:center;text-align:center;color:#929292;font-size:13px;pointer-events:none}.chart-empty[hidden]{display:none}.chart-heading+ .period-tabs{margin-top:8px}.portfolio-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.portfolio-heading p{margin:8px 0 0;color:#999;font-size:12px;line-height:1.6}.reset-filter{padding:7px 12px;border:1px solid #e5e5e5;border-radius:18px;color:#666;font-size:12px;white-space:nowrap}.reset-filter:hover{background:#f4f4f4}.table-toolbar{gap:12px}.storage-note{color:#999;font-size:11px;text-align:right}.table-scroll{width:100%;overflow-x:auto}.asset-table{min-width:660px}.asset-table th:first-child{width:34%}.asset-table th:nth-child(2){width:18%;text-align:right}.asset-table th:nth-child(3){width:25%;text-align:right}.asset-table th:nth-child(4){width:23%;text-align:right}.asset-table td:nth-child(n+2){text-align:right}.holding-quantity{width:100%;max-width:116px;border:1px solid #e5e5e5;border-radius:6px;padding:8px 7px;text-align:right;color:#222;font-size:13px;font-variant-numeric:tabular-nums}.holding-quantity::placeholder{color:#aaa;font-size:11px}.holding-quantity:focus{outline:2px solid #dceac3;border-color:#8db542}.coin-value{max-width:100%}.coin-value small{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.market-source-label{color:#999;font-size:11px}.estimate-value{font-variant-numeric:tabular-nums;white-space:nowrap}.source-panel{padding:24px;min-height:0}.source-panel h2{margin:0 0 22px;font-size:20px}.source-row{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-top:20px}.source-row>div{display:flex;flex-direction:column;gap:6px}.source-row strong{font-size:14px;font-weight:600}.source-row span{font-size:12px;color:#999}.source-state{border-radius:14px;padding:5px 9px;font-size:11px;font-weight:500;white-space:nowrap}.source-state.loading{background:#f1f1f1;color:#888}.source-state.online{background:#eef6df;color:#638838}.source-state.offline{background:#fff0ee;color:#c5554c}.source-state.warning{background:#fff8e6;color:#b26b00}.source-detail{margin:9px 0 0;color:#999;font-size:11px;line-height:1.6;overflow-wrap:anywhere}.source-divider{height:1px;background:#eee;margin:24px 0}.source-note strong{font-size:13px}.source-note p{font-size:12px;color:#888;line-height:1.8;margin:10px 0 0}.footer-intro{align-items:center}.footer-brand{font-size:28px}.footer-note{max-width:800px}.masked .holding-quantity{visibility:hidden}.asset-table td:first-child{overflow:hidden}.asset-table td:first-child .coin-name{min-width:0}.asset-table td:first-child .coin-name b,.asset-table td:first-child .coin-name small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media(max-width:900px){.source-panel{order:3}.balance-card{min-height:0}.chart-wrap{height:250px}.balance-line strong{font-size:24px}}
@media(max-width:600px){.market-search{display:flex;width:min(42vw,190px);margin-right:0}.market-search input{font-size:11px}.header-icons{display:flex}.header-icons button{width:29px;height:29px}.market-source-mark{display:none}.header-deposit{display:none}.balance-card,.portfolio-card,.source-panel{padding:19px 15px}.balance-line{display:block}.balance-line strong{font-size:22px}.currency-label{display:block;padding-top:8px}.quick-actions{margin-top:14px}.data-source-chip{font-size:10px;padding:6px 8px}.chart-heading{align-items:flex-start;flex-direction:column}.chart-heading select{max-width:70vw}.chart-wrap{height:210px}.portfolio-heading h1{font-size:19px}.portfolio-heading p{font-size:11px}.table-toolbar{align-items:flex-start;flex-direction:column;margin:22px 0 14px}.storage-note{text-align:left}.source-panel h2{font-size:19px}.source-row{margin-top:18px}.footer-intro{align-items:flex-start;flex-direction:column}.footer-demo{font-size:9px}}

/* --- Recent Bills & Transaction Import --- */
.bill-card-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}
.bill-card-header h2{font-size:21px;margin:0;font-weight:700}
.add-bill-btn{width:28px;height:28px;border-radius:50%;border:1px solid #d5d5d5;background:#fff;color:#111;font-size:18px;font-weight:600;line-height:1;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all .15s}
.add-bill-btn:hover{background:#111;color:#fff;border-color:#111}
.bill-list-wrap{display:flex;flex-direction:column;gap:12px;margin-top:14px}
.bill-toolbar{display:flex;justify-content:space-between;align-items:center;padding-bottom:10px;border-bottom:1px solid #eee;font-size:12px;color:#888}
.bill-count-label{font-weight:600;color:#333}
.bill-toolbar-actions{display:flex;gap:8px}
.bill-btn-sm{background:#f5f5f5;border:1px solid #e0e0e0;border-radius:6px;padding:4px 9px;font-size:11px;color:#555;cursor:pointer;transition:all .15s}
.bill-btn-sm:hover{background:#eee;color:#111}
.bill-btn-danger{color:#c62828;border-color:#ffcdd2;background:#ffebee}
.bill-btn-danger:hover{background:#ffcdd2}
.bill-items{max-height:480px;overflow-y:auto;display:flex;flex-direction:column;gap:8px;padding-right:4px}
.bill-item{padding:10px 12px;border-radius:10px;background:#f9f9f9;border:1px solid #ececec;font-size:12px;display:flex;flex-direction:column;gap:4px;transition:background .15s}
.bill-item:hover{background:#f3f3f3}
.bill-item-top{display:flex;justify-content:space-between;align-items:center}
.bill-tag{font-size:10px;padding:2px 7px;border-radius:4px;font-weight:600}
.bill-tag.buy{background:#e8f5e9;color:#2e7d32}
.bill-tag.sell{background:#ffebee;color:#c62828}
.bill-tag.transfer{background:#e3f2fd;color:#1565c0}
.bill-tag.dividend{background:#fff8e1;color:#f57f17}
.bill-time{color:#999;font-size:11px;font-variant-numeric:tabular-nums}
.bill-item-name{font-weight:600;color:#222;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bill-item-bottom{display:flex;justify-content:space-between;color:#666;font-size:11px;font-variant-numeric:tabular-nums}
.bill-item-amt{font-weight:600;color:#111}

/* --- Bill Upload Dialog --- */
.bill-upload-dialog{max-width:520px;width:calc(100% - 32px)}
.upload-desc{font-size:13px;color:#666;line-height:1.6;margin:0 0 16px}
.drop-zone{border:2px dashed #ccc;border-radius:12px;padding:24px 16px;text-align:center;cursor:pointer;background:#fafafa;transition:all .2s;display:flex;flex-direction:column;align-items:center;gap:6px}
.drop-zone:hover,.drop-zone.dragover{border-color:#111;background:#f3f3f3}
.upload-icon{color:#666;margin-bottom:4px}
.drop-text{font-size:14px;font-weight:600;color:#222}
.drop-hint{font-size:11px;color:#999}
.sample-import-box{margin-top:14px;padding:10px 12px;background:#f5f7fa;border-radius:8px;display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px}
.sample-label{color:#666;font-weight:500}
.btn-sample{background:#111;color:#fff;border:0;border-radius:6px;padding:6px 12px;font-size:12px;cursor:pointer;font-weight:500;transition:background .15s}
.btn-sample:hover{background:#333}
.upload-progress-box{margin-top:16px;padding:12px 14px;background:#f7f9f7;border:1px solid #dceac3;border-radius:8px}
.progress-bar-wrap{height:6px;background:#e2eed2;border-radius:3px;overflow:hidden;margin-bottom:8px}
.progress-bar-fill{height:100%;background:#4caf50;width:100%;animation:progress-indeterminate 1.4s infinite linear}
@keyframes progress-indeterminate{0%{transform:translateX(-100%)}100%{transform:translateX(100%)}}
.upload-status-text{font-size:12px;color:#33691e;text-align:center;font-weight:500}
.dialog-footer{display:flex;justify-content:flex-end;margin-top:18px}
.dialog-cancel{background:transparent;border:1px solid #ddd;border-radius:8px;padding:7px 16px;cursor:pointer;font-size:13px}
.dialog-cancel:hover{background:#f5f5f5}

/* --- WebSocket Live Status Badge --- */
.ws-badge{display:inline-flex;align-items:center;gap:5px;font-size:11px;padding:3px 9px;border-radius:12px;font-weight:500;white-space:nowrap;transition:all .2s;cursor:default}
.ws-badge:before{content:"";display:inline-block;width:6px;height:6px;border-radius:50%}
.ws-badge.connected{background:#152e0e;color:#8be364;border:1px solid #255217}
.ws-badge.connected:before{background:#5cd632;box-shadow:0 0 6px #5cd632}
.ws-badge.connecting{background:#2b260d;color:#e8cb5b;border:1px solid #4a3e12}
.ws-badge.connecting:before{background:#deb72b;box-shadow:0 0 6px #deb72b;animation:pulse-dot 1s infinite}
.ws-badge.disconnected{background:#301313;color:#e87676;border:1px solid #571e1e}
.ws-badge.disconnected:before{background:#db3b3b}
@keyframes pulse-dot{0%,100%{opacity:1}50%{opacity:.3}}

/* --- Total Asset Valuation & Profit History Chart Enhancements --- */
.chart-heading{display:flex;justify-content:space-between;align-items:center}
.chart-legend{display:inline-flex;gap:10px;align-items:center;font-size:12px;color:#777}
.legend-item{display:inline-flex;align-items:center;gap:5px;cursor:pointer;user-select:none;padding:2px 6px;border-radius:4px;transition:opacity .15s}
.legend-item.inactive{opacity:0.35}
.legend-dot{display:inline-block;width:7px;height:7px;border-radius:50%}
#chart-area-fill{display:none}
#chart-line{fill:none;stroke:#78b400;stroke-width:2.2;stroke-linejoin:round;stroke-linecap:round;transition:opacity .2s}
#chart-profit-line{fill:none;stroke:#ff9800;stroke-width:1.8;stroke-linejoin:round;stroke-linecap:round;transition:opacity .2s}
#chart-zero-line{stroke:#e2e8f0;stroke-dasharray:3 3;stroke-width:1}
#chart-profit-dot{fill:#ff9800;stroke:#fff;stroke-width:2;display:none}
.profit-line .positive{color:#2e7d32;font-weight:600}
.profit-line .negative{color:#c62828;font-weight:600}
#chart-labels text.chart-extreme-label{font-size:11px;fill:#999;font-weight:400}
#chart-labels text.chart-profit-label{font-size:11px;fill:#f59e0b;font-weight:500}
#chart-tooltip{position:absolute;display:none;pointer-events:none;background:#ffffff;padding:9px 12px;border:1px solid #e5e7eb;border-radius:8px;box-shadow:0 8px 24px rgba(0,0,0,0.08);font-size:12px;z-index:10;white-space:nowrap}
#chart-tooltip .tt-time{display:block;font-size:11px;color:#888;margin-bottom:4px}
#chart-tooltip .tt-row{display:flex;align-items:center;gap:6px;line-height:1.5}
#chart-tooltip .tt-row strong{font-size:12.5px;color:#111;font-weight:600}
#chart-tooltip .tt-row.val strong{color:#558b00}
#chart-tooltip .tt-row.pft strong{color:#d97706}
#chart-tooltip .tt-dot{width:6px;height:6px;border-radius:50%;display:inline-block}

/* --- Stock Manual Import Entry & Modal Styles --- */
.table-toolbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px;gap:12px}
.toolbar-title-wrap{display:flex;align-items:center;gap:10px}
.toolbar-actions{display:flex;align-items:center;gap:8px}
.stock-import-btn{display:inline-flex;align-items:center;gap:6px;background:#f3f4f6;color:#1f2937;border:1px solid #d1d5db;border-radius:6px;padding:6px 12px;font-size:12px;font-weight:600;cursor:pointer;transition:all .15s}
.stock-import-btn:hover{background:#111827;color:#ffffff;border-color:#111827;box-shadow:0 2px 6px rgba(0,0,0,0.08)}
.bill-header-actions{display:flex;align-items:center;gap:8px}
.bill-stock-add-btn{display:inline-flex;align-items:center;gap:4px;background:#f0fdf4;color:#166534;border:1px solid #bbf7d0;border-radius:14px;padding:3px 9px;font-size:11px;font-weight:600;cursor:pointer;transition:all .15s}
.bill-stock-add-btn:hover{background:#dcfce7;border-color:#86efac}

.stock-order-dialog{max-width:540px;width:calc(100% - 32px);border:0;border-radius:14px;padding:24px;box-shadow:0 20px 45px rgba(0,0,0,0.18)}
.stock-order-dialog::backdrop{background:rgba(0,0,0,0.5);backdrop-filter:blur(3px)}
.stock-order-dialog .dialog-heading{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:18px}
.stock-order-dialog .dialog-heading h2{margin:0;font-size:18px;font-weight:700;color:#111}
.dialog-sub{display:block;font-size:12px;color:#6b7280;margin-top:3px}
.stock-form{display:flex;flex-direction:column;gap:14px}
.form-group{display:flex;flex-direction:column;gap:6px}
.form-row-2col{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.label-row{display:flex;justify-content:space-between;align-items:center}
.label-row label,.form-group > label{font-size:12.5px;font-weight:600;color:#374151}
.required-star{color:#e11d48}
.field-hint{font-size:11px;color:#9ca3af}
.form-input{height:38px;padding:0 12px;border:1px solid #d1d5db;border-radius:8px;font-size:13px;color:#111;background:#fff;transition:border-color .15s,box-shadow .15s;outline:none}
.form-input:focus{border-color:#2563eb;box-shadow:0 0 0 3px rgba(37,99,235,0.12)}
.time-input{font-variant-numeric:tabular-nums}
.currency-badge{font-size:11px;font-weight:700;color:#4b5563;background:#f3f4f6;padding:2px 6px;border-radius:4px}
.auto-calc-tag{font-size:11px;color:#059669;background:#ecfdf5;padding:2px 6px;border-radius:4px;cursor:help;font-weight:500}
.btn-text-action{background:none;border:0;color:#2563eb;font-size:11.5px;font-weight:500;cursor:pointer;padding:0}
.btn-text-action:hover{text-decoration:underline}
.quick-chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:4px}
.chip-btn{background:#f9fafb;border:1px solid #e5e7eb;border-radius:12px;padding:3px 9px;font-size:11px;color:#4b5563;cursor:pointer;transition:all .15s}
.chip-btn:hover{background:#f3f4f6;border-color:#cbd5e1;color:#111}
.side-selector{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.side-option{display:flex;align-items:center;justify-content:center;gap:8px;height:40px;border-radius:8px;font-size:13px;font-weight:600;cursor:pointer;border:1.5px solid transparent;transition:all .15s}
.side-indicator{width:8px;height:8px;border-radius:50%}
.side-option.buy{background:#f0fdf4;color:#15803d;border-color:#bbf7d0}
.side-option.buy .side-indicator{background:#22c55e}
.side-option.buy.active{background:#15803d;color:#fff;border-color:#15803d;box-shadow:0 3px 10px rgba(21,128,61,0.25)}
.side-option.buy.active .side-indicator{background:#fff}
.side-option.sell{background:#fef2f2;color:#b91c1c;border-color:#fecaca}
.side-option.sell .side-indicator{background:#ef4444}
.side-option.sell.active{background:#b91c1c;color:#fff;border-color:#b91c1c;box-shadow:0 3px 10px rgba(185,28,28,0.25)}
.side-option.sell.active .side-indicator{background:#fff}
.order-preview-card{background:#f8fafc;border:1px solid #e2e8f0;border-radius:8px;padding:12px 14px;font-size:12px}
.preview-header{display:flex;align-items:center;gap:6px;font-weight:600;color:#475569;margin-bottom:8px}
.preview-dot{width:6px;height:6px;border-radius:50%;background:#3b82f6}
.preview-content{display:flex;justify-content:space-between;align-items:center;gap:12px}
.preview-item{display:flex;align-items:center;gap:6px}
.preview-lbl{color:#64748b}
.preview-val{color:#0f172a}
.preview-val.highlight{color:#1d4ed8;font-size:13.5px}
.form-error-msg{color:#e11d48;font-size:12px;background:#fff1f2;padding:8px 12px;border-radius:6px;border:1px solid #ffe4e6}
.dialog-footer{display:flex;justify-content:flex-end;gap:10px;margin-top:8px}
.dialog-cancel{background:#f3f4f6;color:#4b5563;border:0;border-radius:8px;padding:8px 16px;font-size:13px;font-weight:500;cursor:pointer}
.dialog-cancel:hover{background:#e5e7eb}
.dialog-submit{background:#111827;color:#fff;border:0;border-radius:8px;padding:8px 20px;font-size:13px;font-weight:600;cursor:pointer;transition:background .15s}
.dialog-submit:hover{background:#1f2937}
.bill-del-btn{margin-left:auto;background:none;border:0;color:#9ca3af;font-size:16px;line-height:1;padding:0 4px;cursor:pointer;border-radius:4px;transition:all .15s}
.bill-del-btn:hover{color:#ef4444;background:#fee2e2}
.pin-input{letter-spacing:4px;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:14px;font-weight:600}
.pin-verify-row{margin-top:14px;display:flex;flex-direction:column;gap:6px}
.selected-file-badge{display:flex;align-items:center;justify-content:space-between;background:#f8fafc;border:1px solid #e2e8f0;padding:8px 12px;border-radius:8px;font-size:12.5px;color:#1e293b;margin-top:12px}
.selected-file-badge .file-info-main{display:flex;align-items:center;gap:8px;overflow:hidden}
.selected-file-badge .file-name{font-weight:600;color:#0f172a;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:340px}
.selected-file-badge .file-size{font-size:11px;color:#64748b}
.selected-file-badge .remove-file-btn{background:none;border:0;color:#94a3b8;cursor:pointer;font-size:16px;line-height:1;padding:2px 6px;border-radius:4px;transition:all .15s}
.selected-file-badge .remove-file-btn:hover{color:#ef4444;background:#fee2e2}
.dialog-submit:disabled{opacity:0.45;cursor:not-allowed;background:#9ca3af}
.global-nav-link {
  font-size: 14px;
  font-weight: 500;
  color: #a1a1aa;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
}
.global-nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
.nav-watchlist-chip {
  font-size: 13px;
  font-weight: 500;
  color: #2a99fe;
  background: rgba(42, 153, 254, 0.1);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 14px;
  border: 1px solid rgba(42, 153, 254, 0.25);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
}
.nav-watchlist-chip:hover {
  background: rgba(42, 153, 254, 0.2);
}
.watchlist-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid rgba(42, 153, 254, 0.35);
  background: rgba(42, 153, 254, 0.08);
  color: #2a99fe;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}
.watchlist-switch-btn:hover {
  background: rgba(42, 153, 254, 0.18);
  border-color: #2a99fe;
}

/* Longbridge Card Transplant Layout & Responsiveness */
.layout {
  max-width: 1480px;
  grid-template-columns: minmax(0, 1fr) 340px;
}
.portfolio-section {
  min-width: 0;
  width: 100%;
}
#lb-card-root,
.portfolio-section > div {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  padding: 16px;
}
#lb-card-root .lb-card-inner,
.portfolio-section .lb-card-inner {
  display: flex !important;
  flex-direction: column !important;
  gap: 20px !important;
}
#lb-card-root .lb-timeline-section,
.portfolio-section .lb-timeline-section {
  width: 100% !important;
  min-width: 0 !important;
  margin-right: 0 !important;
  margin-top: 14px !important;
  border-top: 1px solid hsl(var(--border)) !important;
  padding-top: 18px !important;
  max-height: 480px;
}
@media (max-width: 1050px) {
  .layout {
    grid-template-columns: 1fr;
    max-width: 900px;
  }
}

/* Longbridge Watchlist Session Badges & Market Status (Pre-market / Post-market) */
:root, #lb-card-root {
  --wl-session-premarket-bg: #ffa61f;
  --wl-session-premarket: #ff7128;
  --wl-session-postmarket-bg: #5a74ff;
  --wl-session-postmarket: #3451ff;
  --wl-session-overnight: #5a74ff;
}

#lb-card-root svg:not(.overflow-visible),
.portfolio-section svg:not(.overflow-visible) {
  stroke: none !important;
  stroke-width: 0 !important;
}

[aria-label="盘前"],
[aria-label="盘前"] * {
  --wl-session-premarket-bg: #ffa61f;
  --wl-session-premarket: #ff7128;
  stroke: none !important;
  stroke-width: 0 !important;
}

[aria-label="盘前"] svg {
  display: inline-block !important;
  vertical-align: middle !important;
  width: 12px !important;
  height: 12px !important;
  stroke: none !important;
  stroke-width: 0 !important;
}

[aria-label="盘前"] svg * {
  stroke: none !important;
  stroke-width: 0 !important;
}

[aria-label="盘前"] svg rect:first-child {
  fill: #ffa61f !important;
  fill-opacity: 0.25 !important;
  stroke: none !important;
}

[aria-label="盘前"] svg path,
[aria-label="盘前"] svg rect:not(:first-child) {
  fill: #ff7128 !important;
  stroke: none !important;
}

[aria-label="盘后"],
[aria-label="盘后"] * {
  --wl-session-postmarket-bg: #5a74ff;
  --wl-session-postmarket: #3451ff;
  stroke: none !important;
  stroke-width: 0 !important;
}

[aria-label="盘后"] svg {
  display: inline-block !important;
  vertical-align: middle !important;
  width: 12px !important;
  height: 12px !important;
  stroke: none !important;
  stroke-width: 0 !important;
}

[aria-label="盘后"] svg * {
  stroke: none !important;
  stroke-width: 0 !important;
}

[aria-label="盘后"] svg rect:first-child {
  fill: #5a74ff !important;
  fill-opacity: 0.25 !important;
  stroke: none !important;
}

[aria-label="盘后"] svg path,
[aria-label="盘后"] svg rect:not(:first-child) {
  fill: #3451ff !important;
  stroke: none !important;
}

/* Longbridge Mini K-line (Sparkline) sizing: override global 22px svg restriction and expand */
#lb-card-root svg.overflow-visible,
.portfolio-section svg.overflow-visible {
  width: 80px !important;
  height: 30px !important;
  min-width: 80px !important;
  max-width: 80px !important;
  display: inline-block !important;
  overflow: visible !important;
  stroke: none !important;
}

#lb-card-root svg.overflow-visible path,
.portfolio-section svg.overflow-visible path {
  stroke-width: 2px !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  opacity: 1 !important;
}

#lb-card-root svg.overflow-visible line,
.portfolio-section svg.overflow-visible line {
  stroke: #82888D !important;
  stroke-width: 1px !important;
  stroke-dasharray: 2 2 !important;
  stroke-opacity: 0.8 !important;
}

#lb-card-root td:nth-child(2),
#lb-card-root th:nth-child(2),
.portfolio-section td:nth-child(2),
.portfolio-section th:nth-child(2) {
  width: 110px !important;
  min-width: 96px !important;
  text-align: center !important;
}

/* Keep the search and connection indicator within narrow screens. */
@media (max-width: 600px) {
  .header-right { flex: 1 1 auto; min-width: 0; gap: 8px; }
  .market-search { flex: 1 1 90px; min-width: 0; width: auto; }
  .market-search input { min-width: 0; width: 100%; }
  .header-icons { flex-shrink: 0; gap: 8px; margin-left: 0; }
}



