/* 账准 Pro：统一后台组件尺寸、间距与对齐规则。 */
:root{
  --ui-control-h:40px;
  --ui-control-h-sm:34px;
  --ui-space-1:4px;
  --ui-space-2:8px;
  --ui-space-3:12px;
  --ui-space-4:16px;
  --ui-space-5:20px;
  --ui-space-6:24px;
  --ui-space-7:28px;
  --ui-card-r:14px;
  --ui-field-r:9px;
  --ui-page-max:1480px;
}

body{letter-spacing:.002em}
header{height:64px;padding-inline:28px}
.page,html[data-theme] .page{width:100%;max-width:var(--ui-page-max);padding:28px}
.heading{align-items:center;gap:var(--ui-space-5);margin-bottom:var(--ui-space-6)}
.heading h1{margin-bottom:6px;font-size:26px;line-height:1.25}
.heading p{max-width:860px;font-size:13px;line-height:1.6}
.heading>div:last-child:not(:first-child){align-items:center;gap:var(--ui-space-2)}
.heading>div:only-child{display:block}

button,.primary,.secondary,html[data-theme] .primary,html[data-theme] .secondary{min-height:var(--ui-control-h)}
.primary,.secondary,html[data-theme] .primary,html[data-theme] .secondary{
  height:var(--ui-control-h);
  border-radius:var(--ui-field-r);
  padding-inline:15px;
  font-size:13px;
  line-height:1;
}
.heading .primary,.heading .secondary{min-width:124px}
.secondary.mini,.source-actions .secondary.mini,.pricing-actions .secondary.mini,.bill-actions .secondary.mini{
  height:var(--ui-control-h-sm);
  min-height:var(--ui-control-h-sm);
  padding-inline:11px;
  border-radius:8px;
  font-size:11px;
}
.link{min-height:34px;padding-inline:6px}
.icon,.user>button{width:36px;height:36px;min-height:36px;border-radius:8px}
.warehouse-switcher{height:40px;border-radius:9px}
.warehouse-switcher select{min-width:108px}

.panel,.metrics article,.timeline article,.sources article,.batch-meta,.recon-flow,.source-compare article,
html[data-theme] .panel,html[data-theme] .metrics article,html[data-theme] .timeline article,html[data-theme] .sources article{
  border-radius:var(--ui-card-r);
}
.panel{padding:20px}
.panel-head{gap:var(--ui-space-4)}
.panel-head h2,.section-head h2{line-height:1.35}
.panel-head p,.section-head p{line-height:1.55}
.metrics{gap:var(--ui-space-3);margin-bottom:var(--ui-space-3)}
.metrics article{min-height:128px;padding:17px 18px}
.metrics article>strong{margin:10px 0 8px}

.process-strip{
  min-height:72px;
  margin-bottom:var(--ui-space-4);
  padding:14px 18px;
  border-radius:var(--ui-card-r);
}
.workflow-callout,.pricing-legend,.export-policy,.quality-gate{border-radius:12px}

.bill-layout{
  grid-template-columns:minmax(620px,1fr) minmax(300px,340px);
  gap:var(--ui-space-5);
  align-items:start;
  margin-bottom:var(--ui-space-7);
}
.bill-builder{gap:var(--ui-space-2);padding:22px}
.bill-builder>label{margin-top:10px}
.bill-builder>select,.form select,.field,.auth-card input,.invite-panel input,.invite-panel select,.inline-form input{
  height:42px;
  min-height:42px;
  border-radius:var(--ui-field-r);
}
.bill-direction{gap:var(--ui-space-3);margin-block:8px 2px}
.bill-direction label{min-height:78px;padding:14px;border-radius:11px}
.surcharge-head{align-items:center;gap:var(--ui-space-3);margin-top:12px}
.surcharge-options{gap:var(--ui-space-2);max-height:196px}
.surcharge-options>p{padding:13px}
.bill-builder>.primary{
  width:auto;
  min-width:210px;
  justify-self:end;
  margin-top:10px;
}
.bill-guidance{top:78px;padding:20px}
.bill-guidance dl div{padding:11px 0}
.guard-note{margin-top:12px;padding:12px 13px}
.section-head{margin:10px 0 12px}

.record-list{gap:var(--ui-space-3)}
.record-list>article{
  min-height:88px;
  gap:var(--ui-space-3);
  padding:15px 18px;
  border-radius:var(--ui-card-r);
}
.record-icon{flex-basis:40px;width:40px;height:40px;border-radius:10px}
.record-list h3{margin-bottom:4px;line-height:1.45}
.record-list p,.record-list small{line-height:1.55}
.bill-controls{
  display:flex;
  flex:0 0 auto;
  align-items:center;
  justify-content:flex-end;
  gap:var(--ui-space-2);
  min-width:0;
  white-space:nowrap;
}
.bill-statuses{
  flex-direction:row;
  align-items:center;
  min-width:0;
  gap:var(--ui-space-2);
}
.bill-actions{
  flex:0 0 auto;
  flex-wrap:nowrap;
  gap:var(--ui-space-2);
  min-width:max-content;
}
#generatedBills .bill-statuses .pill{
  min-height:var(--ui-control-h-sm);
  padding:0 10px;
}
.pill{
  display:inline-flex;
  align-items:center;
  min-height:26px;
  padding:4px 9px;
  line-height:1.2;
}

