:root{--bg:#faf9f5;--paper:#fffdf8;--panel:#fff;--line:#e8e0d7;--ink:#292620;--muted:#79736a;--soft:#f4eee7;--accent:#ad5135;--green:#34704e;--rose:#af4242}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font:14px/1.65 "Microsoft YaHei UI","PingFang SC","Noto Sans SC",system-ui,sans-serif;font-variant-numeric:tabular-nums}a{color:inherit;text-decoration:none}button,input,select,textarea{font:inherit}button,.button{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:42px;padding:8px 16px;background:#fff;border:1px solid var(--line);border-radius:6px;color:var(--ink);cursor:pointer;white-space:nowrap;transition:background .18s,border-color .18s;font-weight:500}button:hover,.button:hover{background:var(--soft);border-color:#cbbbab}.primary{background:var(--accent);border-color:var(--accent);color:#fff}.primary:hover{background:#91432b;border-color:#91432b}.danger{color:var(--rose);border-color:#e8bebe}.danger-text{color:var(--rose)}input,select,textarea{width:100%;min-width:0;border:1px solid #d9d3cb;border-radius:6px;background:#fff;color:var(--ink);padding:9px 11px;min-height:42px}input:focus,select:focus,textarea:focus,button:focus-visible,a:focus-visible{outline:2px solid #b76244;outline-offset:3px}label{display:flex;flex-direction:column;gap:7px;font-size:13px;font-weight:500;min-width:0}h1{font-size:29px;line-height:1.3;margin:7px 0 10px;font-weight:700}h2{font-size:17px;font-weight:600;margin:0}h3{font-size:16px;font-weight:500}p{margin:6px 0 12px}small,.small{font-size:12px}small{display:block;color:var(--muted)}.muted{color:var(--muted)}.eyebrow{font-size:12px;letter-spacing:1px;color:var(--muted)}.sidebar{width:232px;position:fixed;inset:0 auto 0 0;background:var(--paper);border-right:1px solid var(--line);padding:30px 18px;display:flex;flex-direction:column}.brand{display:flex;align-items:center;gap:12px;font-size:20px;font-weight:600;white-space:nowrap}.brand-icon{width:42px;height:42px;display:inline-grid;place-items:center;border-radius:9px;background:var(--accent);color:white;font-size:22px}.brand small{font-weight:400;font-size:11px;letter-spacing:2px;margin-top:2px}.nav-label{font-size:12px;color:var(--muted);margin:44px 12px 12px}.sidebar nav{display:grid;gap:6px}.sidebar nav a{display:flex;align-items:center;gap:12px;padding:12px 14px;border-radius:6px;color:#655f57}.sidebar nav a span{font-size:21px;width:24px;line-height:1}.sidebar nav a.active{background:#f4e8df;color:#98452f;box-shadow:inset 3px 0 var(--accent)}.sidebar nav a:hover{background:var(--soft)}.sidebar-foot{margin-top:auto;padding:16px 6px 0;border-top:1px solid var(--line);color:#696358;font-size:13px}.sidebar-foot p{font-size:12px;margin-top:8px;color:var(--muted)}.dot{display:inline-block;width:7px;height:7px;background:var(--green);border-radius:50%;margin-right:7px}.workspace{margin-left:232px}.topbar{height:68px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:center;padding:0 30px;background:#fffdf9}.topbar>a{display:flex;align-items:center;gap:8px;font-size:13px}.avatar{border-radius:50%;background:var(--soft);width:29px;height:29px;display:inline-grid;place-items:center;color:var(--accent)}main{padding:28px 32px;max-width:1600px;margin:auto}.page-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:22px}.actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.panel{border:1px solid var(--line);border-radius:9px;background:#fff;margin-bottom:22px;overflow:hidden;min-width:0}.panel-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:20px 22px;border-bottom:1px solid var(--line)}.toolbar{display:flex;gap:12px;align-items:flex-end;flex-wrap:wrap;padding:16px 20px;background:#fff}.toolbar label{flex-direction:row;align-items:center;white-space:nowrap}.toolbar select{max-width:250px}.period-form{border:1px solid var(--line);border-radius:8px;align-items:center}.segmented{display:flex;gap:3px;background:var(--bg);padding:3px;border:1px solid var(--line);border-radius:6px}.segmented button{min-height:33px;border:0;background:transparent;padding:4px 15px}.segmented .selected{background:var(--accent);color:#fff}.period-range{margin-left:auto;color:var(--muted);font-size:12px}.period-links{display:flex;justify-content:flex-end;gap:20px;font-size:12px;margin:8px 3px 18px;color:var(--muted)}.metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:24px}.metric{border:1px solid var(--line);border-radius:8px;padding:20px;background:#fff;min-width:0}.metric>div{display:flex;justify-content:space-between;align-items:center;color:#6d665d;font-size:13px}.metric strong{display:flex;align-items:baseline;gap:6px;font-size:clamp(22px,2.1vw,32px);line-height:1.25;font-weight:600;margin:18px 0 10px;white-space:nowrap}.metric strong small{display:inline;font-size:15px;font-weight:400;color:inherit}.metric p{font-size:12px;color:var(--muted);margin:0}.badge{display:inline-block;padding:3px 8px;border-radius:4px;font-size:12px;white-space:nowrap}.income{background:#eaf3ec;color:var(--green)}.expense{background:#fbede3;color:#a65d2d}.neutral{background:#f1eee9;color:#777066}.income-text{color:var(--green)}.dashboard-grid{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:22px}.legend{display:flex;align-items:center;gap:7px;color:var(--muted);font-size:12px}.legend i{width:7px;height:7px;border-radius:2px}.green{background:var(--green)}.orange{background:#c88c69}.quick-panel{padding:22px;background:var(--paper)}.quick-panel>p.muted{margin:12px 0 20px}.quick-link{display:flex;gap:12px;align-items:center;padding:14px 0;border-top:1px solid var(--line)}.quick-link b{margin-left:auto;font-weight:400;color:var(--muted)}.quick-link small{margin-top:2px}.quick-icon{width:36px;height:36px;border-radius:6px;display:grid;place-items:center;font-size:23px}.text-link{color:var(--accent);font-size:13px;white-space:nowrap}.quick-panel>.text-link{display:block;margin-top:16px}.empty{text-align:center;padding:48px 20px;color:var(--muted)}.empty>span{font-size:30px;color:#b1a899}.empty h3{color:var(--ink);margin:12px 0 6px}.empty p{font-size:13px;margin-bottom:20px}.table-scroll{overflow:auto}table{border-collapse:collapse;width:100%;text-align:left;white-space:nowrap;font-size:13px}th{font-weight:400;color:var(--muted);background:#fdfcf9;padding:12px 20px;border-bottom:1px solid var(--line)}td{padding:15px 20px;border-bottom:1px solid #f0ebe5}tbody tr:last-child td{border-bottom:0}tbody tr:hover{background:#fdfcf9}.number{text-align:right}td small{margin-top:4px}.truncate{display:block;max-width:300px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.trend-table{max-height:310px}.bars{min-width:110px}progress{display:block;width:100%;height:7px;margin:6px 0;border:0;border-radius:3px;appearance:none}progress::-webkit-progress-bar{background:#f5f1eb;border-radius:3px}.income-bar::-webkit-progress-value{background:#76a98b;border-radius:3px}.expense-bar::-webkit-progress-value{background:#d4a17d;border-radius:3px}.income-bar::-moz-progress-bar{background:#76a98b}.expense-bar::-moz-progress-bar{background:#d4a17d}.footer{padding:4px 32px 24px;color:#8b8275;font-size:12px;display:flex;justify-content:space-between}.table-note{padding:0 20px;color:var(--muted);font-size:12px}.pagination{display:flex;justify-content:center;align-items:center;gap:20px;padding:16px}.push-right{margin-left:auto}.form-panel{padding:24px}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:22px;margin:16px 0}.form-stack{display:grid;gap:20px;max-width:480px;margin:24px 0}.form-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:25px}.notice{padding:14px 18px;background:#f7f1e7;border:1px solid #e7dac6;border-radius:6px;font-size:13px;margin:16px 0}.error{background:#fff1ee;border-color:#efcbc3;color:#9b372d}.success{background:#eef6ef;border-color:#cedfce;color:#356347}.checkbox{display:flex;flex-direction:row;align-items:center;gap:9px;margin-top:20px;font-weight:400;white-space:normal}.checkbox input{width:16px;height:16px;min-height:16px;flex:0 0 16px;accent-color:var(--accent)}.field-help{align-self:center;color:var(--muted);font-size:13px}.entry-row{display:grid;grid-template-columns:minmax(220px,2.2fr) minmax(65px,.6fr) minmax(65px,.6fr) minmax(140px,1fr) auto;gap:16px;padding:22px;border-bottom:1px solid var(--line);align-items:start}.entry-row button{margin-top:29px;font-size:12px;border:0;color:#8b756a;padding:8px}.entry-row small{font-weight:400}.add-row{padding:18px 22px}.save-dock{position:sticky;bottom:12px;z-index:2;background:var(--paper);border:1px solid var(--line);border-radius:8px;padding:18px 22px;display:flex;align-items:center;justify-content:space-between;gap:15px;box-shadow:0 5px 18px #43301c0b}.save-dock strong{font-size:26px;font-weight:600;margin-left:16px}.save-dock .muted{font-size:13px}.detail-meta{display:flex;gap:20px;flex-wrap:wrap;color:var(--muted);margin:20px 0}.detail-total{display:flex;justify-content:flex-end;gap:30px;align-items:center;padding:24px 0}.detail-total strong{font-size:25px}.note-content{white-space:pre-wrap;overflow-wrap:anywhere;color:var(--muted)}hr{border:0;border-top:1px solid var(--line);margin:30px 0}.mobile-nav{display:none}.login-wrap{max-width:470px;padding:55px 15px}.login-wrap>.brand{justify-content:center;margin-bottom:32px}.login-card{padding:34px}.login-card h1{font-size:25px}.login-caption{text-align:center;color:var(--muted);font-size:13px;letter-spacing:3px}.login-card .form-stack{margin:26px 0}.login-card .primary{width:100%}
@media(min-width:1600px){.metric strong{font-size:34px}}@media(max-width:1150px){.sidebar{width:204px;padding:28px 14px}.workspace{margin-left:204px}main{padding:24px}.metrics{gap:12px}.metric{padding:16px}.dashboard-grid{grid-template-columns:minmax(0,1fr)}.quick-panel{display:none}.entry-row{grid-template-columns:minmax(170px,2fr) 65px 65px minmax(110px,1fr) auto;gap:10px}.period-range{width:100%;margin-left:0}}@media(max-width:760px){.sidebar{display:none}.workspace{margin-left:0}.topbar{height:55px;padding:0 16px;font-size:12px}.topbar .muted{display:none}.topbar>span:before{content:'账';display:inline-grid;place-items:center;width:26px;height:26px;background:var(--accent);border-radius:5px;color:#fff;margin-right:8px}main{padding:21px 15px 30px}h1{font-size:25px}.page-heading{align-items:flex-start;flex-direction:column;margin-bottom:18px;gap:10px}.page-heading>.actions{width:100%}.page-heading>.actions a{flex:1}.page-heading .muted{font-size:13px}.eyebrow{font-size:12px}.metrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.metric{padding:15px 13px}.metric strong{font-size:24px;gap:4px}.metric strong small{font-size:13px}.metric p{font-size:12px}.toolbar{padding:13px;gap:10px}.toolbar label{flex:1;min-width:0;flex-direction:column;align-items:stretch;gap:4px}.toolbar select{max-width:none}.period-form label{flex:1;flex-direction:row;align-items:center}.period-form .segmented{width:100%;justify-content:space-between}.segmented button{flex:1}.period-range{font-size:12px}.panel-heading{padding:17px 15px}h2{font-size:16px}.panel{margin-bottom:17px}.dashboard-grid{gap:0}.empty{padding:36px 14px}.empty p{max-width:240px;margin-left:auto;margin-right:auto}th,td{padding:12px 15px}.document-table{white-space:normal}.document-table thead{display:none}.document-table tbody{display:block}.document-table tr{display:grid;grid-template-columns:1fr 1fr;padding:14px 15px;border-bottom:1px solid var(--line);gap:6px}.document-table td{padding:0;border:0}.document-table td:nth-child(1){font-size:12px}.document-table td:nth-child(1) small{display:inline;margin-left:7px}.document-table td:nth-child(2){text-align:right}.document-table td:nth-child(3){grid-column:1/-1;grid-row:2;font-size:14px}.document-table td:nth-child(4){grid-row:3;grid-column:1;text-align:left;font-size:19px}.document-table td:nth-child(5){grid-row:3;grid-column:2;text-align:right;align-self:center}.truncate{max-width:100%}.footer{padding:0 15px 90px;font-size:12px;display:block}.footer span{display:block;margin-top:4px}.mobile-nav{display:flex;position:fixed;bottom:0;left:0;right:0;z-index:5;background:#fffdf9;border-top:1px solid var(--line);padding:7px 6px calc(7px + env(safe-area-inset-bottom))}.mobile-nav a{flex:1;display:flex;flex-direction:column;text-align:center;line-height:1.3;gap:4px;font-size:23px;color:#8b8278}.mobile-nav a span{font-size:12px}.mobile-nav a.active{color:var(--accent)}.form-panel{padding:18px}.form-grid{gap:17px;grid-template-columns:1fr;margin:8px 0}.entry-row{grid-template-columns:1fr 1fr;gap:13px;padding:18px;position:relative}.entry-row .product-field{grid-column:1/-1;padding-right:55px}.entry-row .amount{width:100%}.entry-row>label:nth-child(4){grid-column:1/-1}.entry-row button{position:absolute;right:12px;top:19px;margin-top:25px}.save-dock{bottom:74px;padding:14px;flex-direction:column;align-items:stretch;gap:12px}.save-dock>div:first-child{display:flex;justify-content:space-between;align-items:center}.save-dock strong{font-size:24px}.save-dock .actions{display:grid;grid-template-columns:auto 1fr 1fr;gap:7px}.save-dock button,.save-dock .button{padding:7px 10px;font-size:13px}.detail-meta{font-size:12px;gap:8px;flex-direction:column}.detail-total strong{font-size:23px}.login-wrap{padding-top:38px;max-width:440px}.login-card{padding:26px}.login-wrap>.brand{margin-bottom:25px}.search{min-width:140px!important}.trend-table th:nth-child(2),.trend-table td:nth-child(2){display:none}}
/* Editable unit prices and final settlement */
.entry-row{grid-template-columns:minmax(180px,2fr) 65px 65px minmax(120px,1fr) minmax(150px,1fr) auto}.unit-prices{display:grid;gap:10px}.entry-row .recalculate-row{position:static;margin:0;padding:2px 0;min-height:25px;justify-content:flex-start;color:var(--accent);font-size:12px;background:transparent}.settlement{display:grid;grid-template-columns:minmax(230px,1fr) minmax(200px,1fr);gap:28px;align-items:center}.settlement #actual-total{font-size:24px;font-weight:600}.settlement .small{margin-top:10px}.save-dock>div:first-child{display:flex;gap:16px;flex-wrap:wrap}
@media(max-width:1150px){.entry-row{grid-template-columns:minmax(160px,2fr) 60px 60px minmax(120px,1fr)}.entry-row .amount-field{grid-column:1/4}.entry-row>.remove-row{grid-column:4;margin-top:20px}}
@media(max-width:760px){.entry-row{grid-template-columns:1fr 1fr;gap:14px}.entry-row>.product-field{grid-column:1/-1}.entry-row>.unit-prices{grid-column:1/-1;grid-template-columns:1fr 1fr}.entry-row>.amount-field{grid-column:1/-1}.entry-row>.remove-row{grid-column:auto;top:19px;right:12px;position:absolute;margin-top:25px}.entry-row .recalculate-row{position:static;margin:0;min-height:32px}.settlement{grid-template-columns:1fr;gap:14px}}
/* Compact operational layout */
.sidebar nav{margin-top:34px}.topbar{position:sticky;top:0;z-index:10;height:66px;background:#fffdf9}.top-home{font-weight:600}.top-actions{display:flex;align-items:center;gap:10px}.account-link{display:flex;align-items:center;gap:8px;margin-left:10px}.page-heading{margin-bottom:18px}.page-heading h1{margin:0;font-size:25px}main{padding-top:23px;padding-bottom:30px}.metric{padding:17px 20px}.metric strong{margin:12px 0 0}.empty{padding:25px 15px}.empty h3{font-size:14px;margin:0;color:var(--muted)}.panel-heading{padding:15px 20px}.panel{margin-bottom:18px}.metrics{margin-bottom:18px}.settlement{grid-template-columns:1fr;padding:18px 22px}.settlement>div{display:grid;grid-template-columns:1fr minmax(200px,300px) auto;align-items:end;gap:12px}.settlement #total-adjustment{grid-column:1/-1;grid-row:2;margin:0}.settlement #total-adjustment:empty{display:none}.settlement #reset-total{grid-column:3;grid-row:1}.settlement #actual-total{font-size:22px}.price-details{margin:15px 0;color:var(--muted)}.price-details summary{cursor:pointer}.price-details textarea{margin-top:12px}.product-actions{display:flex;gap:8px;align-items:center}.product-actions .button{min-height:34px;padding:5px 12px}.notice.success{padding:8px 14px}.entry-row .stock-hint:empty,.entry-row .amount-hint:empty{display:none}.form-panel{padding:20px}.form-grid{margin:0;gap:18px}.form-panel>h2{margin-bottom:16px}
@media(max-width:760px){.topbar{height:62px;padding:0 15px}.top-home{font-size:14px}.top-actions{gap:7px}.top-actions .button{min-height:40px;padding:8px 12px;font-size:13px}.account-link{margin-left:2px}.account-name{display:none}main{padding:18px 15px 92px}.page-heading{margin-bottom:15px}.page-heading h1{font-size:23px}.metric{padding:14px}.metric strong{margin-top:10px}.empty{padding:22px 12px}.panel-heading{padding:13px 15px}.settlement{padding:16px}.settlement>div{grid-template-columns:1fr auto;gap:10px}.settlement>div>p:first-child{grid-column:1/-1;margin:0}.settlement #reset-total{grid-column:2;grid-row:2;padding:8px}.settlement #total-adjustment{grid-row:3}.page-entry .mobile-nav{display:none}.page-entry main{padding-bottom:145px}.page-entry .save-dock{position:fixed;bottom:0;left:0;right:0;border-radius:0;border-width:1px 0 0;padding:12px 15px calc(12px + env(safe-area-inset-bottom));gap:8px;z-index:20}.page-entry .save-dock strong{font-size:23px}.page-entry .save-dock button{min-height:44px}.page-product .form-actions{position:sticky;bottom:76px;background:var(--paper);padding:12px 0}.product-actions{gap:6px}}
@media(max-width:760px){.product-table thead{display:none}.product-table tbody{display:block}.product-table tr{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:16px;border-bottom:1px solid var(--line)}.product-table td{border:0;padding:0;text-align:left;min-width:0;white-space:normal}.product-table td:nth-child(1){font-size:15px;font-weight:600}.product-table td:nth-child(1) small{display:none}.product-table td:nth-child(2){text-align:right;color:var(--muted);font-size:12px}.product-table td:nth-child(3):before{content:'进价';display:block;color:var(--muted);font-size:12px;margin-bottom:3px}.product-table td:nth-child(4):before{content:'售价';display:block;color:var(--muted);font-size:12px;margin-bottom:3px}.product-table td:nth-child(5):before{content:'库存 ';color:var(--muted)}.product-table td:nth-child(6){text-align:right}.product-table td:nth-child(7){grid-column:1/-1}.product-actions{display:grid;grid-template-columns:1fr 1fr auto}.product-actions .button{min-height:40px}.product-actions>.text-link{padding:8px}}
/* Shared navigation icon geometry for desktop and H5. */
.nav-icon{display:block;width:20px;height:20px;flex:0 0 20px;color:inherit}.sidebar nav a{min-height:46px;gap:12px;align-items:center}.sidebar nav a .nav-label-text{font-size:14px;line-height:22px;width:auto;white-space:nowrap}.mobile-nav a{align-items:center;justify-content:center}.mobile-nav .nav-icon{width:21px;height:21px;flex:0 0 21px}
/* H5 uses native page scrolling without a persistent desktop scrollbar. */
@media(max-width:760px){
 html,body{scrollbar-width:none;-ms-overflow-style:none}
 html::-webkit-scrollbar,body::-webkit-scrollbar{display:none;width:0;height:0}
 .page-products .table-scroll{overflow:visible;max-height:none}
 .page-products .product-table{width:100%}
}
/* Larger thumb targets in the mobile app bar. */
@media(max-width:760px){
 .topbar{height:76px;padding:0 12px;gap:8px}
 .topbar .top-home{font-size:14px;white-space:nowrap;flex-shrink:0}
 .top-actions{gap:8px}
 .top-actions .quick-entry{min-height:50px;min-width:92px;padding:10px 14px;border-radius:12px;font-size:16px;font-weight:600;line-height:1.25;touch-action:manipulation}
 .top-actions .quick-entry:active{transform:scale(.97)}
 .account-link{min-width:40px;min-height:48px;justify-content:center;margin-left:0}
}
@media(max-width:359px){
 .top-actions{gap:6px}
 .top-actions .quick-entry{min-width:80px;padding:10px;font-size:15px}
}
/* Mobile home: large functional entrances before bookkeeping summaries. */
.home-launcher,.home-summary-heading{display:none}
@media(max-width:760px){
 .page-dashboard .topbar{height:64px}
 .page-dashboard .topbar .top-home{font-size:20px;font-weight:700}
 .page-dashboard .top-actions .quick-entry{display:none}
 .page-dashboard main>.page-heading{display:none}
 .page-dashboard main{padding-top:18px}
 .home-launcher{display:block;margin-bottom:28px}
 .home-main-actions,.home-feature-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
 .home-main-actions{margin-bottom:12px}
 .home-tile{min-height:146px;position:relative;display:flex;flex-direction:column;justify-content:space-between;align-items:flex-start;padding:20px;border:1px solid var(--line);border-radius:12px;background:#fff}
 .home-sale{background:#fbede5;border-color:#ebcaba;color:#9a452c}
 .home-purchase{background:#eef3ed;border-color:#d9e4d7;color:#3e6546}
 .home-tile-icon{display:grid;place-items:center;width:44px;height:44px;border-radius:12px;background:#fff9}
 .home-tile-icon svg{width:28px;height:28px}
 .home-tile strong{font-size:22px;font-weight:600;line-height:1.4}
 .home-arrow{position:absolute;right:18px;bottom:20px;font-size:23px}
 .home-feature{min-height:108px;position:relative;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:12px;padding:16px;border:1px solid var(--line);border-radius:12px;background:#fff}
 .home-feature-icon{color:#8e6c51}
 .home-feature-icon .nav-icon{width:26px;height:26px}
 .home-feature strong{font-size:16px;font-weight:600;white-space:nowrap}
 .home-feature-arrow{position:absolute;right:15px;bottom:14px;color:#a89d91;font-size:22px}
 .home-tile:active,.home-feature:active{transform:scale(.98);background:var(--soft)}
 .home-summary-heading{display:flex;justify-content:space-between;align-items:center;margin:0 0 12px}
 .page-dashboard .period-form{margin-bottom:0}
}
/* Mobile period navigation and bottom date sheet. */
.mobile-period-nav{display:none}
.period-sheet{width:min(460px,calc(100% - 32px));border:0;border-radius:12px;padding:20px;color:var(--ink);background:var(--paper)}
.period-sheet::backdrop{background:#241f1b66}
.period-sheet-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px}
.period-picker-close{font-size:26px;border:0;min-width:44px;padding:0;background:transparent}
.period-sheet-form{display:grid;gap:18px}
.period-sheet-form>.primary{min-height:48px;font-size:16px;border-radius:10px;margin-top:8px}
@media(max-width:760px){
 .period-form{padding:0;background:transparent;border:0;border-radius:0;display:block}
 .period-form .period-desktop,.period-links{display:none}
 .period-form .segmented{background:#eeebe5;border:0;padding:4px;border-radius:12px;gap:4px}
 .period-form .segmented button{height:42px;border-radius:9px;font-size:15px;color:var(--muted)}
 .period-form .segmented button.selected{background:#fff;color:var(--accent);font-weight:600;box-shadow:0 1px 4px #29262012}
 .mobile-period-nav{display:flex;align-items:center;gap:2px;margin:8px 0 20px;min-height:48px}
 .mobile-period-nav>a:not(.period-current){width:40px;min-height:46px;display:grid;place-items:center;font-size:28px;color:#8a8075;flex-shrink:0}
 .period-picker-open{flex:1;min-width:0;padding:8px 2px;min-height:46px;border:0;background:transparent;font-weight:600;font-size:15px;gap:8px}
 .period-picker-open>span{color:var(--muted);font-size:17px}
 .mobile-period-nav .period-current{font-size:13px;color:var(--accent);padding:12px 4px;white-space:nowrap}
 .period-sheet{position:fixed;inset:auto 0 0;margin:0;width:100%;max-width:none;max-height:85dvh;border-radius:18px 18px 0 0;padding:20px 20px calc(24px + env(safe-area-inset-bottom))}
 .period-sheet-form input{min-height:48px;font-size:16px}
}
@media(max-width:359px){.period-picker-open{font-size:13px}.mobile-period-nav>a:not(.period-current){width:32px}}
@media(max-width:760px){
 .page-documents .panel>.toolbar{display:grid;grid-template-columns:1fr 1fr;align-items:end}
 .page-documents .panel>.toolbar label{width:100%;min-width:0}
 .page-documents .panel>.toolbar button{grid-column:1;min-height:44px}
 .page-documents .panel>.toolbar .muted{grid-column:2;text-align:right;align-self:center}
}
/* Consistent phone layouts across lists, reports and forms. */
@media(max-width:760px){
 body{line-height:1.55;-webkit-text-size-adjust:100%}
 main{padding:18px 14px calc(90px + env(safe-area-inset-bottom))}
 .topbar{padding-top:env(safe-area-inset-top);height:calc(76px + env(safe-area-inset-top))}
 .page-dashboard .topbar{height:calc(64px + env(safe-area-inset-top))}
 .page-heading h1{font-size:22px;line-height:1.4}
 .panel{border-radius:12px;margin-bottom:16px}
 .panel-heading{min-height:54px;padding:14px 16px}
 input,select,textarea{font-size:16px;min-height:46px;border-radius:9px}
 label{font-size:14px;gap:8px}
 button,.button{min-height:44px;border-radius:9px}
 .text-link{display:inline-flex;align-items:center;min-height:40px}
 .mobile-nav{padding-top:9px;padding-bottom:calc(9px + env(safe-area-inset-bottom))}
 .mobile-nav a{min-height:42px;gap:5px}
 .metrics{gap:10px;margin-bottom:18px}
 .metric{border-radius:12px;padding:14px 12px}
 .metric strong{font-size:clamp(19px,5.7vw,26px);flex-wrap:wrap;overflow-wrap:anywhere;white-space:normal;gap:3px}
 .metric>div{font-size:13px}
 .badge{padding:3px 6px}
 .period-form .segmented button{transition:none}
 .period-picker-open{white-space:normal;line-height:1.45}
 .page-products .panel{background:transparent;border:0;overflow:visible}
 .page-products .toolbar{border:1px solid var(--line);border-radius:12px;margin-bottom:12px;display:grid;grid-template-columns:minmax(0,1fr) auto;padding:14px;gap:10px}
 .page-products .toolbar .search{min-width:0!important}
 .page-products .toolbar .push-right{grid-column:1/-1;width:100%;margin:0}
 .product-table tbody{display:grid;gap:12px}
 .product-table tr{background:#fff;border:1px solid var(--line)!important;border-radius:12px;padding:16px;gap:12px}
 .product-table td:nth-child(1){overflow-wrap:anywhere}
 .product-actions .button,.product-actions>.text-link{min-height:44px;justify-content:center}
 .document-table tr{padding:16px;gap:10px}
 .document-table .truncate{white-space:normal;overflow-wrap:anywhere}
 .pagination{padding:14px;gap:12px;font-size:13px}
 .page-documents .toolbar select{font-size:14px}
 .trend-table{max-height:none;overflow:visible}
 .trend-table table{table-layout:fixed;white-space:normal}
 .trend-table th,.trend-table td{padding:13px 9px;font-size:12px;overflow-wrap:anywhere}
 .trend-table th:first-child{width:34%}
 .report-products-table,.detail-items-table{white-space:normal}
 .report-products-table thead,.detail-items-table thead{display:none}
 .report-products-table tbody,.detail-items-table tbody{display:block}
 .report-products-table tr,.detail-items-table tr{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:14px;padding:16px;border-bottom:1px solid var(--line)}
 .report-products-table td,.detail-items-table td{padding:0;border:0;text-align:left;min-width:0;overflow-wrap:anywhere;font-size:14px}
 .report-products-table td:first-child,.detail-items-table td:first-child{grid-column:1/-1;font-size:16px;font-weight:600}
 .report-products-table td:before,.detail-items-table td:before{display:block;font-size:12px;color:var(--muted);margin-bottom:4px}
 .report-products-table td:nth-child(2):before{content:'进货数量'}
 .report-products-table td:nth-child(3):before{content:'销售数量'}
 .report-products-table td:nth-child(4):before{content:'进货金额'}
 .report-products-table td:nth-child(5):before{content:'销售金额'}
 .detail-items-table td:nth-child(2):before{content:'数量'}
 .detail-items-table td:nth-child(3):before{content:'单价 / 原小计'}
 .detail-items-table td:nth-child(4){grid-column:1/-1;display:flex;justify-content:space-between;align-items:center;font-size:19px;color:var(--accent)}
 .detail-items-table td:nth-child(4):before{content:'入账金额';margin:0}
 .form-panel{padding:16px}
 .entry-row{padding:16px;gap:16px}
 .entry-row>.product-field{padding-right:0}
 .entry-row>.remove-row{top:6px;right:12px;margin:0;min-height:36px;padding:4px 8px}
 .entry-row .stock-hint{line-height:1.6;overflow-wrap:anywhere}
 .entry-row .unit-prices{gap:12px}
 .entry-row .recalculate-row{min-height:40px}
 .add-row{padding:14px 16px}
 #add-row{width:100%;border-style:dashed;color:var(--accent)}
 .settlement>div{grid-template-columns:minmax(0,1fr) auto}
 .settlement #actual-total{font-size:22px}
 .page-entry main{padding-bottom:calc(176px + env(safe-area-inset-bottom))}
 .page-entry .save-dock .actions{grid-template-columns:auto minmax(0,1fr) minmax(0,1fr)}
 .page-entry .save-dock button{font-size:14px;min-height:48px}
 .page-entry .save-dock .button{min-height:48px}
 .page-product .mobile-nav{display:none}
 .page-product main{padding-bottom:calc(100px + env(safe-area-inset-bottom))}
 .page-product .form-actions{position:fixed;bottom:0;left:0;right:0;z-index:20;background:var(--paper);border-top:1px solid var(--line);padding:12px 16px calc(12px + env(safe-area-inset-bottom));margin:0;display:grid;grid-template-columns:1fr 2fr}
 .page-product .form-actions>*{min-height:48px}
 .page-account .form-stack{max-width:none;margin:20px 0;gap:18px}
 .page-account form>button{width:100%;min-height:48px}
 .page-account h2{overflow-wrap:anywhere}
 .page-account hr{margin:24px 0}
 .page-detail .panel-heading{padding:0 0 16px;flex-wrap:wrap}
 .detail-meta{font-size:13px;overflow-wrap:anywhere}
 .detail-total{gap:12px;flex-wrap:wrap}
 .detail-total strong{overflow-wrap:anywhere}
 .page-detail .table-note{padding:0;margin-top:16px;line-height:1.7}
 .page-detail .form-actions{display:grid;grid-template-columns:1fr 1fr}
 .login-wrap{padding:36px 16px calc(24px + env(safe-area-inset-bottom))}
 .login-card{padding:24px 20px}
 .login-card .primary{min-height:48px}
}
@media(max-width:760px){
 .metric strong.long-amount{font-size:16px;gap:2px;flex-wrap:nowrap;white-space:nowrap}
 .metric strong.long-amount small{font-size:12px}
 .trend-table table{table-layout:auto}
 .trend-table thead{display:none}
 .trend-table tbody{display:block}
 .trend-table tr{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px;padding:14px 16px;border-bottom:1px solid var(--line)}
 .trend-table td{border:0;padding:0;text-align:left;font-size:14px;min-width:0}
 .trend-table td:first-child{grid-column:1/-1;font-size:13px;color:var(--muted)}
 .trend-table td:nth-child(3):before,.trend-table td:nth-child(4):before{display:block;font-size:12px;color:var(--muted);margin-bottom:4px}
 .trend-table td:nth-child(3):before{content:'销售收入'}
 .trend-table td:nth-child(4):before{content:'进货支出'}
}
