:root {
  --bg: #f1f5f9;
  --panel: #ffffff;
  --sidebar: #0f172a;
  --sidebar-hover: #1e293b;
  --text: #1e293b;
  --text-2: #64748b;
  --border: #e2e8f0;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --danger: #dc2626;
  --amber: #b45309;
  --green: #15803d;
  --blue: #1d4ed8;
  --purple: #7c3aed;
  --teal: #0f766e;
  --red: #b91c1c;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 236px;
  background: linear-gradient(180deg, #0f172a 0%, #111c34 55%, #0b1222 100%);
  color: #cbd5e1;
  display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; z-index: 20;
  box-shadow: 1px 0 0 rgba(15,23,42,.06);
}
.main { flex: 1; margin-left: 236px; padding: 24px 28px 60px; }

.brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-logo {
  width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff; font-weight: 700; font-size: 17px; display: flex; align-items: center; justify-content: center;
}
.brand-logo.lg { width: 56px; height: 56px; font-size: 26px; border-radius: 14px; margin: 0 auto 12px; }
.brand-text { font-weight: 600; font-size: 15px; color: #f1f5f9; line-height: 1.35; }
.brand-sub { display: block; font-size: 10.5px; font-weight: 400; color: #64748b; letter-spacing: .5px; margin-top: 1px; }

.nav { padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(148,163,184,.35) transparent; }
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb { background: rgba(148,163,184,.35); border-radius: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-radius: 8px;
  color: #cbd5e1; font-size: 13.5px; transition: all .15s;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { background: var(--sidebar-hover); color: #fff; text-decoration: none; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(59,130,246,.32), rgba(59,130,246,.08));
  color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 #3b82f6;
}
.nav-item.active svg { color: #60a5fa; }
.nav-group-label {
  display: flex; align-items: center; gap: 10px; padding: 12px 12px 4px;
  color: #94a3b8; font-size: 13px; font-weight: 600; letter-spacing: .5px;
}
.nav-group-label.on { color: #e2e8f0; }
.nav-group-label svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item.nav-sub { padding: 7px 12px 7px 26px; font-size: 13px; gap: 8px; }
.nav-item.nav-sub svg { width: 16px; height: 16px; }
/* 菜单徽标：待办数字提醒（询价管理等） */
.nav-badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: #d93025; color: #fff; font-size: 11px; font-weight: 700; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  font-variant-numeric: tabular-nums; animation: navBadgePulse 2.4s ease-in-out infinite;
}
@keyframes navBadgePulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(217,48,37,.45); } 50% { box-shadow: 0 0 0 4px rgba(217,48,37,0); } }
/* 模块分组头：可点击折叠 */
.nav-module-label {
  display: flex; align-items: center; gap: 7px; margin-top: 7px; padding: 9px 12px;
  color: #64748b; font-size: 11.5px; font-weight: 700; letter-spacing: 1.5px;
  border-top: 1px solid rgba(255,255,255,.07); border-radius: 8px;
  cursor: pointer; user-select: none; transition: color .15s, background .15s;
}
.nav-module-label:hover { color: #cbd5e1; background: rgba(148,163,184,.08); }
.nav-module-label:first-child { border-top: none; margin-top: 0; }
.nav-module-label .chev { width: 14px; height: 14px; flex-shrink: 0; opacity: .75; transition: transform .18s ease; }
.nav-module-label.open .chev { transform: rotate(90deg); }
.nav-module-label.on { color: #7dd3fc; }
.nav-module-label.on .chev { opacity: 1; }
/* 分组内容容器：默认收起，label.open 时展开 */
.nav-group { display: none; flex-direction: column; gap: 2px; }
.nav-module-label.open + .nav-group { display: flex; animation: navIn .18s ease; }
@keyframes navIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: translateY(0); } }
.sidebar-foot { padding: 10px; border-top: 1px solid rgba(255,255,255,.08); display: flex; flex-direction: column; gap: 2px; flex-shrink: 0; }
.logout-form { margin-top: 2px; }
.logout-btn {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 7px 12px; border: none;
  background: transparent; color: #cbd5e1; font-size: 13.5px; border-radius: 8px; cursor: pointer; font-family: inherit;
}
.logout-btn svg { width: 18px; height: 18px; }
.logout-btn:hover { background: rgba(220, 38, 38, .15); color: #fca5a5; }

.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 12px; }
.page-title { font-size: 21px; font-weight: 700; }
.page-actions { display: flex; gap: 8px; }

/* ---------- 面板 / 卡片 ---------- */
.panel { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.panel-head h2 { font-size: 15px; font-weight: 600; }
.link { font-size: 13px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card {
  background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px;
  border-left: 4px solid var(--primary);
}
.stat-card.warn { border-left-color: var(--amber); }
.stat-label { color: var(--text-2); font-size: 13px; }
.stat-value { font-size: 26px; font-weight: 700; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 12px; color: var(--text-2); }
.stat-sub a { color: var(--amber); }

/* ---------- 工作台模块分区标题 ---------- */
.module-sec { display: flex; align-items: center; gap: 10px; margin: 26px 0 14px; }
.module-sec:first-of-type { margin-top: 0; }
.module-sec-tag { font-size: 13px; font-weight: 700; letter-spacing: 2px; color: var(--text-2); background: var(--panel); border: 1px solid var(--border); border-radius: 999px; padding: 4px 14px; white-space: nowrap; }
.module-sec-line { flex: 1; height: 1px; background: var(--border); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* ---------- 移动端顶栏与抽屉遮罩（桌面隐藏，≤980px 显示） ---------- */
.m-topbar { display: none; }
.drawer-mask { display: none; }

@media (max-width: 980px) {
  .grid-2 { grid-template-columns: 1fr; }
  .main { margin-left: 0; padding: 64px 16px 60px; }
  /* 侧边栏降级为左侧抽屉（默认滑出屏幕，.open 滑入） */
  .sidebar {
    width: 280px; z-index: 40;
    transform: translateX(-100%);
    transition: transform .25s ease;
  }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(15,23,42,.35); }
  /* 半透明遮罩：点击收起抽屉 */
  .drawer-mask {
    display: block; position: fixed; inset: 0; z-index: 30;
    background: rgba(15,23,42,.5); opacity: 0; pointer-events: none;
    transition: opacity .25s ease;
  }
  .drawer-mask.show { opacity: 1; pointer-events: auto; }
  /* 移动端顶栏：汉堡 + 标题 + 用户名 */
  .m-topbar {
    display: flex; align-items: center; gap: 6px;
    position: fixed; top: 0; left: 0; right: 0; z-index: 25;
    height: 48px; padding: 0 8px 0 4px;
    background: #0f172a; color: #f1f5f9;
    box-shadow: 0 1px 4px rgba(15,23,42,.25);
  }
  .m-menu-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; border: none; border-radius: 8px;
    background: transparent; color: #e2e8f0; cursor: pointer; flex-shrink: 0;
  }
  .m-menu-btn:active { background: rgba(148,163,184,.2); }
  .m-menu-btn svg { width: 22px; height: 22px; }
  .m-title {
    flex: 1; font-size: 15px; font-weight: 600;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .m-user {
    display: inline-flex; align-items: center; gap: 6px; color: #cbd5e1;
    font-size: 13px; padding: 8px 10px; border-radius: 8px; text-decoration: none;
    flex-shrink: 0; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .m-user:hover { background: rgba(148,163,184,.15); color: #fff; text-decoration: none; }
}

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; color: var(--text-2); font-weight: 500; font-size: 12.5px;
  padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:hover { background: #f8fafc; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .num.strong { font-weight: 600; }
.table .sub { color: var(--text-2); font-size: 12px; }
.table .empty { text-align: center; color: var(--text-2); padding: 30px 0; }
.th-ops, .ops { white-space: nowrap; }
.cell-content { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sum-tip { color: var(--text-2); font-size: 13px; }
.sum-tip b { color: var(--text); font-size: 15px; }

.kv { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.kv th { text-align: left; color: var(--text-2); font-weight: 500; width: 110px; padding: 8px 10px; white-space: nowrap; }
.kv td { padding: 8px 10px; border-bottom: 1px dashed var(--border); }

/* ---------- 徽标 ---------- */
.badge {
  display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; white-space: nowrap;
}
.badge-lg { padding: 5px 16px; font-size: 14px; }
.st-amber { background: #fef3c7; color: var(--amber); }
.st-blue { background: #dbeafe; color: var(--blue); }
.st-green { background: #dcfce7; color: var(--green); }
.st-red { background: #fee2e2; color: var(--red); }
.st-purple { background: #ede9fe; color: var(--purple); }
.st-teal { background: #ccfbf1; color: var(--teal); }
.st-orange { background: #ffedd5; color: #c2410c; }
.st-gray { background: #f1f5f9; color: var(--text-2); }
.btn-badge { border: none; cursor: pointer; font-family: inherit; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 16px; border-radius: 8px; border: 1px solid var(--border); background: #fff;
  color: var(--text); font-size: 13.5px; cursor: pointer; transition: all .15s; font-family: inherit; white-space: nowrap;
}
.btn:hover { border-color: #cbd5e1; background: #f8fafc; text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: #f1f5f9; color: var(--text); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-danger-ghost { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger-ghost:hover { background: #fee2e2; }
.btn-xs { padding: 3px 10px; font-size: 12.5px; border-radius: 6px; }
.btn-block { width: 100%; padding: 10px; }
.inline-form { display: inline-block; margin: 0 3px; }
.right { margin-left: auto; }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field > span { font-size: 13px; color: var(--text-2); }
.field i { color: var(--danger); font-style: normal; }
.field input, .field select, .field textarea, .input-inline, .filter-form input, .filter-form select {
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px;
  font-family: inherit; background: #fff; color: var(--text); outline: none; transition: border-color .15s;
}
.field input:focus, .field select:focus, .field textarea:focus, .input-inline:focus, .filter-form input:focus, .filter-form select:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-grid .span-2 { grid-column: span 2; }
.form-actions { display: flex; gap: 10px; margin-top: 6px; }
.form-vertical .field input { width: 100%; }
.panel-form { max-width: 780px; }
.panel-form-wide { max-width: 100%; }
.select-xs { padding: 3px 6px; border-radius: 6px; border: 1px solid var(--border); font-size: 12.5px; font-family: inherit; background: #fff; color: var(--text); }
.input-inline { padding: 7px 12px; margin-right: 8px; min-width: 200px; }

/* ---------- 筛选 ---------- */
.filter-bar { margin-bottom: 16px; }
.filter-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter-form input[type="text"] { width: 240px; }
.filter-sep { color: var(--text-2); }

/* ---------- 详情 ---------- */
.detail-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; }
.detail-no { font-size: 22px; font-weight: 700; }
.detail-meta { color: var(--text-2); font-size: 13px; margin-top: 4px; }
.steps { display: flex; align-items: center; gap: 0; margin-bottom: 18px; background: var(--panel); border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow); }
.step { display: flex; align-items: center; flex: 1; position: relative; }
.step-dot { width: 20px; height: 20px; border-radius: 50%; background: #e2e8f0; border: 3px solid #fff; box-shadow: 0 0 0 2px #e2e8f0; flex-shrink: 0; }
.step-label { margin-left: 8px; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.step.done .step-dot { background: var(--green); box-shadow: 0 0 0 2px var(--green); }
.step.done .step-label { color: var(--green); font-weight: 500; }
.step:not(:last-child)::after { content: ''; position: absolute; top: 10px; left: 20px; right: 0; height: 2px; background: #e2e8f0; }
.step.done:not(:last-child)::after { background: var(--green); }

.action-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 10px 0; }
.audit-reject { display: flex; gap: 8px; align-items: center; }
.text-danger { color: var(--danger); }
.text-success { color: var(--green); }
.tip { color: var(--text-2); font-size: 12.5px; }

/* ---------- 开票 PDF ---------- */
.pdf-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); }
.pdf-info { min-width: 0; }
.pdf-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf-actions { display: flex; gap: 8px; flex-shrink: 0; }
.input-file { font-size: 13px; max-width: 260px; }
.pdf-upload-form { margin-top: 4px; }
.pdf-upload-form .tip { margin-left: 2px; }

/* ---------- 提示 ---------- */
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 13.5px; }
.flash-success { background: #dcfce7; color: var(--green); border: 1px solid #bbf7d0; }
.flash-error { background: #fee2e2; color: var(--red); border: 1px solid #fecaca; }

/* ---------- 登录页 ---------- */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%); }
.login-card { background: #fff; border-radius: 16px; padding: 40px 36px; width: 380px; max-width: 92vw; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.login-brand { text-align: center; margin-bottom: 24px; }
.login-brand h1 { font-size: 20px; margin-bottom: 4px; }
.login-brand p { color: var(--text-2); font-size: 13px; }
.login-form .field input { width: 100%; padding: 11px 12px; }
@media (max-width: 480px) {
  .login-body { padding: 24px 12px; }
  .login-card { padding: 32px 24px; }
  .login-form input { font-size: 16px; min-height: 46px; }
}

/* ---------- 错误页 ---------- */
.error-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.error-card { text-align: center; }
.error-code { font-size: 64px; font-weight: 800; color: var(--primary); }
.error-msg { color: var(--text-2); margin: 8px 0 20px; }

/* ---------- 弹窗 ---------- */
.modal { border: none; border-radius: 14px; padding: 0; box-shadow: 0 20px 60px rgba(0,0,0,.25); width: 400px; max-width: 92vw; }
.modal::backdrop { background: rgba(15, 23, 42, .45); }
.modal-body { padding: 24px 26px; }
.modal-body h3 { margin-bottom: 16px; }
.modal-body .tip { margin-bottom: 10px; }

.row-self { background: #eff6ff; }

/* ---------- 批量导入 ---------- */
.panel-body { padding: 16px 20px 20px; }
.panel-body .tip { margin-bottom: 14px; line-height: 1.7; }
.file-pick { display: block; margin-bottom: 14px; }
.file-pick input[type="file"] { display: none; }
.file-pick-box { display: flex; align-items: center; justify-content: center; padding: 26px 16px; border: 2px dashed var(--border); border-radius: 10px; color: var(--text-2); font-size: 14px; cursor: pointer; transition: border-color .15s, color .15s; text-align: center; }
.file-pick-box:hover { border-color: var(--primary); color: var(--primary); }
.import-tips { margin: 0; padding-left: 18px; line-height: 2.1; color: var(--text-1); font-size: 13.5px; }
.import-tips code { background: #f1f5f9; padding: 1px 6px; border-radius: 4px; font-size: 12.5px; }
.import-result { margin-top: 16px; }
.import-result .stats { margin-bottom: 4px; }
.import-result .table { margin-bottom: 12px; }
.stat-num.green { color: var(--green); }
.stat-num.amber { color: var(--amber); }

/* ---------- 发票选择器 ---------- */
.inv-pick-row { padding: 8px; background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; }
.inv-pick-row select, .inv-pick-row input { padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }
.inv-pick-row select:focus, .inv-pick-row input:focus { border-color: var(--primary); outline: none; }
.btn-sm { font-size: 12px; padding: 5px 12px; }

/* ---------- 类目管理 ---------- */
.cat-group { border-bottom: 1px solid var(--border); }
.cat-group:last-child { border-bottom: none; }
.cat-l1 { display: flex; align-items: center; gap: 8px; padding: 12px 16px; cursor: pointer; font-weight: 600; font-size: 15px; color: var(--text); background: #f8fafc; user-select: none; }
.cat-l1:hover { background: #f1f5f9; }
.cat-arrow { width: 16px; height: 16px; transition: transform .15s; flex-shrink: 0; }
.cat-group.collapsed .cat-arrow { transform: rotate(-90deg); }
.cat-group.collapsed .cat-l2-wrap { display: none; }
.cat-l1-name { flex: 1; }
.cat-l1-count { font-size: 12px; font-weight: 400; color: var(--text-2); background: #e2e8f0; padding: 2px 8px; border-radius: 10px; }
.cat-l2-wrap { padding: 4px 16px 12px 40px; }
.cat-l2-section { margin-top: 8px; }
.cat-l2-head { font-size: 13px; font-weight: 600; color: var(--text-2); padding: 4px 0; border-bottom: 1px dashed var(--border); margin-bottom: 6px; }
.cat-l3-list { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-l3-item { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; background: #f1f5f9; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }
.cat-l3-name { color: var(--text); }
.cat-used { font-size: 11px; color: var(--teal); background: #ccfbf1; padding: 1px 6px; border-radius: 8px; }
a.cat-used { text-decoration: none; cursor: pointer; display: inline-block; }
a.cat-used:hover { background: #a7f3e0; }
a.cat-drill { color: var(--teal); text-decoration: none; border-bottom: 1px dashed #99f6e4; cursor: pointer; }
a.cat-drill:hover { color: #0d9488; border-bottom-style: solid; }
a.cat-drill .drill-arrow { font-size: 10px; margin-left: 3px; opacity: .7; }
.cat-op { padding: 2px 8px !important; font-size: 11px !important; }

/* ---------- 模态框 ---------- */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(15,23,42,.45); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-box { background: var(--panel); border-radius: var(--radius); padding: 24px; width: 440px; max-width: 90vw; max-height: 85vh; overflow-y: auto; box-shadow: 0 8px 32px rgba(15,23,42,.2); }
.modal-box h3 { margin: 0 0 16px; font-size: 17px; }
.modal-box .form-group { margin-bottom: 14px; }
.modal-box .form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.modal-box .form-group input { width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; box-sizing: border-box; }
.modal-box .form-group input:focus { border-color: var(--primary); outline: none; }

/* ---------- 入库表单 ---------- */
.inv-info-card { background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; padding: 16px; }
.inv-info-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.inv-info-row:last-child { border-bottom: none; }
.inv-info-row .label { color: var(--text-2); font-size: 13px; }
.inv-info-row .val { font-size: 14px; }
.cat-select-row { display: flex; gap: 8px; }
.cat-select-row select { flex: 1; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; }
.cat-select-row select:focus { border-color: var(--primary); outline: none; }

/* ---------- 类目标签 ---------- */
.cat-tag { display: inline-block; font-size: 12px; color: var(--primary); background: #eff6ff; padding: 2px 8px; border-radius: 4px; white-space: nowrap; }
.stock-group-head td { background: #f0f5ff; border-top: 2px solid var(--primary); padding: 10px 16px; }
.stock-group-head .sg-title { font-size: 15px; font-weight: 700; color: var(--primary); }
.stock-group-head .sg-stats { float: right; font-size: 12px; font-weight: 400; color: var(--text-2); }
.empty-state { background: var(--panel); border-radius: var(--radius); }
.inv-no-link { color: var(--primary); font-weight: 500; }
.inv-no-link:hover { text-decoration: underline; }
/* 商品明细子行（始终可见，紧凑横排） */
.inv-items-sub > td { padding: 0 !important; border-bottom: 1px solid var(--border) !important; }
.inv-items-inline { display: flex; flex-wrap: wrap; gap: 6px 8px; padding: 7px 16px 8px; background: #f8fafc; }
.inv-items-inline.empty { display: none; }
.item-inline { display: inline-flex; align-items: baseline; gap: 4px; font-size: 12.5px; background: #fff; border: 1px solid var(--border); border-radius: 4px; padding: 2px 8px; line-height: 1.5; }
.item-inline .item-name { color: var(--text); font-weight: 500; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-inline .item-meta { color: var(--text-2); font-size: 11.5px; white-space: nowrap; }
.item-inline .item-cat { color: var(--teal); font-size: 11px; background: rgba(0,150,136,.08); border: 1px solid rgba(0,150,136,.25); border-radius: 3px; padding: 0 5px; white-space: nowrap; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.item-inline .item-cat-edit { font-size: 11px; color: var(--primary); background: #eff6ff; border: 1px solid #dbeafe; border-radius: 3px; padding: 0 6px; text-decoration: none; white-space: nowrap; }
.item-inline .item-cat-edit:hover { background: #dbeafe; }
.cat-tag + .item-cat-edit, td .item-cat-edit { font-size: 11px; color: var(--primary); background: #eff6ff; border: 1px solid #dbeafe; border-radius: 3px; padding: 0 6px; cursor: pointer; white-space: nowrap; vertical-align: middle; }
.cat-tag + .item-cat-edit:hover, td .item-cat-edit:hover { background: #dbeafe; }
.item-inline .item-meta.price { color: var(--teal); }
.item-more-inline { font-size: 12px; color: var(--primary); cursor: pointer; display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 4px; background: #eff6ff; border: 1px solid #dbeafe; white-space: nowrap; }
.item-more-inline:hover { background: #dbeafe; }
.inv-items-inline .item-extra { display: none; }
.inv-items-inline.expanded .item-extra { display: inline-flex; }
.inv-items-inline.expanded .item-more-inline { display: none; }

/* AI 比对度标签（未认证清单商品） */
.ai-score { font-size: 10.5px; border-radius: 3px; padding: 0 4px; white-space: nowrap; vertical-align: middle; line-height: 1.6; }
.ai-hi { color: #0f766e; background: rgba(13,148,136,.1); border: 1px solid rgba(13,148,136,.35); }
.ai-mid { color: #1d4ed8; background: rgba(59,130,246,.1); border: 1px solid rgba(59,130,246,.35); }
.ai-low { color: #b45309; background: rgba(245,158,11,.13); border: 1px solid rgba(245,158,11,.45); }
.ai-none { color: #b91c1c; background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.35); }
.ai-warn { color: #c2410c; background: #fff7ed; border-color: #fdba74; box-shadow: 0 0 0 1px #fdba74; font-weight: 600; }
.ai-hint { font-size: 12px; color: var(--text-2); padding: 8px 16px; border-bottom: 1px dashed var(--border); line-height: 1.8; }
.ai-hint b { color: var(--text); }

/* 类目下钻页商品元信息（名称旁的数量×单价） */
.catd-item-meta { color: var(--text-2); font-size: 11.5px; white-space: nowrap; margin-left: 2px; }
.catd-item-meta.price { color: var(--teal); }

/* 旧样式保留兼容 */
.inv-toggle { display: none; }
.items-cell { max-width: 280px; }
.item-tag { font-size: 12px; color: var(--text); background: #f0f5ff; padding: 2px 8px; border-radius: 4px; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: default; }
.item-more { font-size: 12px; color: var(--primary); cursor: pointer; display: inline-block; padding: 2px 4px; }
.item-more:hover { text-decoration: underline; }
.inv-items-row > td { padding: 0 !important; background: #f8fafc; }
.items-expand { padding: 8px 16px 12px; }
.items-sub-table { width: 100%; font-size: 13px; border-collapse: collapse; }
.items-sub-table thead th { text-align: left; padding: 6px 10px; color: var(--text-2); font-weight: 500; border-bottom: 1px solid var(--border); white-space: nowrap; }
.items-sub-table tbody td { padding: 6px 10px; border-bottom: 1px solid #eef2f6; }
.items-sub-table tbody tr:last-child td { border-bottom: none; }
.inv-info-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px 24px; padding: 16px; }
.inv-info-grid .info-item { display: flex; flex-direction: column; gap: 4px; }
.inv-info-grid .info-item.span-2 { grid-column: span 2; }
.inv-info-grid .info-item label { font-size: 12px; color: var(--text-2); font-weight: 500; }
.inv-info-grid .info-item span { font-size: 14px; color: var(--text); }
.inv-amount-bar { display: flex; gap: 12px; padding: 16px; border-top: 1px solid var(--border); }
.inv-amount-bar .amt-box { flex: 1; display: flex; flex-direction: column; gap: 4px; padding: 12px 16px; background: #f8fafc; border-radius: 8px; }
.inv-amount-bar .amt-box-primary { background: #eff6ff; }
.inv-amount-bar .amt-box-success { background: #f0fdf4; }
.inv-amount-bar .amt-label { font-size: 12px; color: var(--text-2); }
.inv-amount-bar .amt-val { font-size: 18px; color: var(--text); }
.inv-amount-bar .amt-box-primary .amt-val { color: var(--primary); }
.inv-amount-bar .amt-box-success .amt-val { color: var(--green); }
.table .total-row td { background: #f8fafc; font-weight: 700; border-top: 2px solid var(--border); }
.detail-info-grid { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 12px 24px; padding: 16px; }
.detail-info-grid .info-item { display: flex; flex-direction: column; gap: 2px; }
.detail-info-grid .info-label { font-size: 12px; color: var(--text-2); font-weight: 500; }
.detail-info-grid .info-val { font-size: 14px; color: var(--text); word-break: break-all; }

/* 开票申请商品明细表格 */
.app-items-table { margin-bottom: 8px; min-width: 1100px; table-layout: fixed; }
.app-items-table th { font-size: 12px; white-space: nowrap; }
.app-items-table td { padding: 6px; vertical-align: middle; }
.app-items-table input[type="text"],
.app-items-table input[type="number"],
.app-items-table select {
  font-size: 14px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 4px;
  box-sizing: border-box; width: 100%; color: var(--text);
}
/* 隐藏 number 输入框的上下箭头，腾出空间显示内容 */
.app-items-table input[type="number"]::-webkit-inner-spin-button,
.app-items-table input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none; margin: 0;
}
.app-items-table input[type="number"] { -moz-appearance: textfield; }
.app-items-table input:focus,
.app-items-table select:focus { border-color: var(--primary); outline: none; }
.app-items-table .row-num { text-align: center; color: var(--text-2); font-size: 12px; }
.app-items-table .item-row:hover { background: #f8fafc; }
.app-items-table tfoot .total-row td { font-size: 14px; }
.badge-info { background: #eff6ff; color: #2563eb; }
.badge-success { background: #f0fdf4; color: #16a34a; }
.badge-primary { background: #eef2ff; color: #4f46e5; }
.table-wrap { overflow-x: auto; max-width: 100%; }

/* 开票申请：商品行类型（库存商品 / 服务类） */
.item-type-select { padding: 5px 6px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; color: var(--text); background: #fff; }
.link-disabled { cursor: not-allowed; }
.link-service-badge { display: inline-block; font-size: 12px; color: var(--text-2); background: #f1f5f9; border: 1px dashed #cbd5e1; border-radius: 6px; padding: 4px 10px; white-space: nowrap; }

/* 关联发票搜索弹窗 */
.link-tab {
  padding: 8px 16px; border: none; background: transparent; cursor: pointer;
  font-size: 13px; color: var(--text-2); font-family: inherit;
  border-bottom: 2px solid transparent; transition: all .15s;
}
.link-tab:hover { color: var(--text); }
.link-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }

/* AI 类目智能比对 */
.ai-suggest-box { margin-top: 20px; padding: 16px 20px; border: 1px solid #d4e4f7; border-radius: 8px; background: linear-gradient(135deg, #f0f7ff 0%, #f8fbff 100%); }
.ai-suggest-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.ai-icon { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 6px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: 0.5px; }
.ai-title { font-size: 15px; font-weight: 600; color: var(--text); }
.ai-confidence { font-size: 12px; padding: 2px 8px; border-radius: 10px; font-weight: 500; }
.ai-conf-high { background: #e8f8ee; color: #16a34a; }
.ai-conf-mid { background: #fff8e6; color: #d97706; }
.ai-conf-low { background: #fee2e2; color: #dc2626; }
.ai-match-type { font-size: 12px; color: var(--text-2); padding: 2px 8px; background: #f0f5ff; border-radius: 4px; }
.ai-suggested-cat { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.ai-cat-label { font-size: 13px; color: var(--text-2); }
.ai-cat-path { font-size: 15px; font-weight: 600; color: var(--primary); }
.ai-accept-btn { margin-left: 4px; }
.ai-section-label { font-size: 12px; color: var(--text-2); margin: 8px 0 6px; }
.ai-item-list { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-item-tag { font-size: 12px; padding: 3px 8px; border-radius: 4px; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-item-high { background: #e8f8ee; color: #16a34a; }
.ai-item-mid { background: #fff8e6; color: #d97706; }
.ai-item-low { background: #fef3f3; color: #dc2626; }
.ai-item-unmatched { background: #f5f5f5; color: #999; }
.ai-alt-list { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-alt-btn { font-size: 12px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 4px; background: #fff; color: var(--text-2); cursor: pointer; transition: all .15s; font-family: inherit; }
.ai-alt-btn:hover { border-color: var(--primary); color: var(--primary); background: #f0f7ff; }
.ai-no-match { font-size: 13px; color: var(--text-2); padding: 8px 0; }
.ai-loading-hint { margin-top: 20px; padding: 12px 16px; font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.stock-items-preview { margin-top: 20px; }
.stock-items-preview h4 { font-size: 14px; margin-bottom: 8px; color: var(--text); }

.link-result-card {
  border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin-bottom: 8px;
  cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.link-result-card:hover { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.08); }
.link-result-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.link-result-no { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; font-weight: 600; color: var(--text); }
.link-items-list { margin-top: 6px; }
.link-item-row {
  display: flex; align-items: baseline; gap: 8px; padding: 3px 0;
  font-size: 12.5px; border-bottom: 1px dashed #eef2f6;
}
.link-item-row:last-child { border-bottom: none; }
.link-item-name { flex: 1; color: var(--text); }
.link-item-meta { color: var(--text-2); white-space: nowrap; }
.link-item-amt { color: var(--teal); font-weight: 500; white-space: nowrap; }

/* 关联显示区（表格行内） */
.link-cell { min-width: 180px; }
.link-display { cursor: pointer; min-height: 28px; display: flex; align-items: center; }
.link-display:hover .link-placeholder { color: var(--primary); border-color: var(--primary); }
.link-placeholder { font-size: 12px; color: var(--text-2); border: 1px dashed var(--border); border-radius: 6px; padding: 3px 10px; width: 100%; text-align: center; }
.link-selected { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; background: #f0f5ff; border-radius: 6px; padding: 4px 8px; }
.link-selected-no { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; font-weight: 500; }
.link-selected-name { font-size: 11px; color: var(--text-2); max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-unlink { font-size: 11px !important; padding: 1px 6px !important; margin-left: auto; }

/* ---------- 窄屏移动端增强（≤640px） ---------- */
@media (max-width: 640px) {
  img { max-width: 100%; height: auto; }
  .panel { padding: 14px; }
  .page-title { font-size: 18px; }
  /* 页头堆叠：标题在上、操作按钮换行在下 */
  .page-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .page-head .page-actions { flex-wrap: wrap; }
  .page-head .page-actions .btn { flex: 1 1 auto; min-height: 40px; }
  /* 表单单列 */
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
  .form-actions { flex-wrap: wrap; }
  .form-actions .btn { flex: 1 1 auto; min-height: 42px; }
  /* 触控目标 ≥40px；输入 16px 防 iOS 聚焦自动缩放 */
  .btn { min-height: 40px; }
  .btn-xs, .btn-sm { min-height: auto; }
  .field input, .field select, .field textarea,
  .filter-form input, .filter-form select,
  .search-bar input, .input-inline { font-size: 16px; min-height: 42px; }
  .input-inline { min-width: 0; width: 100%; margin-right: 0; }
  .filter-form { align-items: stretch; }
  .filter-form input[type="text"] { width: 100%; }
  .filter-form .btn, .filter-form button, .filter-form a.btn { min-height: 40px; }
  .search-bar input { max-width: none; flex: 1 1 100%; }
  .select-xs { padding: 6px 8px; min-height: 34px; }
  /* 弹窗：接近全屏 / 底部抽屉式 */
  .modal {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; margin: 0;
    width: 100%; max-width: 100%; max-height: 90vh; overflow-y: auto;
    border-radius: 16px 16px 0 0;
  }
  .modal-body { padding: 18px 16px; }
  .modal-overlay { align-items: flex-end; }
  .modal-box { width: 100%; max-width: 100%; max-height: 92vh; border-radius: 16px 16px 0 0; }
  /* 统计卡片紧凑双列 */
  .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 22px; }
  .stat-sub { font-size: 11px; }
  /* 步骤条纵向 */
  .steps { flex-direction: column; align-items: stretch; gap: 4px; padding: 12px 16px; }
  .step::after { display: none; }
  .step { gap: 8px; }
  /* 详情/信息网格单列 */
  .detail-info-grid, .inv-info-grid { grid-template-columns: 1fr; gap: 10px; }
  .detail-info-grid .info-item, .inv-info-grid .info-item { flex-direction: row; align-items: baseline; gap: 8px; }
  .detail-info-grid .info-label, .inv-info-grid .info-item label { min-width: 84px; flex: none; }
  .inv-amount-bar { flex-direction: column; gap: 8px; }
  .detail-top { flex-direction: column; align-items: flex-start; gap: 10px; }
  .detail-top .page-actions { flex-wrap: wrap; }
  .kv th { width: 88px; font-size: 12.5px; }
  .table { font-size: 12.5px; }
  .table th, .table td { padding: 8px; }
  .cell-content { max-width: 120px; }
  /* 电商式级联类目更紧凑 */
  .cat-label { width: 46px; font-size: 11px; }
  .cat-tab, .cat-chip { min-height: 34px; }
  /* tab 允许横向滚动 */
  .tab-bar { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tab { white-space: nowrap; }
  /* 选品模式条：避让固定顶栏（顶栏 48px、z25） */
  .pick-bar { position: sticky; top: 48px; z-index: 20; padding: 10px 14px; gap: 8px; }
  .pick-bar strong { font-size: 13px; }
  .pick-bar span { font-size: 12px; }
  .staged-drawer { right: 8px; bottom: 8px; }
  /* 其他微调 */
  .file-pick-box { padding: 18px 12px; font-size: 13px; }
  .pdf-actions { flex-direction: column; align-items: stretch; }
  .link-tab { padding: 10px 12px; }
}

/* ---------- 手机版入口页（/m）与入口二维码（/m/qr） ---------- */
.m-home { max-width: 760px; margin: 0 auto; }

.m-hello {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  color: #fff; border-radius: 14px; padding: 18px 18px 16px; margin-bottom: 18px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, .18);
}
.m-hello-hi { font-size: 18px; font-weight: 600; }
.m-hello-sub { font-size: 12.5px; color: #c7d2fe; margin-top: 4px; }

.m-sec { margin-bottom: 18px; }
.m-sec-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-2); margin: 0 2px 10px; }
.m-sec-title .m-sec-line { flex: 1; height: 1px; background: var(--border); }
.m-sec-title .m-sec-count { font-weight: 500; color: var(--primary); }

.m-todo { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.m-todo-card {
  display: flex; align-items: center; gap: 12px; background: var(--panel);
  border: 1px solid var(--border); border-radius: 12px; padding: 14px;
  text-decoration: none; color: var(--text); box-shadow: var(--shadow);
}
.m-todo-card:hover { text-decoration: none; border-color: #c7d2fe; }
.m-todo-card:active { background: #f8fafc; }
.m-todo-icon {
  flex: none; width: 40px; height: 40px; border-radius: 10px;
  background: #eff6ff; display: flex; align-items: center; justify-content: center;
}
.m-todo-icon svg { width: 20px; height: 20px; fill: none; stroke: var(--primary); stroke-width: 2; }
.m-todo-main { display: flex; flex-direction: column; min-width: 0; }
.m-todo-num { font-size: 22px; font-weight: 700; color: var(--primary); line-height: 1.15; }
.m-todo-label { font-size: 13.5px; font-weight: 600; }
.m-todo-hint { font-size: 11.5px; color: var(--text-2); margin-top: 1px; }

.m-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.m-tile {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; min-height: 88px; padding: 14px 8px; background: var(--panel);
  border: 1px solid var(--border); border-radius: 12px; text-decoration: none;
  color: var(--text); box-shadow: var(--shadow);
}
.m-tile:hover { text-decoration: none; border-color: #c7d2fe; }
.m-tile:active { background: #f1f5f9; }
.m-tile svg { width: 24px; height: 24px; fill: none; stroke: var(--primary); stroke-width: 2; }
.m-tile-label { font-size: 12.5px; font-weight: 500; }
.m-tile-badge {
  position: absolute; top: 8px; right: 8px; background: var(--danger); color: #fff;
  font-size: 10.5px; line-height: 1.5; border-radius: 9px; padding: 0 6px; min-width: 18px; text-align: center;
}

.m-empty {
  background: var(--panel); border: 1px dashed var(--border); border-radius: 12px;
  padding: 18px; text-align: center; color: var(--text-2); font-size: 13px;
}

.m-qr-entry {
  display: flex; align-items: center; gap: 10px; background: #eff6ff;
  border: 1px solid #bfdbfe; border-radius: 12px; padding: 14px;
  color: #1d4ed8; text-decoration: none; font-size: 13.5px; font-weight: 500;
}
.m-qr-entry:hover { text-decoration: none; background: #e0ecff; }
.m-qr-entry svg { width: 22px; height: 22px; flex: none; fill: none; stroke: #1d4ed8; stroke-width: 2; }
.m-qr-arrow { margin-left: auto; font-size: 20px; line-height: 1; color: #93b4f8; }

.m-foot-tip { text-align: center; color: var(--text-2); font-size: 12px; padding: 4px 0 8px; }

/* --- 入口二维码页 --- */
.m-qr-wrap { max-width: 560px; margin: 0 auto; }
.m-qr-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
  padding: 26px 20px 22px; text-align: center; box-shadow: var(--shadow);
}
.m-qr-head { font-size: 17px; font-weight: 700; }
.m-qr-sub { font-size: 12.5px; color: var(--text-2); margin-top: 4px; }
.m-qr-img { display: block; width: 300px; height: 300px; max-width: 76vw; max-height: 76vw; margin: 18px auto 0; }
.m-qr-url {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px; color: var(--text-2); margin-top: 14px; word-break: break-all;
}
.m-qr-note { font-size: 12.5px; color: var(--text); margin-top: 10px; }

.m-qr-tips { margin-top: 16px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; }
.m-qr-tip-title { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.m-qr-steps { margin: 0 0 14px 18px; font-size: 13px; line-height: 1.9; }
.m-qr-warn { background: #fef2f2; border: 1px solid #fecaca; color: var(--red); border-radius: 10px; padding: 10px 12px; font-size: 12.5px; margin-bottom: 14px; }
.m-qr-actions { display: flex; gap: 10px; flex-wrap: wrap; }

@media (max-width: 640px) {
  .m-home { max-width: none; }
  .m-hello { border-radius: 12px; padding: 16px; }
  .m-todo { grid-template-columns: 1fr; }
  .m-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .m-tile { min-height: 82px; padding: 12px 4px; }
  .m-tile-label { font-size: 12px; }
  .m-qr-card { padding: 20px 14px 18px; }
  .m-qr-actions .btn { flex: 1 1 auto; }
}

/* --- 今日速览：铃铛入口 + 弹窗（2026-09-12，09-12 下午美化升级） --- */
.notice-bell {
  position: relative; width: 34px; height: 34px; padding: 0; border: 1px solid #e2e8f0;
  border-radius: 9px; background: #fff; color: #475569; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; font-family: inherit;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
}
.notice-bell svg { width: 18px; height: 18px; }
.notice-bell:hover { background: #f1f5f9; color: #0f172a; border-color: #cbd5e1; box-shadow: 0 2px 8px rgba(15,23,42,.08); }
/* 使用帮助入口（2026-09-16）：与铃铛同尺寸同风格，a 标签去掉下划线 */
.help-entry { text-decoration: none; }
.help-entry:hover { text-decoration: none; }
.notice-bell-badge {
  position: absolute; top: -6px; right: -6px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: #d93025; color: #fff; font-size: 10.5px; font-weight: 700;
  line-height: 1; display: inline-flex; align-items: center; justify-content: center;
  font-variant-numeric: tabular-nums; border: 2px solid #fff;
}
.notice-overlay {
  position: fixed; inset: 0; z-index: 1000; background: rgba(15, 23, 42, .42);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center; padding: 9vh 16px 16px;
}
.notice-overlay[hidden] { display: none; }
.notice-card {
  width: 400px; max-width: 100%; max-height: 80vh; display: flex; flex-direction: column;
  background: #fff; border-radius: 16px; overflow: hidden;
  box-shadow: 0 24px 64px rgba(15, 23, 42, .28), 0 4px 16px rgba(15, 23, 42, .12);
  animation: noticeIn .22s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes noticeIn { from { opacity: 0; transform: translateY(-14px) scale(.96); } to { opacity: 1; transform: none; } }
.notice-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 14px; color: #fff;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
}
.notice-head-text { display: flex; align-items: baseline; gap: 10px; }
.notice-title { font-size: 16.5px; font-weight: 700; letter-spacing: .5px; }
.notice-date { font-size: 12px; color: rgba(255,255,255,.75); font-variant-numeric: tabular-nums; }
.notice-close {
  width: 28px; height: 28px; padding: 0; border: none; border-radius: 50%;
  background: rgba(255,255,255,.16); color: #fff; cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.notice-close svg { width: 14px; height: 14px; }
.notice-close:hover { background: rgba(255,255,255,.3); }
.notice-body { padding: 16px 20px 6px; overflow-y: auto; }
.notice-sec { margin-bottom: 18px; }
.notice-sec-title {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 700; color: #64748b; letter-spacing: .5px; margin-bottom: 9px;
}
.notice-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.notice-dot-red { background: #d93025; box-shadow: 0 0 0 3px rgba(217,48,37,.14); }
.notice-dot-blue { background: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.14); }
.notice-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; margin-bottom: 7px;
  background: #f8fafc; border: 1px solid #eef2f7; border-radius: 12px;
  text-decoration: none; transition: background .15s, border-color .15s, transform .15s, box-shadow .15s;
}
.notice-item:last-child { margin-bottom: 0; }
.notice-item:hover { background: #eff6ff; border-color: #bfdbfe; transform: translateX(3px); box-shadow: 0 2px 8px rgba(37,99,235,.1); }
.notice-ico {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.notice-ico svg { width: 17px; height: 17px; }
.notice-ico-amber { background: #fff7ed; color: #ea580c; }
.notice-ico-blue { background: #eff6ff; color: #2563eb; }
/* 统一待办中心（2026-09-14）：新增来源色调 */
.notice-ico-violet { background: #f5f3ff; color: #7c3aed; }
.notice-ico-red { background: #fef2f2; color: #dc2626; }
.notice-ico-teal { background: #f0fdfa; color: #0d9488; }
.notice-ico-orange { background: #fffbeb; color: #d97706; }
/* 待办中心页 */
.todo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.todo-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 10px; transition: box-shadow .15s, transform .15s; }
.todo-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); transform: translateY(-2px); }
.todo-card-top { display: flex; align-items: center; gap: 10px; }
.todo-card-title { font-weight: 600; color: var(--text); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-card-num { font-size: 22px; font-weight: 700; }
.todo-card-sub { color: var(--muted, #64748b); font-size: 13px; line-height: 1.5; }
.todo-card-link { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; text-decoration: none; }
.tone-amber { color: #ea580c; } .tone-blue { color: #2563eb; } .tone-violet { color: #7c3aed; }
.tone-red { color: #dc2626; } .tone-teal { color: #0d9488; } .tone-orange { color: #d97706; }
.notice-avatar {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  color: #fff; font-size: 15px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.notice-item-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notice-item-name { font-size: 13.5px; font-weight: 600; color: #0f172a; }
.notice-item-sub { font-size: 11.5px; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notice-item-num {
  min-width: 24px; height: 21px; padding: 0 7px; border-radius: 11px; background: #d93025;
  color: #fff; font-size: 11.5px; font-weight: 700; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; margin-left: auto;
  font-variant-numeric: tabular-nums; flex-shrink: 0;
}
.notice-arrow {
  margin-left: auto; width: 18px; height: 18px; flex-shrink: 0; color: #94a3b8;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color .15s, transform .15s;
}
.notice-arrow svg { width: 14px; height: 14px; }
.notice-item:hover .notice-arrow { color: #2563eb; transform: translateX(2px); }
.notice-empty {
  display: flex; align-items: center; gap: 8px; padding: 12px 4px;
  font-size: 13px; color: #94a3b8;
}
.notice-empty svg { width: 16px; height: 16px; flex-shrink: 0; opacity: .7; }
.notice-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 20px 16px; border-top: 1px solid #eef2f7; background: #fafbfd;
}
.notice-foot-tip { font-size: 11.5px; color: #94a3b8; }
.notice-ok {
  padding: 7px 20px; border: none; border-radius: 10px; background: #2563eb; color: #fff;
  font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: background .15s, box-shadow .15s;
}
.notice-ok:hover { background: #1d4ed8; box-shadow: 0 2px 8px rgba(37,99,235,.35); }
.notice-ok:active { background: #1e40af; }

/* --- 打印：只保留二维码卡片 --- */
@media print {
  .sidebar, .m-topbar, .drawer-mask, .page-head, .flash, .no-print, .m-foot-tip, #flash { display: none !important; }
  body { background: #fff; }
  .main { margin: 0 !important; padding: 0 !important; }
  .m-qr-wrap { max-width: none; }
  .m-qr-card { border: none; box-shadow: none; padding: 0; }
  .m-qr-img { width: 78mm; height: 78mm; max-width: none; max-height: none; margin-top: 8mm; }
  .m-qr-head { font-size: 15pt; }
  .m-qr-sub, .m-qr-url, .m-qr-note { font-size: 10pt; }
}
