*{box-sizing:border-box}
body{margin:0;background:#F4F6F9;color:#1C2430;font:14px/1.5 -apple-system,"PingFang SC","Microsoft YaHei","Noto Sans SC",Inter,sans-serif}
a{color:#1F4E9E}
[hidden]{display:none!important}
h1{margin:2px 0 0;font-size:22px}
h2{margin:0 0 14px;font-size:16px;font-weight:600}
.muted{color:#5B6573}.small{font-size:12px}.r{text-align:right}
.warn-text{color:#9A3A0A}
.err{color:#B42318;font-size:13px;min-height:18px}
.btn{font:inherit;font-size:14px;font-weight:500;min-height:40px;padding:0 16px;border-radius:8px;border:1px solid #D5DAE1;background:#fff;color:#1C2430;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:6px;text-decoration:none;white-space:nowrap}
.btn:hover{background:#F0F2F5}.btn:disabled{opacity:.5;cursor:default}
.btn.primary{background:#1F4E9E;border-color:#1F4E9E;color:#fff}.btn.primary:hover{background:#163A78}
.btn.sm{min-height:32px;padding:0 12px;font-size:13px}
.btn.danger{color:#B42318}
.link{background:none;border:0;color:#1F4E9E;cursor:pointer;font:inherit;padding:4px 0}
input,select{font:inherit;font-size:14px;color:#1C2430;min-height:38px;border:1px solid #D5DAE1;border-radius:8px;padding:0 10px;background:#fff;width:100%}
input[type=checkbox]{width:18px;min-height:18px;height:18px}
label{display:flex;flex-direction:column;gap:6px;font-size:13px;color:#4A5563}
.card{background:#fff;border:1px solid #E3E7EC;border-radius:12px;padding:20px}
/* 登录 */
.login{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:20px}
.login-card{width:100%;max-width:360px;background:#fff;border:1px solid #E3E7EC;border-radius:14px;padding:28px;display:flex;flex-direction:column;gap:14px}
.brand{display:flex;align-items:center;gap:10px}.brand small{display:block;color:#5B6573;font-size:12px}.brand b{font-size:16px}
.logo{width:36px;height:36px;border-radius:9px;background:#1F4E9E;display:flex;align-items:center;justify-content:center;flex-shrink:0}
/* 布局 */
.app{display:flex;flex-wrap:wrap;min-height:100vh}
.side{flex:1 1 220px;max-width:250px;background:#fff;border-right:1px solid #E3E7EC;padding:20px 14px;display:flex;flex-direction:column;gap:20px}
#nav{display:flex;flex-direction:column;gap:4px}
#nav button{font:inherit;text-align:left;min-height:44px;padding:0 14px;border-radius:8px;border:0;background:transparent;cursor:pointer;display:flex;align-items:center;gap:8px;color:#1C2430}
#nav button.on{background:#E8F1FF;color:#163A78;font-weight:600}
.badge{margin-left:auto;min-width:22px;height:22px;border-radius:11px;background:#C2410C;color:#fff;font-size:12px;font-weight:600;display:inline-flex;align-items:center;justify-content:center;padding:0 6px}
.side-foot{margin-top:auto;display:flex;flex-direction:column;gap:6px}
.main{flex:999 1 560px;min-width:0;padding:24px 28px 60px}
.main>*{max-width:1200px;margin-left:auto;margin-right:auto}
.page,.stack{display:flex;flex-direction:column;gap:16px}
.top{display:flex;flex-wrap:wrap;gap:12px;align-items:flex-end;margin-bottom:18px}
.top-title{flex:1 1 260px}
.month-pick{flex-direction:row;align-items:center;gap:8px}.month-pick select{width:auto;min-height:32px}
.actions,.btn-row{display:flex;flex-wrap:wrap;gap:8px}
.toast{display:flex;gap:12px;align-items:center;background:#E8F1FF;border:1px solid #B9D2F7;color:#163A78;border-radius:10px;padding:10px 14px;margin-bottom:16px}
.toast span{flex:1;white-space:pre-line}
.tabs{display:flex;flex-wrap:wrap;gap:4px;background:#fff;border:1px solid #E3E7EC;border-radius:10px;padding:4px;align-self:flex-start}
.tabs button{font:inherit;min-height:36px;padding:0 16px;border:0;border-radius:7px;background:transparent;cursor:pointer;color:#1C2430}
.tabs button.on{background:#1F4E9E;color:#fff;font-weight:600}
.tabs.small{background:#F4F6F9;border:0}.tabs.small button.on{background:#fff;color:#163A78;box-shadow:0 1px 2px rgba(0,0,0,.08)}
.kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:14px}
.kpi{display:flex;flex-direction:column;gap:4px;text-align:left;font:inherit;color:inherit}
.kpi span{font-size:13px;color:#5B6573}.kpi b{font-size:26px}.kpi small{font-size:12px;color:#5B6573}
button.kpi{cursor:pointer}
.kpi.blue{background:#E8F1FF;border-color:#B9D2F7}.kpi.blue *{color:#163A78}
.kpi.warn{background:#FFF7F0;border-color:#F3C9A8}.kpi.warn *{color:#9A3A0A}
.row2{display:flex;flex-wrap:wrap;gap:16px;align-items:flex-start}
.grow3{flex:3 1 440px;min-width:0}.grow2{flex:2 1 300px;min-width:0}
.bars{display:flex;flex-direction:column;gap:4px}
.bar{display:grid;grid-template-columns:96px minmax(0,1fr) 52px 104px;gap:12px;align-items:center;padding:7px 4px;border:0;background:none;font:inherit;text-align:left;cursor:pointer;border-radius:8px;color:inherit}
.bar:hover{background:#F7F8FA}
.bar .track{height:10px;background:#EEF1F4;border-radius:5px;overflow:hidden}.bar .fill{height:10px;border-radius:5px;background:#1F4E9E}
.timeline{list-style:none;margin:0 0 16px;padding:0}
.timeline li{display:flex;gap:12px;padding-bottom:14px;position:relative}
.timeline li:not(:last-child)::before{content:"";position:absolute;left:6px;top:16px;bottom:0;width:2px;background:#D5DAE1}
.timeline .dot{width:14px;height:14px;border-radius:7px;border:2px solid #A8B1BD;background:#fff;flex-shrink:0;margin-top:3px;position:relative;z-index:1}
.timeline .dot.done{background:#1F4E9E;border-color:#1F4E9E}.timeline .dot.next{border:3px solid #1F4E9E}
.checks{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px}
.checks>*{background:#F7F8FA;border-radius:10px;padding:12px 14px;display:flex;flex-direction:column;gap:2px;border:0;font:inherit;text-align:left;color:inherit}
.checks span{font-size:12px;color:#5B6573}.checks b{font-size:20px}
.warnbox{background:#FFF7F0!important;cursor:pointer}.warnbox *{color:#9A3A0A!important}
.tablebox{overflow-x:auto;border:1px solid #E3E7EC;border-radius:10px}
table{border-collapse:collapse;width:100%;font-size:13px}
th{text-align:left;font-weight:600;color:#4A5563;background:#F7F8FA;padding:10px 12px;border-bottom:1px solid #E3E7EC;white-space:nowrap}
td{padding:9px 12px;border-bottom:1px solid #EEF1F4;white-space:nowrap;vertical-align:middle}
tr.flag td{background:#FFF7F0}
tfoot td{background:#F7F8FA;font-weight:600}
td.click{cursor:pointer}
.tag{font-size:12px;font-weight:600;border-radius:6px;padding:3px 8px;display:inline-block}
.tag.ok{color:#166534;background:#ECFDF3;font-weight:400}.tag.bad{color:#9A3A0A;background:#FFF1E6}
.tag.A{color:#1F4E9E;background:#E8F1FF}.tag.B{color:#0F6B5C;background:#E3F5F1}.tag.C{color:#7A3E9D;background:#F4EAFA}.tag.X{color:#4A5563;background:#EEF1F4}
.paid{font:inherit;font-size:12px;min-height:28px;padding:0 10px;border-radius:14px;cursor:pointer;border:1px solid #D5DAE1;background:#fff;color:#4A5563}
.paid.on{border-color:#166534;background:#ECFDF3;color:#166534}
.filters{display:flex;flex-wrap:wrap;gap:12px;align-items:flex-end;margin-bottom:14px}
.filters label{flex-direction:row;align-items:center;gap:6px}.filters select{width:auto}
.filters .search input{width:210px}
.bulk,.prompt{display:flex;flex-wrap:wrap;gap:10px;align-items:center;background:#F4F6F9;border-radius:10px;padding:12px 14px;margin-top:14px}
.bulk span,.prompt span{flex:1 1 260px}
.bulk.sel{background:#E8F1FF}
.prompt{background:#E8F1FF;border:1px solid #B9D2F7;color:#163A78}
.empty{text-align:center;color:#5B6573;padding:40px 0}
.upload{display:flex;flex-wrap:wrap;gap:20px;margin-bottom:16px}
.drop{flex:1 1 300px;border:2px dashed #B9C3CF;border-radius:12px;padding:24px;text-align:center;display:flex;flex-direction:column;gap:10px;align-items:center;justify-content:center;background:#FAFBFC}
.drop.over{border-color:#1F4E9E;background:#E8F1FF}
.upload-result{flex:1 1 300px;display:flex;flex-direction:column;gap:8px}
.upload-result p{margin:0}
.res{font-size:13px;padding:6px 10px;border-radius:6px;background:#F4F6F9}
.res.new{background:#ECFDF3;color:#166534}.res.dup{background:#F4F6F9;color:#4A5563}.res.unrecognized{background:#FFF1E6;color:#9A3A0A}
.review-item{display:flex;flex-wrap:wrap;gap:14px;align-items:center}
.review-item .info{flex:1 1 340px;min-width:0}
.grid2{display:grid;grid-template-columns:repeat(auto-fit,minmax(420px,1fr));gap:16px;align-items:start}
.grid2.tight{gap:12px;grid-template-columns:repeat(auto-fit,minmax(200px,1fr))}
.card .stack{gap:10px;margin-bottom:12px}
.acc,.co,.cat{border:1px solid #EEF1F4;border-radius:10px;padding:12px;display:grid;gap:8px}
.acc{grid-template-columns:repeat(auto-fit,minmax(180px,1fr))}
.co{grid-template-columns:repeat(2,minmax(0,1fr))}
.cat{grid-template-columns:110px minmax(0,1fr) auto;align-items:center;padding:8px 10px}
.save-bar{position:sticky;bottom:0;background:#F4F6F9;padding:12px 0;display:flex;justify-content:flex-end}
.dlg{border:0;border-radius:14px;padding:24px;width:min(720px,94vw);max-height:92vh}
.dlg::backdrop{background:rgba(20,24,30,.45)}
.dlg form{display:flex;flex-direction:column;gap:12px}
.dlg-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:6px}.spacer{flex:1}
@media (max-width:820px){
  .side{max-width:none;flex-basis:100%;border-right:0;border-bottom:1px solid #E3E7EC;padding:12px;gap:10px}
  #nav{flex-direction:row;overflow-x:auto}#nav button{white-space:nowrap}
  .side-foot{display:none}
  .main{padding:16px 12px 60px}
  .grid2{grid-template-columns:1fr}
  .bar{grid-template-columns:72px minmax(0,1fr) 44px 92px;gap:8px}
}
