main:has(.doc-layout) { max-width: none; padding: 0; }
.doc-layout { display: grid; min-height: calc(100vh - 4rem); grid-template-columns: minmax(10rem, 13rem) minmax(0,1fr); background: #fff; }
.doc-sidebar { padding: 1.25rem .75rem; background: #f6f8f8; border-right: 1px solid var(--line); }
.doc-sidebar strong { display:block; padding: .2rem .65rem .9rem; font-size: 1.05rem; }
.doc-sidebar a { display:block; padding:.55rem .65rem; border-radius:.35rem; margin-bottom:.25rem; color:#304746; }
.doc-sidebar a[aria-current] { background:#dcefe9; color:var(--teal); font-weight:700; }
.doc-content { min-width:0; padding: 1.1rem clamp(.75rem,2vw,1.7rem); }
.doc-content h1 { margin:0 0 .65rem; font-size:1.45rem; }
.doc-view-tabs, .doc-toolbar, .doc-search { display:flex; flex-wrap:wrap; align-items:center; gap:.45rem; }
.doc-view-tabs { border-bottom:1px solid var(--line); gap:1.2rem; }
.doc-view-tabs a { padding:.3rem .05rem .5rem; color:#475c5a; }
.doc-view-tabs a[aria-current] { color:var(--teal); border-bottom: 2px solid var(--teal); font-weight:bold; }
.doc-toolbar { padding:.65rem 0; gap:.35rem .55rem; position:relative; z-index:4; font-size:.9rem; }
.doc-toolbar summary { list-style:revert; cursor:pointer; padding:.32rem .4rem; color:#294f4b; }
.doc-menu { position:relative; }
.doc-menu[open] summary { background:#e8f2ef; border-radius:.35rem; }
.doc-controls { display:grid; gap:.7rem; width:16rem; max-width:calc(100vw - 2rem); padding:.85rem; background:white;
  position:absolute; top:100%; left:0; border:1px solid var(--line); border-radius:.45rem; box-shadow:0 8px 24px #1f3f321c; z-index:6; }
.doc-controls button, .doc-search button { padding:.4rem .8rem; font-size:.9rem; }
.doc-save-menu .doc-controls { left:auto; right:0; }
.doc-toolbar select, .doc-toolbar input:not([type=checkbox]) { padding:.4rem .55rem; font-size:.9rem; }
.column-options { max-height: min(42vh,18rem); overflow-y:auto; }
.column-options label { display:flex; align-items:center; gap:.5rem; padding:.2rem; font-weight:normal; }
.column-options input { width:auto; }
.column-options [hidden] { display:none; }
.doc-search { margin-left:auto; max-width:100%; }
.doc-search select { max-width:7rem; }
.doc-search input { width:10rem; flex: 1 1 5rem; }
.doc-scroll { max-height: calc(100vh - 16rem); min-height:12rem; overflow:auto; border:1px solid var(--line); border-radius:.4rem; }
.doc-table { width:max-content; min-width:100%; border-collapse:separate; border-spacing:0; font-size:.88rem; }
.doc-table td,.doc-table th { padding:.32rem .65rem; border-right:1px solid #e1e8e6; border-bottom:1px solid #e1e8e6; background:white; }
.doc-table th { position:sticky; top:0; z-index:2; background:#edf3f1; }
.doc-index { color:#677a76; min-width:3.2rem; width:3.2rem; text-align:right; }
.doc-table .doc-key { position:sticky; left:0; z-index:1; min-width:6.9rem; }
.doc-table th.doc-key { z-index:3; }
.doc-table .doc-group-title { position:static; background:#ecf4f0; text-align:left; }
.doc-table tbody tr:hover td { background:#f3f9f7; }
.doc-file { display:inline-flex; vertical-align:middle; margin-right:.16rem; }
.doc-file img { width:3rem; height:2rem; object-fit:cover; border-radius:.2rem; }
.width-customer { --cell-width:8rem }
.width-note { --cell-width:11rem }
.width-photos { --cell-width:9rem }
.width-suffix { --cell-width:6.5rem }
.doc-table .doc-cell-reader { display:block; width:var(--cell-width,15rem); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:inherit; }
.doc-table .doc-cell-reader:hover, .doc-table .doc-cell-reader:focus-visible { color:var(--teal); text-decoration:underline; }
.width-photos .doc-photo-strip { width:var(--cell-width); display:flex; flex-wrap:wrap; align-items:center; gap:.14rem .32rem; white-space:normal; overflow-wrap:anywhere; }
.width-photos .doc-photo-strip .pending-file { display:block; max-width:100%; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.doc-card-text { color:inherit; }
.doc-cover[href]:focus-visible { outline-offset:-3px; }
.doc-height-compact td { padding-block:.13rem; }
.doc-height-compact .doc-file img { height:1.4rem; }
.doc-height-tall td { padding-block:.7rem; max-width:28rem; white-space:normal; overflow-wrap:anywhere; }
.doc-height-tall .doc-file img { width:5rem; height:3.3rem; }
.pending-file { color:#6c6761; white-space:normal; }
.doc-count { margin-top:.5rem; font-size:.87rem; }
.doc-gallery { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(100%,14.5rem),1fr)); gap:.85rem; }
.doc-card { min-width:0; color:#273a37; border:1px solid var(--line); border-radius:.5rem; overflow:hidden; background:white; }
.doc-card:hover { border-color:#64968d; text-decoration:none; }
.doc-cover { display:grid; place-items:center; aspect-ratio:4/3; background:#edf2f0; color:#61726c; font-size:.87rem; }
.doc-cover img { display:block; width:100%; height:100%; min-height:0; object-fit:cover; }
.doc-card-text { display:grid; padding:.65rem .8rem; gap:.25rem; overflow-wrap:anywhere; }
.doc-card-text strong { color:var(--teal); }
.doc-content [data-fill="待核对"], .doc-content [data-fill="待识别"] { --record-fill:#fff4dc; }
.doc-content [data-fill="已核对"], .doc-content [data-fill="已识别"] { --record-fill:#e4f4e9; }
.doc-content [data-fill="异常"] { --record-fill:#fce5df; }
.doc-content [data-fill="识别中"] { --record-fill:#e3f1fc; }
.doc-table [data-fill] td, .doc-card[data-fill] { background-color:var(--record-fill,white); }
.doc-content .doc-export { white-space:nowrap; padding:.3rem .4rem; }
.doc-table .doc-action-column { position:sticky; right:0; min-width:3.6rem; text-align:center; box-shadow:-1px 0 0 var(--line); }
.doc-table thead .doc-action-column { z-index:3; }
.doc-remove { display:inline-block; padding:.3rem .25rem; color:#82342e; white-space:nowrap; }
.doc-remove:hover,.doc-remove:focus-visible { color:#64231e; text-decoration:underline; }
.doc-card-action { padding:0 .55rem .4rem; text-align:right; }
.doc-section { font-size:1rem; padding-top:.5rem; }
.doc-sr { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
.doc-range-number { cursor:cell; font-variant-numeric:tabular-nums; user-select:none; }
.doc-range-number:focus-visible { outline:2px solid #286fbe; outline-offset:-2px; }
.doc-table.doc-range-dragging { user-select:none; cursor:cell; }
.doc-table tbody tr td.doc-range-selected { background:#e4edff; color:#183251; }
.doc-table .doc-range-anchor { box-shadow:inset 0 0 0 2px #3977cc; }
.doc-range-footer { position:sticky; bottom:0; z-index:3; display:flex; align-items:center; justify-content:space-between;
  flex-wrap:wrap; gap:.25rem .6rem; padding:.3rem 0; background:white; }
.doc-range-footer .doc-count { margin:0; }
.doc-range-summary { display:flex; align-items:center; flex-wrap:wrap; gap:.12rem .45rem; margin-left:auto; padding:.15rem .45rem .15rem .65rem;
  color:#24423f; background:#f2f7f6; border:1px solid var(--line); border-radius:.35rem; font-size:.85rem; }
.doc-range-summary[hidden] { display:none; }
.doc-range-totals { display:flex; align-items:center; flex-wrap:wrap; gap:.15rem .7rem; font-variant-numeric:tabular-nums; }
.doc-range-totals span { white-space:nowrap; }
.doc-range-totals b { font-weight:600; }
.doc-range-summary .doc-range-clear { border:0; background:transparent; padding:.05rem .3rem; color:#425d58;
  font-size:1.15rem; line-height:1.25; }
@media(max-width:820px){
  .width-customer { --cell-width:6.85rem } .width-note { --cell-width:8.5rem } .width-photos { --cell-width:7.65rem } .width-suffix { --cell-width:5rem }
  .doc-layout { display:block; }
  .doc-sidebar { display:flex; flex-wrap:wrap; align-items:center; gap:.3rem; padding:.5rem .7rem; border-right:0; border-bottom:1px solid var(--line); }
  .doc-sidebar strong { display:none; }
  .doc-sidebar a { margin:0; padding:.35rem .55rem; }
  .doc-content { padding:.7rem; }
  .doc-scroll { max-height: max(16rem,65vh); }
  .doc-menu { position:static; }
  .doc-controls { top:auto; left:0; }
  .doc-search { margin-left:0; }
}
