:root{
  --bg:#f6f4ef;
  --surface:#ffffff;
  --surface-2:#faf9f5;
  --ink:#1d2c27;
  --ink-2:#5c6b65;
  --ink-3:#93a09a;
  --line:#e9e6de;
  --line-strong:#dcd8cd;
  --brand:#1f5b4a;
  --brand-dark:#164335;
  --brand-soft:#e7f1ec;
  --accent:#c26a3d;
  --accent-soft:#fbeee5;
  --warn:#b4832b;
  --warn-soft:#fbf3e2;
  --danger:#b34b3e;
  --shadow:0 1px 2px rgba(28,44,39,.04),0 8px 28px rgba(28,44,39,.06);
  --shadow-lg:0 20px 60px rgba(28,44,39,.16);
  --radius:14px;
  --sidebar-w:244px;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0;height:100%}
html{-webkit-text-size-adjust:100%}
body{
  background:var(--bg);color:var(--ink);
  font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","Segoe UI",sans-serif;
  font-size:14px;line-height:1.6;-webkit-font-smoothing:antialiased;overflow-x:hidden;
}
button,input,select{font:inherit;color:inherit}
button{cursor:pointer}
svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none}
.icon-sprite{position:absolute;width:0;height:0;overflow:hidden}
[hidden]{display:none !important}
.muted{color:var(--ink-3);font-size:12px;font-weight:400}
.req{color:var(--accent);font-style:normal}
code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;background:var(--surface-2);padding:2px 6px;border-radius:5px;border:1px solid var(--line)}

