/* ============================================================
   进销存管理系统 · Web 版 样式表
   结构：设计变量 → 基础 → 登录页 → 主界面 → 弹窗 → 响应式
   ============================================================ */

/* ---------------- 设计变量 ---------------- */
:root {
  --brand-50:  #eff6ff;
  --brand-100: #dbeafe;
  --brand-500: #3b82f6;
  --brand-600: #2563eb;
  --brand-700: #1d4ed8;
  --brand-900: #172554;

  --navy-800:  #10233f;
  --navy-900:  #0b1a30;

  --ink-900: #0f172a;
  --ink-700: #334155;
  --ink-500: #64748b;
  --ink-400: #94a3b8;
  --ink-300: #cbd5e1;

  --line:        #e2e8f0;
  --line-strong: #cbd5e1;

  --bg:      #f4f7fb;
  --surface: #ffffff;

  --danger:      #dc2626;
  --danger-bg:   #fef2f2;
  --danger-line: #fecaca;
  --ok:          #16a34a;
  --ok-bg:       #f0fdf4;
  --ok-line:     #bbf7d0;
  --warn:        #d97706;

  --radius-lg: 16px;
  --radius:    12px;
  --radius-sm: 9px;

  --shadow-card: 0 20px 50px -28px rgba(15, 23, 42, .35), 0 2px 8px -4px rgba(15, 23, 42, .08);
  --shadow-pop:  0 30px 70px -30px rgba(15, 23, 42, .45);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
}

/* ---------------- 基础 ---------------- */
*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-900);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ul, li, figure { margin: 0; padding: 0; }
ul { list-style: none; }
button { font-family: inherit; font-size: inherit; cursor: pointer; }
input { font-family: inherit; font-size: inherit; }
a { color: var(--brand-600); }

:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }

/* ------------------------------------------------------------
   hidden 属性必须能压过组件自己的 display
   注意：浏览器给 hidden 准备的 display:none 来自 UA 样式表，
   任何作者样式里的 display（如 .modal{display:flex}）都会把它盖掉，
   结果就是「元素明明带了 hidden 却依然显示、且设 hidden 也关不掉」。
   走 !important 把这条拉回最高优先级，下面所有弹窗/提示条才受 hidden 控制。
   ------------------------------------------------------------ */
[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;
}

/* ============================================================
   登录页
   ============================================================ */
.auth-page { background: var(--surface); }

.auth-shell {
  display: grid;
  grid-template-columns: minmax(360px, 44%) 1fr;
  min-height: 100vh;
}

/* ---------- 左侧品牌区 ---------- */
.brand-pane {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 56px 52px 36px;
  color: #eaf1fb;
  background:
    radial-gradient(760px 420px at 12% 6%, rgba(59, 130, 246, .34), transparent 62%),
    radial-gradient(560px 380px at 96% 96%, rgba(37, 99, 235, .26), transparent 60%),
    var(--navy-900);
  overflow: hidden;
}

.brand-pane::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: .5;
  pointer-events: none;
}

.brand-inner { position: relative; z-index: 1; max-width: 420px; }

.brand-logo { margin-bottom: 26px; }

.brand-title {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: .5px;
  color: #ffffff;
}

.brand-sub {
  margin-top: 10px;
  font-size: 14px;
  color: #a8bfdd;
}

.brand-points {
  margin-top: 42px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.brand-points li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.brand-points .dot {
  flex: none;
  width: 7px; height: 7px;
  margin-top: 8px;
  border-radius: 50%;
  background: var(--brand-500);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, .18);
}

.brand-points strong {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #ffffff;
}

.brand-points em {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  font-style: normal;
  color: #93aac9;
  line-height: 1.55;
}

.brand-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 28px;
  font-size: 12px;
  color: #7f96b5;
}

.brand-foot-sep {
  width: 1px; height: 12px;
  background: rgba(255, 255, 255, .18);
}

/* ---------- 右侧表单区 ---------- */
.form-pane {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  background: var(--surface);
}

.form-wrap { width: 100%; max-width: 384px; }

.form-head { margin-bottom: 30px; }

.form-head h2 {
  font-size: 22px;
  font-weight: 600;
  color: var(--ink-900);
}

.form-head p {
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--ink-500);
}

.login-form { display: flex; flex-direction: column; gap: 18px; }

