/* ============================================================================
   SKU Pallet & Weight Calculator — 全站样式
   ----------------------------------------------------------------------------
   单文件、零构建、明暗双主题（CSS 变量）。
   设计取向：内部作业工具，但工具不等于丑。信息密度要高，层级要一眼可辨，
   异常要靠颜色直接抓住眼睛 —— 仓库同学扫一眼就知道哪一行有问题。

   重量单位全站统一 LB，样式层不做任何单位相关的分支。
   ========================================================================== */

/* ---------------------------------------------------------------- 1. 变量 */
:root {
  color-scheme: light;

  --bg: #f2f5f9;
  --bg-accent: radial-gradient(1200px 600px at 12% -8%, #dfe8f7 0%, transparent 60%),
               radial-gradient(900px 500px at 100% 0%, #e3f0f6 0%, transparent 55%);
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --surface-3: #eef2f8;

  --border: #e1e7f0;
  --border-strong: #cfd8e6;

  --text: #101828;
  --text-2: #475467;
  --text-3: #98a2b3;

  --brand: #2d4bd8;
  --brand-strong: #1f37ab;
  --brand-soft: #eaeeff;
  --brand-ring: rgba(45, 75, 216, 0.18);

  --ok: #087443;
  --ok-soft: #e6f6ee;
  --ok-border: #b7e4cd;

  --warn: #a15c07;
  --warn-soft: #fdf5e4;
  --warn-border: #f2dca6;

  --danger: #b42318;
  --danger-soft: #fdecea;
  --danger-border: #f5c6c0;

  --info: #0a6a8f;
  --info-soft: #e5f4fa;

  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.08), 0 2px 4px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 16px 40px rgba(16, 24, 40, 0.14);
  --shadow-brand: 0 6px 18px rgba(45, 75, 216, 0.24);

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --font-sans: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", "Cascadia Mono", Consolas,
    "Liberation Mono", Menlo, monospace;

  --topbar-h: 60px;
  --content-max: 1360px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;

    --bg: #080d17;
    --bg-accent: radial-gradient(1200px 620px at 10% -10%, #16233d 0%, transparent 60%),
                 radial-gradient(900px 520px at 100% 0%, #102b38 0%, transparent 55%);
    --surface: #0f172a;
    --surface-2: #141e33;
    --surface-3: #1b2740;

    --border: #22304d;
    --border-strong: #2d3f61;

    --text: #e9eefb;
    --text-2: #a7b4cf;
    --text-3: #6f7f9e;

    --brand: #7b8dff;
    --brand-strong: #9aa8ff;
    --brand-soft: rgba(123, 141, 255, 0.14);
    --brand-ring: rgba(123, 141, 255, 0.26);

    --ok: #4ade80;
    --ok-soft: rgba(74, 222, 128, 0.12);
    --ok-border: rgba(74, 222, 128, 0.32);

    --warn: #fbbf24;
    --warn-soft: rgba(251, 191, 36, 0.12);
    --warn-border: rgba(251, 191, 36, 0.32);

    --danger: #fb7185;
    --danger-soft: rgba(251, 113, 133, 0.12);
    --danger-border: rgba(251, 113, 133, 0.34);

    --info: #38bdf8;
    --info-soft: rgba(56, 189, 248, 0.12);

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.45);
    --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.6);
    --shadow-brand: 0 6px 20px rgba(123, 141, 255, 0.28);
  }
}

/* ---------------------------------------------------------------- 2. 基础 */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background-color: var(--bg);
  background-image: var(--bg-accent);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 650;
  letter-spacing: -0.011em;
  color: var(--text);
}

h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }

p { margin: 0 0 10px; }

a {
  color: var(--brand);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

code, .mono {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

code {
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  border: 1px solid var(--border);
}

::selection {
  background: var(--brand-ring);
}

/* 滚动条：暗色下原生滚动条会突兀，收敛一下 */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background-clip: padding-box; }

/* ---------------------------------------------------------------- 3. 顶栏 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 22px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 680;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--text);
  white-space: nowrap;
}
.topbar__brand:hover { text-decoration: none; }

.topbar__mark {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 9px;
  background: linear-gradient(145deg, var(--brand) 0%, var(--brand-strong) 100%);
  box-shadow: var(--shadow-brand);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}

.topbar__sub {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.topbar__nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  flex: 1 1 auto;
  overflow-x: auto;
}

.navlink {
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-weight: 560;
  font-size: 13.5px;
  white-space: nowrap;
  transition: background 120ms ease, color 120ms ease;
}
.navlink:hover {
  background: var(--surface-3);
  color: var(--text);
  text-decoration: none;
}
.navlink[aria-current="page"] {
  background: var(--brand-soft);
  color: var(--brand);
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.userchip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 10px 5px 5px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: var(--surface-2);
}
.userchip__avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--brand) 0%, var(--brand-strong) 100%);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
.userchip__meta { line-height: 1.15; }
.userchip__name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.15;
}
.userchip__role {
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.15;
}

/* ---------------------------------------------------------------- 4. 布局 */
.page {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 26px 22px 64px;
}

.page--narrow { max-width: 880px; }

.pagehead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.pagehead__eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 5px;
}
.pagehead__desc {
  margin: 6px 0 0;
  color: var(--text-2);
  max-width: 72ch;
}
.pagehead__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.stack { display: flex; flex-direction: column; gap: 16px; }
.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.row--between { justify-content: space-between; }
.row--end { justify-content: flex-end; }
.spacer { flex: 1 1 auto; }