/* ---------- 布局 ---------- */
.app{display:flex;min-height:100vh}
.sidebar{
  width:var(--sidebar-w);flex:none;background:var(--surface);border-right:1px solid var(--line);
  display:flex;flex-direction:column;position:sticky;top:0;height:100vh;z-index:40;
}
.brand{display:flex;align-items:center;gap:11px;padding:22px 20px 20px;border-bottom:1px solid var(--line)}
.brand-mark{width:38px;height:38px;border-radius:11px;background:var(--brand);color:#fff;display:grid;place-items:center;flex:none}
.brand-mark svg{width:20px;height:20px}
.brand-copy{display:flex;flex-direction:column;line-height:1.35}
.brand-copy strong{font-size:17px;letter-spacing:.06em}
.brand-copy span{font-size:11px;color:var(--ink-3)}
.nav{flex:1;overflow-y:auto;padding:16px 12px}
.nav-label{font-size:10px;letter-spacing:.14em;color:var(--ink-3);padding:14px 10px 7px;font-weight:600}
.nav-item{
  width:100%;display:flex;align-items:center;gap:11px;padding:10px 12px;margin-bottom:2px;
  background:transparent;border:0;border-radius:9px;text-align:left;color:var(--ink-2);font-weight:500;
  transition:background .16s,color .16s;position:relative;
}
.nav-item svg{width:17px;height:17px}
.nav-item:hover{background:var(--surface-2);color:var(--ink)}
.nav-item.active{background:var(--brand-soft);color:var(--brand);font-weight:600}
.nav-item b{margin-left:auto;font-size:11px;font-weight:600;color:var(--ink-3);background:var(--surface-2);padding:1px 7px;border-radius:20px}
.nav-item.active b{background:#fff;color:var(--brand)}
.nav-dot{width:6px;height:6px;border-radius:50%;background:var(--accent);margin-left:auto}
.sidebar-foot{padding:14px 20px 20px;border-top:1px solid var(--line)}
.storage-pill{display:flex;align-items:center;gap:7px;font-size:11px;color:var(--ink-2);background:var(--surface-2);border:1px solid var(--line);padding:7px 10px;border-radius:8px}
.storage-pill .dot{width:7px;height:7px;border-radius:50%;background:var(--warn);flex:none}
.sidebar-foot p{margin:9px 0 0;font-size:10px;color:var(--ink-3)}

.main{flex:1;min-width:0;display:flex;flex-direction:column}
.topbar{
  height:74px;flex:none;display:flex;align-items:center;gap:18px;padding:0 30px;
  background:rgba(255,255,255,.9);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);border-bottom:1px solid var(--line);
  position:sticky;top:0;z-index:30;
}
.page-heading{min-width:0}
.page-heading h1{margin:0;font-size:19px;font-weight:650;letter-spacing:.01em}
.page-heading p{margin:1px 0 0;font-size:12px;color:var(--ink-3);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.topbar-tools{margin-left:auto;display:flex;align-items:center;gap:12px}
.global-search,.field-search{display:flex;align-items:center;gap:8px;background:var(--surface-2);border:1px solid var(--line);border-radius:9px;padding:0 12px;color:var(--ink-3);transition:border-color .16s,box-shadow .16s}
.global-search{width:250px;height:38px}
.global-search:focus-within,.field-search:focus-within{border-color:var(--brand);box-shadow:0 0 0 3px var(--brand-soft);background:#fff}
.global-search svg,.field-search svg{width:16px;height:16px}
.global-search input,.field-search input{border:0;background:transparent;outline:0;width:100%;font-size:13px;color:var(--ink)}
.global-search kbd{font-size:10px;border:1px solid var(--line-strong);border-radius:4px;padding:0 5px;background:#fff;color:var(--ink-3)}
.menu-btn{display:none}
.content{padding:26px 30px 48px;max-width:1500px;width:100%;margin:0 auto}
.view{display:none}
.view.active{display:block;animation:fade .2s ease}
@keyframes fade{from{transform:translateY(5px)}to{transform:none}}

/* ---------- 通用组件 ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;border-radius:9px;border:1px solid transparent;padding:9px 15px;font-size:13px;font-weight:600;white-space:nowrap;transition:transform .12s,background .16s,border-color .16s,box-shadow .16s}
.btn svg{width:16px;height:16px}
.btn:active{transform:scale(.98)}
.btn:disabled{opacity:.45;cursor:not-allowed}
.btn-primary{background:var(--brand);color:#fff;box-shadow:0 3px 10px rgba(31,91,74,.18)}
.btn-primary:hover:not(:disabled){background:var(--brand-dark)}
.btn-outline{background:var(--surface);border-color:var(--line-strong);color:var(--ink-2)}
.btn-outline:hover:not(:disabled){border-color:var(--brand);color:var(--brand);background:var(--brand-soft)}
.btn-light{background:#fff;color:var(--brand);border-color:#fff}
.btn-light:hover{background:var(--brand-soft)}
.btn-ghost-light{background:transparent;color:rgba(255,255,255,.9);border-color:rgba(255,255,255,.35)}
.btn-ghost-light:hover{background:rgba(255,255,255,.12)}
.btn-ghost-light svg{width:14px;height:14px}
.icon-btn{width:34px;height:34px;border:0;background:transparent;border-radius:8px;display:grid;place-items:center;color:var(--ink-2)}
.icon-btn:hover{background:var(--surface-2);color:var(--ink)}
.link-btn{border:0;background:transparent;color:var(--brand);font-size:12px;font-weight:600;display:inline-flex;align-items:center;gap:3px;padding:0}
.link-btn svg{width:13px;height:13px}
.link-btn:hover{text-decoration:underline}
.tag{display:inline-flex;align-items:center;font-size:11px;font-weight:600;padding:3px 9px;border-radius:20px;white-space:nowrap}
.tag-green{background:var(--brand-soft);color:var(--brand)}
.tag-orange{background:var(--accent-soft);color:var(--accent)}
.tag-warn{background:var(--warn-soft);color:var(--warn)}
.tag-muted{background:var(--surface-2);color:var(--ink-3);border:1px solid var(--line)}
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:20px;margin-bottom:20px}
.card-head{display:flex;align-items:baseline;gap:12px;margin-bottom:16px;flex-wrap:wrap}
.card-head h3{margin:0;font-size:15px;font-weight:650}
.card-head .muted{margin-left:auto}
.card-foot-note{display:flex;gap:7px;align-items:flex-start;margin-top:14px;padding-top:13px;border-top:1px dashed var(--line);font-size:11.5px;color:var(--ink-3);line-height:1.55}
.card-foot-note svg{width:14px;height:14px;margin-top:2px}

/* ---------- 页脚 / 备案信息 ---------- */
.site-footer{margin-top:26px;padding:18px 2px 4px;border-top:1px solid var(--line);display:flex;flex-direction:column;gap:7px;font-size:11.5px;color:var(--ink-3)}
.site-footer-row{display:flex;align-items:center;flex-wrap:wrap;gap:10px}
.footer-brand{display:inline-flex;align-items:center;gap:6px;font-weight:600;color:var(--ink-2)}
.footer-brand svg{width:14px;height:14px}
.footer-domain{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11px;color:var(--brand);background:var(--brand-soft);padding:2px 9px;border-radius:20px}
.site-footer-legal{gap:8px;font-size:11px}
.site-footer-legal a{color:var(--ink-2);text-decoration:none;border-bottom:1px dashed var(--line-strong)}
.site-footer-legal a:hover{color:var(--brand);border-bottom-color:var(--brand)}
.footer-dot{color:var(--line-strong)}

.two-col{display:grid;grid-template-columns:1fr 1fr;gap:20px}
.two-col .card{margin-bottom:20px}
.eyebrow{font-size:10px;letter-spacing:.16em;font-weight:700;text-transform:uppercase;opacity:.75}

/* ---------- 总览 ---------- */
.hero-band{
  background:linear-gradient(115deg,var(--brand-dark) 0%,var(--brand) 58%,#2c7159 100%);
  border-radius:18px;padding:30px 34px;color:#fff;display:flex;align-items:center;justify-content:space-between;gap:30px;
  margin-bottom:20px;box-shadow:0 14px 36px rgba(22,67,53,.2);position:relative;overflow:hidden;
}
.hero-band:after{content:"";position:absolute;right:-70px;top:-120px;width:340px;height:340px;border-radius:50%;border:1px solid rgba(255,255,255,.09);box-shadow:0 0 0 46px rgba(255,255,255,.035),0 0 0 92px rgba(255,255,255,.025)}
.hero-text{position:relative;z-index:1;max-width:640px}
.hero-text h2{margin:12px 0 10px;font-size:26px;line-height:1.35;font-weight:650;letter-spacing:.01em}
.hero-text p{margin:0;font-size:13px;line-height:1.8;color:rgba(255,255,255,.78);max-width:540px}
.hero-actions{display:flex;gap:10px;margin-top:22px;flex-wrap:wrap}
.hero-ring{position:relative;z-index:1;text-align:center;flex:none}
.ring{width:152px;height:152px;border-radius:50%;display:grid;place-items:center;background:conic-gradient(#e8c88a var(--p,0.58%),rgba(255,255,255,.16) 0);position:relative}
.ring:before{content:"";position:absolute;inset:11px;border-radius:50%;background:rgba(22,67,53,.55);backdrop-filter:blur(4px)}
.ring-inner{position:relative;display:flex;flex-direction:column}
.ring-inner strong{font-size:29px;font-weight:650;letter-spacing:-.02em;line-height:1.2}
.ring-inner span{font-size:10.5px;color:rgba(255,255,255,.7);margin-top:3px}
.ring-caption{font-size:11px;color:rgba(255,255,255,.7);margin-top:11px}
.kpi-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:14px;margin-bottom:20px}
.kpi{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:16px 17px;box-shadow:var(--shadow)}
.kpi .kpi-label{font-size:11.5px;color:var(--ink-3);display:flex;align-items:center;gap:6px}
.kpi .kpi-label svg{width:14px;height:14px;opacity:.8}
.kpi .kpi-value{font-size:25px;font-weight:650;line-height:1.25;margin-top:9px;letter-spacing:-.02em;font-variant-numeric:tabular-nums}
.kpi .kpi-value small{font-size:12px;font-weight:500;color:var(--ink-3);margin-left:3px}
.kpi .kpi-foot{font-size:10.5px;color:var(--ink-3);margin-top:5px}
.kpi.hl .kpi-value{color:var(--accent)}
.kpi.good .kpi-value{color:var(--brand)}
.bar-chart{display:flex;flex-direction:column;gap:11px}
.bar-row{display:grid;grid-template-columns:58px 1fr 34px;align-items:center;gap:10px;font-size:11.5px}
.bar-row .bar-label{color:var(--ink-2);font-weight:500}
.bar-track{height:9px;background:var(--surface-2);border-radius:20px;overflow:hidden;border:1px solid var(--line)}
.bar-fill{display:block;height:100%;border-radius:20px;background:linear-gradient(90deg,var(--brand),#4c9b7d);min-width:3px}
.bar-row .bar-num{text-align:right;color:var(--ink-3);font-variant-numeric:tabular-nums}
.verify-list{display:flex;flex-direction:column;gap:0;max-height:238px;overflow:auto}
.verify-item{display:flex;align-items:center;gap:10px;padding:9px 0;border-bottom:1px dashed var(--line)}
.verify-item:last-child{border-bottom:0}
.verify-item svg{width:15px;height:15px;color:var(--warn)}
.verify-item strong{font-size:12.5px;font-weight:600}
.verify-item span{font-size:11px;color:var(--ink-3);margin-left:auto;white-space:nowrap}
.recent-list{display:flex;flex-direction:column;gap:9px;min-height:120px}
.recent-item{display:flex;align-items:center;gap:11px;padding:8px;border:1px solid var(--line);border-radius:10px;background:var(--surface-2)}
.recent-thumb{width:40px;height:48px;border-radius:6px;object-fit:cover;background:var(--line);flex:none}
.recent-thumb.ph{display:grid;place-items:center;color:var(--ink-3)}
.recent-thumb.ph svg{width:17px;height:17px}
.recent-item .r-title{font-size:12.5px;font-weight:600}
.recent-item .r-meta{font-size:10.5px;color:var(--ink-3)}
.recent-item .r-time{margin-left:auto;font-size:10.5px;color:var(--ink-3);white-space:nowrap}
.recent-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;color:var(--ink-3);font-size:12px;padding:22px 0;text-align:center}
.recent-empty svg{width:26px;height:26px;opacity:.5}
.note-quote{font-size:12.5px;line-height:1.85;color:var(--ink-2);background:var(--surface-2);border-left:3px solid var(--brand);padding:13px 15px;border-radius:0 9px 9px 0;margin-bottom:14px}
.match-rule{display:flex;gap:10px;align-items:flex-start}
.match-rule svg{width:17px;height:17px;color:var(--brand);margin-top:2px}
.match-rule strong{font-size:12.5px}
.match-rule p{margin:3px 0 0;font-size:11.5px;color:var(--ink-3);line-height:1.7}

/* ---------- 工具栏 / 表格 ---------- */
.toolbar{display:flex;align-items:center;gap:14px;flex-wrap:wrap;margin-bottom:16px}
.segmented{display:inline-flex;background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:3px;gap:2px;box-shadow:var(--shadow)}
.segmented button{border:0;background:transparent;border-radius:7px;padding:7px 13px;font-size:12.5px;color:var(--ink-2);font-weight:500;white-space:nowrap}
.segmented button.active{background:var(--brand);color:#fff;font-weight:600}
.segmented button b{font-size:10.5px;margin-left:4px;opacity:.7;font-weight:600}
.toolbar-right{margin-left:auto;display:flex;gap:10px;align-items:center}
.field-search{height:36px;width:220px}
.table-card{padding:0;overflow:hidden}
.data-table{width:100%;border-collapse:collapse;font-size:13px}
.data-table th{text-align:left;font-size:11px;font-weight:600;color:var(--ink-3);letter-spacing:.03em;padding:13px 16px;background:var(--surface-2);border-bottom:1px solid var(--line);white-space:nowrap}
.data-table td{padding:12px 16px;border-bottom:1px solid var(--line);vertical-align:middle}
.data-table tbody tr:last-child td{border-bottom:0}
.data-table tbody tr:hover{background:var(--surface-2)}
.data-table .col-seq{width:78px}
.data-table .col-status{width:100px}
.data-table .col-op{width:160px;text-align:right}
.data-table .col-check{width:46px}
.seq-num{font-variant-numeric:tabular-nums;color:var(--ink-3);font-size:12px}
.book-title{font-weight:600;color:var(--ink)}
.book-author{color:var(--ink-2);font-size:12px;line-height:1.5;max-width:460px}
.row-actions{display:flex;gap:6px;justify-content:flex-end}
.mini-btn{border:1px solid var(--line-strong);background:#fff;border-radius:7px;padding:5px 9px;font-size:11.5px;color:var(--ink-2);font-weight:500;white-space:nowrap}
.mini-btn:hover{border-color:var(--brand);color:var(--brand);background:var(--brand-soft)}
.mini-btn.primary{background:var(--brand-soft);color:var(--brand);border-color:transparent}
.pager{display:flex;align-items:center;justify-content:center;gap:9px;padding:14px;border-top:1px solid var(--line);font-size:12px;color:var(--ink-2)}
.pager button{border:1px solid var(--line-strong);background:#fff;border-radius:7px;padding:5px 11px;font-size:12px;color:var(--ink-2)}
.pager button:disabled{opacity:.4}
.pager .page-info{font-variant-numeric:tabular-nums;color:var(--ink-3)}
.empty-state{text-align:center;padding:48px 20px;color:var(--ink-3);font-size:13px}
input[type=checkbox]{accent-color:var(--brand);width:15px;height:15px;cursor:pointer}

/* ---------- 藏书卡片 ---------- */
.book-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(216px,1fr));gap:14px;margin-bottom:16px}
.book-card{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:14px;box-shadow:var(--shadow);cursor:pointer;transition:transform .15s,box-shadow .15s,border-color .15s;display:flex;flex-direction:column;min-height:178px}
.book-card:hover{transform:translateY(-2px);box-shadow:0 10px 26px rgba(28,44,39,.1);border-color:var(--line-strong)}
.book-card-top{display:flex;gap:11px}
.book-cover{width:54px;height:72px;border-radius:5px;flex:none;background:linear-gradient(145deg,#eae7dd,#dcd8cc);display:grid;place-items:center;color:#8d968c;overflow:hidden;position:relative;box-shadow:inset -4px 0 8px rgba(0,0,0,.06)}
.book-cover:after{content:"";position:absolute;left:5px;top:0;bottom:0;width:2px;background:rgba(255,255,255,.35)}
.book-cover img{width:100%;height:100%;object-fit:cover}
.book-cover svg{width:20px;height:20px}
.book-card h4{margin:0 0 5px;font-size:13.5px;font-weight:650;line-height:1.45;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.book-card .bc-meta{font-size:11px;color:var(--ink-3);line-height:1.6}
.book-card-tags{display:flex;gap:5px;flex-wrap:wrap;margin-top:auto;padding-top:13px}
.book-card .bc-remark{font-size:10.5px;color:var(--warn);margin-top:8px;line-height:1.5;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.book-card .bc-seq{font-size:10px;color:var(--ink-3);margin-top:2px;font-variant-numeric:tabular-nums}

/* ---------- 待补书单 ---------- */
.gap-banner{background:linear-gradient(110deg,#2f3e38,#1d2c27);border-radius:14px;padding:22px 26px;color:#fff;display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:18px;flex-wrap:wrap}
.gap-banner h2{margin:8px 0 5px;font-size:21px;font-weight:650}
.gap-banner p{margin:0;font-size:12px;color:rgba(255,255,255,.7)}
.gap-banner-actions{display:flex;align-items:center;gap:12px}
.pill{background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.18);padding:6px 12px;border-radius:20px;font-size:11.5px}

/* ---------- 拍照录入 ---------- */
.capture-layout{display:grid;grid-template-columns:minmax(0,1.08fr) minmax(0,.92fr);gap:20px;align-items:start}
.camera-card,.form-card{margin-bottom:0}
.camera-stage{position:relative;width:100%;aspect-ratio:4/3;background:#1d2c27;border-radius:11px;overflow:hidden;display:grid;place-items:center}
#camera-video{width:100%;height:100%;object-fit:cover;display:none;transform:scaleX(var(--mirror,1))}
.camera-stage.live #camera-video{display:block}
.camera-frame{position:absolute;inset:12%;border:1px dashed rgba(255,255,255,.35);border-radius:6px;display:none;pointer-events:none}
.camera-stage.live .camera-frame{display:block}
.corner{position:absolute;width:20px;height:20px;border:2px solid #e8c88a}
.corner.tl{left:-1px;top:-1px;border-right:0;border-bottom:0}
.corner.tr{right:-1px;top:-1px;border-left:0;border-bottom:0}
.corner.bl{left:-1px;bottom:-1px;border-right:0;border-top:0}
.corner.br{right:-1px;bottom:-1px;border-left:0;border-top:0}
.camera-placeholder{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:9px;color:rgba(255,255,255,.62);text-align:center;padding:24px;background:radial-gradient(circle at 50% 40%,#2c4139,#18251f)}
.camera-placeholder svg{width:38px;height:38px;stroke-width:1.3;opacity:.7}
.camera-placeholder strong{font-size:14px;color:rgba(255,255,255,.85)}
.camera-placeholder p{font-size:11.5px;line-height:1.7;max-width:300px;margin:0}
.camera-stage.live .camera-placeholder{display:none}
.camera-status{position:absolute;left:10px;top:10px;background:rgba(0,0,0,.5);color:#fff;font-size:10.5px;padding:4px 9px;border-radius:20px;backdrop-filter:blur(4px)}
.camera-status.ok{background:rgba(31,91,74,.85)}
.scan-toast{position:absolute;bottom:12px;left:50%;transform:translateX(-50%);background:#e8c88a;color:#3a2d12;font-size:12px;font-weight:600;padding:8px 14px;border-radius:20px;box-shadow:0 6px 20px rgba(0,0,0,.25);white-space:nowrap;z-index:2}
.camera-controls{display:flex;gap:8px;flex-wrap:wrap;margin-top:14px}
.camera-controls .btn{flex:1;min-width:112px;padding:9px 10px;font-size:12px}
.btn-shutter{position:relative}
.shutter-dot{width:11px;height:11px;border-radius:50%;background:#fff;box-shadow:0 0 0 3px rgba(255,255,255,.35);flex:none}
.file-btn{cursor:pointer}
.scan-panel{display:flex;align-items:center;gap:12px;margin-top:14px;padding:11px 13px;background:var(--surface-2);border:1px solid var(--line);border-radius:9px}
.scan-panel strong{font-size:12.5px}
.scan-panel p{margin:2px 0 0;font-size:11px;color:var(--ink-3);line-height:1.5}
.scan-panel .tag{margin-left:auto}
.shot-strip{display:flex;gap:9px;flex-wrap:wrap;margin-top:14px;min-height:8px}
.shot{position:relative;width:76px;height:76px;border-radius:8px;overflow:hidden;border:1px solid var(--line-strong);background:var(--surface-2)}
.shot img{width:100%;height:100%;object-fit:cover;cursor:zoom-in}
.shot button{position:absolute;right:3px;top:3px;width:20px;height:20px;border-radius:50%;border:0;background:rgba(0,0,0,.62);color:#fff;display:grid;place-items:center;padding:0}
.shot button svg{width:12px;height:12px;stroke-width:2.4}
.shot .shot-primary{position:absolute;left:0;bottom:0;right:0;background:rgba(31,91,74,.88);color:#fff;font-size:9px;text-align:center;padding:1px 0}
.fine-print{font-size:10.5px;color:var(--ink-3);line-height:1.6;margin:12px 0 0}
.form-row{margin-bottom:14px}
.form-row.two{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.form-field{display:flex;flex-direction:column;gap:6px;min-width:0}
.form-field>span{font-size:11.5px;color:var(--ink-2);font-weight:600}
.form-field input,.form-field select{height:38px;border:1px solid var(--line-strong);background:#fff;border-radius:8px;padding:0 11px;font-size:13px;outline:0;transition:border-color .16s,box-shadow .16s;width:100%}
.form-field input:focus,.form-field select:focus{border-color:var(--brand);box-shadow:0 0 0 3px var(--brand-soft)}
.form-field input:disabled{background:var(--surface-2);color:var(--ink-3)}
.form-field small{font-size:10.5px;color:var(--ink-3)}
.match-suggest{border:1px solid var(--line);border-radius:9px;margin:-6px 0 14px;overflow:hidden;box-shadow:var(--shadow)}
.match-suggest .ms-head{padding:8px 12px;background:var(--brand-soft);color:var(--brand);font-size:11px;font-weight:600}
.match-suggest button{display:flex;width:100%;gap:10px;align-items:center;text-align:left;border:0;border-top:1px solid var(--line);background:#fff;padding:9px 12px;font-size:12px}
.match-suggest button:hover{background:var(--surface-2)}
.match-suggest .ms-seq{color:var(--ink-3);font-size:11px;font-variant-numeric:tabular-nums;min-width:28px}
.match-suggest .ms-title{font-weight:600}
.match-suggest .ms-author{color:var(--ink-3);font-size:10.5px;margin-left:auto;max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.link-box{background:var(--surface-2);border:1px solid var(--line);border-radius:10px;padding:14px;margin:4px 0 18px}
.link-box-head{display:flex;align-items:center;gap:7px;margin-bottom:11px}
.link-box-head svg{width:15px;height:15px;color:var(--brand)}
.link-box-head strong{font-size:12.5px}
.switch-line{display:flex;align-items:center;gap:9px;font-size:12.5px;cursor:pointer;font-weight:500}
.switch-line input{position:absolute;opacity:0;width:0;height:0}
.switch{width:34px;height:19px;border-radius:20px;background:var(--line-strong);position:relative;transition:background .18s;flex:none}
.switch:after{content:"";position:absolute;left:2px;top:2px;width:15px;height:15px;border-radius:50%;background:#fff;transition:transform .18s;box-shadow:0 1px 3px rgba(0,0,0,.2)}
.switch-line input:checked+.switch{background:var(--brand)}
.switch-line input:checked+.switch:after{transform:translateX(15px)}
.inline-field{margin-top:12px;max-width:200px}
.inline-field input{height:34px}
.link-tip{font-size:10.5px;color:var(--ink-3);margin:10px 0 0}
.form-actions{display:flex;gap:10px;justify-content:flex-end;border-top:1px solid var(--line);padding-top:16px}

/* ---------- 数据说明 ---------- */
.about-notes{display:flex;flex-direction:column;gap:14px}
.about-note{border-left:2px solid var(--line-strong);padding-left:12px}
.about-note strong{font-size:12.5px;display:block;margin-bottom:3px}
.about-note p{margin:0;font-size:11.5px;color:var(--ink-2);line-height:1.75}
.sheet-list{display:flex;flex-direction:column;gap:8px}
.sheet-row{display:flex;align-items:center;gap:10px;padding:9px 11px;border:1px solid var(--line);border-radius:9px;background:var(--surface-2)}
.sheet-row svg{width:15px;height:15px;color:var(--brand)}
.sheet-row strong{font-size:12.5px}
.sheet-row span{margin-left:auto;font-size:11px;color:var(--ink-3)}
.metric-list{display:flex;flex-direction:column}
.metric-row{display:flex;align-items:center;gap:12px;padding:10px 0;border-bottom:1px dashed var(--line)}
.metric-row:last-child{border-bottom:0}
.metric-row .m-label{font-size:12.5px;color:var(--ink-2)}
.metric-row .m-value{margin-left:auto;font-weight:650;font-size:14px;font-variant-numeric:tabular-nums}
.metric-row .m-note{font-size:10.5px;color:var(--ink-3);max-width:280px;text-align:right;line-height:1.5}
.roadmap{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:14px}
.roadmap li{display:flex;gap:12px;align-items:flex-start}
.roadmap .step{font-size:10px;font-weight:700;color:var(--brand);background:var(--brand-soft);border-radius:6px;padding:3px 6px;letter-spacing:.05em;flex:none;margin-top:2px}
.roadmap strong{font-size:12.5px}
.roadmap p{margin:2px 0 0;font-size:11.5px;color:var(--ink-3);line-height:1.6}

/* ---------- 抽屉 / 弹层 ---------- */
.drawer-backdrop{position:fixed;inset:0;background:rgba(20,32,28,.35);opacity:0;pointer-events:none;transition:opacity .2s;z-index:60}
.drawer-backdrop.open{opacity:1;pointer-events:auto}
.drawer{position:fixed;right:0;top:0;bottom:0;width:min(430px,92vw);background:var(--surface);z-index:61;transform:translateX(100%);transition:transform .25s cubic-bezier(.2,.8,.2,1);box-shadow:var(--shadow-lg);display:flex;flex-direction:column}
.drawer.open{transform:none}
.drawer-head{display:flex;align-items:center;gap:12px;padding:18px 22px;border-bottom:1px solid var(--line)}
.drawer-head h2{margin:0;font-size:16px;font-weight:650;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.drawer-body{padding:22px;overflow-y:auto;flex:1}
.detail-photo{width:100%;max-height:260px;object-fit:contain;background:var(--surface-2);border-radius:10px;border:1px solid var(--line);margin-bottom:16px}
.detail-grid{display:grid;grid-template-columns:82px 1fr;gap:10px 14px;font-size:12.5px;margin-bottom:18px}
.detail-grid dt{color:var(--ink-3)}
.detail-grid dd{margin:0;line-height:1.65}
.detail-section{border-top:1px solid var(--line);padding-top:16px;margin-top:16px}
.detail-section h4{margin:0 0 10px;font-size:12.5px}
.detail-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:18px}
.photo-thumbs{display:flex;gap:8px;flex-wrap:wrap}
.photo-thumbs img{width:72px;height:88px;object-fit:cover;border-radius:7px;border:1px solid var(--line);cursor:zoom-in}
.lightbox{position:fixed;inset:0;background:rgba(12,20,17,.9);z-index:80;display:grid;place-items:center;padding:30px}
.lightbox img{max-width:100%;max-height:100%;object-fit:contain;border-radius:6px}
.lightbox-close{position:absolute;right:20px;top:20px;color:#fff;background:rgba(255,255,255,.12)}
.toast-host{position:fixed;right:24px;bottom:24px;z-index:90;display:flex;flex-direction:column;gap:9px;align-items:flex-end}
.toast{background:#1d2c27;color:#fff;padding:11px 16px;border-radius:10px;font-size:12.5px;box-shadow:var(--shadow-lg);display:flex;align-items:center;gap:9px;animation:toastIn .25s ease;max-width:340px}
.toast svg{width:16px;height:16px;color:#8fd3b3}
.toast.error svg{color:#f0a89b}
@keyframes toastIn{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}
.modal-backdrop{position:fixed;inset:0;background:rgba(20,32,28,.4);z-index:85;display:grid;place-items:center;padding:20px}
.modal{background:#fff;border-radius:14px;padding:24px;width:min(400px,92vw);box-shadow:var(--shadow-lg)}
.modal h3{margin:0 0 8px;font-size:16px}
.modal p{margin:0 0 20px;font-size:13px;color:var(--ink-2);line-height:1.7}
.modal-actions{display:flex;justify-content:flex-end;gap:9px}

/* ---------- 占位封面（无实拍照片时显示书名） ---------- */
.book-cover.placeholder{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;text-align:center;padding:5px}
.book-cover.placeholder span{font-size:9px;line-height:1.25;color:#6f7d72;font-weight:600;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.book-cover.placeholder svg{width:13px;height:13px;opacity:.5}

/* ---------- 移动端组件（桌面默认隐藏） ---------- */
.bottom-tab,.mobile-search-btn,.mobile-select-all,.capture-savebar{display:none}

/* ---------- 响应式 ---------- */
@media(max-width:1280px){.kpi-grid{grid-template-columns:repeat(3,1fr)}}
@media(max-width:1080px){
  .two-col,.capture-layout{grid-template-columns:1fr}
  .hero-band{padding:26px}
  .hero-text h2{font-size:22px}
}
@media(max-width:920px){
  .sidebar{position:fixed;left:0;top:0;transform:translateX(-100%);transition:transform .24s;box-shadow:var(--shadow-lg)}
  body.sidebar-open .sidebar{transform:none}
  body.sidebar-open:before{content:"";position:fixed;inset:0;background:rgba(20,32,28,.42);z-index:39}
  .menu-btn{display:grid}
  .topbar{padding:0 18px;gap:10px}
  .content{padding:20px 18px 40px}
  .global-search{width:190px}
}
@media(max-width:680px){
  /* 顶栏：单行 + 可展开搜索 */
  .topbar{height:56px;min-height:56px;flex-wrap:nowrap;padding:0 12px;gap:6px}
  .page-heading{flex:1;min-width:0}
  .page-heading h1{font-size:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .page-heading p{display:none}
  .topbar-tools{width:auto;margin-left:auto;gap:2px;flex:none}
  .mobile-search-btn{display:grid;position:relative;z-index:7}
  #quick-capture{display:none}
  .global-search{
    position:absolute;left:10px;right:52px;top:8px;height:40px;width:auto;z-index:6;
    background:#fff;box-shadow:0 8px 24px rgba(28,44,39,.16);opacity:0;pointer-events:none;
    transform:translateY(-8px);transition:opacity .18s,transform .18s;
  }
  body.search-open .global-search{opacity:1;pointer-events:auto;transform:none}
  .global-search kbd{display:none}
  .global-search input,.field-search input,.form-field input,.form-field select{font-size:16px}

  .content{padding:16px 12px calc(86px + env(safe-area-inset-bottom))}
  body.view-capture .content{padding-bottom:calc(172px + env(safe-area-inset-bottom))}
  .card{padding:16px;border-radius:12px;margin-bottom:14px}
  .card-head{margin-bottom:13px}
  .card-head h3{font-size:14.5px}
  .card-head .muted{font-size:11px;flex-basis:100%;margin-left:0}
  .two-col{gap:14px}
  .capture-layout{grid-template-columns:1fr;gap:14px}

  /* 底部导航 */
  .bottom-tab{
    display:flex;position:fixed;left:0;right:0;bottom:0;z-index:38;
    background:rgba(255,255,255,.96);-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);
    border-top:1px solid var(--line);padding:6px 4px calc(6px + env(safe-area-inset-bottom));
    box-shadow:0 -4px 18px rgba(28,44,39,.06);
  }
  .tab-item{
    flex:1;min-width:0;border:0;background:transparent;display:flex;flex-direction:column;
    align-items:center;justify-content:center;gap:3px;padding:4px 2px;color:var(--ink-3);
    font-size:10px;font-weight:500;min-height:48px;border-radius:10px;
  }
  .tab-item svg{width:20px;height:20px}
  .tab-item.active{color:var(--brand);font-weight:700}
  .tab-capture-btn{
    width:46px;height:46px;border-radius:50%;background:var(--brand);color:#fff;
    display:grid;place-items:center;margin-top:-24px;box-shadow:0 6px 16px rgba(31,91,74,.3);
    border:3px solid #fff;
  }
  .tab-capture-btn svg{width:21px;height:21px}
  .tab-item.tab-capture.active .tab-capture-btn{background:var(--brand-dark);box-shadow:0 6px 20px rgba(22,67,53,.45)}
  .tab-capture>span:last-child{margin-top:1px}
  /* 拍照页已有固定保存条，取消凸起按钮避免两层叠加 */
  body.view-capture .tab-capture-btn{margin-top:0;width:32px;height:32px;border-width:2px}
  body.view-capture .tab-capture-btn svg{width:18px;height:18px}

  /* 抽屉 → 底部面板 */
  .drawer{top:auto;left:0;right:0;bottom:0;width:100%;height:min(86vh,720px);border-radius:20px 20px 0 0;transform:translateY(100%)}
  .drawer.open{transform:none}
  .drawer-head{padding:20px 18px 14px;position:relative}
  .drawer-head:before{content:"";position:absolute;top:8px;left:50%;transform:translateX(-50%);width:36px;height:4px;border-radius:4px;background:var(--line-strong)}
  .drawer-body{padding:16px 16px calc(24px + env(safe-area-inset-bottom))}
  .detail-actions .btn{flex:1;min-width:calc(50% - 4px)}

  /* 总览 */
  .hero-band{padding:20px 18px;flex-direction:column;align-items:flex-start;gap:16px;border-radius:14px}
  .hero-text h2{font-size:20px;margin:10px 0 8px}
  .hero-text p{font-size:12px}
  .hero-actions{gap:8px;margin-top:16px}
  .hero-actions .btn{flex:1;min-width:0;padding:9px 8px;font-size:12px}
  .hero-ring{align-self:center}
  .ring{width:118px;height:118px}
  .ring-inner strong{font-size:23px}
  .kpi-grid{grid-template-columns:repeat(2,1fr);gap:9px;margin-bottom:14px}
  .kpi{padding:12px}
  .kpi .kpi-label{font-size:10.5px}
  .kpi .kpi-value{font-size:20px;margin-top:6px}
  .kpi .kpi-foot{font-size:9.5px}
  .bar-row{grid-template-columns:48px 1fr 28px;font-size:11px}
  .verify-item strong{font-size:12px}
  .verify-item span{font-size:10px;max-width:54%;text-align:right;white-space:normal}

  /* 筛选 / 工具栏 */
  .toolbar{gap:10px;margin-bottom:12px}
  .segmented{width:100%;overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch}
  .segmented::-webkit-scrollbar{display:none}
  .segmented button{min-height:40px;padding:7px 12px;flex:1;font-size:12px}
  .toolbar-right{width:100%;margin-left:0;gap:8px}
  .field-search{flex:1;width:auto;height:42px}
  .mobile-select-all{display:inline-flex;flex:none;min-height:42px;padding:8px 10px;font-size:12px}

  /* 表格 → 卡片流 */
  .table-card{background:transparent;border:0;box-shadow:none;padding:0}
  .data-table thead{display:none}
  .data-table,.data-table tbody{display:block;width:100%}
  .data-table tbody tr{
    display:grid;grid-template-columns:1fr auto;gap:5px 8px;
    background:var(--surface);border:1px solid var(--line);border-radius:12px;
    padding:12px 13px;margin-bottom:10px;box-shadow:var(--shadow);
  }
  .data-table tbody tr:hover{background:var(--surface)}
  .data-table td{display:block;border:0;padding:0;width:auto}
  .data-table .seq-num{font-size:11px}
  #rec-tbody tr{grid-template-areas:"seq status" "title title" "author author" "op op"}
  #rec-tbody td:nth-child(1){grid-area:seq}
  #rec-tbody td:nth-child(2){grid-area:title}
  #rec-tbody td:nth-child(3){grid-area:author}
  #rec-tbody td:nth-child(4){grid-area:status;text-align:right}
  #rec-tbody td:nth-child(5){grid-area:op}
  #gap-tbody tr{grid-template-columns:34px 1fr;grid-template-areas:"check seq" "check title" "check author" "op op"}
  #gap-tbody td:nth-child(1){grid-area:check;align-self:center}
  #gap-tbody td:nth-child(2){grid-area:seq}
  #gap-tbody td:nth-child(3){grid-area:title}
  #gap-tbody td:nth-child(4){grid-area:author}
  #gap-tbody td:nth-child(5){grid-area:op}
  .data-table .book-title{font-size:14.5px;display:block;line-height:1.45}
  .data-table .book-author{display:block;font-size:11.5px;max-width:none;color:var(--ink-3);line-height:1.5}
  .data-table .col-op{width:auto;text-align:left}
  .row-actions{justify-content:flex-start;gap:8px;margin-top:5px}
  .mini-btn{min-height:38px;padding:8px 14px;font-size:12px}
  input[type=checkbox]{width:22px;height:22px}
  .pager{padding:12px 6px 4px;background:transparent;border:0;gap:8px}
  .pager button{min-height:42px;min-width:64px}
  .pager .page-info{font-size:11px}

  /* 藏书卡片：两列纵向 */
  .book-grid{grid-template-columns:repeat(2,1fr);gap:10px}
  .book-card{padding:11px;min-height:0;border-radius:12px}
  .book-card-top{flex-direction:column;gap:9px}
  .book-cover{width:100%;height:98px;border-radius:7px}
  .book-cover.placeholder span{font-size:12px;max-width:92%}
  .book-card h4{font-size:12.5px}
  .book-card-tags{padding-top:9px;gap:4px}
  .book-card .tag{font-size:10px;padding:2px 7px}

  /* 待补书单 */
  .gap-banner{padding:16px;gap:12px;border-radius:12px}
  .gap-banner h2{font-size:18px}
  .gap-banner-actions{width:100%;justify-content:space-between}

  /* 拍照录入 */
  .camera-card .card-head .muted{flex-basis:100%}
  .camera-stage{aspect-ratio:4/3;max-height:44vh}
  .camera-controls{display:grid;grid-template-columns:1fr 1fr;gap:8px}
  .camera-controls .btn{min-width:0;min-height:44px;padding:10px 6px;font-size:12px}
  #btn-shutter{order:-1;grid-column:1/-1;min-height:52px;font-size:15px}
  .file-btn{grid-column:1/-1}
  .shutter-dot{width:13px;height:13px}
  .scan-panel{padding:10px 11px}
  .scan-panel p{font-size:10.5px}
  .shot{width:82px;height:82px}
  .shot button{width:26px;height:26px}
  .shot button svg{width:14px;height:14px}
  .form-row.two{grid-template-columns:1fr;gap:12px}
  .form-field input,.form-field select{height:46px}
  .form-field>span{font-size:12px}
  .switch-line{min-height:44px;font-size:13px}
  .link-box{padding:13px}
  .inline-field{max-width:100%}
  .form-actions{display:none}
  .match-suggest button{min-height:44px}
  .ms-author{display:none}

  /* 固定保存条（仅拍照页） */
  body.view-capture .capture-savebar{
    display:flex;position:fixed;left:0;right:0;bottom:calc(60px + env(safe-area-inset-bottom));
    z-index:37;align-items:center;gap:10px;padding:9px 12px;
    background:rgba(255,255,255,.97);-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);
    border-top:1px solid var(--line);box-shadow:0 -6px 20px rgba(28,44,39,.09);
  }
  .savebar-reset{width:38px;height:38px;flex:none;border:1px solid var(--line-strong);background:#fff;border-radius:9px;display:grid;place-items:center;color:var(--ink-2)}
  .savebar-reset svg{width:16px;height:16px}
  .savebar-info{min-width:0;flex:1;display:flex;flex-direction:column;line-height:1.35}
  .savebar-info strong{font-size:12.5px;font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .savebar-info span{font-size:10px;color:var(--ink-3);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  #btn-save-mobile{flex:none;min-height:42px;padding:9px 15px}

  /* 弹层与提示 */
  .metric-row .m-note{display:none}
  .sheet-row span{font-size:10px;text-align:right}
  .toast-host{left:12px;right:12px;bottom:calc(76px + env(safe-area-inset-bottom));align-items:center}
  .toast{max-width:100%;font-size:12px}
  .lightbox-close{top:calc(14px + env(safe-area-inset-top));right:14px}
  .modal{border-radius:16px;padding:20px}
}
@media(max-width:360px){
  .kpi .kpi-value{font-size:18px}
  .tab-item{font-size:9px}
  .camera-controls .btn{font-size:11px}
  .tab-capture-btn{width:42px;height:42px}
}
/* 手机端页脚：居中收拢，避免备案号换行后过于零散 */
@media(max-width:680px){
  .site-footer{margin-top:20px;padding:14px 4px 6px;gap:7px;text-align:center}
  .site-footer-row{justify-content:center;gap:8px}
  .site-footer-legal{font-size:10.5px;line-height:1.9}
  .footer-brand svg{width:13px;height:13px}
}
