:root{
  --bg:#f2f4f7; --card:#ffffff; --text:#101828; --muted:#667085;
  --line:#eaecf0; --green:#039855; --red:#d92d20; --brand:#175cd3;
}
*{box-sizing:border-box}
[hidden]{display:none !important}
html,body{margin:0;padding:0}
body{
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;
  background:var(--bg); color:var(--text); line-height:1.5; -webkit-font-smoothing:antialiased;
}
.topbar{
  position:sticky; top:0; z-index:10; display:flex; align-items:center; justify-content:space-between;
  gap:12px; padding:14px 16px; background:var(--card); border-bottom:1px solid var(--line);
}
.topbar h1{font-size:17px; margin:0; font-weight:600}
.topbar input[type=month]{border:1px solid var(--line); border-radius:8px; padding:6px 10px; font-size:14px; color:var(--text); background:#fff}
.month-box{display:flex; align-items:center; gap:6px}
.month-btn{border:1px solid #c7d7fe; background:#eef4ff; color:var(--brand); border-radius:8px; padding:6px 12px; font-size:14px; font-weight:600; cursor:pointer; white-space:nowrap}
.month-btn:hover{background:#e0ebff}
.month-btn:disabled{background:var(--bg); color:var(--muted); border-color:var(--line); cursor:default}
main{max-width:760px; margin:0 auto; padding:16px; padding-bottom:48px}
.nav-buttons{display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-bottom:16px}
.nav-btn{padding:14px 8px; border:1px solid var(--line); border-radius:12px; background:#fff; font-size:14px; font-weight:600; cursor:pointer; display:flex; flex-direction:column; align-items:center; gap:5px; color:var(--text)}
.nav-btn i{font-style:normal; font-size:20px; line-height:1}
.nav-btn:active{background:var(--bg)}
.nav-btn:hover{border-color:#c7d7fe; background:#f5f8ff}
.back-btn{margin-bottom:12px; padding:8px 13px; border:1px solid var(--line); border-radius:9px; background:#fff; color:var(--brand); font-size:13px; cursor:pointer}
.entry-title{margin:0 0 14px; font-size:16px; font-weight:600}
.seg-row{display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-bottom:12px}
.seg-row .seg{margin-bottom:0}
.back-btn:hover{background:#eef4ff; border-color:#c7d7fe}
.screen{display:block}
.big-sum{background:#fff; border:1px solid var(--line); border-radius:14px; padding:18px; margin-bottom:14px; display:flex; flex-direction:column; gap:6px}
.big-sum span{font-size:12px; color:var(--muted)}
.big-sum strong{font-size:28px; font-weight:700; letter-spacing:-.5px; font-variant-numeric:tabular-nums}
.big-sum em{font-size:12px; color:var(--muted); font-style:normal}
.big-sum.income strong{color:var(--green)}
.big-sum.expense strong{color:var(--red)}
.add-btn{width:100%; padding:13px; border:0; border-radius:12px; font-size:16px; font-weight:600; cursor:pointer; margin-bottom:16px; color:#fff}
.add-btn.income{background:var(--green)}
.add-btn.expense{background:var(--red)}
.add-btn:active{opacity:.85}
.h2-sub{float:right; font-weight:400; color:var(--muted)}
.link-row{display:flex; flex-wrap:wrap; gap:8px}
.tabbar{position:fixed; left:0; right:0; bottom:0; z-index:40; display:flex; background:#fff; border-top:1px solid var(--line); padding:6px 0 calc(6px + env(safe-area-inset-bottom))}
.tab{flex:1; border:0; background:transparent; display:flex; flex-direction:column; align-items:center; gap:2px; padding:6px 0; cursor:pointer; color:var(--muted); font-size:11px}
.tab i{font-style:normal; font-size:19px; line-height:1}
.tab.active{color:var(--brand); font-weight:600}
.balance-delta{font-size:13px; font-weight:700; font-style:normal; animation:pop .55s ease}
.balance-delta.up{color:var(--green)}
.balance-delta.down{color:var(--red)}
.row-delta{font-style:normal; font-size:11px; font-weight:600; margin-left:3px; animation:pop .55s ease}
.row-delta.up{color:var(--green)}
.row-delta.down{color:var(--red)}
@keyframes pop{0%{transform:scale(.6); opacity:0} 60%{transform:scale(1.18)} 100%{transform:scale(1); opacity:1}}
.cards{display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-bottom:16px}
.card{background:var(--card); border:1px solid var(--line); border-radius:12px; padding:12px; display:flex; flex-direction:column; gap:6px}
.card span{font-size:12px; color:var(--muted)}
.card strong{font-size:17px; font-weight:600; letter-spacing:-.3px; font-variant-numeric:tabular-nums}
.card:nth-child(1) strong{color:var(--green)}
.card:nth-child(2) strong{color:var(--red)}
.card strong.neg{color:var(--red)}
.panel{background:var(--card); border:1px solid var(--line); border-radius:14px; padding:16px; margin-bottom:16px}
.panel h2{font-size:13px; margin:0 0 12px; font-weight:600; color:var(--muted)}
.seg{display:inline-flex; background:var(--bg); border-radius:10px; padding:3px; margin-bottom:12px}
.seg label{cursor:pointer}
.seg input{display:none}
.seg span{display:block; padding:6px 18px; border-radius:8px; font-size:14px; color:var(--muted); transition:.15s}
.seg input:checked + span{background:#fff; color:var(--text); box-shadow:0 1px 3px rgba(16,24,40,.12); font-weight:600}
.seg input[value=expense]:checked + span{color:var(--red)}
.seg input[value=income]:checked + span{color:var(--green)}
.grid{display:grid; grid-template-columns:1fr 1fr; gap:10px}
.grid label{display:flex; flex-direction:column; gap:5px; font-size:12px; color:var(--muted)}
.grid input[type=text],.grid input[type=number],.grid input[type=date],.grid input[type=datetime-local],.grid select{border:1px solid var(--line); border-radius:9px; padding:9px 11px; font-size:15px; color:var(--text); background:#fff; width:100%}
.grid select{appearance:none; background-image:linear-gradient(45deg,transparent 50%,var(--muted) 50%),linear-gradient(135deg,var(--muted) 50%,transparent 50%); background-position:calc(100% - 15px) 50%,calc(100% - 10px) 50%; background-size:5px 5px,5px 5px; background-repeat:no-repeat; padding-right:30px}
.grid input:focus{outline:2px solid rgba(23,92,211,.25); border-color:var(--brand)}
.att-field{grid-column:1/-1}
.att-field input[type=file]{font-size:13px; color:var(--muted); padding:6px 0}
.filelist{font-size:12px; color:var(--muted); margin:6px 0 0; word-break:break-all}
button[type=submit]{margin-top:12px; width:100%; padding:11px; border:0; border-radius:10px; background:var(--brand); color:#fff; font-size:15px; font-weight:600; cursor:pointer}
button[type=submit]:active{opacity:.85}
button[type=submit]:disabled{opacity:.6; cursor:default}
.msg{font-size:13px; margin:8px 0 0; min-height:18px}
.msg.ok{color:var(--green)}
.msg.err{color:var(--red)}
.list{list-style:none; margin:0; padding:0; display:flex; flex-direction:column}
.item{display:flex; align-items:flex-start; gap:10px; padding:12px 0; border-bottom:1px solid var(--line)}
.item:last-child{border-bottom:0}
.item-main{flex:1; min-width:0}
.item-top{display:flex; justify-content:space-between; gap:10px; align-items:baseline}
.cat{font-size:14px; font-weight:500; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.amt{font-size:15px; font-weight:600; font-variant-numeric:tabular-nums; white-space:nowrap}
.amt.income{color:var(--green)}
.item-sub{display:flex; gap:10px; font-size:12px; color:var(--muted); margin-top:2px}
.item-sub .note{overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.chip{background:#eef4ff; color:var(--brand); border-radius:6px; padding:1px 7px; font-size:11px; white-space:nowrap}
.item-detail{font-size:13px; color:var(--text); margin-top:3px; word-break:break-all}
.actions{display:flex; flex-direction:column; gap:6px}
.icon-btn{width:28px; height:28px; border-radius:8px; border:1px solid var(--line); background:#fff; color:var(--muted); font-size:14px; line-height:1; cursor:pointer; padding:0}
.icon-btn:hover{border-color:var(--brand); color:var(--brand)}
.icon-btn.del:hover{border-color:var(--red); color:var(--red); background:#fef3f2}
.atts{display:flex; flex-wrap:wrap; gap:8px; margin-top:8px}
.att-img{position:relative; display:inline-block}
.att-img img{width:64px; height:64px; object-fit:cover; border-radius:8px; border:1px solid var(--line); display:block; background:var(--bg)}
.att-img .att-del{position:absolute; top:-6px; right:-6px; width:20px; height:20px; border-radius:50%; border:1px solid var(--line); background:#fff; color:var(--muted); font-size:13px; line-height:1; cursor:pointer; padding:0}
.att-img .att-del:hover{background:#fef3f2; color:var(--red); border-color:var(--red)}
.att-file{display:inline-flex; align-items:center; gap:6px; background:var(--bg); border:1px solid var(--line); border-radius:8px; padding:5px 9px; font-size:12px; max-width:100%}
.att-file a{color:var(--brand); text-decoration:none; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:180px}
.att-file em{color:var(--muted); font-style:normal}
.att-file button{border:0; background:transparent; color:var(--muted); font-size:14px; line-height:1; cursor:pointer; padding:0}
.att-file button:hover{color:var(--red)}
.auth-wrap{min-height:100vh; display:flex; align-items:center; justify-content:center; padding:20px}
.auth-card{background:#fff; border:1px solid var(--line); border-radius:16px; padding:24px; width:100%; max-width:380px; box-shadow:0 8px 30px rgba(16,24,40,.08)}
.auth-logo{margin:0 0 18px; font-size:18px; text-align:center; font-weight:600}
.auth-tabs{display:flex; background:var(--bg); border-radius:10px; padding:3px; margin-bottom:18px}
.auth-tab{flex:1; border:0; background:transparent; padding:8px; border-radius:8px; font-size:14px; color:var(--muted); cursor:pointer; font-weight:600}
.auth-tab.active{background:#fff; color:var(--text); box-shadow:0 1px 3px rgba(16,24,40,.12)}
.auth-form{display:flex; flex-direction:column; gap:12px}
.auth-form > label{display:flex; flex-direction:column; gap:6px; font-size:12px; color:var(--muted)}
.auth-form input[type=text],.auth-form input[type=password]{border:1px solid var(--line); border-radius:9px; padding:10px 12px; font-size:15px; background:#fff; color:var(--text); width:100%}
.auth-form input:focus{outline:2px solid rgba(23,92,211,.25); border-color:var(--brand)}
.auth-form .btn-primary{padding:11px; border:0; border-radius:10px; background:var(--brand); color:#fff; font-size:15px; font-weight:600; cursor:pointer; margin-top:4px}
.auth-field{display:flex; flex-direction:column; gap:6px; font-size:12px; color:var(--muted)}
.auth-label{font-size:12px}
.gender-row{display:flex; gap:8px}
.gender-opt{flex:1; display:flex; align-items:center; justify-content:center; gap:5px; border:1px solid var(--line); border-radius:9px; padding:9px; font-size:14px; color:var(--text); cursor:pointer}
.gender-opt input{accent-color:var(--brand)}
.gender-opt:has(input:checked){border-color:var(--brand); background:#eef4ff; color:var(--brand); font-weight:600}
.topbar-right{display:flex; align-items:center; gap:10px; flex-wrap:wrap; justify-content:flex-end}
.user-box{display:flex; align-items:center; gap:8px}
.user-label{font-size:13px; color:var(--muted); max-width:150px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.link-btn{border:0; background:transparent; color:var(--brand); font-size:13px; cursor:pointer; padding:4px 6px}
.link-btn:hover{text-decoration:underline}
.scope-info{font-size:12px; color:var(--muted); margin:0; flex:1; min-width:0; word-break:break-all; line-height:1.5}
.scope-info.active{color:var(--brand); font-weight:600}
.f-field{display:flex; flex-direction:column; gap:6px; margin-bottom:14px}
.f-label{font-size:12px; color:var(--muted)}
.f-inline{display:flex; align-items:center; gap:8px}
.f-inline input[type=month],.f-inline input[type=date]{flex:1; min-width:0; max-width:160px; border:1px solid var(--line); border-radius:9px; padding:9px 11px; font-size:14px; background:#fff; color:var(--text)}
.f-inline input[type=month]:focus,.f-inline input[type=date]:focus{outline:2px solid rgba(23,92,211,.25); border-color:var(--brand)}
.f-tilde{flex:0 0 auto; color:var(--muted); font-size:13px}
.f-btn{flex:0 0 auto; border:1px solid #c7d7fe; background:#eef4ff; color:var(--brand); border-radius:9px; padding:9px 15px; font-size:13px; font-weight:600; cursor:pointer}
.f-btn:hover{background:#e0ebff}
.f-btn:disabled{background:var(--bg); color:var(--muted); border-color:var(--line); cursor:default}
.f-grid{display:grid; grid-template-columns:repeat(auto-fit, minmax(130px, 1fr)); gap:12px; margin-bottom:16px}
.reimburse-row{margin:14px 0}
.reimburse-btn{width:100%; padding:11px; border:1px dashed var(--line); border-radius:10px; background:#fff; color:var(--muted); font-size:14px; font-weight:600; cursor:pointer}
.reimburse-btn:hover{border-color:#f7b27a; color:#b54708; background:#fffbf7}
.reimburse-btn.on{border:1px solid #f7b27a; border-style:solid; background:#fff4ed; color:#b54708}
.chip-reimburse{background:#fff4ed; color:#b54708}
.f-grid .f-field{margin-bottom:0}
.f-grid select{border:1px solid var(--line); border-radius:9px; padding:9px 11px; font-size:14px; background:#fff; color:var(--text); width:100%}
.f-grid select:focus{outline:2px solid rgba(23,92,211,.25); border-color:var(--brand)}
.f-foot{display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; border-top:1px solid var(--line); padding-top:14px}
.f-clear{flex:0 0 auto; border:1px solid var(--line); background:#fff; color:var(--brand); border-radius:9px; padding:8px 15px; font-size:13px; cursor:pointer}
.f-clear:hover{background:#eef4ff; border-color:#c7d7fe}
.f-clear:disabled{color:var(--muted); background:var(--bg); border-color:var(--line); cursor:default}
.f-export{flex:0 0 auto; border:1px solid var(--brand); background:var(--brand); color:#fff; border-radius:9px; padding:8px 15px; font-size:13px; font-weight:600; cursor:pointer}
.f-export:hover{opacity:.9}
.f-export:disabled{opacity:.6; cursor:default}
#exportZipBtn:disabled{color:var(--muted); background:var(--bg); cursor:default}
.data-table{width:100%; border-collapse:collapse; font-size:13px}
.data-table th{text-align:left; color:var(--muted); font-weight:500; font-size:11px; padding:6px 8px; border-bottom:1px solid var(--line); white-space:nowrap}
.data-table td{padding:9px 8px; border-bottom:1px solid var(--line); vertical-align:top}
.data-table tr:last-child td{border-bottom:0}
.data-table .col-idx{width:40px; text-align:right; color:var(--muted); font-variant-numeric:tabular-nums; white-space:nowrap}
.data-table .col-amount{text-align:right; white-space:nowrap; font-weight:600; font-variant-numeric:tabular-nums}
.data-table .col-amount.income{color:var(--green)}
.data-table .col-amount.expense{color:var(--text)}
.data-table .col-date{white-space:nowrap; color:var(--muted); font-size:12px}
.data-table .col-date em{display:block; font-style:normal; font-size:11px}
.data-table .col-detail{min-width:130px; word-break:break-all}
.att-count{display:inline-block; margin-left:6px; color:var(--muted); font-size:11px; white-space:nowrap}
.data-table .col-note{color:var(--muted); max-width:180px; word-break:break-all}
.data-table .col-ops{white-space:nowrap; text-align:right}
.data-table .muted{color:var(--muted)}
.reim-yes{color:#b54708; font-weight:600}
.data-table .att-groups{margin-top:6px}
.data-table .att-group-name{flex:0 0 46px; font-size:10px}
.data-table .att-img img{width:36px; height:36px}
.data-table .icon-btn{width:26px; height:26px; font-size:12px; margin-left:3px}
.gal-list{display:flex; flex-direction:column; gap:14px}
.gal-item{border:1px solid var(--line); border-radius:10px; padding:11px; break-inside:avoid; content-visibility:auto; contain-intrinsic-size:auto 200px}
.gal-head{display:flex; flex-wrap:wrap; align-items:baseline; gap:8px; font-size:13px; margin-bottom:9px}
.gal-idx{display:inline-flex; align-items:center; justify-content:center; min-width:22px; height:22px; border-radius:50%; background:var(--bg); color:var(--muted); font-size:12px; font-weight:600}
.gal-cat{font-weight:600}
.gal-amt{font-weight:600}
.gal-amt.income{color:var(--green)}
.gal-date,.gal-method,.gal-detail{color:var(--muted); font-size:12px}
.gal-atts{display:flex; flex-wrap:wrap; gap:10px}
.gal-fig{margin:0; width:132px}
.gal-fig img{width:132px; height:132px; object-fit:cover; border:1px solid var(--line); border-radius:8px; background:var(--bg); display:block}
.gal-fig figcaption{font-size:11px; color:var(--muted); margin-top:4px; word-break:break-all}
.gal-img-wrap{position:relative; display:inline-block}
.gal-del{position:absolute; top:-7px; right:-7px; width:20px; height:20px; border-radius:50%; border:1px solid var(--line); background:#fff; color:var(--muted); font-size:13px; line-height:1; cursor:pointer; padding:0}
.gal-del:hover{background:#fef3f2; color:var(--red); border-color:var(--red)}
.gal-file{position:relative; display:flex; flex-direction:column; gap:2px; border:1px solid var(--line); border-radius:8px; padding:8px 22px 8px 10px; font-size:12px; min-width:150px}
.gal-file-del{position:absolute; top:4px; right:4px; width:18px; height:18px; border-radius:50%; border:0; background:transparent; color:var(--muted); font-size:13px; line-height:1; cursor:pointer; padding:0}
.gal-file-del:hover{color:var(--red)}
.gal-file a{color:var(--brand); text-decoration:none; word-break:break-all}
.gal-file em{font-style:normal; color:var(--muted); font-size:11px}
.gal-kind{color:var(--muted); font-size:11px}
.print-only{display:none}
@media print{
  .topbar,.back-btn,.f-inline,.f-grid,.f-clear,.f-export,.col-ops,.chip,.att-del,.modal,.tabbar{display:none !important}
  #attGalleryPanel{display:none !important}
  .print-only{display:block !important; font-size:12px; color:#000; margin:0 0 10px}
  body{background:#fff}
  main{max-width:none; padding:0; margin:0}
  .panel{border:0; border-radius:0; padding:0 0 14px; margin:0 0 14px}
  .table-scroll{overflow:visible}
  .data-table th,.data-table td,.stat-table th,.stat-table td{border-color:#bbb}
  .scope-info{color:#000}
  .screen[hidden]{display:none !important}
}
.filter-row{display:flex; flex-wrap:wrap; gap:10px; align-items:flex-end}
.filter-row label{display:flex; flex-direction:column; gap:5px; font-size:12px; color:var(--muted); flex:1; min-width:130px}
.filter-row select,.filter-row input[type=month]{border:1px solid var(--line); border-radius:9px; padding:9px 11px; font-size:14px; background:#fff; color:var(--text); width:100%}
.filter-row-next{margin-top:10px}
.filter-row input[type=month]{max-width:220px}
.filter-row button{flex:0 0 auto; padding:9px 14px; border-radius:9px; font-size:14px; cursor:pointer}
.filter-row button:disabled{color:var(--muted); background:var(--bg); cursor:default; border-color:var(--line)}
.stats-grid{display:grid; grid-template-columns:1fr 1fr; gap:16px}
.stats-sub{font-size:12px; color:var(--muted); margin:0 0 8px; font-weight:600}
.stat-table{width:100%; border-collapse:collapse; font-size:13px}
.stat-table th{text-align:left; color:var(--muted); font-weight:500; font-size:11px; padding:4px 6px; border-bottom:1px solid var(--line)}
.stat-table td{padding:5px 6px; border-bottom:1px solid var(--line); font-variant-numeric:tabular-nums; white-space:nowrap}
.stat-table td.stat-name{font-weight:500; white-space:normal}
.stat-table td.stat-exp{color:var(--red)}
.stat-table td.stat-inc{color:var(--green)}
.stat-table td.stat-count{color:var(--muted)}
.stat-table td.stat-bal{color:var(--text); font-weight:600}
.stat-table td.stat-bal.neg{color:var(--red)}
.stat-table tr.stat-total td{border-top:2px solid var(--line); border-bottom:0; padding-top:9px; font-weight:700}
.stat-table tr.stat-total td.stat-bal{color:var(--brand)}
.stat-table tr.stat-total td.stat-bal.neg{color:var(--red)}
.stat-empty{color:var(--muted); text-align:center; padding:16px 0}
.empty{text-align:center; color:var(--muted); font-size:14px; padding:28px 0; margin:0}
@media (max-width:600px){ .stats-grid{grid-template-columns:1fr} .f-grid{grid-template-columns:1fr} .f-inline input[type=month],.f-inline input[type=date]{max-width:none} }
.att-block{margin-top:14px}
.att-block-title{font-size:12px; color:var(--muted); margin-bottom:8px}
.att-slots{display:flex; flex-direction:column; gap:10px}
.att-slot{border:1px dashed var(--line); border-radius:10px; padding:9px 11px; display:flex; flex-direction:column; gap:7px; background:#fcfcfd}
.att-slot-name{font-size:12px; font-weight:600; color:var(--text)}
.att-slot-head{display:flex; align-items:center; gap:8px}
.att-slot-head .att-slot-name{flex:0 0 auto; white-space:nowrap}
.kind-note-input{flex:1; border:1px solid var(--line); border-radius:7px; padding:5px 9px; font-size:13px; color:var(--text); background:#fff; min-width:0}
.kind-note-input:focus{outline:2px solid rgba(23,92,211,.25); border-color:var(--brand)}
.kind-note{background:#fff8e6; color:#b54708; border-radius:6px; padding:2px 8px; font-size:12px; word-break:break-all}
.edit-notes{display:flex; flex-direction:column; gap:8px; margin-top:14px}
.edit-note-row{display:flex; align-items:center; gap:8px}
.edit-note-name{flex:0 0 66px; font-size:12px; color:var(--muted); text-align:right}
.att-add-btn{display:inline-block; align-self:flex-start; font-size:12px; color:var(--brand); border:1px solid #c7d7fe; background:#eef4ff; border-radius:7px; padding:4px 10px; cursor:pointer}
.att-add-btn:hover{background:#e0ebff}
.att-pending{display:flex; flex-wrap:wrap; gap:6px}
.att-groups{margin-top:8px; display:flex; flex-direction:column; gap:7px}
.att-group{display:flex; align-items:flex-start; gap:8px}
.att-group-name{flex:0 0 62px; font-size:11px; color:var(--muted); padding-top:6px; text-align:right}
.att-group-body{flex:1; display:flex; flex-wrap:wrap; gap:6px; align-items:center; min-width:0}
.kind-choices{display:flex; flex-direction:column; gap:8px}
.kind-choice{padding:11px; border-radius:10px; border:1px solid var(--line); background:#fff; font-size:15px; cursor:pointer; text-align:left}
.kind-choice:hover{border-color:var(--brand); background:#f5f8ff; color:var(--brand)}
.att-file span{overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:150px}
.modal{position:fixed; inset:0; background:rgba(16,24,40,.45); z-index:50; display:flex; align-items:center; justify-content:center; padding:16px}
.modal[hidden]{display:none}
.modal-card{background:#fff; border-radius:14px; padding:18px; width:100%; max-width:460px; max-height:90vh; overflow:auto}
.modal-wide{max-width:760px}
.admin-search{border:1px solid var(--line); border-radius:9px; padding:9px 11px; font-size:14px; width:100%; margin-bottom:10px}
.admin-table-wrap{overflow:auto; max-height:55vh}
.admin-ops{display:flex; gap:6px; flex-wrap:wrap}
.mini-btn{border:1px solid var(--line); background:#fff; color:var(--brand); border-radius:7px; padding:4px 9px; font-size:12px; cursor:pointer; white-space:nowrap}
.mini-btn:hover{background:#eef4ff; border-color:#c7d7fe}
.mini-btn.danger{color:var(--red)}
.mini-btn.danger:hover{background:#fef3f2; border-color:#fecdca}
.badge-on{color:var(--green); font-size:12px}
.badge-off{color:var(--red); font-size:12px}
.reset-who{font-size:13px; color:var(--muted); margin:0 0 10px}
.reset-field{display:flex; flex-direction:column; gap:6px; font-size:12px; color:var(--muted); margin-bottom:10px}
.reset-field input{border:1px solid var(--line); border-radius:9px; padding:9px 11px; font-size:15px; width:100%}
.pwd-box{background:#fff8e6; color:#b54708; padding:2px 8px; border-radius:6px; font-family:ui-monospace,Menlo,Consolas,monospace; letter-spacing:.5px}
.backup-line{margin:16px 0 4px; text-align:center; font-size:12px; color:var(--muted); line-height:1.6}
.backup-line.warn{color:#b54708; background:#fff4ed; border:1px solid #fddcab; border-radius:9px; padding:8px 10px}
.backup-line.danger{color:#b42318; background:#fef3f2; border:1px solid #fecdca; border-radius:9px; padding:8px 10px; font-weight:600}
/* ---------- 单据识别 ---------- */
.ocr-btn{display:flex; align-items:center; gap:8px; width:100%; margin:0 0 14px; padding:12px 14px;
  border:1px dashed var(--brand); border-radius:10px; background:#f5f8ff; color:var(--brand);
  font-size:14px; font-weight:600; cursor:pointer; text-align:left; font-family:inherit}
.ocr-btn:hover:not(:disabled){background:#eaf1ff}
.ocr-btn:disabled{border-color:var(--line); background:#f9fafb; color:var(--muted); cursor:not-allowed}
.ocr-btn-icon{font-size:18px}
.ocr-btn-text{flex:1}
.ocr-btn-hint{font-size:11px; font-weight:400; color:var(--muted); white-space:nowrap}
.ocr-panel{border:1px solid var(--line); border-radius:10px; padding:12px; margin:0 0 14px; background:#fbfcfe}
.ocr-head{display:flex; align-items:baseline; justify-content:space-between; gap:8px; margin-bottom:10px; font-size:14px}
.ocr-meta{font-size:12px; color:var(--muted)}
.ocr-fields{display:flex; flex-direction:column; gap:6px}
.ocr-row{display:flex; gap:10px; font-size:14px; padding:7px 9px; background:#fff; border-radius:8px; border:1px solid var(--line)}
.ocr-k{color:var(--muted); min-width:44px; flex:none}
.ocr-v{flex:1; word-break:break-all}
.ocr-none{margin:0; font-size:13px; color:var(--muted); line-height:1.7}
/* 识别中：让"识别中…"轻微呼吸，避免看起来像卡住了 */
.ocr-wait{display:inline-block; font-weight:600; color:var(--brand); animation:ocrPulse 1.1s ease-in-out infinite}
@keyframes ocrPulse{0%,100%{opacity:1}50%{opacity:.35}}
.ocr-raw{max-height:220px; overflow:auto; background:#f4f6f9; border-radius:8px; padding:10px;
  font-size:12px; line-height:1.6; white-space:pre-wrap; word-break:break-all; margin:10px 0 0; color:#475467}
.ocr-actions{display:flex; gap:8px; flex-wrap:wrap; margin-top:12px}
.setup-card{max-width:520px}
.setup-hint{font-size:13px; color:var(--muted); line-height:1.7; margin:0 0 14px}
.setup-rows{display:flex; flex-direction:column; gap:8px; margin-bottom:10px}
.setup-row{display:flex; gap:8px; align-items:center}
.setup-name{flex:1.2; min-width:0; border:1px solid var(--line); border-radius:9px; padding:9px 11px; font-size:14px}
.setup-open{flex:1; min-width:0; border:1px solid var(--line); border-radius:9px; padding:9px 11px; font-size:14px}
.setup-save{width:100%; margin-top:12px}
.table-scroll{overflow-x:auto}
.stat-table td.stat-open{color:var(--muted)}
.hint{font-size:12px; color:var(--muted)}
.modal-card h3{margin:0 0 12px; font-size:16px; font-weight:600}
.modal-card .grid{margin-top:2px}
.modal-actions{display:flex; gap:10px; margin-top:16px}
.modal-actions button{flex:1; padding:11px; border-radius:10px; font-size:15px; font-weight:600; cursor:pointer}
.btn-primary{background:var(--brand); color:#fff; border:0}
.btn-ghost{background:#fff; color:var(--text); border:1px solid var(--line)}
body.modal-open{overflow:hidden}
@media (max-width:480px){
  .grid{grid-template-columns:1fr}
  .cards{gap:8px}
  .card{padding:10px}
  .card strong{font-size:15px}
  .topbar h1{font-size:15px}
}