/* ---------------------------------------------------------------- 5. 卡片 */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(to bottom, var(--surface-2), var(--surface));
}
.card__title {
  font-size: 14.5px;
  font-weight: 650;
}
.card__hint {
  font-size: 12.5px;
  color: var(--text-3);
}
.card__body { padding: 18px; }
.card__body--flush { padding: 0; }
.card__foot {
  padding: 13px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* 入口卡片（Dashboard） */
.entry {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  color: inherit;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}
.entry:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand);
}
.entry__icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 19px;
}
.entry__title {
  font-size: 16px;
  font-weight: 660;
}
.entry__desc {
  color: var(--text-2);
  font-size: 13px;
  margin: 0;
}
.entry__go {
  margin-top: auto;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
}

/* 统计块 */
.stat {
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}
.stat__label {
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}
.stat__value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  margin-top: 4px;
}
.stat__unit {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  margin-left: 5px;
}
.stat__foot {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 3px;
}
.stat--brand { border-top: 3px solid var(--brand); }
.stat--ok { border-top: 3px solid var(--ok); }
.stat--warn { border-top: 3px solid var(--warn); }
.stat--danger { border-top: 3px solid var(--danger); }

/* ---------------------------------------------------------------- 6. 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease, transform 80ms ease;
}
.btn:hover { background: var(--surface-2); border-color: var(--text-3); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--brand-ring);
}
.btn[disabled],
.btn.is-busy {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn--primary {
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-strong) 100%);
  border-color: var(--brand-strong);
  color: #fff;
  box-shadow: var(--shadow-brand);
}
.btn--primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); }

.btn--danger {
  background: var(--danger-soft);
  border-color: var(--danger-border);
  color: var(--danger);
}
.btn--danger:hover { background: var(--danger-soft); border-color: var(--danger); }

.btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-2);
}
.btn--ghost:hover { background: var(--surface-3); color: var(--text); }

.btn--sm { padding: 5px 10px; font-size: 12.5px; }
.btn--lg { padding: 11px 20px; font-size: 14.5px; }
.btn--block { width: 100%; }

.btn--icon {
  padding: 6px;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
}

.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* 加载态：按钮内的小转圈 */
.btn.is-busy::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: spin 640ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- 7. 表单 */
.field { display: flex; flex-direction: column; gap: 5px; }
.field__label {
  font-size: 12.5px;
  font-weight: 620;
  color: var(--text-2);
}
.field__label .req { color: var(--danger); margin-left: 2px; }
.field__hint { font-size: 12px; color: var(--text-3); }
.field__error {
  font-size: 12px;
  color: var(--danger);
  font-weight: 550;
  min-height: 0;
}

.input,
.select,
.textarea {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.4;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.input::placeholder,
.textarea::placeholder { color: var(--text-3); }
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}
.input[readonly],
.input[disabled],
.select[disabled] {
  background: var(--surface-3);
  color: var(--text-2);
  cursor: not-allowed;
}
.input--mono { font-family: var(--font-mono); }
.input--num { text-align: right; font-variant-numeric: tabular-nums; }
.input.is-invalid,
.select.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 16%, transparent);
}

.textarea { resize: vertical; min-height: 76px; font-family: var(--font-mono); }

/* 只读的"单位"展示：明确告诉用户单位是 LB 且不可改 */
.unitro {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 11px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.unitro__tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  border-radius: 99px;
  background: var(--brand-soft);
  color: var(--brand);
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  cursor: pointer;
  user-select: none;
}
.checkbox input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
  cursor: pointer;
}

/* ---------------------------------------------------------------- 8. 表格 */
.table-wrap {
  overflow: auto;
  border-radius: 0;
  max-height: none;
}
.table-wrap--scroll { max-height: 62vh; }

table.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

table.table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 10px 12px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-2);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
}

table.table tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

table.table tbody tr:hover { background: var(--surface-2); }
table.table tbody tr:last-child td { border-bottom: none; }

table.table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  font-size: 12.5px;
}
table.table .nowrap { white-space: nowrap; }
table.table .muted { color: var(--text-3); }