/* ---------- 表单字段 ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }

.field > label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-700);
}

.control {
  position: relative;
  display: flex;
  align-items: center;
}

.control-icon {
  position: absolute;
  left: 13px;
  display: flex;
  color: var(--ink-400);
  pointer-events: none;
  transition: color .15s ease;
}

.control input {
  width: 100%;
  height: 46px;
  padding: 0 42px 0 40px;
  color: var(--ink-900);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.control input::placeholder { color: var(--ink-400); }

.control input:hover { border-color: #b6c2d2; }

.control input:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, .14);
}

.control:focus-within .control-icon { color: var(--brand-600); }

.control input:disabled {
  background: #f8fafc;
  color: var(--ink-500);
  cursor: not-allowed;
}

.control-clear,
.control-eye {
  position: absolute;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  color: var(--ink-400);
  background: transparent;
  border: 0;
  border-radius: 7px;
  transition: color .15s ease, background .15s ease;
}

.control-clear:hover,
.control-eye:hover { color: var(--ink-700); background: #f1f5f9; }

.control-eye .eye-slash { opacity: 0; transition: opacity .15s ease; }
.control-eye[aria-pressed="true"] .eye-slash { opacity: 1; }

.field.invalid .control input {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(220, 38, 38, .1);
}
.field.invalid .control-icon { color: var(--danger); }

.field-error {
  font-size: 12.5px;
  color: var(--danger);
}

/* ---------- 记住账号 ---------- */
.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: -4px;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.checkbox input { position: absolute; opacity: 0; width: 0; height: 0; }

.checkbox-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 17px; height: 17px;
  color: transparent;
  background: var(--surface);
  border: 1.5px solid var(--line-strong);
  border-radius: 5px;
  transition: all .15s ease;
}

.checkbox input:checked + .checkbox-box {
  color: #fff;
  background: var(--brand-600);
  border-color: var(--brand-600);
}

.checkbox input:focus-visible + .checkbox-box {
  box-shadow: 0 0 0 4px rgba(59, 130, 246, .18);
}

.checkbox-text { font-size: 13px; color: var(--ink-700); }

.link-btn {
  padding: 0;
  font-size: 13px;
  color: var(--brand-600);
  background: none;
  border: 0;
}

.link-btn:hover { color: var(--brand-700); text-decoration: underline; }

/* ---------- 提示条 ---------- */
.alert {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 11px 13px;
  font-size: 13px;
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid var(--danger-line);
  border-radius: var(--radius-sm);
}

.alert.is-ok {
  color: #15803d;
  background: var(--ok-bg);
  border-color: var(--ok-line);
}

.alert-icon { flex: none; margin-top: 1px; }
.alert-text { line-height: 1.5; }

/* ---------- 主按钮 ---------- */
.btn-primary {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 46px;
  margin-top: 2px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 2px;
  color: #fff;
  background: var(--brand-600);
  border: 0;
  border-radius: var(--radius-sm);
  transition: background .15s ease, transform .06s ease, box-shadow .15s ease;
}

