/* 湖北合信智能检验系统 · 全局样式 */
:root {
  --bg: #eef2f8;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --border: #e4e9f2;
  --border-strong: #d1dae8;
  --text: #15202e;
  --text-2: #55637a;
  --muted: #8b97a8;
  --brand: #0f5fbf;
  --brand-2: #1a7fd4;
  --brand-ink: #0a3566;
  --brand-weak: #eaf2ff;
  --brand-line: #cfe1fb;
  --danger: #d92b2b;
  --danger-weak: #fdeceb;
  --warn: #b26a00;
  --warn-weak: #fff5e5;
  --ok: #0f7a4d;
  --ok-weak: #e8f7ef;
  --seal: #c8302b;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(16, 29, 48, .06);
  --shadow: 0 1px 2px rgba(16, 29, 48, .04), 0 12px 32px -14px rgba(16, 29, 48, .22);
  --shadow-lg: 0 30px 70px -24px rgba(9, 24, 45, .34);
  --font: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
button, input, select, textarea { font-family: inherit; font-size: 14px; }
::selection { background: rgba(15, 95, 191, .16); }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c8d3e2; border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #a9b8cc; background-clip: content-box; }

/* ---------- 登录页 ---------- */
.login-body { background: #081525; }
.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(400px, 1fr);
}
.login-brand {
  position: relative;
  overflow: hidden;
  color: #fff;
  padding: 64px 72px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    radial-gradient(880px 520px at 14% 6%, rgba(48, 142, 240, .55), transparent 62%),
    radial-gradient(660px 480px at 90% 94%, rgba(0, 198, 255, .20), transparent 62%),
    linear-gradient(135deg, #0a2244 0%, #0d3c74 50%, #0f5fbf 100%);
}
.login-brand::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .055) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(circle at 32% 42%, #000 0%, transparent 76%);
  mask-image: radial-gradient(circle at 32% 42%, #000 0%, transparent 76%);
  pointer-events: none;
}
.login-brand::after {
  content: "";
  position: absolute;
  width: 520px; height: 520px;
  right: -190px; bottom: -230px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 0 0 64px rgba(255, 255, 255, .028), 0 0 0 148px rgba(255, 255, 255, .018);
  pointer-events: none;
}
.login-brand-inner { position: relative; z-index: 2; max-width: 560px; }
.login-logo { margin-bottom: 36px; }
.login-logo img {
  display: block;
  width: 320px;
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 8px 22px rgba(0, 0, 0, .3));
}
.login-brand h1 { font-size: 40px; font-weight: 700; letter-spacing: 5px; line-height: 1.22; }
.login-brand .en { opacity: .68; letter-spacing: 3.6px; font-size: 12px; margin-top: 16px; }
.brand-rule {
  width: 58px; height: 3px; border-radius: 2px; margin: 26px 0 16px;
  background: linear-gradient(90deg, #58aeff, rgba(88, 174, 255, 0));
}
.brand-org { font-size: 13.5px; color: rgba(255, 255, 255, .78); letter-spacing: 1.8px; }
.login-brand-foot {
  position: absolute; left: 72px; bottom: 34px; z-index: 2;
  font-size: 12px; letter-spacing: 1px; color: rgba(255, 255, 255, .42);
}

.login-panel {
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(760px 420px at 100% 0%, #f1f7ff 0%, rgba(241, 247, 255, 0) 62%),
    radial-gradient(620px 380px at 0% 100%, #f6f9ff 0%, rgba(246, 249, 255, 0) 60%),
    var(--surface);
  padding: 48px 32px; position: relative;
}
.login-card { width: 372px; max-width: 100%; }
.login-mobile-logo { display: none; }
.login-card h2 { font-size: 26px; letter-spacing: 1px; }
.login-card .sub { color: var(--text-2); margin: 10px 0 30px; font-size: 13px; line-height: 1.7; }
.login-panel .input { height: 46px; border-radius: 10px; background: #f8fafd; }
.login-panel .input:focus { background: #fff; }
.login-panel .field label { font-size: 13px; }
.login-panel .btn-block { height: 48px; font-size: 15px; letter-spacing: 2px; }
.login-tip { margin-top: 18px; font-size: 12px; color: var(--muted); line-height: 1.8; }
.login-panel-foot {
  position: absolute; bottom: 26px; left: 0; right: 0; text-align: center;
  font-size: 11.5px; color: #a9b4c4; letter-spacing: .4px;
}

@media (max-width: 960px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-panel { padding: 40px 22px; background: linear-gradient(180deg, #f6f9fe 0%, #fff 40%); }
  .login-card {
    background: #fff; border: 1px solid var(--border); border-radius: 18px;
    padding: 30px 26px; box-shadow: var(--shadow);
  }
  .login-mobile-logo { display: block; margin-bottom: 20px; }
  .login-mobile-logo img { display: block; width: 196px; max-width: 100%; height: auto; }
  .login-panel-foot { display: none; }
}

/* ---------- 启动页 ---------- */
.boot-body {
  background:
    radial-gradient(760px 460px at 50% -10%, rgba(47, 139, 240, .5), transparent 62%),
    linear-gradient(150deg, #081a30 0%, #0d3c74 55%, #0b2b52 100%);
}
.boot { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; }
.boot-logo { width: 244px; max-width: 70vw; height: auto; filter: drop-shadow(0 8px 22px rgba(0, 0, 0, .32)); }
.boot-title { color: rgba(255, 255, 255, .86); font-size: 15px; letter-spacing: 3.4px; }
.boot-bar { width: 180px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .16); overflow: hidden; }
.boot-bar i { display: block; width: 40%; height: 100%; border-radius: 2px; background: linear-gradient(90deg, #57aeff, #ffffff); animation: bootSlide 1.2s ease-in-out infinite; }
@keyframes bootSlide { 0% { transform: translateX(-110%); } 100% { transform: translateX(360%); } }
.boot-text { color: rgba(255, 255, 255, .5); font-size: 12.5px; letter-spacing: 1px; }

/* ---------- 应用外壳 ---------- */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  background: linear-gradient(180deg, #0a1626 0%, #0c1e33 58%, #0a1828 100%);
  color: #c2cfe0;
  display: flex;
  flex-direction: column;
  padding: 0 12px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid rgba(255, 255, 255, .05);
}
.brand {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  padding: 22px 10px 20px; margin-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.brand img { display: block; width: 148px; height: auto; }
.brand-sub {
  font-family: "Microsoft YaHei", "微软雅黑", "PingFang SC", "Hiragino Sans GB", sans-serif;
  font-size: 16px; font-weight: 700; letter-spacing: .6px; line-height: 1.45;
  color: #ffffff; padding-left: 1px; white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .35);
}
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, #2f8bf0, #0f5fbf);
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px;
}
.brand-text b { display: block; color: #fff; font-size: 14px; letter-spacing: .5px; }
.brand-text span { font-size: 11px; color: #7b8ba3; letter-spacing: 1px; }
.nav-group { margin-top: 16px; }
.nav-group-title {
  font-size: 11px; color: #62758f; padding: 0 12px 8px; letter-spacing: 1.6px;
}
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 9px; color: #c2cfe0;
  cursor: pointer; font-size: 13.5px; margin-bottom: 3px;
  transition: background .16s, color .16s, transform .16s;
}
.nav-item:hover { background: rgba(255, 255, 255, .07); text-decoration: none; color: #fff; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(26, 127, 212, .95), rgba(15, 95, 191, .78));
  color: #fff; font-weight: 600;
  box-shadow: 0 6px 18px -8px rgba(20, 120, 220, .9);
}
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: #6fc0ff;
}
.nav-item .ico { width: 18px; height: 18px; display: grid; place-items: center; opacity: .88; }
.nav-item .ico svg { display: block; width: 17px; height: 17px; }
.nav-item.active .ico { opacity: 1; }
.sidebar-footer {
  margin-top: auto; font-size: 11.5px; color: #64768e; padding: 12px 12px 4px;
  letter-spacing: .5px; border-top: 1px solid rgba(255, 255, 255, .06);
}

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 60px; background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 16.5px; letter-spacing: .6px; position: relative; padding-left: 12px; }
.topbar h1::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 16px; border-radius: 2px;
  background: linear-gradient(180deg, var(--brand-2), var(--brand));
}
.topbar .right { display: flex; align-items: center; gap: 14px; }
.user-chip { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text-2); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #e8f1ff, #d3e5ff);
  color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 12.5px;
  box-shadow: inset 0 0 0 1px rgba(15, 95, 191, .12);
}
.content { padding: 24px; max-width: 1440px; width: 100%; margin: 0 auto; }

/* ---------- 卡片 / 表单 ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px;
  overflow: hidden;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 20px; border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #fdfefe, #fafcff);
}
.card-head h3 { font-size: 15px; letter-spacing: .3px; }
.card-head .hint { color: var(--muted); font-size: 12px; }
.card-body { padding: 20px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.inspector-grid { display: grid; grid-template-columns: 400px minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1180px) { .inspector-grid { grid-template-columns: 1fr; } }
@media (max-width: 1100px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 7px; font-weight: 500; }
.field .req { color: var(--danger); margin-left: 2px; }
.input, .select, .textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: #fff; color: var(--text); outline: none;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
.input::placeholder, .textarea::placeholder { color: #aab4c4; }
.input:hover, .select:hover, .textarea:hover { border-color: #bccada; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3.5px rgba(15, 95, 191, .13);
}
.input:disabled { background: #f2f5f9; color: var(--muted); cursor: not-allowed; }
.select { padding-right: 28px; }
.form-row { display: flex; gap: 12px; }
.form-row > * { flex: 1; }
.help { font-size: 12px; color: var(--muted); margin-top: 7px; line-height: 1.7; }
.error-text { color: var(--danger); font-size: 12.5px; margin-top: 6px; min-height: 18px; }
input[type="checkbox"] { cursor: pointer; accent-color: var(--brand); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 17px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: #fff; color: var(--text); cursor: pointer; font-size: 13.5px;
  transition: .16s; white-space: nowrap; box-shadow: var(--shadow-sm);
  text-decoration: none;
}
.btn:hover { border-color: #b6c4d8; background: var(--surface-2); color: var(--brand); text-decoration: none; }
.btn:active { transform: translateY(.5px); }
.btn:disabled { opacity: 1; background: #eef2f8; border-color: #e0e7f1; color: #a6b3c5; cursor: not-allowed; box-shadow: none; }
.btn:disabled .spinner { border-color: #c8d3e3; border-top-color: var(--brand); }
.btn:disabled:has(.spinner) {
  background: linear-gradient(180deg, #1a72d0, var(--brand)); border-color: #0d55ab; color: #fff;
}
.btn:disabled:has(.spinner) .spinner { border-color: rgba(255,255,255,.4); border-top-color: #fff; }
.btn-primary {
  background: linear-gradient(180deg, #1a72d0, var(--brand));
  border-color: #0d55ab; color: #fff;
  box-shadow: 0 4px 12px -4px rgba(15, 95, 191, .55);
}
.btn-primary:hover { background: linear-gradient(180deg, #1c7ce0, #0d56ad); border-color: #0a4a96; color: #fff; }
.btn-danger { background: linear-gradient(180deg, #e04040, var(--danger)); border-color: #bf2222; color: #fff; }
.btn-danger:hover { background: #b81f1f; border-color: #b81f1f; color: #fff; }
.btn-seal { background: linear-gradient(180deg, #d4433c, var(--seal)); border-color: #b02a25; color: #fff; box-shadow: 0 4px 14px -5px rgba(200, 48, 43, .6); }
.btn-seal:hover { background: #ab241f; border-color: #ab241f; color: #fff; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 7px; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--brand); box-shadow: none; }
.btn-ghost:hover { background: var(--brand-weak); border-color: transparent; }
.btn-block { width: 100%; padding: 12px; font-size: 14.5px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
table.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.table th {
  text-align: left; font-weight: 600; color: var(--text-2); background: #f5f8fc;
  padding: 11px 14px; border-bottom: 1px solid var(--border); white-space: nowrap;
  font-size: 12.5px; letter-spacing: .3px;
}
.table th:first-child { border-top-left-radius: 8px; }
.table th:last-child { border-top-right-radius: 8px; }
.table td { padding: 11px 14px; border-bottom: 1px solid #eff2f7; vertical-align: middle; }
.table td.mono, .table td.num, .table td.nowrap { white-space: nowrap; }
.nowrap { white-space: nowrap; }
.table tbody tr { transition: background .14s; }
.table tbody tr:hover { background: #f7fafe; }
.table tbody tr:last-child td { border-bottom: none; }
.table .num { font-variant-numeric: tabular-nums; }
.table .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.empty { padding: 52px 0; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- 标签 / 状态 ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px;
  border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.6;
  white-space: nowrap;
}
.chip .dot { box-shadow: 0 0 0 2.5px rgba(255, 255, 255, .65); }
.chip-draft { background: #eef1f6; color: #58657a; }
.chip-stamping { background: var(--warn-weak); color: var(--warn); }
.chip-stamped { background: var(--ok-weak); color: var(--ok); }
.chip-failed { background: var(--danger-weak); color: var(--danger); }
.chip-role-admin { background: #eaf2ff; color: #0f5fbf; }
.chip-role-inspector { background: #eafaf3; color: #0f7a4d; }
.chip-role-user { background: #f3f0ff; color: #6b46c1; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters .input, .filters .select { width: auto; min-width: 140px; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.stat {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-sm); transition: .18s;
}
.stat::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--brand-2), var(--brand));
}
.stat:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.stat .k { font-size: 12px; color: var(--muted); letter-spacing: .4px; }
.stat .v { font-size: 26px; font-weight: 700; margin-top: 7px; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
@media (max-width: 900px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }

/* ---------- 上传区 ---------- */
.dropzone {
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius);
  padding: 30px 22px; text-align: center; color: var(--text-2); cursor: pointer;
  background: linear-gradient(180deg, #fbfcfe, #f5f8fc); transition: .18s;
}
.dropzone:hover, .dropzone.drag {
  border-color: var(--brand); background: var(--brand-weak); color: var(--brand);
  box-shadow: inset 0 0 0 3px rgba(15, 95, 191, .05);
}
.dropzone b { display: block; margin-bottom: 7px; color: var(--text); font-size: 13.5px; }
.dropzone span { font-size: 12px; }
.dropzone.drag b { color: var(--brand); }
.dz-icon {
  width: 42px; height: 42px; margin: 0 auto 12px; border-radius: 12px;
  display: grid; place-items: center; background: var(--brand-weak); color: var(--brand);
  box-shadow: inset 0 0 0 1px rgba(15, 95, 191, .1);
  transition: .18s;
}
.dz-icon svg { width: 22px; height: 22px; }
.dropzone:hover .dz-icon, .dropzone.drag .dz-icon { background: #fff; transform: translateY(-1px); }

/* ---------- 预览区 ---------- */
.preview-box {
  background: linear-gradient(180deg, #e6ebf3, #eef2f8);
  border: 1px solid var(--border); border-radius: var(--radius);
  min-height: 420px; max-height: 68vh; overflow: auto; padding: 18px; position: relative;
  box-shadow: inset 0 2px 8px rgba(20, 32, 52, .06);
}
.pdf-page { position: relative; margin: 0 auto 16px; background: #fff; box-shadow: 0 2px 12px rgba(15, 28, 48, .14); }
.pdf-page canvas { display: block; }
.pdf-page .hit {
  position: absolute; border: 2px solid rgba(217, 43, 43, .9);
  background: rgba(217, 43, 43, .10); border-radius: 3px; pointer-events: none;
}
.pdf-page .hit.chosen { border-color: var(--brand); background: rgba(15, 95, 191, .13); box-shadow: 0 0 0 3px rgba(15, 95, 191, .14); }
.pdf-page .seal-ghost {
  position: absolute; pointer-events: none; opacity: .55;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .2));
}
.pdf-page.pickable { cursor: crosshair; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.page-indicator { font-size: 12.5px; color: var(--text-2); }

/* ---------- 弹窗 / 提示 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(10, 20, 34, .5);
  backdrop-filter: blur(2px);
  display: grid; place-items: center; z-index: 100; padding: 20px;
  animation: fadeIn .14s ease-out;
}
.modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 520px;
  box-shadow: var(--shadow-lg); overflow: hidden;
  animation: popIn .18s cubic-bezier(.2, .9, .3, 1.1);
}
.modal.wide { max-width: 780px; }
.modal-head { padding: 17px 22px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; background: linear-gradient(180deg, #fdfefe, #fafcff); }
.modal-body { padding: 22px; max-height: 66vh; overflow: auto; }
.modal-foot { padding: 15px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; background: var(--surface-2); }
.modal-close { border: none; background: none; font-size: 22px; color: var(--muted); cursor: pointer; line-height: 1; border-radius: 6px; padding: 0 4px; }
.modal-close:hover { color: var(--text); background: #eef1f6; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }

.toast-wrap { position: fixed; top: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 9px; }
.toast {
  min-width: 220px; max-width: 380px; padding: 12px 15px; border-radius: 10px;
  background: #fff; box-shadow: 0 10px 30px -8px rgba(10, 22, 40, .3); border-left: 3px solid var(--brand);
  font-size: 13px; animation: slideIn .2s ease-out; line-height: 1.6;
}
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warn); }
@keyframes slideIn { from { transform: translateX(14px); opacity: 0; } to { transform: none; opacity: 1; } }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
.spinner {
  width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.badge-num { background: var(--danger); color: #fff; border-radius: 999px; padding: 0 6px; font-size: 11px; }

/* ---------- 移动端：侧栏转为底部横向导航（一行 5 个，超出横向滑动） ---------- */
.mobile-only { display: none; }
@media (max-width: 900px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
    padding-bottom: calc(62px + env(safe-area-inset-bottom));
  }
  .sidebar {
    position: fixed; top: auto; left: 0; right: 0; bottom: 0;
    height: auto; z-index: 60;
    flex-direction: row; align-items: stretch; gap: 2px;
    padding: 5px 5px calc(5px + env(safe-area-inset-bottom));
    border-right: 0; border-top: 1px solid rgba(255, 255, 255, .09);
    overflow-x: auto; overflow-y: hidden;
    scroll-snap-type: x mandatory; scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    box-shadow: 0 -10px 26px rgba(6, 16, 30, .3);
  }
  .sidebar::-webkit-scrollbar { height: 0; }
  .sidebar .brand, .sidebar .sidebar-footer, .sidebar .nav-group-title { display: none; }
  .nav-group { display: contents; }          /* 两组条目排进同一行 */
  .nav-item {
    flex: 0 0 20%; max-width: 20%;
    flex-direction: column; justify-content: center; gap: 3px;
    margin: 0; padding: 6px 2px; border-radius: 10px;
    font-size: 11px; line-height: 1.15; text-align: center; letter-spacing: 0;
    scroll-snap-align: start;
  }
  .nav-item > span:last-child { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .nav-item .ico { width: 22px; height: 22px; margin: 0 auto; opacity: .9; }
  .nav-item .ico svg { width: 20px; height: 20px; }
  .nav-item.active { background: rgba(26, 127, 212, .92); box-shadow: none; }
  .nav-item.active::before { display: none; }

  .topbar { height: 52px; padding: 0 12px; gap: 8px; }
  .topbar h1 { font-size: 16px; padding-left: 10px; }
  .topbar .right { gap: 8px; }
  .user-chip > span:not(.avatar) { display: none; }
  .avatar { width: 26px; height: 26px; font-size: 11.5px; }
  .content { padding: 14px 12px 18px; }
  .card-head { padding: 12px 14px; }
  .card-body { padding: 14px; }
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .table { font-size: 12.5px; }
  .table th, .table td { padding: 8px 9px; }
  .table .actions { flex-wrap: wrap; gap: 4px; min-width: 168px; }
  .table .btn-sm { padding: 5px 9px; font-size: 11.5px; border-radius: 6px; }
  /* 文档表：手机上隐藏单号/页数/上传人/时间，单号并入标题下方，保证「操作」列可见 */
  .docs-table th:nth-child(1), .docs-table td:nth-child(1),
  .docs-table th:nth-child(4), .docs-table td:nth-child(4),
  .docs-table th:nth-child(5), .docs-table td:nth-child(5),
  .docs-table th:nth-child(6), .docs-table td:nth-child(6) { display: none; }
  .docs-table .mobile-only { display: block; margin-top: 3px; font-size: 11px; color: var(--muted); white-space: nowrap; }

  /* 文档表改为卡片式：客户 + 状态一行，标题与单号一行，操作按钮独占一行 */
  .docs-table, .docs-table tbody { display: block; }
  .docs-table thead { display: none; }
  .docs-table tbody tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "cust status" "title title" "act act";
    align-items: center; gap: 2px 8px;
    padding: 11px 12px; border-bottom: 1px solid #eff2f7;
  }
  .docs-table td { display: block; border: 0; padding: 0; }
  .docs-table td:nth-child(2) { grid-area: cust; font-weight: 600; font-size: 13.5px; color: var(--text); }
  .docs-table td:nth-child(3) { grid-area: title; font-size: 12.5px; color: var(--text-2); }
  .docs-table td:nth-child(7) { grid-area: status; justify-self: end; }
  .docs-table td:nth-child(8) { grid-area: act; margin-top: 7px; }
  .docs-table .actions { min-width: 0; }
}

/* ---------- 打印 ---------- */
#print-root { display: none; }
@media print {
  @page { size: A4; margin: 0; }
  body { background: #fff; }
  body > *:not(#print-root) { display: none !important; }
  #print-root { display: block; }
  #print-root img { display: block; width: 100%; page-break-after: always; break-after: page; }
  #print-root img:last-child { page-break-after: auto; break-after: auto; }
}