/* 行状态染色：与结果页、导出 Excel 三处保持一致 */
tr.is-error { background: var(--danger-soft); }
tr.is-error:hover { background: var(--danger-soft); }
tr.is-warn { background: var(--warn-soft); }
tr.is-warn:hover { background: var(--warn-soft); }
tr.is-error td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
tr.is-warn td:first-child { box-shadow: inset 3px 0 0 var(--warn); }

.cell-sku {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.cell-name { color: var(--text-2); max-width: 260px; }

.empty {
  padding: 46px 20px;
  text-align: center;
  color: var(--text-3);
}
.empty__icon {
  font-size: 30px;
  opacity: 0.5;
  margin-bottom: 8px;
}
.empty__title {
  font-weight: 620;
  color: var(--text-2);
  margin-bottom: 3px;
}
.empty__desc { font-size: 13px; }

/* ---------------------------------------------------------------- 9. 徽标 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge--ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-border); }
.badge--warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-border); }
.badge--danger { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-border); }
.badge--info { background: var(--info-soft); color: var(--info); }
.badge--neutral { background: var(--surface-3); color: var(--text-2); border-color: var(--border); }
.badge--brand { background: var(--brand-soft); color: var(--brand); }

.badge__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ---------------------------------------------------------------- 10. 提示条 */
.callout {
  display: flex;
  gap: 11px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 13px;
  color: var(--text-2);
}
.callout__icon { flex: 0 0 auto; font-size: 15px; line-height: 1.4; }
.callout__body { min-width: 0; }
.callout__title { font-weight: 650; color: var(--text); margin-bottom: 2px; }
.callout--ok { background: var(--ok-soft); border-color: var(--ok-border); color: var(--ok); }
.callout--ok .callout__title { color: var(--ok); }
.callout--warn { background: var(--warn-soft); border-color: var(--warn-border); color: var(--warn); }
.callout--warn .callout__title { color: var(--warn); }
.callout--danger { background: var(--danger-soft); border-color: var(--danger-border); color: var(--danger); }
.callout--danger .callout__title { color: var(--danger); }
.callout--brand { background: var(--brand-soft); border-color: transparent; color: var(--brand); }
.callout--brand .callout__title { color: var(--brand); }

/* ---------------------------------------------------------------- 11. 结果页 */
.resultbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  border-left-width: 4px;
}
.resultbar--ok { border-left-color: var(--ok); }
.resultbar--warn { border-left-color: var(--warn); }
.resultbar--danger { border-left-color: var(--danger); }
.resultbar__icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 18px;
  flex: 0 0 38px;
}
.resultbar--ok .resultbar__icon { background: var(--ok-soft); color: var(--ok); }
.resultbar--warn .resultbar__icon { background: var(--warn-soft); color: var(--warn); }
.resultbar--danger .resultbar__icon { background: var(--danger-soft); color: var(--danger); }
.resultbar__title { font-size: 15.5px; font-weight: 660; }
.resultbar__desc { font-size: 13px; color: var(--text-2); margin: 2px 0 0; }
.resultbar__meta { margin-left: auto; text-align: right; font-size: 12px; color: var(--text-3); }

/* 明细行里的文案序列（设计文档 §4.4） */
.linecard__title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.linecard__sku {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
}
.speclist {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.speclist li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 13px;
}
.speclist li span:first-child { color: var(--text-2); }
.speclist li span:last-child {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  font-size: 12.5px;
}
.speclist li.is-strong {
  background: var(--brand-soft);
}
.speclist li.is-strong span:last-child { color: var(--brand); font-size: 14px; }
.speclist li.is-missing span:last-child { color: var(--warn); }

/* 复制结果用的文本框 */
.copybox {
  width: 100%;
  min-height: 220px;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.65;
  white-space: pre;
  overflow: auto;
}

/* ---------------------------------------------------------------- 12. 登录页 */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
}
.auth__aside {
  position: relative;
  padding: 46px 48px;
  background: linear-gradient(155deg, #1a2a5e 0%, #22368f 45%, #2d4bd8 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}
.auth__aside::before {
  content: "";
  position: absolute;
  inset: -30% -20% auto auto;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.16) 0%, transparent 68%);
}
.auth__aside::after {
  content: "";
  position: absolute;
  inset: auto auto -34% -18%;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(120, 220, 255, 0.16) 0%, transparent 70%);
}
.auth__brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 16px;
}
.auth__mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  display: grid;
  place-items: center;
  font-size: 17px;
}
.auth__pitch {
  position: relative;
  max-width: 42ch;
}
.auth__pitch h1 {
  color: #fff;
  font-size: 32px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.auth__pitch p {
  color: rgba(255, 255, 255, 0.78);
  font-size: 14.5px;
  line-height: 1.65;
}
.auth__facts {
  position: relative;
  display: grid;
  gap: 12px;
  margin-top: 26px;
}
.auth__fact {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.88);
}
.auth__fact b {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 1px 7px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 700;
}
.auth__foot {
  position: relative;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}

