/* ==========================================================================
   合格证管理系统 · 样式表
   ========================================================================== */
:root {
  --bg: #f2f5fb;
  --surface: #ffffff;
  --surface-2: #f8fafd;
  --line: #e5eaf3;
  --line-soft: #eef2f8;
  --text: #0e1726;
  --text-2: #46556b;
  --muted: #8b98ad;
  --primary: #2563eb;
  --primary-d: #1d4ed8;
  --primary-soft: #eaf1ff;
  --green: #0e9f6e;
  --green-soft: #e6f7f0;
  --amber: #d97706;
  --amber-soft: #fdf3e3;
  --purple: #7c3aed;
  --purple-soft: #f1ebfe;
  --red: #dc2626;
  --red-soft: #fdecec;
  --r-lg: 18px;
  --r: 14px;
  --r-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 10px 26px -16px rgba(15, 23, 42, .22);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p { margin: 0; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-d); }
img { display: block; max-width: 100%; }
button { font-family: inherit; }
code { font-family: var(--mono); font-size: 13px; background: #f1f4fa; padding: 1px 6px; border-radius: 5px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.ta-right { text-align: right !important; }
.ta-center { text-align: center !important; }
.req { color: var(--red); font-style: normal; }

.ico { flex: none; vertical-align: -3px; }

/* ---------------------------------------------------------------- 顶部导航 */
.app-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  height: 66px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-mark {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: linear-gradient(145deg, #3b82f6, #1d4ed8);
  color: #fff;
  box-shadow: 0 6px 14px -6px rgba(37, 99, 235, .8);
  flex: none;
}
.brand-mark-lg { width: 46px; height: 46px; border-radius: 13px; background: rgba(255,255,255,.16); box-shadow: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 15.5px; font-weight: 700; letter-spacing: .01em; }
.brand-text em {
  font-style: normal; font-size: 10.5px; color: var(--muted);
  letter-spacing: .14em; text-transform: uppercase;
}

.main-nav { display: flex; align-items: center; gap: 6px; margin-left: 8px; }
.nav-link {
  display: inline-flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 14px;
  border-radius: 10px;
  color: var(--text-2);
  font-size: 14px; font-weight: 500;
  transition: background .18s, color .18s;
  white-space: nowrap;
}
.nav-link:hover { background: #f3f7fd; color: var(--primary-d); }
.nav-link.is-active { background: var(--primary-soft); color: var(--primary-d); font-weight: 600; }

.header-user { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.user-chip {
  display: flex; align-items: center; gap: 9px;
  padding: 4px 12px 4px 4px; border-radius: 999px;
  transition: background .18s;
  color: var(--text);
}
.user-chip:hover { background: #f4f7fd; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #dbeafe, #bfdbfe);
  color: var(--primary-d); font-weight: 700; font-size: 14px;
  flex: none;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.25; }
.user-meta b { font-size: 13px; font-weight: 600; color: var(--text); }
.user-meta i { font-style: normal; font-size: 11px; color: var(--muted); }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  color: var(--text-2); border: 1px solid transparent;
  transition: .18s;
}
.icon-btn:hover { background: var(--red-soft); color: var(--red); border-color: #f8dada; }

/* ---------------------------------------------------------------- 主区域 */
.app-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 20px 64px;
  min-height: calc(100vh - 150px);
}
.app-footer {
  max-width: 1180px; margin: 0 auto;
  padding: 0 20px 30px;
  color: var(--muted); font-size: 12.5px;
  display: flex; gap: 8px; align-items: center; justify-content: center;
}
.dot { opacity: .5; }

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.page-title { font-size: 23px; font-weight: 700; letter-spacing: -.01em; }
.page-desc { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.page-head-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- 卡片 */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
}
.card-head h2 {
  font-size: 14.5px; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
  color: var(--text);
}
.card-head h2 .ico { color: var(--primary); }
.card-hint { font-size: 12.5px; color: var(--muted); }

/* ---------------------------------------------------------------- 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; padding: 0 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 14px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: transform .12s, box-shadow .18s, background .18s, border-color .18s;
  user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(180deg, #3b82f6, var(--primary));
  color: #fff;
  box-shadow: 0 8px 18px -10px rgba(37, 99, 235, .95), inset 0 1px 0 rgba(255,255,255,.18);
}
.btn-primary:hover { background: linear-gradient(180deg, #2f76ee, var(--primary-d)); color: #fff; }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--text-2); }
.btn-ghost:hover { background: #f7fafd; border-color: #d3dceb; color: var(--text); }
.btn-block { width: 100%; }
.btn-lg { height: 46px; font-size: 15px; padding: 0 22px; border-radius: 11px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; box-shadow: none; }
.btn-danger {
  background: linear-gradient(180deg, #ef4444, #dc2626);
  color: #fff;
  box-shadow: 0 8px 18px -10px rgba(220, 38, 38, .95), inset 0 1px 0 rgba(255,255,255,.16);
}
.btn-danger:hover { background: linear-gradient(180deg, #e53935, #c62828); color: #fff; }
.btn-sm { height: 34px; padding: 0 13px; font-size: 13px; border-radius: 9px; gap: 5px; }

/* ---------------------------------------------------------------- 表单 */
.field { display: flex; flex-direction: column; gap: 7px; }
.field-label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field-hint { font-size: 12px; color: var(--muted); }
.input-box {
  position: relative;
  display: flex; align-items: center;
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 11px;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.input-box:focus-within {
  background: #fff;
  border-color: #93b4f8;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .1);
}
.input-box input {
  flex: 1; min-width: 0;
  height: 44px; padding: 0 13px;
  border: 0; background: transparent;
  font-family: inherit; font-size: 15px; color: var(--text);
  outline: none;
}
.input-box input::placeholder { color: #a9b4c6; }
.input-box select {
  flex: 1; min-width: 0;
  height: 44px; padding: 0 13px;
  border: 0; background: transparent;
  font-family: inherit; font-size: 15px; color: var(--text);
  outline: none; cursor: pointer; -webkit-appearance: none; appearance: none;
}
.input-box:has(.input-ico) select { padding-left: 40px; }
.input-ico {
  position: absolute; left: 13px; color: #94a3b8; pointer-events: none;
}
.input-box:has(.input-ico) input { padding-left: 40px; }
.input-box .input-ico + input { padding-left: 40px; }
.pw-toggle {
  border: 0; background: transparent; color: var(--muted);
  font-size: 12.5px; padding: 0 13px; height: 100%;
  cursor: pointer; border-radius: 0 11px 11px 0;
}
.pw-toggle:hover { color: var(--primary); }
input[type="date"] { color-scheme: light; }
input[type="search"]::-webkit-search-cancel-button { display: none; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 20px; }
.field-full { grid-column: 1 / -1; }

/* ---------------------------------------------------------------- 提示条 */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 15px;
  border-radius: 12px;
  font-size: 13.5px;
  margin-bottom: 18px;
  border: 1px solid transparent;
}
.alert .ico { margin-top: 2px; }
.alert-success { background: var(--green-soft); border-color: #c8ecdd; color: #08704e; }
.alert-error { background: var(--red-soft); border-color: #f7d4d4; color: #a51d1d; }
.alert-warn { background: var(--amber-soft); border-color: #f6e0bd; color: #92500a; }

/* ================================================================ 登录页 */
.auth-body {
  min-height: 100vh;
  background:
    radial-gradient(900px 480px at 8% -8%, #e2ecff 0%, rgba(226, 236, 255, 0) 60%),
    radial-gradient(800px 500px at 96% 4%, #eaf3ff 0%, rgba(234, 243, 255, 0) 55%),
    var(--bg);
}
.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.02fr 1fr;
  max-width: 1060px;
  margin: 0 auto;
  background: #fff;
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 30px 70px -40px rgba(15, 23, 42, .45);
  align-self: center;
}
.auth-body { display: flex; align-items: center; padding: 32px 20px; }

.auth-visual {
  position: relative;
  overflow: hidden;
  padding: 44px 46px;
  color: #fff;
  background: linear-gradient(155deg, #1e3a8a 0%, #1d4ed8 45%, #2563eb 100%);
  display: flex; flex-direction: column;
}
.visual-glow {
  position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; pointer-events: none;
}
.g1 { width: 320px; height: 320px; background: #60a5fa; top: -90px; right: -70px; }
.g2 { width: 280px; height: 280px; background: #22d3ee; bottom: -110px; left: -60px; opacity: .35; }
.visual-top { display: flex; align-items: center; gap: 12px; position: relative; }
.visual-brand { font-size: 16px; font-weight: 700; letter-spacing: .02em; }
.visual-body { margin-top: auto; margin-bottom: auto; position: relative; padding: 34px 0; }
.visual-body h2 {
  font-size: 30px; line-height: 1.35; font-weight: 700; letter-spacing: -.01em;
}
.visual-body p { margin-top: 14px; font-size: 14px; line-height: 1.8; color: rgba(255,255,255,.78); max-width: 340px; }
.visual-list { list-style: none; padding: 0; margin: 26px 0 0; display: flex; flex-direction: column; gap: 12px; }
.visual-list li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: rgba(255,255,255,.92); }
.visual-list .ico { color: #93c5fd; }
.visual-foot { font-size: 12px; color: rgba(255,255,255,.55); position: relative; letter-spacing: .04em; }

.auth-form-panel { display: flex; align-items: center; justify-content: center; padding: 48px 44px; }
.auth-form-inner { width: 100%; max-width: 340px; }
.auth-mobile-brand { display: none; align-items: center; gap: 10px; margin-bottom: 26px; }
.auth-form-inner h1 { font-size: 25px; font-weight: 700; letter-spacing: -.01em; }
.auth-sub { color: var(--muted); font-size: 13.5px; margin-top: 6px; margin-bottom: 26px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-form .btn { margin-top: 6px; }
.auth-tip { margin-top: 22px; font-size: 12.5px; color: var(--muted); text-align: center; }

/* ================================================================ 添加页 */
.add-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 372px;
  gap: 20px;
  align-items: start;
}
.form-card { min-width: 0; }
.form-actions {
  grid-column: 1 / -1;
  display: flex; justify-content: flex-end; gap: 12px;
  padding-top: 2px;
}

.upload-card { padding-bottom: 18px; }
.upload-zone {
  position: relative;
  margin: 18px 18px 12px;
  border: 1.5px dashed #d2dcea;
  border-radius: 14px;
  background: #fafcff;
  min-height: 216px;
  display: grid; place-items: center;
  cursor: pointer;
  transition: border-color .18s, background .18s;
  overflow: hidden;
}
.upload-zone:hover, .upload-zone.is-drag { border-color: #93b4f8; background: var(--primary-soft); }
.upload-zone input[type="file"] { display: none; }
.upload-empty { text-align: center; padding: 24px 18px; pointer-events: none; }
.upload-ico {
  width: 54px; height: 54px; border-radius: 16px; margin: 0 auto 12px;
  display: grid; place-items: center;
  background: #fff; color: var(--primary);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.upload-empty p { font-size: 13.5px; color: var(--text-2); }
.upload-empty .muted { font-size: 12px; display: block; margin-top: 5px; }
.upload-preview { width: 100%; height: 100%; position: relative; display: grid; place-items: center; background: #f4f7fc; }
.upload-preview img { max-height: 300px; width: auto; max-width: 100%; object-fit: contain; }
.upload-remove {
  position: absolute; top: 10px; right: 10px;
  width: 30px; height: 30px; border-radius: 50%;
  border: 0; background: rgba(15, 23, 42, .62); color: #fff;
  display: grid; place-items: center; cursor: pointer;
  transition: background .18s;
}
.upload-remove:hover { background: var(--red); }
.upload-actions { padding: 0 18px; font-size: 12.5px; }
.tip-box {
  margin: 16px 18px 0;
  padding: 13px 15px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  font-size: 12.5px; color: var(--text-2);
}
.tip-box b { display: flex; align-items: center; gap: 6px; color: var(--amber); font-size: 12.5px; }
.tip-box ul { margin: 8px 0 0; padding-left: 18px; color: var(--muted); line-height: 1.9; }

.success-card {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 18px;
  margin-bottom: 20px;
  border-color: #c8ecdd;
  background: linear-gradient(180deg, #f4fdf9, #fff);
}
.success-mark {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; flex: none;
  background: var(--green-soft); color: var(--green);
}
.success-body h3 { font-size: 15px; font-weight: 700; color: #08704e; }
.success-body p { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.success-thumb { width: 52px; height: 52px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); flex: none; }
.success-thumb img { width: 100%; height: 100%; object-fit: cover; }
.success-actions { margin-left: auto; display: flex; gap: 10px; flex: none; }

/* ================================================================ 查询页 */
.toolbar {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 15px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  position: sticky; top: 78px; z-index: 40;
}
.search-box {
  position: relative; flex: 0 1 230px; min-width: 150px;
  display: flex; align-items: center;
  background: #f7f9fd;
  border: 1px solid var(--line);
  border-radius: 11px;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.search-box:focus-within { background: #fff; border-color: #93b4f8; box-shadow: 0 0 0 4px rgba(37,99,235,.1); }
.search-ico { position: absolute; left: 13px; color: #94a3b8; pointer-events: none; }
.search-box input {
  flex: 1; min-width: 0; height: 44px;
  border: 0; background: transparent; outline: none;
  padding: 0 38px; font-family: inherit; font-size: 15px; color: var(--text);
}
.search-box input::placeholder { color: #a9b4c6; }
.search-clear {
  position: absolute; right: 8px;
  width: 26px; height: 26px; border-radius: 50%;
  border: 0; background: #e8eef8; color: var(--text-2);
  display: grid; place-items: center; cursor: pointer;
}
.search-clear:hover { background: #dbe5f5; }

.date-filter {
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px; height: 44px;
  background: #f7f9fd; border: 1px solid var(--line); border-radius: 11px;
  color: var(--text-2); font-size: 13px;
}
.date-filter:focus-within { background: #fff; border-color: #93b4f8; box-shadow: 0 0 0 4px rgba(37,99,235,.1); }
.date-filter input {
  border: 0; background: transparent; outline: none;
  font-family: inherit; font-size: 13.5px; color: var(--text);
  width: 128px; height: 40px;
}
.date-ico { display: none; }
.date-sep { color: var(--muted); }
.toolbar-actions { display: flex; gap: 10px; }

/* 统计卡 */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px; margin-bottom: 16px;
}
.stat-card {
  display: flex; align-items: center; gap: 13px;
  padding: 16px 17px;
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow-sm);
}
.stat-ico {
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  display: grid; place-items: center;
}
.stat-ico.blue { background: var(--primary-soft); color: var(--primary-d); }
.stat-ico.green { background: var(--green-soft); color: var(--green); }
.stat-ico.purple { background: var(--purple-soft); color: var(--purple); }
.stat-ico.amber { background: var(--amber-soft); color: var(--amber); }
.stat-body { min-width: 0; }
.stat-body em { display: block; font-style: normal; font-size: 12.5px; color: var(--muted); }
.stat-body b { display: block; font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.35; }
.stat-body b i { font-style: normal; font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.stat-body b.stat-date { font-size: 16px; font-weight: 600; }

/* 型号 chips */
.chip-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip-label {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; color: var(--muted); margin-right: 2px;
}
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px;
  border-radius: 999px;
  background: #fff; border: 1px solid var(--line);
  color: var(--text-2); font-size: 13px; font-weight: 500;
  transition: .18s;
}
.chip:hover { border-color: #b9cdf5; color: var(--primary-d); background: #f8fbff; }
.chip i {
  font-style: normal; font-size: 11px; font-weight: 600;
  background: #eef2f9; color: var(--muted);
  padding: 1px 6px; border-radius: 999px;
}
.chip.is-on { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip.is-on i { background: rgba(255,255,255,.24); color: #fff; }
.chip-clear { color: var(--muted); border-style: dashed; }
.chip-clear:hover { color: var(--red); border-color: #f2c4c4; background: var(--red-soft); }

/* 图表 */
.chart-card { margin-bottom: 16px; }
.bars { padding: 16px 20px 18px; display: flex; flex-direction: column; gap: 11px; }
.bar-row { display: grid; grid-template-columns: 46px 1fr 68px; align-items: center; gap: 12px; }
.bar-label { font-size: 12.5px; color: var(--muted); }
.bar-track { height: 10px; border-radius: 999px; background: #f0f4fa; overflow: hidden; }
.bar-fill {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #60a5fa, var(--primary));
  animation: grow .6s cubic-bezier(.2,.8,.3,1) both;
}
@keyframes grow { from { transform: scaleX(.02); transform-origin: left; } to { transform: scaleX(1); transform-origin: left; } }
.bar-value { font-size: 12.5px; font-weight: 600; color: var(--text-2); text-align: right; }

/* 表格 */
.table-card { overflow: hidden; }
.head-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.batch-bar { display: flex; align-items: center; gap: 10px; }
.batch-bar .sel-info { font-size: 12.5px; color: var(--text-2); }
.batch-bar .sel-info b { color: var(--red); font-size: 14px; }
.col-check { width: 46px; text-align: center !important; }
.col-check input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
  vertical-align: middle;
}
#checkAll { cursor: pointer; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th {
  text-align: left; white-space: nowrap;
  font-size: 12px; font-weight: 600; color: var(--muted);
  padding: 11px 16px;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  letter-spacing: .02em;
}
.data-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
  color: var(--text-2);
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fafcff; }
.col-id { width: 74px; }
.model-cell { font-weight: 600; color: var(--text); font-size: 14px; }
/* 文件名列：次要信息，单行截断 */
.file-cell {
  display: inline-block; max-width: 220px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; vertical-align: bottom;
  color: var(--text-2); font-size: 12.5px;
}
.qty-cell { color: var(--text); font-size: 14.5px; }
.seq-cell { font-family: var(--mono); font-size: 13px; color: var(--text-2); }

/* 表格附件徽标 */
.doc-cell { display: inline-flex; align-items: center; gap: 6px; }
.doc-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 8px;
  background: #fff7e6; color: #b26a00; border: 1px solid #f0d9ad;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}

/* 新旧标记徽标：新=绿，老=灰 */
.tag-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; height: 22px; padding: 0 8px;
  font-size: 12.5px; font-weight: 700; border-radius: 6px;
  cursor: help; line-height: 1;
}
.tag-new {
  color: #12783f; background: rgba(16, 163, 74, .1);
  border: 1px solid rgba(16, 163, 74, .26);
}
.tag-old {
  color: #64748b; background: #f1f5fb;
  border: 1px solid #dbe3ef;
}

/* 工具栏：新旧筛选 */
.tag-filter {
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px; height: 44px;
  background: #f7f9fd; border: 1px solid var(--line); border-radius: 11px;
  color: var(--text-2); font-size: 13px;
}
.tag-filter:focus-within { background: #fff; border-color: #93b4f8; box-shadow: 0 0 0 4px rgba(37,99,235,.1); }
.tag-filter select {
  border: 0; background: transparent; outline: none; cursor: pointer;
  font-family: inherit; font-size: 13.5px; color: var(--text); height: 40px;
}
.tag-ico { display: none; }
/* 信息页 / 多图母图不可导出：勾选框禁用态 */
.row-check:disabled { cursor: not-allowed; opacity: .4; }
.date-cell { white-space: nowrap; color: var(--text); }
.url-cell { display: inline-flex; align-items: center; gap: 8px; }
.url-cell a { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; }
/* 二维码网址：只显示「已录入」，不提供入口（避免误开验伪页），可复制 */
.url-done {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12.5px; color: var(--text-2); cursor: default; user-select: none;
}
.copy-btn {
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  font-size: 11.5px; padding: 1px 7px; border-radius: 6px; cursor: pointer;
}
.copy-btn:hover { color: var(--primary); border-color: #b9cdf5; }

/* 二维码无法识别（照片太糊/打印发虚）——红色标注 */
.qr-bad {
  display: inline-flex; align-items: center; gap: 4px;
  color: #d93026; font-size: 12.5px; font-weight: 600;
  background: rgba(217, 48, 38, .08); border: 1px solid rgba(217, 48, 38, .22);
  padding: 1px 7px; border-radius: 6px; cursor: help;
}

.thumb {
  width: 72px; height: 96px; border-radius: 10px;
  overflow: hidden; border: 1px solid var(--line);
  display: inline-grid; place-items: center;
  background: #f4f7fc; color: #b6c2d6;
  transition: transform .18s, box-shadow .18s;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
a.thumb:hover { transform: scale(1.06); box-shadow: 0 6px 16px -8px rgba(15,23,42,.4); }

/* 分页 */
.pager {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 13px 16px;
  border-top: 1px solid var(--line-soft);
  flex-wrap: wrap;
}
.pager-info { font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.per-page { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-2); }
.per-page select {
  height: 28px; padding: 0 6px; border-radius: 7px;
  border: 1px solid var(--line); background: #fff; color: var(--text);
  font-family: var(--font); font-size: 12.5px; cursor: pointer; outline: none;
}
.per-page select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.pager-btns { display: flex; gap: 5px; }
.page-btn {
  min-width: 32px; height: 32px; padding: 0 8px;
  display: grid; place-items: center;
  border-radius: 8px; border: 1px solid var(--line);
  background: #fff; color: var(--text-2);
  font-size: 13px; font-weight: 500;
}
.page-btn:hover { border-color: #b9cdf5; color: var(--primary-d); }
.page-btn.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-btn.is-disabled { opacity: .4; pointer-events: none; }

/* 空状态 */
.empty-state { text-align: center; padding: 52px 24px 56px; }
.empty-state.card { padding: 64px 24px; margin-top: 8px; }
.empty-ico {
  width: 62px; height: 62px; border-radius: 18px;
  display: grid; place-items: center; margin: 0 auto 16px;
  background: var(--primary-soft); color: var(--primary);
}
.empty-state h3 { font-size: 15.5px; font-weight: 600; }
.empty-state p { color: var(--muted); font-size: 13.5px; margin-top: 6px; margin-bottom: 18px; line-height: 1.8; }

/* 图片预览 */
.lightbox {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(8, 13, 24, .86);
  display: grid; place-items: center;
  padding: 24px;
  animation: fade .18s ease both;
}
.lightbox[hidden] { display: none; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.lightbox img {
  max-width: min(92vw, 1000px); max-height: 86vh;
  border-radius: 12px; box-shadow: 0 30px 80px -30px rgba(0,0,0,.8);
  background: #fff; object-fit: contain;
}
.lightbox-close {
  position: absolute; top: 18px; right: 18px;
  width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: rgba(255,255,255,.14); color: #fff;
  display: grid; place-items: center; cursor: pointer;
}
.lightbox-close:hover { background: rgba(255,255,255,.26); }

/* 灯箱上一张/下一张导航 */
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px; border-radius: 50%;
  border: 0; background: rgba(255,255,255,.14); color: #fff;
  display: grid; place-items: center; cursor: pointer;
  transition: background .15s, opacity .15s;
}
.lightbox-nav:hover { background: rgba(255,255,255,.28); }
.lightbox-nav:disabled { opacity: .18; cursor: default; }
.lightbox-nav:disabled:hover { background: rgba(255,255,255,.14); }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }
.lightbox-counter {
  position: absolute; top: 24px; left: 50%; transform: translateX(-50%);
  color: #fff; background: rgba(255,255,255,.14);
  border-radius: 999px; padding: 5px 16px; font-size: 13.5px;
  letter-spacing: .5px; user-select: none;
}
@media (max-width: 640px) {
  .lightbox-nav { width: 42px; height: 42px; }
  .lightbox-prev { left: 10px; }
  .lightbox-next { right: 10px; }
  .lightbox-counter { top: 14px; }
}

/* 灯箱：操作按钮组（转多图 / 转信息页） */
.lightbox-actions {
  position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 10px; align-items: center;
  flex-wrap: wrap; justify-content: center; max-width: 94vw;
}
.lightbox-multi, .lightbox-info, .lightbox-del {
  border: 0; border-radius: 999px; cursor: pointer;
  padding: 10px 20px; font-size: 14.5px; font-weight: 600;
  color: #fff; white-space: nowrap;
  transition: background .15s, transform .1s;
}
.lightbox-multi { background: #f59e0b; box-shadow: 0 6px 22px -6px rgba(245,158,11,.65); }
.lightbox-multi:hover { background: #d97706; }
.lightbox-multi.is-on { background: #10b981; box-shadow: 0 6px 22px -6px rgba(16,185,129,.55); }
.lightbox-multi.is-on:hover { background: #059669; }
.lightbox-info { background: #3b82f6; box-shadow: 0 6px 22px -6px rgba(59,130,246,.6); }
.lightbox-info:hover { background: #2563eb; }
.lightbox-info.is-on { background: #6366f1; box-shadow: 0 6px 22px -6px rgba(99,102,241,.55); }
.lightbox-info.is-on:hover { background: #4f46e5; }
.lightbox-del { background: #dc2626; box-shadow: 0 6px 22px -6px rgba(220,38,38,.6); }
.lightbox-del:hover { background: #b91c1c; }
.lightbox-multi:active, .lightbox-info:active, .lightbox-del:active { transform: scale(.97); }
.lightbox-multi:disabled, .lightbox-info:disabled, .lightbox-del:disabled { opacity: .55; cursor: wait; }

/* 灯箱：信息页填写面板 */
.lightbox-infopanel {
  position: absolute; bottom: 92px; left: 50%; transform: translateX(-50%);
  width: min(440px, 92vw); background: #101826; color: #e8eefc;
  border: 1px solid rgba(255,255,255,.12); border-radius: 14px;
  padding: 16px 18px 14px; box-shadow: 0 24px 60px -20px rgba(0,0,0,.8);
}
.ip-title { font-size: 14px; font-weight: 600; color: #cfe0ff; margin-bottom: 12px; }
.ip-row { display: flex; gap: 12px; }
.ip-field { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.ip-field span { font-size: 12.5px; color: #9fb0cc; }
.ip-field input {
  width: 100%; box-sizing: border-box; background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.16); border-radius: 8px;
  color: #fff; font-size: 15px; padding: 9px 11px; outline: none;
  letter-spacing: 1px;
}
.ip-field input:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.2); }
.ip-err { color: #fca5a5; font-size: 12.5px; margin: 10px 0 0; }
.ip-btns { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.ip-btns button {
  border: 0; border-radius: 8px; padding: 8px 16px; font-size: 13.5px; cursor: pointer;
}
.ip-cancel { background: rgba(255,255,255,.1); color: #dbe4f5; }
.ip-cancel:hover { background: rgba(255,255,255,.18); }
.ip-save { background: #3b82f6; color: #fff; font-weight: 600; }
.ip-save:hover { background: #2563eb; }
.ip-save:disabled { opacity: .6; cursor: wait; }
@media (max-width: 640px) {
  .lightbox-actions { bottom: 18px; gap: 8px; }
  .lightbox-multi, .lightbox-info, .lightbox-del { padding: 9px 14px; font-size: 13.5px; }
  .lightbox-infopanel { bottom: 74px; padding: 14px; }
}

/* 列表缩略图角标：码 / 拆N / 信息页 */
.js-lightbox { position: relative; display: inline-block; }
.thumb-tags {
  position: absolute; top: 4px; right: 4px; z-index: 2;
  display: flex; flex-direction: column; align-items: flex-end; gap: 3px;
  pointer-events: none;
}
.tbadge {
  color: #fff; font-size: 11px; font-weight: 700;
  line-height: 1; padding: 3px 6px; border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,.35);
  white-space: nowrap;
}
.tbadge-code  { background: #10a34a; }
.tbadge-split { background: #4f46e5; }
.tbadge-info  { background: #3b82f6; }

/* 表格附件：占位缩略图（纯装饰，点击下载） */
.thumb-doc {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; background: #fff; text-decoration: none;
}
.doc-cap { font-size: 11px; font-weight: 700; color: #15803d; line-height: 1; }

/* 隐藏项提示条 */
.vis-note {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 0 10px; padding: 8px 13px;
  border: 1px dashed #cfdbef; background: #f7faff; color: var(--text-2);
  border-radius: 9px; font-size: 13px;
}
.vis-note .vis-text { display: inline-flex; align-items: center; gap: 7px; }
.vis-note b { color: var(--text); }
.vis-toggle {
  flex: none; font-size: 13px; font-weight: 600; color: var(--primary);
  text-decoration: none; white-space: nowrap;
}
.vis-toggle:hover { text-decoration: underline; }

/* 安装页 */
.install-wrap { width: 100%; max-width: 480px; margin: 0 auto; }

/* 修改密码 */
.pw-wrap { max-width: 560px; }
.pw-grid { grid-template-columns: 1fr 1fr; }
.form-actions-in {
  grid-column: 1 / -1;
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px;
  padding-top: 4px;
  flex-wrap: wrap;
}
.install-card { padding: 28px; }
.install-head { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.install-head h1 { font-size: 19px; font-weight: 700; }
.install-head p { font-size: 12.5px; color: var(--muted); }
.install-list { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-direction: column; gap: 9px; }
.install-list li {
  display: flex; align-items: center; gap: 8px;
  font-size: 13.5px; color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--line-soft);
  padding: 9px 12px; border-radius: 10px;
}
.install-list .ico { color: var(--green); }
.install-account {
  background: #f8fafd; border: 1px dashed #d8e2f0; border-radius: 12px;
  padding: 14px; margin-bottom: 18px;
}
.install-account p { font-size: 12.5px; margin-bottom: 8px; }
.cred-row { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; color: var(--text-2); }
.cred-row code { font-size: 13px; color: var(--text); }
.code-area {
  width: 100%; font-family: var(--mono); font-size: 12.5px;
  border: 1px solid var(--line); border-radius: 10px; padding: 10px;
  background: #f8fafd; color: var(--text-2); resize: vertical;
}

/* ================================================================ 响应式 */
@media (max-width: 1080px) {
  .add-grid { grid-template-columns: minmax(0, 1fr) 330px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .auth-wrap { grid-template-columns: 1fr; max-width: 460px; border-radius: 20px; }
  .auth-visual { display: none; }
  .auth-form-panel { padding: 36px 28px 40px; }
  .auth-mobile-brand { display: flex; }
}

@media (max-width: 860px) {
  .add-grid { grid-template-columns: 1fr; }
  .toolbar { position: static; }
}

@media (max-width: 760px) {
  .app-main { padding: 18px 14px 48px; }
  .page-title { font-size: 20px; }
  .page-desc { font-size: 12.5px; }
  .header-inner { height: 58px; padding: 0 14px; gap: 10px; }
  .nav-link { padding: 0 10px; font-size: 13.5px; }
  .user-meta { display: none; }
  .user-chip { padding: 2px; }

  .form-grid { grid-template-columns: 1fr; padding: 16px; gap: 15px; }
  .pw-wrap { max-width: none; }
  .card-head { padding: 14px 16px; flex-wrap: wrap; }
  .head-right { width: 100%; justify-content: space-between; }
  .col-check { width: 38px; }
  .form-actions-in { flex-direction: column-reverse; align-items: stretch; }
  .form-actions-in .btn { width: 100%; }
  .toolbar { padding: 11px; gap: 9px; }
  .search-box { flex: 1 1 100%; }
  .date-filter { flex: 1 1 100%; justify-content: space-between; }
  .date-filter input { width: auto; flex: 1; }
  .toolbar-actions { flex: 1 1 100%; }
  .toolbar-actions .btn { flex: 1; }

  .chip-row { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .chip-row::-webkit-scrollbar { display: none; }
  .chip-label { flex: none; }

  /* 表格转卡片 */
  .table-card { background: transparent; border: 0; box-shadow: none; overflow: visible; }
  .table-card .card-head { padding: 0 2px 10px; border-bottom: 0; }
  .table-wrap { overflow: visible; }
  .data-table { display: block; }
  .data-table thead { display: none; }
  .data-table tbody { display: block; }
  .data-table tr {
    display: block;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: var(--shadow-sm);
    padding: 8px 14px;
    margin-bottom: 11px;
  }
  .data-table td {
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px;
    padding: 7px 0;
    border-bottom: 1px dashed #eef2f8;
    text-align: right;
  }
  .data-table td:last-child { border-bottom: 0; }
  .data-table td::before {
    content: attr(data-label);
    flex: none;
    font-size: 12.5px; font-weight: 600; color: var(--muted);
    text-align: left;
  }
  .col-id { width: auto; }
  .data-table td.col-time { display: none; }
  .ta-right, .ta-center { text-align: right !important; }
  .thumb { width: 64px; height: 84px; }

  .success-card { flex-wrap: wrap; }
  .success-actions { margin-left: 0; width: 100%; }
  .success-actions .btn { flex: 1; }
  .stats-grid { gap: 10px; }
  .stat-card { padding: 13px; gap: 10px; }
  .stat-ico { width: 36px; height: 36px; border-radius: 10px; }
  .stat-body b { font-size: 18px; }
  .stat-body b.stat-date { font-size: 13.5px; }
  .stat-body em { font-size: 11.5px; }
  .bars { padding: 14px 16px; }
  .bar-row { grid-template-columns: 40px 1fr 54px; gap: 9px; }
  .pager { padding: 12px; }
}

@media (max-width: 560px) {
  .brand-text { display: none; }
  .nav-link { padding: 0 9px; gap: 5px; }
  .page-head { margin-bottom: 15px; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .btn { width: 100%; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-body { padding: 0; }
  .auth-wrap { border-radius: 0; min-height: 100vh; max-width: none; box-shadow: none; }
  .auth-form-panel { padding: 28px 22px 36px; }
  .lightbox img { max-width: 94vw; }
}

@media (max-width: 380px) {
  .nav-link span { display: none; }
  .nav-link { padding: 0 11px; }
}

/* ---------- 导出次数列 / 导出数量输入 ---------- */
.exp-count {
  display: inline-block;
  min-width: 26px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef2f7;
  color: #64748b;
  font-size: 12px;
  text-align: center;
}
.exp-count.has-exp {
  background: #fef3c7;
  color: #92400e;
  font-weight: 600;
}
.export-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.export-count-input {
  width: 92px;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
}

/* ==========================================================================
   二次确认弹窗（删除需输入密码）
   ========================================================================== */
.batch-bar .sel-limit { font-style: normal; color: var(--muted); font-size: 11.5px; }
.batch-bar .btn[disabled] { opacity: .5; cursor: not-allowed; }

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(14, 23, 38, .5);
  backdrop-filter: blur(2px);
  animation: maskIn .16s ease-out;
}
@keyframes maskIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: var(--r);
  box-shadow: 0 20px 60px -12px rgba(15, 23, 42, .45);
  padding: 22px 22px 18px;
  animation: modalIn .18s ease-out;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

.modal-title {
  margin: 0 0 8px;
  font-size: 16.5px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal-title svg { color: var(--red); }
.modal-text {
  margin: 0 0 16px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-2);
}
.modal-field { display: block; margin-bottom: 6px; }
.modal-label {
  display: block;
  font-size: 12.5px;
  color: var(--text-2);
  margin-bottom: 6px;
}
.modal-field input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  font-size: 14px;
  font-family: var(--font);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.modal-field input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft);
}
.modal-err {
  margin: 8px 0 0;
  font-size: 12.5px;
  color: var(--red);
  background: var(--red-soft);
  border-radius: 8px;
  padding: 7px 10px;
}
.modal-btns {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}
.modal-btns .btn { min-width: 92px; justify-content: center; }

@media (max-width: 520px) {
  .modal { padding: 18px 16px 14px; }
  .modal-btns .btn { flex: 1; }
}

/* ---------- 信息页查看弹层（操作区「查看信息页」） ---------- */
.infopage-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, .78);
}
.infopage-modal[hidden] { display: none; }
.infopage-box {
  display: flex;
  flex-direction: column;
  max-width: min(980px, 96vw);
  max-height: 92vh;
  overflow: hidden;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
.infopage-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid #e6ecf3;
}
.infopage-title { font-weight: 600; color: #0f172a; }
.infopage-cap {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: #64748b;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.infopage-close {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: #f1f5f9;
  color: #334155;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.infopage-close:hover { background: #e2e8f0; }
.infopage-body {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  background: #0f172a;
}
.infopage-body img {
  display: block;
  max-width: 100%;
  max-height: calc(92vh - 56px);
}
@media (max-width: 640px) {
  .infopage-box { max-width: 100vw; max-height: 94vh; }
  .infopage-body img { max-height: calc(94vh - 56px); }
}