.btn-primary:hover:not(:disabled) { background: var(--brand-700); }
.btn-primary:active:not(:disabled) { transform: translateY(1px); }
.btn-primary:disabled { background: #93b4ee; cursor: not-allowed; }

.btn-spinner {
  display: none;
  width: 16px; height: 16px;
  border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.btn-primary.is-loading .btn-spinner { display: block; }
.btn-primary.is-loading .btn-label { opacity: .85; }

@keyframes spin { to { transform: rotate(360deg); } }

.form-note {
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--ink-500);
  text-align: center;
  line-height: 1.6;
}

.form-foot {
  margin-top: 26px;
  padding-top: 18px;
  font-size: 12.5px;
  color: var(--ink-500);
  text-align: center;
  border-top: 1px solid var(--line);
}

.form-foot b { color: var(--ink-700); font-weight: 500; }

/* ============================================================
   弹窗
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .5);
}

.modal-box {
  position: relative;
  width: 100%;
  max-width: 400px;
  padding: 26px 26px 22px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
}

.modal-box h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
}

.modal-box p {
  font-size: 13.5px;
  color: var(--ink-700);
  line-height: 1.7;
}

.modal-hint {
  margin-top: 10px;
  padding: 10px 12px;
  font-size: 12.5px !important;
  color: var(--ink-500) !important;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

/* 窗体拖动（2026-10-19，配合 assets/js/modalDrag.js）
   ⚠ 这里只加光标提示，定位/移动全在 JS 里用 transform 做，现有弹窗布局一行没改。
      底部空白、标题栏以外的空白也能拖（用户要求），但那里不给抓手光标，免得整窗都是「抓手」。 */
.modal-box > .modal-head,
.modal-box > h3,
.pv-link-head {
  cursor: move;
}
/* 拖动过程中：禁掉文字选中（不然会跟着框选一片） */
body.is-dragging-modal {
  user-select: none;
  -webkit-user-select: none;
}
body.is-dragging-modal .modal-box,
body.is-dragging-modal .modal-box > .modal-head,
body.is-dragging-modal .modal-box > h3,
body.is-dragging-modal .pv-link-head {
  cursor: grabbing;
}

/* 窗体最小化（2026-10-19，配合 modalDrag.js）
   ⚠ 方案 1 口径：只把窗体本身藏起来，**遮罩保留**（后台页面依然点不了）——
      这样现有业务逻辑一个字没动，风险最小。 */
.modal-box.is-min {
  display: none !important;
}
/* 最小化按钮：运行时注入（HTML 里本来没有，靠 JS 加）
   ⚠ 用绝对定位钉在「×」左边（坐标由 JS 按 × 的实际位置算），
      不插进现有结构 —— 各窗体大小/结构不一样也不会跑偏 */
.modal-min-btn {
  width: 26px;
  height: 26px;
  line-height: 1;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-500, #64748b);
  font-size: 16px;
  cursor: pointer;
}
.modal-min-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}
/* 底部任务栏：只在有窗体被收起时出现 */
.inv-taskbar {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 200; /* 高于所有弹窗（最高的库存提醒窗是 90） */
  display: flex;
  gap: 8px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line, #e3e8ef);
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.18);
}
/* ⚠ 作者样式（display:flex）会压掉 UA 的 [hidden]，必须显式兜住 */
.inv-taskbar[hidden] {
  display: none !important;
}
.inv-taskbar-item {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 220px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line, #e3e8ef);
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  font-size: 12.5px;
  cursor: pointer;
}
.inv-taskbar-item:hover {
  background: #eef2ff;
  border-color: #c7d2fe;
}
.inv-taskbar-item .it-dot {
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f59e0b;
}
.inv-taskbar-item .it-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 手机上不做（窗体本来就全屏，任务栏反而碍事） */
@media (max-width: 720px) {
  .modal-min-btn,
  .inv-taskbar {
    display: none !important;
  }
}

/* 2026-09-26：「账号已在别处登录」弹窗——把对方 IP / 时间 / 设备列成三行，方便一眼看清 */
.online-lead { margin-bottom: 10px; }

.online-list {
  margin: 0;
  padding: 12px 14px;
  list-style: none;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.online-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  line-height: 2;
}

.online-list li span { color: var(--ink-500); flex: 0 0 auto; }
.online-list li b {
  color: var(--ink-900);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
  word-break: break-all;
}

.modal-box .btn-ghost { margin-top: 20px; width: 100%; }

.btn-ghost {
  height: 42px;
  font-size: 14px;
  color: var(--ink-700);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  transition: background .15s ease, border-color .15s ease;
}

.btn-ghost:hover { background: #f8fafc; border-color: #b6c2d2; }

.btn-ghost.is-danger { color: var(--danger); border-color: var(--danger-line); }
.btn-ghost.is-danger:hover { background: var(--danger-bg); }

/* ============================================================
   主界面
   ============================================================ */
.app-page { background: var(--bg); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 62px;
  padding: 0 26px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-900);
}

.topbar-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: var(--brand-600);
  border-radius: 8px;
}

.topbar-right { display: flex; align-items: center; gap: 12px; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.user-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  font-size: 13px;
  font-weight: 500;
  color: var(--brand-700);
  background: var(--brand-100);
  border-radius: 50%;
}

.user-meta { display: flex; flex-direction: column; line-height: 1.25; }
.user-meta .user-name { font-size: 13px; font-weight: 500; }
.user-meta .user-acc { font-size: 11.5px; color: var(--ink-500); }

.badge {
  display: inline-flex;
  align-items: center;
  height: 21px;
  padding: 0 8px;
  font-size: 11.5px;
  font-weight: 500;
  border-radius: 999px;
}