.auth__main {
  display: grid;
  place-items: center;
  padding: 40px 24px;
  background: var(--surface);
}
.auth__form {
  width: 100%;
  max-width: 356px;
}
.auth__form h2 {
  font-size: 23px;
  letter-spacing: -0.02em;
  margin-bottom: 5px;
}
.auth__form .lead {
  color: var(--text-2);
  font-size: 13.5px;
  margin-bottom: 24px;
}
.auth__form .field { margin-bottom: 15px; }
.auth__error {
  margin-bottom: 15px;
  display: none;
}
.auth__error.is-visible { display: flex; }

@media (max-width: 880px) {
  .auth { grid-template-columns: 1fr; }
  .auth__aside { display: none; }
}

/* ---------------------------------------------------------------- 13. 弹窗 */
.modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 18px 24px;
  overflow-y: auto;
  background: color-mix(in srgb, #0b1220 62%, transparent);
  backdrop-filter: blur(3px);
}
.modal.is-open { display: flex; }
.modal__panel {
  width: 100%;
  max-width: 560px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: pop 160ms cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.modal__panel--wide { max-width: 940px; }
@keyframes pop {
  from { transform: translateY(-10px) scale(0.985); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.modal__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
}
.modal__title { font-size: 15.5px; font-weight: 660; }
.modal__close {
  margin-left: auto;
  border: none;
  background: transparent;
  color: var(--text-3);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}
.modal__close:hover { background: var(--surface-3); color: var(--text); }
.modal__body { padding: 18px; }
.modal__foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ---------------------------------------------------------------- 14. Toast */
.toasts {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-width: min(400px, calc(100vw - 36px));
}
.toast {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  font-size: 13px;
  animation: slidein 180ms ease;
}
@keyframes slidein {
  from { transform: translateX(14px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.toast__icon { flex: 0 0 auto; font-size: 15px; }
.toast__body { min-width: 0; }
.toast__title { font-weight: 640; margin-bottom: 1px; }
.toast__msg { color: var(--text-2); word-break: break-word; }
.toast--ok { border-left: 3px solid var(--ok); }
.toast--warn { border-left: 3px solid var(--warn); }
.toast--danger { border-left: 3px solid var(--danger); }
.toast--info { border-left: 3px solid var(--brand); }

/* ---------------------------------------------------------------- 15. 其他 */
.divider { height: 1px; background: var(--border); margin: 4px 0; border: 0; }

.kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
  font-size: 13px;
}
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; font-weight: 600; }

.skeleton {
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
  height: 14px;
}
@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.pagination__info { font-size: 12.5px; color: var(--text-3); }

.toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.toolbar .input { width: auto; min-width: 190px; }
.toolbar .select { width: auto; min-width: 130px; }

.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.text-2 { color: var(--text-2); }
.text-3 { color: var(--text-3); }
.text-danger { color: var(--danger); }
.text-warn { color: var(--warn); }
.text-ok { color: var(--ok); }
.fw-6 { font-weight: 600; }
.fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

/* 拖拽上传区 */
.dropzone {
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 26px 18px;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  text-align: center;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}
.dropzone:hover,
.dropzone.is-over {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.dropzone__icon { font-size: 24px; color: var(--brand); }
.dropzone__title { font-weight: 640; font-size: 14px; }
.dropzone__hint { font-size: 12.5px; color: var(--text-3); }
.dropzone.is-over .dropzone__title { color: var(--brand); }

.filepill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 11px;
  border-radius: 99px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12.5px;
  font-weight: 620;
}

/* 异常清单 */
.issues { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--text-2); }
.issues li { margin-bottom: 3px; }

/* 权限拒绝提示 */
.denied {
  display: flex;
  gap: 11px;
  align-items: flex-start;
}

/* ---------------------------------------------------------------- 16. 响应式 */
@media (max-width: 1100px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .grid--2,
  .grid--3 { grid-template-columns: 1fr; }
  .topbar { gap: 10px; padding: 0 14px; }
  .topbar__nav { gap: 2px; }
  .navlink { padding: 6px 9px; font-size: 13px; }
  .page { padding: 18px 14px 56px; }
}
@media (max-width: 620px) {
  .grid--4 { grid-template-columns: 1fr; }
  .userchip__meta { display: none; }
  .pagehead { align-items: flex-start; }
}

/* ---------------------------------------------------------------- 17. 打印 */
@media print {
  .topbar,
  .pagehead__actions,
  .btn,
  .toasts { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #ccc; }
}