#rules .timeline{gap:var(--ui-space-3)}
#rules .timeline article,.sources article{min-height:94px;padding:16px 18px}
#rules .timeline article{gap:var(--ui-space-4)}
#rules .timeline article>span,.sources article>span{flex:1;min-width:0}
#rules .timeline h2,.sources h2{line-height:1.45}
.pricing-filter-bar{
  display:grid;
  grid-template-columns:minmax(148px,.8fr) minmax(148px,.8fr) minmax(150px,.85fr) minmax(220px,1.35fr) auto;
  gap:10px 12px;
  align-items:end;
  margin:0 0 var(--ui-space-4);
  padding:14px 16px 12px;
  border:1px solid var(--border);
  border-radius:var(--ui-card-r);
  background:var(--panel-2);
  box-shadow:0 1px 2px rgba(18,45,75,.035);
}
.pricing-filter-bar>label{display:grid;gap:6px;min-width:0}
.pricing-filter-bar>label>span{font-size:11px;font-weight:700;color:var(--ink-2)}
.pricing-filter-bar input,.pricing-filter-bar select{
  width:100%;
  height:40px;
  min-height:40px;
  padding:0 11px;
  border:1px solid var(--border);
  border-radius:var(--ui-field-r);
  background:var(--bg);
  color:var(--ink-1);
  font:inherit;
  font-size:13px;
}
.pricing-filter-bar input:focus,.pricing-filter-bar select:focus{
  outline:0;
  border-color:var(--accent);
  box-shadow:0 0 0 3px var(--accent-soft);
}
.pricing-filter-bar input::placeholder{color:var(--ink-3)}
.pricing-filter-actions{display:flex;gap:var(--ui-space-2);align-items:center;white-space:nowrap}
.pricing-filter-actions .primary,.pricing-filter-actions .secondary{height:40px;min-height:40px;padding-inline:14px}
.pricing-filter-bar output{grid-column:1/-1;min-height:16px;color:var(--ink-3);font-size:11px;font-variant-numeric:tabular-nums}
.pricing-filter-bar output.error{color:var(--danger-ink);font-weight:700}
.pricing-filter-empty{min-height:330px;padding:70px 24px 36px}
#pricingTimeline:has(#pricingFilterEmpty:not([hidden])):before{display:none}
.source-actions,.pricing-actions{
  max-width:430px;
  flex:0 0 auto;
  flex-direction:row;
  align-items:center;
  justify-content:flex-end;
  gap:var(--ui-space-2);
  flex-wrap:wrap;
}
.pricing-actions>strong{width:100%;text-align:right}
.pricing-legend{
  gap:10px 18px;
  margin:-4px 0 16px;
  padding:11px 14px;
  line-height:1.5;
}

.tablewrap{margin-top:14px}
th,td{padding:12px 15px}
.toolbar{gap:var(--ui-space-2)}
.toolbar label{height:40px;border-radius:var(--ui-field-r)}
.tabs{padding:3px;border-radius:10px}
.tabs button{min-height:34px;padding:7px 13px}

.modal,html[data-theme] .modal{
  width:min(680px,100%);
  max-height:calc(100vh - 32px);
  overflow:auto;
  border-radius:18px;
}
.import-modal,.wizard-modal,.pricing-import-modal{width:min(760px,100%)}
.modal-head{align-items:flex-start;gap:var(--ui-space-4);padding:19px 22px 16px}
.modal-head h2{font-size:19px;line-height:1.35}
.modal-head p{margin-top:4px;font-size:12px;line-height:1.55}
.modal-head>button{
  display:grid;
  place-items:center;
  flex:0 0 36px;
  width:36px;
  height:36px;
  min-height:36px;
  margin-top:-3px;
  border-radius:9px;
}
.modal-head>button:hover{background:var(--panel-2)}
.steps{min-height:58px;padding:14px 20px}
.form{padding:18px 22px 0}
.form>label:not(:first-child){margin-top:16px}
.modal-foot{gap:var(--ui-space-2);padding:16px 22px 20px}
.modal-foot .primary,.modal-foot .secondary{min-width:96px}
.standard-notice,.security-note,.confirm-card{border-radius:11px}
.source-type-cards,.pricing-direction-cards{gap:var(--ui-space-3)}
.source-type-cards label{min-height:84px;padding:12px}
.pricing-direction-cards label{min-height:70px;padding:12px}
.data-dropzone{min-height:104px;border-radius:11px}
.toast{
  right:20px;
  bottom:20px;
  max-width:min(420px,calc(100vw - 40px));
  border-radius:11px;
}
.upload-box{
  display:flex;
  min-height:76px;
  height:auto;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  gap:6px;
  padding:13px 16px;
  text-align:center;
  cursor:pointer;
}
.upload-box b{font-size:13px;color:var(--accent)}
.upload-box small{font-size:11px;line-height:1.45;color:var(--ink-3)}
.upload-box.selected{
  border-color:var(--accent);
  background:var(--accent-soft);
}