.badge-admin { color: var(--brand-700); background: var(--brand-100); }
.badge-user  { color: var(--ink-700); background: #eef2f7; }
.badge-ok    { color: #15803d; background: var(--ok-bg); }
.badge-off   { color: var(--ink-500); background: #f1f5f9; }

.btn-sm {
  height: 34px;
  padding: 0 14px;
  font-size: 13px;
  color: var(--ink-700);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.btn-sm:hover { background: #f8fafc; border-color: #b6c2d2; }
.btn-sm.is-danger { color: var(--danger); border-color: var(--danger-line); }
.btn-sm.is-danger:hover { background: var(--danger-bg); }

.app-main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 26px 26px 60px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.page-hero {
  padding: 24px 26px;
  color: #fff;
  background:
    radial-gradient(520px 220px at 92% 10%, rgba(96, 165, 250, .38), transparent 60%),
    var(--navy-800);
  border-radius: var(--radius-lg);
}

.page-hero h1 { font-size: 20px; font-weight: 600; }
.page-hero p { margin-top: 6px; font-size: 13px; color: #a8bfdd; }

.card {
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.card-head h2 { font-size: 15px; font-weight: 600; }
.card-head .card-head-sub { font-size: 12.5px; color: var(--ink-500); }

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px 22px;
}

.info-item .info-label { font-size: 12.5px; color: var(--ink-500); }
.info-item .info-value {
  margin-top: 3px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-900);
  word-break: break-all;
}
.info-item .info-value.is-mono { font-family: var(--mono); font-size: 13px; }

.perm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
  gap: 12px;
}

.perm-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.perm-item.on { background: var(--brand-50); border-color: var(--brand-100); }
.perm-item .perm-name { font-size: 13px; }

.empty-hint {
  padding: 30px 20px;
  font-size: 13px;
  color: var(--ink-500);
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
}

/* ---------- 顶部导航（与销售开单页保持一致） ---------- */
.topbar-left { display: flex; align-items: center; gap: 16px; min-width: 0; }

.topnav { display: flex; gap: 4px; flex: none; }

.topnav a {
  padding: 6px 12px;
  font-size: 14px;
  color: #5b6579;
  text-decoration: none;
  border-radius: 8px;
  transition: background .15s ease, color .15s ease;
}

.topnav a:hover { background: #f0f3fa; }
.topnav a.active { color: #3559d6; background: #eaf0ff; font-weight: 600; }

/* ---------- 业务模块卡片 ---------- */
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  gap: 12px;
}

.module-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  color: inherit;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.module-card.is-ready {
  background: linear-gradient(180deg, var(--brand-50), var(--surface) 72%);
  border-color: var(--brand-100);
  cursor: pointer;
}

.module-card.is-ready:hover {
  border-color: var(--brand-500);
  box-shadow: 0 12px 28px -18px rgba(37, 99, 235, .6);
  transform: translateY(-1px);
}

.module-card.is-soon,
.module-card.is-locked { opacity: .6; cursor: not-allowed; }

.module-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 40px;
  height: 40px;
  color: var(--ink-500);
  background: var(--bg);
  border-radius: 10px;
}

.module-card.is-ready .module-icon { color: var(--brand-600); background: var(--brand-100); }

.module-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.module-name { font-size: 14px; font-weight: 600; color: var(--ink-900); }
.module-desc { font-size: 12px; line-height: 1.45; color: var(--ink-500); }
.module-state { flex: none; align-self: flex-start; }

/* ---------- 修改密码 ---------- */
.modal-box.is-wide { max-width: 440px; }

.modal-form { display: flex; flex-direction: column; gap: 15px; }

.pwd-meter {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--ink-500);
}

.pwd-meter-bars { display: flex; gap: 4px; flex: none; }

.pwd-meter-bars i {
  display: block;
  width: 26px; height: 4px;
  background: var(--line);
  border-radius: 2px;
  transition: background .2s ease;
}

.pwd-meter[data-score="1"] .pwd-meter-bars i:nth-child(-n+1),
.pwd-meter[data-score="2"] .pwd-meter-bars i:nth-child(-n+2),
.pwd-meter[data-score="3"] .pwd-meter-bars i:nth-child(-n+3),
.pwd-meter[data-score="4"] .pwd-meter-bars i:nth-child(-n+4) { background: var(--brand-500); }

.pwd-meter[data-score="1"] .pwd-meter-bars i:nth-child(-n+1) { background: var(--danger); }
.pwd-meter[data-score="2"] .pwd-meter-bars i:nth-child(-n+2) { background: var(--warn); }

.modal-actions { display: flex; gap: 10px; margin-top: 4px; }
.modal-actions .btn-primary,
.modal-actions .btn-ghost { flex: 1; margin-top: 0; letter-spacing: 0; }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; min-height: auto; }

  .brand-pane {
    padding: 30px 26px 28px;
    justify-content: flex-start;
  }

  .brand-logo { margin-bottom: 18px; }
  .brand-logo svg { width: 34px; height: 34px; }
  .brand-title { font-size: 23px; }
  .brand-points { display: none; }
  .brand-foot { margin-top: 22px; padding-top: 0; }

  .form-pane { padding: 32px 22px 48px; align-items: flex-start; }
  .form-wrap { max-width: 100%; }

  .topbar { height: auto; padding: 12px 16px; flex-wrap: wrap; }
  .topbar-right { width: 100%; justify-content: space-between; }
  .user-meta .user-acc { display: none; }
  .app-main { padding: 18px 16px 48px; }
  .page-hero { padding: 20px; }
  .card { padding: 18px; }
}

@media (max-width: 420px) {
  .form-head h2 { font-size: 20px; }
  .btn-primary { letter-spacing: 1px; }
}

/* 减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* 打印时隐藏交互元素 */
@media print {
  .topbar, .modal { display: none !important; }
}

/* ============================================================
   2026-09-24 全站格式统一（用户要求）
   1) 所有数据表格的表头/单元格内容水平居中（含数字列）。
      ⚠ 用 !important 压过各页自身的 text-align:left/right
        （.ks-table/.st-table/.q-table/.dash-table/.num/.ta-r …），
        因为本文件在各页专属 css 之前加载，同等优先级会被覆盖。
   2) .btn-sm 不换行、不被 flex 压缩 —— 修统计页筛选条里
      「清除条件」被压窄、文字竖排溢出按钮框的问题。
   ============================================================ */
.data-table th, .data-table td,
.ks-table th, .ks-table td,
.st-table th, .st-table td,
.q-table th, .q-table td,
.sum-table th, .sum-table td,
.dash-table th, .dash-table td,
.cf-table th, .cf-table td,
.pick-table th, .pick-table td,
.exp-tables th, .exp-tables td { text-align: center !important; }

.btn-sm { white-space: nowrap; flex: none; }
.stf-actions, .qf-actions { flex: none; }

/* ============================================================
   2026-09-25 工具排按钮统一：等宽、同高（用户要求）
   .btn-primary 原是登录页通栏按钮（width:100% / 46px 高 / 2px 字距），
   落进筛选条 / 维护页工具排后会把按钮撑成容器同宽
   （实测：/backup「立即备份」1268px、/unpack「查询库存」「生成拆包单」370px、
   统计页「查询」150px），和旁边按内容宽的 .btn-sm（56~82px）摆一排七长八短。
   这里把工具排里的 .btn-primary 拉回普通按钮尺寸，并给整排按钮一个
   统一最小宽度（对齐 grid-toolbar 已有的 92px），短按钮补齐、长按钮自然展开。
   只动布局，不碰任何运行逻辑。
   ============================================================ */
.stf-actions .btn-primary,
.qf-actions .btn-primary,
.maint-acts .btn-primary {
  width: auto;
  height: 34px;
  margin-top: 0;
  font-size: 13px;
  letter-spacing: 0;
}

.stf-actions button,
.qf-actions button,
.maint-acts button,
.card-head-right .btn-sm {
  min-width: 95px;
  text-align: center;
}

/* ===== 2026-09-27 改单冲突对比弹窗（公共组件 conflictModal.js 用） ===== */
.conflict-grid { max-height: 46vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.conflict-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.conflict-table th, .conflict-table td { border: 1px solid var(--line); padding: 4px 6px; text-align: center; vertical-align: middle; }
.conflict-table thead th { background: var(--bg); font-weight: 600; position: sticky; top: 0; z-index: 1; }
.conflict-side { background: var(--brand-50) !important; color: var(--brand-700); }
.conflict-row.is-diff   { background: var(--danger-bg); }
.conflict-row.is-mine   { background: var(--ok-bg); }
.conflict-row.is-theirs { background: #fffbeb; }
.conflict-tag { font-size: 11px; color: var(--ink-500); white-space: nowrap; }
.conflict-cell.is-changed { font-weight: 600; }
.conflict-mine   { color: var(--danger); }
.conflict-arrow  { margin: 0 5px; color: var(--ink-300); }
.conflict-theirs { color: var(--ok); }