.access-summary{gap:var(--ui-space-3)}
.access-layout{grid-template-columns:minmax(0,1fr) 320px;gap:var(--ui-space-4)}
.access-main{gap:var(--ui-space-4)}

@media(max-width:1180px){
  .bill-layout{grid-template-columns:minmax(520px,1fr) 300px}
  .source-actions,.pricing-actions{max-width:320px}
  #generatedBills>article{flex-wrap:wrap}
  #generatedBills .bill-controls{
    width:calc(100% - 52px);
    margin-left:52px;
    justify-content:flex-end;
  }
}

@media(max-width:900px){
  .page,html[data-theme] .page{padding:22px}
  .bill-layout,.access-layout{grid-template-columns:1fr}
  .bill-guidance,.access-aside{position:static;transform:none!important}
  .pricing-filter-bar{grid-template-columns:repeat(2,minmax(0,1fr))}
  .pricing-filter-actions{justify-content:flex-end}
}

@media(max-width:760px){
  header{padding-inline:14px}
  .page,html[data-theme] .page{padding:18px 14px 26px}
  .heading{align-items:flex-start;margin-bottom:20px}
  .heading>div:last-child:not(:first-child),.heading>button{width:100%}
  .heading .primary,.heading .secondary{flex:1 1 140px}
  .panel,.bill-builder{padding:16px}
  .bill-builder>.primary{width:100%;justify-self:stretch}
  .record-list>article{align-items:flex-start;flex-wrap:wrap}
  .source-actions,.pricing-actions,.bill-actions{
    width:100%;
    max-width:none;
    margin-left:0;
    justify-content:flex-start;
  }
  #generatedBills .bill-controls{
    width:100%;
    margin-left:0;
    justify-content:flex-start;
    overflow-x:auto;
    padding-bottom:2px;
  }
  #generatedBills .bill-controls .bill-statuses{
    flex:0 0 auto;
    align-items:center;
    margin-left:0;
  }
  #generatedBills .bill-controls .bill-actions{
    width:auto;
    max-width:none;
    margin-left:0;
    flex:0 0 auto;
  }
  .pricing-actions>strong{width:auto;margin-right:auto;text-align:left}
  .pricing-filter-bar{grid-template-columns:1fr;padding:13px}
  .pricing-filter-actions{width:100%;justify-content:stretch}
  .pricing-filter-actions .primary,.pricing-filter-actions .secondary{flex:1;min-height:44px;height:44px}
  .pricing-filter-bar input,.pricing-filter-bar select{min-height:44px;height:44px}
  .bill-statuses{align-items:flex-start;margin-left:52px}
  .modal,html[data-theme] .modal{max-height:calc(100vh - 20px);border-radius:15px}
  .modal-head,.form,.modal-foot{padding-inline:17px}
}

@media(max-width:430px){
  .primary,.secondary{padding-inline:12px}
  .heading h1{font-size:23px}
  .source-actions .secondary.mini,.pricing-actions .secondary.mini,.bill-actions .secondary.mini{
    min-height:40px;
    height:40px;
  }
}

/* 融通四海品牌标识 */
.brand-logo-frame{
  display:block;
  flex:0 0 auto;
  overflow:hidden;
  background:#fff;
}
.brand-logo-frame>.brand-logo{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
  transform:scale(1.42);
}
.brand>.brand-logo-frame{
  width:36px;
  height:36px;
  border:1px solid rgba(255,255,255,.36);
  border-radius:10px;
  box-shadow:0 6px 16px rgba(8,31,58,.2);
}
.brand strong{
  font-size:14px;
  letter-spacing:-.04em;
  white-space:nowrap;
}
.auth-brand>.brand-logo-frame{
  width:58px;
  height:58px;
  border:1px solid rgba(255,255,255,.48);
  border-radius:16px;
  box-shadow:0 12px 28px rgba(4,29,60,.24);
}
.auth-brand strong{
  white-space:nowrap;
}
@media(max-width:760px){
  .auth-brand>.brand-logo-frame{
    width:46px;
    height:46px;
    border-radius:13px;
  }
}
