/* ============================================================
   景元记账 - 纯静态原型样式
   ============================================================ */
:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eff6ff;
  --green: #16a34a;
  --green-soft: #f0fdf4;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --orange: #d97706;
  --orange-soft: #fffbeb;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --bg: #f5f7fa;
  --card: #ffffff;
  --border: #e5e7eb;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 10px 30px rgba(16, 24, 40, .12);
  --sidebar-w: 232px;
  --topbar-h: 56px; /* T19（09-09）：62→56px 全局紧凑化（下限52px） */
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: var(--gray-800);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
.hidden { display: none !important; }
.muted { color: var(--gray-500); }
.money-in { color: var(--green); }
.money-out { color: var(--red); }
.text-right { text-align: right; }
.text-center { text-align: center; }

/* ---------- 通用图标 ---------- */
/* 通用图标尺寸基类（配合 .nav-icon svg 等描边规则，Kimi 批1/GLM 监督合入） */
.ic svg, .ic { width: 18px; height: 18px; }
.ic-sm svg, .ic-sm { width: 14px; height: 14px; }
.ic-lg svg, .ic-lg { width: 22px; height: 22px; }
.ic svg, .ic-sm svg, .ic-lg svg { stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav-icon, .chip-icon { display: inline-flex; align-items: center; justify-content: center; }
.nav-icon svg, .chip-icon svg, .icon-btn svg, .stat-icon svg { width: 18px; height: 18px; }
.nav-icon svg { stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn svg { stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; width: 18px; height: 18px; }
.chip-icon svg { stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; width: 16px; height: 16px; }
.stat-icon svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ============================================================
   登录页
   ============================================================ */
.login-view { display: flex; min-height: 100vh; }
.login-left {
  flex: 1.15;
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 45%, #3b82f6 100%);
  color: #fff;
  padding: 56px 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.login-left::after {
  content: ""; position: absolute; right: -120px; top: -120px;
  width: 380px; height: 380px; border-radius: 50%;
  background: rgba(255, 255, 255, .08);
}
.login-left::before {
  content: ""; position: absolute; left: -80px; bottom: -140px;
  width: 320px; height: 320px; border-radius: 50%;
  background: rgba(255, 255, 255, .06);
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 48px; }
.brand-logo {
  width: 42px; height: 42px; border-radius: 12px;
  background: #fff; color: var(--primary);
  font-size: 22px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.brand-name { font-size: 20px; font-weight: 700; letter-spacing: .5px; }
.login-left h1 { font-size: 34px; line-height: 1.35; font-weight: 700; margin-bottom: 16px; position: relative; z-index: 1; }
.login-slogan { font-size: 16px; line-height: 1.9; color: rgba(255,255,255,.88); margin-bottom: 36px; position: relative; z-index: 1; }
.login-features { list-style: none; position: relative; z-index: 1; }
.login-features li { display: flex; align-items: center; gap: 12px; font-size: 15px; padding: 10px 0; color: rgba(255,255,255,.94); }
.f-icon { font-size: 20px; }
.login-foot { margin-top: auto; padding-top: 40px; font-size: 13px; color: rgba(255,255,255,.6); position: relative; z-index: 1; }

.login-right { flex: 1; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 24px; }
.login-card {
  width: 100%; max-width: 400px; background: #fff;
  border-radius: 16px; box-shadow: var(--shadow-lg);
  padding: 40px 36px;
}
.login-card-head { text-align: center; margin-bottom: 28px; }
.login-card h2 { font-size: 22px; color: var(--gray-900); }
.login-card-head p { color: var(--gray-500); margin-top: 6px; }
/* 登录卡片：账号框与密码框间距 24px，密码框与登录按钮间距 24px */
.login-card .form-group + .form-group { margin-top: 24px; }
.login-card .btn-block { margin-top: 24px; }
.login-tip { text-align: center; font-size: 12.5px; color: var(--gray-400); margin-top: 16px; }

/* ============================================================
   主框架：侧边栏 + 顶栏 + 内容
   ============================================================ */
.app-view { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: #fff; border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 18px 20px; border-bottom: 1px solid var(--gray-100); }
.sidebar-brand .brand-logo { width: 36px; height: 36px; border-radius: 10px; font-size: 18px; }
.brand-sub { font-size: 11px; color: var(--gray-400); margin-top: 2px; }

.sidebar-nav {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 10px 12px 16px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.nav-group-title { font-size: 11.5px; color: var(--gray-400); padding: 14px 10px 6px; font-weight: 600; letter-spacing: .5px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; margin: 2px 0; border-radius: var(--radius-sm);
  color: var(--gray-600); font-size: 13.5px;
  transition: background .15s, color .15s;
  border-left: 3px solid transparent;
}
.nav-item:hover { background: var(--gray-50); color: var(--gray-800); }
.nav-item.active {
  background: var(--primary-soft); color: var(--primary);
  border-left-color: var(--primary); font-weight: 600;
}
.nav-item .nav-icon { color: var(--gray-400); }
.nav-item:hover .nav-icon { color: var(--gray-600); }
.nav-item.active .nav-icon { color: var(--primary); }

.sidebar-foot { padding: 14px 20px; border-top: 1px solid var(--gray-100); font-size: 12px; color: var(--gray-400); min-height: 110px; display: flex; flex-direction: column; justify-content: center; }
.sidebar-ver { font-size: 11px; margin-top: 2px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h); background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; position: sticky; top: 0; z-index: 50; /* T19：0 24px→0 16px */
}
.topbar-left { display: flex; align-items: baseline; gap: 12px; }
.page-title { font-size: 16px; font-weight: 700; color: var(--gray-900); } /* T19：17→16px */
.page-date { font-size: 12.5px; color: var(--gray-400); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.company-chip {
  display: flex; align-items: center; gap: 7px;
  background: var(--gray-50); border: 1px solid var(--gray-200);
  padding: 6px 12px; border-radius: 999px;
  font-size: 12.5px; color: var(--gray-600);
}
.company-chip .chip-icon { color: var(--gray-400); }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--gray-200);
  background: #fff; color: var(--gray-500); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.icon-btn:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 8px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #3b82f6); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 600;
}
.user-name { font-size: 13.5px; font-weight: 600; color: var(--gray-800); }
.user-role { font-size: 11.5px; color: var(--gray-400); }

.content { flex: 1; padding: 14px; max-width: 1280px; width: 100%; margin: 0 auto; } /* T19：24→14px */

/* ============================================================
   通用组件：按钮 / 徽章 / 卡片 / 表格 / 表单 / tab
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; border: 1px solid transparent;
  cursor: pointer; transition: all .15s; line-height: 1.4; white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); box-shadow: 0 4px 12px rgba(37, 99, 235, .3); }
.btn-secondary { background: #fff; color: var(--gray-700); border-color: var(--gray-300); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: #fff; color: var(--red); border-color: #fca5a5; }
.btn-danger:hover { background: var(--red-soft); border-color: var(--red); }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-ghost { background: transparent; color: var(--gray-500); border-color: transparent; }
.btn-ghost:hover { color: var(--red); background: var(--red-soft); }
.btn-lg { padding: 12px 26px; font-size: 15px; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500;
}
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-orange { background: var(--orange-soft); color: var(--orange); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-blue { background: var(--primary-soft); color: var(--primary); }
.badge-gray { background: var(--gray-100); color: var(--gray-500); }
/* 申报记录红绿状态文字变体（badge-green/badge-red 的无底色文字版，老板要求字体红绿不用胶囊底色） */
.badge-text-green { background: transparent; color: var(--green); }
.badge-text-red { background: transparent; color: var(--red); }
/* 批15：科目表行按编码首位数字循环变色（1灰 2蓝 3绿 4灰 5蓝…），淡色保持灰系审美 */
.ac-c1 { background: #f5f5f4; }
.ac-c2 { background: #eef6ff; }
.ac-c3 { background: #f0fdf4; }

.card {
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--gray-200); box-shadow: var(--shadow);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--gray-100); /* T19：16px 20px→12px 14px */
}
.card-title { font-size: 15px; font-weight: 600; color: var(--gray-800); }
.card-body { padding: 14px; } /* T19：20→14px */
.card-body-flush { padding: 0; }

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; } /* T19：gap 16→10px */
.stat-card { padding: 14px 16px; background: linear-gradient(180deg, #eef2f8, #e0e7f1); border: 1px solid #c8d2e0; border-radius: 12px; } /* T19：18px 20px→14px 16px */
.stat-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.stat-label { font-size: 13px; color: #4b5563; font-weight: 600; }
.stat-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; border: 1px solid rgba(0,0,0,.05); }
.stat-value { font-size: 24px; font-weight: 700; color: var(--gray-900); letter-spacing: -.3px; }
.stat-value small { font-size: 13px; font-weight: 400; color: var(--gray-400); margin-left: 2px; }
.stat-foot { font-size: 12px; color: var(--gray-400); margin-top: 8px; display: flex; align-items: center; gap: 4px; }
.stat-foot .trend-up { color: var(--green); }
.stat-foot .trend-down { color: var(--red); }

/* 表格 */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* 窄屏横向滚动：表格最小宽度固定（单元格不压缩），超出容器时出横向滑动条 */
table.tbl { width: 100%; min-width: 900px; border-collapse: collapse; font-size: 13.5px; }
.tbl thead th {
  text-align: left; padding: 11px 16px; font-size: 12.5px; font-weight: 600;
  color: var(--gray-500); background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200); white-space: nowrap;
}
.tbl tbody td { padding: 12px 16px; border-bottom: 1px solid var(--gray-100); color: var(--gray-700); }
.tbl tbody tr:hover { background: var(--gray-50); }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--gray-800); }
.tbl th.num { text-align: right; }
.tbl .actions { display: flex; gap: 6px; justify-content: flex-end; }
.link-btn { background: none; border: none; color: var(--primary); font-size: 13px; cursor: pointer; padding: 3px 6px; border-radius: 6px; }
.link-btn:hover { background: var(--primary-soft); }
.link-btn.danger { color: var(--red); }
.link-btn.danger:hover { background: var(--red-soft); }

/* 期初数据：科目全量表（左借右贷两列，滚动容器，紧凑灰色系） */
.ob-account-scroll { max-height: 420px; overflow: auto; border: 1px solid var(--gray-200); border-radius: 8px; }
.ob-account-scroll .tbl thead th { position: sticky; top: 0; z-index: 1; padding: 8px 12px; font-size: 12px; }
.ob-account-scroll .tbl tbody td { padding: 5px 12px; }
.ob-acct-name { white-space: nowrap; }
.ob-code { font-family: Consolas, Menlo, monospace; font-size: 12px; color: var(--gray-500); margin-right: 8px; }
.ob-name { color: var(--gray-700); font-size: 13px; }
.ob-dr, .ob-cr { width: 100%; min-width: 88px; box-sizing: border-box; padding: 5px 8px; border: 1px solid var(--gray-200); border-radius: 6px; font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; background: #fff; color: var(--gray-800); }
.ob-dr:focus, .ob-cr:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.ob-dr::placeholder, .ob-cr::placeholder { color: var(--gray-300); }

/* 工具栏（筛选+搜索+按钮） */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.toolbar-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar-right { display: flex; align-items: center; gap: 10px; }

/* 筛选 tab 组 */
.filter-tabs { display: inline-flex; background: var(--gray-100); border-radius: 10px; padding: 3px; }
.filter-tabs button {
  border: none; background: transparent; padding: 6px 14px; font-size: 13px;
  border-radius: 8px; cursor: pointer; color: var(--gray-600);
}
.filter-tabs button.active { background: #fff; color: var(--primary); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* 系统设置子导航 tab */
/* 二轮修复4：定高 + 去 overflow，杜绝滚轮滑动（原 overflow-x:auto 会让该行变成可滚动容器） */
.sub-tabs { display: flex; align-items: flex-end; gap: 4px; height: 36px; margin-bottom: 16px; border-bottom: 1px solid var(--gray-200); overflow-x: auto; overflow-y: hidden; }
.sub-tab { display: inline-block; padding: 5px 12px; font-size: 13.5px; line-height: 1.25; color: var(--gray-500); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.sub-tab:hover { color: var(--gray-700); }
.sub-tab.active { color: var(--primary); font-weight: 600; border-bottom-color: var(--primary); }

/* 审计日志动作码 */
.act-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; color: var(--gray-600); background: var(--gray-100); padding: 2px 6px; border-radius: 4px; }

/* 表单 */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.form-group { display: flex; flex-direction: column; gap: 7px; }
.form-group label { font-size: 13px; font-weight: 500; color: var(--gray-600); }
.form-group label .req { color: var(--red); margin-left: 2px; }
.form-group input, .form-group select, .form-group textarea {
  padding: 9px 12px; border: 1px solid var(--gray-300); border-radius: var(--radius-sm);
  font-size: 14px; font-family: inherit; color: var(--gray-800); background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.form-group .hint { font-size: 12px; color: var(--gray-400); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 18px; border-top: 1px solid var(--gray-100); margin-top: 22px; }

/* 开关 */
.switch { position: relative; width: 42px; height: 24px; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0; background: var(--gray-300); border-radius: 999px;
  transition: .2s; cursor: pointer;
}
.switch .slider::before {
  content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider::before { transform: translateX(18px); }

/* 分段按钮（收/未收） */
.seg { display: inline-flex; border: 1px solid var(--gray-300); border-radius: 10px; overflow: hidden; }
.seg button { border: none; background: #fff; padding: 8px 16px; font-size: 13px; cursor: pointer; color: var(--gray-600); }
.seg button.active { background: var(--primary); color: #fff; font-weight: 600; }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(17, 24, 39, .45);
  display: flex; align-items: center; justify-content: center; z-index: 999; padding: 20px;
}
.modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .18s ease;
}
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-head { padding: 20px 24px 0; }
.modal-title { font-size: 17px; font-weight: 700; }
.modal-body { padding: 14px 24px 6px; font-size: 14px; color: var(--gray-600); line-height: 1.8; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px 20px; }
.modal-success-icon {
  width: 56px; height: 56px; border-radius: 50%; margin: 8px auto 14px;
  background: var(--green-soft); color: var(--green);
  display: flex; align-items: center; justify-content: center;
}
.modal-success-icon svg { width: 28px; height: 28px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

/* toast */
#toast-root { position: fixed; right: 24px; bottom: 24px; z-index: 1000; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--gray-900); color: #fff; padding: 12px 18px;
  border-radius: 10px; font-size: 13.5px; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 9px;
  animation: slideIn .25s ease; max-width: 360px;
}
.toast.warn { background: #7c2d12; }
.toast.success { background: #14532d; }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* 空状态 */
.empty { text-align: center; padding: 48px 20px; color: var(--gray-400); }
.empty .empty-icon { font-size: 42px; margin-bottom: 10px; }
.empty p { font-size: 13.5px; }

/* 分页 */
.pager { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-top: 1px solid var(--gray-100); color: var(--gray-500); font-size: 13px; }
.pager-btns { display: flex; gap: 6px; }
.pager-btns button { border: 1px solid var(--gray-200); background: #fff; border-radius: 8px; padding: 5px 12px; font-size: 13px; cursor: pointer; color: var(--gray-600); }
.pager-btns button:hover { border-color: var(--primary); color: var(--primary); }
.pager-btns button.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ============================================================
   看板专用
   ============================================================ */
.dash-grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 10px; margin-top: 10px; align-items: start; } /* T19：gap/margin 16→10px */
.mt-16 { margin-top: 16px; }

/* CSS 柱状图 */
.bar-chart { display: flex; align-items: flex-end; gap: 14px; height: 170px; padding: 10px 4px 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bar-val { font-size: 12px; color: var(--gray-500); font-weight: 600; }
.bar {
  width: 100%; max-width: 40px; border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  min-height: 4px; transition: height .3s;
}
.bar-col.today .bar { background: linear-gradient(180deg, #f59e0b, #d97706); }
.bar-day { font-size: 12px; color: var(--gray-400); }
.bar-col.today .bar-day { color: var(--orange); font-weight: 600; }

/* 最近动态时间线 */
.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--gray-100); align-items: flex-start; }
.feed-item:last-child { border-bottom: none; }
.feed-dot { width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 15px; }
.feed-main { flex: 1; min-width: 0; }
.feed-title { font-size: 13.5px; color: var(--gray-700); }
.feed-title b { color: var(--gray-800); }
.feed-meta { font-size: 12px; color: var(--gray-400); margin-top: 3px; }
.feed-amt { font-size: 13.5px; font-weight: 600; white-space: nowrap; }

/* 提醒条 */
.alert-line { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 10px; font-size: 13.5px; margin-bottom: 10px; }
.alert-warn { background: var(--orange-soft); color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: var(--primary-soft); color: #1e40af; border: 1px solid #bfdbfe; }
.alert-line .a-icon { font-size: 16px; }

/* 快捷入口 */
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 16px; }
.quick-btn {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  background: #fff; border: 1px dashed var(--gray-300); border-radius: var(--radius);
  padding: 18px 10px; cursor: pointer; color: var(--gray-600);
  transition: all .15s; font-size: 13.5px;
}
.quick-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.quick-btn .q-icon { font-size: 24px; }

/* ============================================================
   账户页
   ============================================================ */
.acc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; } /* T19：gap 16→10px */
.acc-card { padding: 22px; position: relative; overflow: hidden; }
.acc-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--primary); }
.acc-card.cash::before { background: var(--green); }
.acc-type { font-size: 12px; color: var(--gray-400); display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.acc-name { font-size: 16px; font-weight: 700; color: var(--gray-800); }
.acc-note { font-size: 12px; color: var(--gray-400); margin-top: 3px; }
.acc-subject { font-size: 12px; color: var(--gray-600); margin-top: 8px; padding: 3px 9px; background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 6px; display: inline-block; }
.acc-balance { font-size: 26px; font-weight: 700; color: var(--gray-900); margin: 16px 0 4px; letter-spacing: -.3px; }
.acc-flow { display: flex; gap: 18px; font-size: 12.5px; color: var(--gray-500); margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--gray-200); }

/* ============================================================
   欠款页
   ============================================================ */
.debt-card { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--gray-100); }
.debt-card:last-child { border-bottom: none; }
.debt-avatar { width: 42px; height: 42px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 600; }
.debt-card.supplier .debt-avatar { background: var(--orange-soft); color: var(--orange); }
.debt-info { flex: 1; min-width: 0; }
.debt-name { font-size: 14.5px; font-weight: 600; color: var(--gray-800); }
.debt-sub { font-size: 12px; color: var(--gray-400); margin-top: 3px; }
.debt-amt { font-size: 17px; font-weight: 700; }

/* ============================================================
   资产页
   ============================================================ */
.asset-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; } /* T19：gap 16→10px */
.asset-card { padding: 20px; }
.asset-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.asset-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.asset-name { font-size: 15.5px; font-weight: 700; color: var(--gray-800); }
.asset-cat { font-size: 12px; color: var(--gray-400); margin-top: 2px; }
.asset-rows { margin-top: 12px; }
.asset-row { display: flex; justify-content: space-between; padding: 7px 0; font-size: 13px; border-bottom: 1px dashed var(--gray-100); }
.asset-row:last-child { border-bottom: none; }
.asset-row .k { color: var(--gray-500); }
.asset-row .v { font-weight: 600; color: var(--gray-700); }

/* ============================================================
   报表页
   ============================================================ */
.report-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; } /* T19：gap 16→10px */
.report-entry {
  background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius);
  padding: 26px 20px; text-align: center; cursor: pointer; transition: all .18s; box-shadow: var(--shadow);
}
.report-entry:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--primary); }
.report-entry .r-icon { width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.report-entry .r-name { font-size: 15px; font-weight: 600; color: var(--gray-800); }
.report-entry .r-desc { font-size: 12px; color: var(--gray-400); margin-top: 6px; }

.rpt-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.rpt-table th, .rpt-table td { padding: 10px 16px; border: 1px solid var(--gray-200); }
.rpt-table thead th { background: var(--gray-50); font-size: 12.5px; color: var(--gray-500); font-weight: 600; text-align: left; }
.rpt-table tbody tr.section td { background: var(--gray-100); font-weight: 600; color: var(--gray-800); }
.rpt-table tbody tr.total td { background: var(--primary-soft); font-weight: 700; color: var(--primary); }
.rpt-table tbody tr.sub td { color: var(--gray-500); font-size: 12.5px; }
.rpt-table td.ln { text-align: center; color: var(--gray-400); font-size: 12px; white-space: nowrap; }
.rpt-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rpt-note { font-size: 12.5px; color: var(--gray-400); margin-top: 12px; line-height: 1.8; }

/* ============================================================
   结账页
   ============================================================ */
.closing-wrap { max-width: 760px; margin: 0 auto; }
.closing-hero {
  background: linear-gradient(135deg, #1e40af, #2563eb); color: #fff;
  border-radius: 16px; padding: 34px 36px; margin-bottom: 20px; position: relative; overflow: hidden;
}
.closing-hero h2 { font-size: 22px; font-weight: 700; }
.closing-hero p { color: rgba(255,255,255,.85); margin-top: 8px; font-size: 14px; line-height: 1.8; }
.closing-steps { display: flex; gap: 14px; margin-top: 22px; }
.step-item {
  flex: 1; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
  border-radius: 12px; padding: 16px; font-size: 13px; line-height: 1.7;
}
.step-item .s-no { width: 24px; height: 24px; border-radius: 50%; background: #fff; color: var(--primary); font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.closing-main { background: #fff; border: 1px solid var(--gray-200); border-radius: 14px; padding: 28px; text-align: center; box-shadow: var(--shadow); }
.closing-status { font-size: 14px; color: var(--gray-600); margin-bottom: 6px; }
.closing-period { font-size: 24px; font-weight: 700; color: var(--gray-900); margin-bottom: 8px; }
.closing-tip { font-size: 13px; color: var(--gray-400); margin-bottom: 24px; }
.closing-btn-big { padding: 15px 52px; font-size: 17px; border-radius: 12px; }

/* ============================================================
   设置页
   ============================================================ */
.settings-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--gray-200); margin-bottom: 20px; }
.settings-tabs button {
  border: none; background: none; padding: 11px 18px; font-size: 14px; cursor: pointer;
  color: var(--gray-500); border-bottom: 2.5px solid transparent; margin-bottom: -1px; font-weight: 500;
}
.settings-tabs button.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.member-row { display: flex; align-items: center; gap: 14px; padding: 16px 4px; border-bottom: 1px solid var(--gray-100); }
.member-row:last-child { border-bottom: none; }
.member-avatar { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; font-size: 15px; }
.member-info { flex: 1; }
.member-name { font-size: 14.5px; font-weight: 600; color: var(--gray-800); }
.member-desc { font-size: 12.5px; color: var(--gray-400); margin-top: 2px; }
.upload-zone {
  border: 2px dashed var(--gray-300); border-radius: 14px; padding: 40px 20px;
  text-align: center; color: var(--gray-400); transition: all .15s; cursor: pointer;
}
.upload-zone:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.upload-zone .u-icon { font-size: 38px; margin-bottom: 10px; }
.upload-zone .u-main { font-size: 14.5px; color: var(--gray-600); }
.upload-zone .u-sub { font-size: 12.5px; margin-top: 6px; }

/* 结账后状态 */
.done-banner { display: flex; align-items: center; gap: 12px; background: var(--green-soft); border: 1px solid #bbf7d0; color: #166534; border-radius: 12px; padding: 16px 20px; margin-bottom: 20px; font-size: 14px; }

/* ============================================================
   财务会计模块（凭证 / 科目 / 账簿 / 期末处理）
   ============================================================ */
/* 余额方向小标签（借/贷） */
.dir-tag {
  display: inline-block; font-size: 11.5px; font-weight: 600;
  background: var(--gray-100); color: var(--gray-600);
  border-radius: 5px; padding: 1px 6px; vertical-align: 1px;
}
/* 表格合计行（tfoot） */
.subj-total td {
  background: var(--gray-50); font-weight: 700; color: var(--gray-800);
  border-top: 1px solid var(--gray-200); font-variant-numeric: tabular-nums;
}

/* 凭证录入：分录表格内的输入控件 */
.voucher-tbl td { padding: 8px 10px; }
.voucher-tbl input, .voucher-tbl select {
  width: 100%; padding: 8px 10px;
  border: 1px solid var(--gray-200); border-radius: 8px;
  font-size: 13.5px; font-family: inherit; color: var(--gray-800); background: #fff;
}
.voucher-tbl input:focus, .voucher-tbl select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

/* 全局表单控件：圆角统一（与凭证录入风格一致——圆角 8px + 灰边框 + 聚焦蓝环）；checkbox/radio 除外 */
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  border: 1px solid var(--gray-200); border-radius: 8px;
  padding: 8px 10px; box-sizing: border-box;
  font-size: 13.5px; font-family: inherit; color: var(--gray-800); background: #fff;
}
input:not([type="checkbox"]):not([type="radio"]):focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

/* 借贷合计条 */
.voucher-balance-bar {
  display: flex; justify-content: flex-end; gap: 40px;
  align-items: center; padding: 4px 4px 14px;
}
.v-total { display: flex; align-items: baseline; gap: 10px; }
.v-total span { font-size: 13.5px; color: var(--gray-500); }
.v-total b {
  font-size: 24px; font-weight: 700; color: var(--gray-900);
  font-variant-numeric: tabular-nums; letter-spacing: -.3px;
}

/* 借贷平衡状态条 */
.voucher-balance {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; border-radius: 10px; font-size: 13.5px;
}
.voucher-balance .v-bal-icon {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; color: #fff; font-weight: 700;
}
.voucher-balance.ok { background: var(--green-soft); color: #166534; border: 1px solid #bbf7d0; }
.voucher-balance.ok .v-bal-icon { background: var(--green); }
.voucher-balance.err {
  background: var(--red-soft); color: #991b1b; border: 1px solid #fecaca;
  animation: shake .3s ease;
}
.voucher-balance.err .v-bal-icon { background: var(--red); }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

/* 期末处理卡片 */
.pe-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; align-items: stretch; } /* T19：gap 16→10px、margin-top 20→12px */
.pe-card { padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.pe-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 21px;
}
.pe-title { font-size: 16px; font-weight: 700; color: var(--gray-900); }
.pe-desc { font-size: 12.8px; color: var(--gray-500); line-height: 1.9; flex: 1; }
.pe-status { margin-bottom: 4px; }
.pe-card .btn { margin-top: auto; }

/* ============================================================
   选择公司页（多公司版）
   ============================================================ */
.company-select-view { min-height: 100vh; background: var(--bg); display: flex; flex-direction: column; }
.cs-header {
  height: 62px; background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 32px;
}
.cs-brand { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 700; color: var(--gray-900); }
.cs-brand .brand-logo { width: 36px; height: 36px; border-radius: 10px; font-size: 18px; }
.cs-header-right { display: flex; align-items: center; gap: 14px; }
.cs-user { font-size: 13px; color: var(--gray-500); }
.cs-user b { color: var(--gray-800); }
.cs-main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 40px 32px 64px; }
.cs-title { font-size: 26px; font-weight: 700; color: var(--gray-900); }
.cs-sub { font-size: 14px; color: var(--gray-500); margin-top: 8px; line-height: 1.8; }
.cs-toolbar { display: flex; align-items: center; gap: 10px; margin: 26px 0 22px; flex-wrap: wrap; }
.cs-toolbar input {
  flex: 1; min-width: 240px; max-width: 360px; padding: 10px 14px;
  border: 1px solid var(--gray-300); border-radius: 10px; font-size: 14px; font-family: inherit; color: var(--gray-800);
}
.cs-toolbar input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.cs-group { margin-bottom: 26px; }
.cs-group-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.cs-group-name { font-size: 15px; font-weight: 700; color: var(--gray-800); }
.cs-group-count { font-size: 12.5px; color: var(--gray-400); }
/* 「我的公司」分组头设置按钮（账套设置弹窗入口，行内删除已收进弹窗统一管理） */
.cs-settings-btn { margin-left: auto; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }
.cs-settings-btn svg { flex-shrink: 0; opacity: .75; }
/* 账套设置弹窗内分组小标题（信息资料 / 删除账套） */
.cs-set-section-title { font-size: 13px; font-weight: 700; color: var(--gray-800); margin: 14px 0 6px; }
.cs-set-section-title:first-child { margin-top: 0; }
.cs-sort-btn {
  width: 26px; height: 22px; border: 1px solid var(--gray-200); background: #fff;
  border-radius: 6px; cursor: pointer; color: var(--gray-500); font-size: 12px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.cs-sort-btn:hover { border-color: var(--primary); color: var(--primary); }
.cs-sort-btn:disabled { opacity: .35; cursor: not-allowed; }
.cs-sort-btn:disabled:hover { border-color: var(--gray-200); color: var(--gray-500); }

/* 分类管理弹窗 */
.cat-add-row { display: flex; gap: 8px; margin-bottom: 12px; }
.cat-add-row input {
  flex: 1; padding: 8px 12px; border: 1px solid var(--gray-300); border-radius: 8px;
  font-size: 13.5px; font-family: inherit; color: var(--gray-800);
}
.cat-add-row input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.cat-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--gray-100); }
.cat-row:last-child { border-bottom: none; }
.cat-info { min-width: 0; }
.cat-name { font-size: 14px; font-weight: 600; color: var(--gray-800); }
.cat-count { font-size: 12px; color: var(--gray-400); margin-top: 2px; }
.cat-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* 列表视图：紧凑行 */
.cs-list { display: flex; flex-direction: column; border: 1px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; background: #fff; }
.cs-table-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 6px 14px; cursor: pointer; transition: background .12s;
  border-bottom: 1px solid var(--gray-100); min-height: 40px;
}
.cs-table-row:last-child { border-bottom: none; }
.cs-table-row:hover { background: var(--primary-soft); }
.cs-row-main { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.cs-row-name { font-size: 14px; font-weight: 600; color: var(--gray-800); white-space: nowrap; }
.cs-row-note { font-size: 12px; color: var(--gray-400); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-row-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
/* 选择页行内申报/缴税状态徽标：margin-left:auto 右对齐（老板 0904 要求，不紧贴公司名），不随名字换行挤压 */
[data-decl-badge] { margin-left: auto; flex-shrink: 0; white-space: nowrap; }

/* 新建账套页（0 家公司全新账号首登） */
.cs-setup-main { display: flex; align-items: center; justify-content: center; }
.cs-setup-card {
  width: 100%; max-width: 520px; background: #fff; border: 1px solid var(--gray-200);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 40px 44px 32px; text-align: center;
}
.cs-setup-head { margin-bottom: 20px; }
.cs-setup-icon {
  width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 18px;
  background: var(--primary-soft); display: flex; align-items: center; justify-content: center; font-size: 32px;
}
.cs-setup-title { font-size: 22px; font-weight: 700; color: var(--gray-900); }
.cs-setup-sub { font-size: 14px; color: var(--gray-500); margin-top: 6px; }
.cs-setup-desc {
  font-size: 13.5px; color: var(--gray-500); line-height: 1.9; margin-bottom: 26px;
  background: var(--primary-soft); border-radius: 10px; padding: 14px 16px; text-align: left;
}
.cs-setup-form { text-align: left; margin-bottom: 18px; }
.cs-setup-label { display: block; font-size: 13px; font-weight: 600; color: var(--gray-700); margin-bottom: 8px; }
.cs-setup-form input, .cs-setup-form select {
  width: 100%; padding: 11px 14px; border: 1px solid var(--gray-300); border-radius: 10px;
  font-size: 14px; font-family: inherit; color: var(--gray-800); background: #fff; cursor: pointer;
}
.cs-setup-form input:focus, .cs-setup-form select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.cs-setup-tip { font-size: 12px; color: var(--gray-400); margin-top: 14px; }

@media (max-width: 860px) {
  .cs-header { padding: 0 16px; }
  .cs-main { padding: 28px 16px 48px; }
}

/* ============================================================
   响应式适配（手机 / 平板 / 桌面）
   断点设计：
   - >1100px   桌面完整布局（默认样式）
   - ≤1100px   平板横屏：统计卡 2 列、卡片网格降列
   - ≤900px    平板竖屏：侧边栏收起为抽屉菜单（汉堡按钮打开）
   - ≤600px    手机：内容紧凑、弹窗底部抽屉式、表格横向滑动
   - ≤400px    小屏手机：进一步收紧
   ============================================================ */

/* 汉堡按钮 & 抽屉遮罩：默认（桌面）隐藏 */
.menu-btn { display: none; }
.sidebar-mask { display: none; }

/* ---------- 平板（≤1100px） ---------- */
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .acc-grid, .asset-grid, .report-grid { grid-template-columns: repeat(2, 1fr); }
  /* !important：覆盖页面内联的 1fr 1fr 双列网格 */
  .dash-grid-2 { grid-template-columns: 1fr !important; }
  .pe-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- 平板竖屏（≤900px）：侧边栏 → 抽屉 ---------- */
@media (max-width: 900px) {
  /* 汉堡按钮 */
  .menu-btn { display: inline-flex; }

  /* 侧边栏抽屉化：默认滑出屏幕外，点汉堡滑入 */
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 200;
    width: 264px;
    /* 抽屉高度双层兼容：先写 100vh（老浏览器/个别 dvh 计算异常时回退），
       再写 100dvh（动态视口，适配手机地址栏收起/展开） */
    height: 100vh;
    height: 100dvh;
    transform: translateX(-105%);
    transition: transform .25s ease;
    overscroll-behavior: contain;
  }
  /* 抽屉内导航菜单自身可纵向滚动（min-height:0 保证 flex 子项能收缩，滚动才生效）。
     底部 padding-bottom 留白：让最后一项「系统设置」能滚出手机底部工具栏遮挡区，
     滚到底后完全可见且上方保留安全空隙（100px 基础留白 + 设备安全区）。 */
  .sidebar-nav {
    min-height: 0;
    padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px));
  }
  .app-view.sidebar-open .sidebar { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .sidebar-mask {
    display: block; position: fixed; inset: 0; z-index: 190;
    background: rgba(17, 24, 39, .45);
    opacity: 0; pointer-events: none; transition: opacity .25s ease;
  }
  .app-view.sidebar-open .sidebar-mask { opacity: 1; pointer-events: auto; }

  /* 登录页：左右分栏改上下堆叠（品牌/标语在上、表单在下） */
  .login-view { flex-direction: column; }
  .login-left {
    flex: none; justify-content: flex-start;
    padding: 22px 20px 18px;
  }
  /* 去掉大背景装饰 */
  .login-left::after, .login-left::before { display: none; }
  .login-brand { margin-bottom: 10px; }
  .login-left h1 { font-size: 22px; margin-bottom: 6px; }
  .login-slogan { font-size: 13.5px; line-height: 1.7; margin-bottom: 0; }
  /* 简化：隐藏特性列表与页脚 */
  .login-features, .login-foot { display: none; }
  .login-right { padding: 16px; }

  /* 表单、期末卡片降列 */
  .form-grid { grid-template-columns: 1fr; }
  .pe-grid { grid-template-columns: 1fr; }
  /* 凭证页统计卡（页面内联 3 列 → 2 列） */
  .stat-grid[style*="repeat(3,1fr)"] { grid-template-columns: repeat(2, 1fr) !important; }

/* ============================================================
   凭证管理体验优化（科目模糊搜索 / 列宽拖拽 / 行展开）
   ============================================================ */
/* 科目 combobox */
.ac-wrap { position: relative; }
.v-account-input {
  width: 100%; padding: 6px 8px; border: 1px solid var(--gray-300); border-radius: 8px;
  font-size: 13px; font-family: inherit; color: var(--gray-800); background: #fff;
}
.v-account-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
#ac-list {
  position: absolute; z-index: 300; min-width: 280px; max-height: 260px; overflow-y: auto;
  background: #fff; border: 1px solid var(--gray-200); border-radius: 10px;
  box-shadow: var(--shadow-lg); padding: 4px;
}
#ac-list .ac-item {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  border-radius: 7px; cursor: pointer; font-size: 13px;
}
#ac-list .ac-item:hover, #ac-list .ac-item.active { background: var(--primary-soft); }
#ac-list .ac-code { color: var(--primary); font-weight: 600; font-size: 12px; min-width: 56px; }
#ac-list .ac-name { color: var(--gray-800); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#ac-list .ac-cat { color: var(--gray-400); font-size: 11.5px; }
#ac-list .ac-empty { padding: 10px; color: var(--gray-400); font-size: 13px; text-align: center; }

/* 凭证列表行：可展开 */
.voucher-row { cursor: pointer; }
.voucher-row:hover td { background: var(--primary-soft); }
.voucher-expand { padding: 10px 14px; background: var(--gray-50); border-radius: 8px; }
.voucher-expand-head { font-weight: 600; color: var(--gray-600); margin-bottom: 6px; font-size: 12.5px; }
.voucher-entries-mini { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.voucher-entries-mini th, .voucher-entries-mini td {
  padding: 4px 8px; border: 1px solid var(--gray-200); text-align: left;
}
.voucher-entries-mini .num { text-align: right; }
.voucher-entries-mini thead th { background: var(--gray-100); }
.dir-tag {
  display: inline-block; padding: 1px 8px; border-radius: 20px; font-size: 11.5px;
  background: var(--primary-soft); color: var(--primary); font-weight: 600;
}

/* 表头列宽拖拽 */
thead th { position: relative; }
.col-resizer {
  position: absolute; right: 0; top: 0; width: 7px; height: 100%;
  cursor: col-resize; user-select: none; z-index: 5;
}
body.col-resizing, body.col-resizing * { cursor: col-resize !important; user-select: none; }

  .content { padding: 20px; }
  .topbar { padding: 0 16px; }
  .company-chip { display: none; }
}

/* ---------- 手机（≤600px） ---------- */
@media (max-width: 600px) {
  .content { padding: 12px; }
  .card-head { padding: 13px 14px; }
  .card-body { padding: 14px; }

  /* 统计卡 2 列紧凑 */
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 20px; }
  .stat-label { font-size: 12px; }
  /* 手机单列（覆盖 live.js 内联 repeat(2,1fr)，Kimi 批1/GLM 监督合入） */
  .stat-grid { grid-template-columns: 1fr !important; }
  /* 表单内联网格手机降单列（覆盖内联 repeat(2/3,1fr)） */
  .form-grid[style*="repeat(2,1fr)"], .form-grid[style*="repeat(3,1fr)"] { grid-template-columns: 1fr !important; }
  .quick-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .acc-grid, .asset-grid { grid-template-columns: 1fr; }
  .pe-grid { grid-template-columns: 1fr; }
  /* 凭证页统计卡：第 3 张占整行 */
  .stat-grid[style*="repeat(3,1fr)"] .stat-card:last-child { grid-column: 1 / -1; }

  /* 顶栏精简 */
  .topbar { height: 54px; padding: 0 12px; }
  .page-date { display: none; }
  .user-role { display: none; }
  .topbar-right { gap: 6px; }
  .user-chip { padding: 2px; }
  .avatar { width: 32px; height: 32px; font-size: 13px; }
  .page-title { font-size: 15.5px; }

  /* 按钮触控友好 */
  .btn { padding: 10px 14px; white-space: normal; }
  .btn-sm { padding: 7px 11px; }

  /* 行内链接/分页/排序按钮触控目标 ≥36px */
  .link-btn { padding: 6px 9px; font-size: 13.5px; }
  .pager-btns button { padding: 8px 13px; min-height: 36px; }
  .cs-sort-btn { width: 32px; height: 28px; }
  .seg button { padding: 9px 15px; }

  /* 卡片头部：标题+按钮空间不足时自动换行 */
  .card-head { flex-wrap: wrap; gap: 8px; }
  /* 兜底：内联 space-between 的行在窄屏换行 */
  [style*="space-between"] { flex-wrap: wrap; }

  /* 工具栏：筛选组占满整行、控件自适应 */
  .toolbar-left { width: 100%; }
  .toolbar-left .form-group { flex: 1 1 100%; }
  .toolbar-left input, .toolbar-left select { width: auto !important; flex: 1; min-width: 100px; }
  .toolbar-right { margin-left: auto; }

  /* 凭证编辑：顶部信息 4 列 → 2 列 */
  .form-grid[style*="repeat(4,1fr)"] { grid-template-columns: repeat(2, 1fr) !important; }

  /* 表格紧凑；凭证分录表横向滑动查看 */
  .tbl thead th { padding: 9px 10px; font-size: 12px; }
  .tbl tbody td { padding: 10px; font-size: 12.5px; }
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .voucher-tbl { min-width: 620px; }

  /* 报表表格紧凑（手机端） */
  .rpt-table { font-size: 12px; }
  .rpt-table th, .rpt-table td { padding: 7px 8px; }

  /* 弹窗：底部抽屉式（贴近拇指、好操作） */
  .modal-mask { padding: 10px; align-items: flex-end; }
  .modal { max-width: 100%; max-height: 92vh; overflow-y: auto; border-radius: 16px 16px 0 0; }
  .modal-head { padding: 18px 18px 0; }
  .modal-body { padding: 12px 18px 4px; }
  .modal-foot { padding: 14px 18px 18px; }

  /* toast 通栏 */
  #toast-root { left: 14px; right: 14px; bottom: 10px; }
  .toast { max-width: 100%; width: 100%; }

  /* 登录卡片 */
  .login-right { padding: 14px; }
  .login-card { padding: 28px 20px; }

  /* 选择公司页 */
  .cs-main { padding: 20px 12px 40px; }
  .cs-title { font-size: 21px; }
  .cs-sub { font-size: 13px; }
  .cs-toolbar { margin: 18px 0 16px; }
  .cs-toolbar input { min-width: 100%; max-width: 100%; }
  .cs-toolbar .btn { flex: 1; justify-content: center; padding: 9px 10px; font-size: 13px; }
  .cs-header { padding: 0 12px; }
  .cs-user { display: none; }
  .cs-setup-card { padding: 28px 20px 24px; }

  /* 选择页行手机端优化（删除入口已收进「我的公司」分组头设置弹窗，行内无删除按钮）：
     - 「进入」文字按钮隐藏（行本身可点进入，必须用 [data-enter] 精确匹配）；
     - 账套名放开 nowrap 允许换行（右侧状态文字由 live.js 内联样式自理）。 */
  .cs-table-row .link-btn[data-enter] { display: none; }
  .cs-row-name { white-space: normal; word-break: break-all; line-height: 1.35; }

  /* 期末处理 */
  .closing-hero { padding: 26px 18px; }
  .closing-steps { flex-direction: column; }
  .closing-main { padding: 22px 16px; }
  .closing-btn-big { padding: 13px 36px; font-size: 15px; }

  /* 设置页页签横向滑动 */
  .settings-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .settings-tabs button { padding: 10px 12px; white-space: nowrap; }

  /* 欠款 / 成员行紧凑 */
  .debt-card { padding: 14px 16px; gap: 12px; }
  .member-row { gap: 10px; }

  /* 凭证借贷合计条 */
  .voucher-balance-bar { gap: 18px; }
  .v-total b { font-size: 19px; }
  .v-total span { font-size: 12.5px; }

  /* 筛选页签可横向滑动 */
  .filter-tabs { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .filter-tabs button { white-space: nowrap; }
}

/* ---------- 小屏手机（≤400px） ---------- */
@media (max-width: 400px) {
  .stat-grid { grid-template-columns: 1fr; }
  .stat-value { font-size: 22px; }
  .form-grid[style*="repeat(4,1fr)"] { grid-template-columns: 1fr !important; }
  .form-actions .btn { flex: 1; }
  .cs-toolbar .btn { flex: 1 1 100%; }

  /* 报表表格 390px 窄屏适配：无横向滚动 */
  .rpt-table th, .rpt-table td { padding: 6px 5px; }
  .rpt-table thead th { font-size: 11.5px; }
  .rpt-table tbody tr.sub td { font-size: 11.5px; }
  .rpt-table td.ln { font-size: 11px; padding-left: 2px; padding-right: 2px; min-width: 28px; }
  .rpt-table td.num { font-size: 12px; white-space: normal; word-break: break-all; }
  .rpt-balance td:not(.ln):not(.num) { word-break: break-word; }
}

/* ============================================================
   凭证列表：固定高度 + 横纵滚动 + 文字两行截断 + 表头固定
   ============================================================ */
.voucher-table-wrap {
  height: 60vh;
  min-height: 320px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.voucher-list-tbl > thead > tr > th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--gray-50);
  box-shadow: 0 1px 0 var(--gray-200);
}
/* 科目模糊搜索下拉（全局生效——此前误置于媒体查询内，桌面下定位失效） */
#ac-list, .ac-list {
  position: absolute;
  z-index: 1100;
  min-width: 280px;
  max-height: 260px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  padding: 4px;
}
#ac-list .ac-item, .ac-list .ac-item {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  border-radius: 7px; cursor: pointer; font-size: 13px;
}
#ac-list .ac-item:hover, #ac-list .ac-item.active,
.ac-list .ac-item:hover, .ac-list .ac-item.active { background: var(--primary-soft); }
#ac-list .ac-code, .ac-list .ac-code { color: var(--primary); font-weight: 600; font-size: 12px; min-width: 56px; }
#ac-list .ac-name, .ac-list .ac-name { color: var(--gray-800); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#ac-list .ac-cat, .ac-list .ac-cat { color: var(--gray-400); font-size: 11.5px; }
#ac-list .ac-empty, .ac-list .ac-empty { padding: 10px; color: var(--gray-400); font-size: 13px; text-align: center; }
#ac-list .ac-add-row, .ac-list .ac-add-row {
  padding: 4px 4px 6px; margin-bottom: 2px;
  border-bottom: 1px solid var(--gray-100);
  text-align: right;
}
#ac-list .ac-add-row .btn { font-size: 12.5px; padding: 5px 12px; }

/* ============================================================
   ������̨��admin.js������ר����
   ============================================================ */
/* ��˾ѡ��ҳ / �½�����ҳ�Ĺ�����̨��ڿ�Ƭ����������ʾ�� */
.admin-entry-card {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, #f8fafc, #eef2ff);
  border: 1px solid var(--border); border-radius: 14px;
  padding: 15px 18px; margin-bottom: 22px; text-decoration: none;
  transition: box-shadow .15s, transform .15s;
}
.admin-entry-card:hover { box-shadow: 0 4px 14px rgba(37,99,235,.12); transform: translateY(-1px); }
.admin-entry-icon {
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.admin-entry-title { display: block; font-size: 15.5px; font-weight: 700; color: var(--gray-900); }
.admin-entry-desc { display: block; font-size: 12.5px; color: var(--gray-500); margin-top: 3px; }
.admin-entry-arrow { margin-left: auto; color: var(--gray-400); font-size: 18px; }
#cs-setup-admin-entry { max-width: 520px; margin: 0 auto 18px; }
#cs-setup-admin-entry .admin-entry-card { margin-bottom: 0; }

/* ������̨�ӵ������˺Ź��� / ��ɫȨ�ޣ� */
.admin-tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.admin-tabs a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 10px; font-size: 13.5px; font-weight: 600;
  color: var(--gray-600); background: var(--gray-100); text-decoration: none;
}
.admin-tabs a.active { background: var(--primary); color: #fff; }
.admin-tabs a:hover:not(.active) { background: var(--gray-200); }

/* �˺��б���ҳ�� */
.admin-pager {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-top: 1px solid var(--gray-100); flex-wrap: wrap; gap: 8px;
}

/* ��ɫȨ�޹�ѡ���󣨰�ģ����飩 */
.perm-matrix {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 4px 18px;
}
.perm-group { break-inside: avoid; }
.perm-group-title { font-size: 12.5px; font-weight: 700; color: var(--gray-500); margin: 12px 0 6px; }
.perm-item {
  display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 8px;
  font-size: 13px; color: var(--gray-700); cursor: pointer;
}
.perm-item:hover { background: var(--gray-50); }
.perm-item input { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; flex: none; }
.perm-item em { margin-left: auto; font-style: normal; font-size: 11px; color: var(--gray-400); }
.perm-matrix-actions {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--gray-100);
}

/* ============================================================
   空态（无数据占位）Kimi 批2/GLM 监督合入
   ============================================================ */
.empty {
  padding: 40px;
  text-align: center;
  color: var(--gray-500);
  font-size: 13.5px;
  line-height: 1.8;
}
.empty-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  color: var(--gray-500);
  opacity: .35;
}
.empty-icon svg {
  width: 48px;
  height: 48px;
  stroke: currentColor;
  fill: none;
}

/* ===== 统一空态组件（liveEmptyState）增强 ===== */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 56px 24px; text-align: center; }
.empty-state .empty-icon { font-size: 46px; line-height: 1; opacity: .85; }
.empty-state .empty-title { font-size: 15px; font-weight: 600; color: var(--gray-700, #444); }
.empty-state .empty-desc { font-size: 12.5px; color: var(--gray-400, #999); max-width: 320px; line-height: 1.6; }
.empty-state .empty-cta { margin-top: 14px; }

/* ===== 移动端细节（≤600px）===== */
@media (max-width: 600px) {
  .empty-state { padding: 40px 16px; }
  .empty-state .empty-icon { font-size: 38px; }
  /* 表格横向滚动兜底 */
  .table-wrap, table { -webkit-overflow-scrolling: touch; }
  /* 触控友好最小高度 */
  button, .btn, .link-btn { min-height: 40px; }
  input, select, textarea { min-height: 40px; }
  /* 弹窗近全屏 */
  .modal, .dialog { width: 100% !important; max-width: 100% !important; border-radius: 12px 12px 0 0 !important; }
  /* 卡片间距收紧 */
  .card { margin-bottom: 10px; }
  .page-head, .card-head { padding: 10px 12px !important; }
  /* 侧边栏折叠态 */
  .sidebar.collapsed { width: 0; overflow: hidden; }
  .app-body.with-sidebar .main-area { margin-left: 0; }
}
/* ================= 自定义账单（2026-09-04，#/bill-templates） ================= */
/* 设计器弹层：左右双栏（左=基本信息+字段白名单，右=列队列+单位绑定面板） */
.bt-dsg-grid { display: grid; grid-template-columns: 320px 1fr; gap: 10px; align-items: start; } /* T19：gap 16→10px */
@media (max-width: 900px) { .bt-dsg-grid { grid-template-columns: 1fr; } }
.modal-lg .modal-body { max-height: 62vh; overflow-y: auto; }
/* 白名单字段清单（名称 + 加列按钮，每行一条） */
.bt-field-list .bt-field-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 8px; border: 1px solid var(--gray-200); border-radius: 8px;
  margin-bottom: 6px; font-size: 13px; color: var(--gray-700);
}
/* 列队列行：序号+来源字段名+显示名输入+上移/下移/删除 */
.bt-col-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border: 1px solid var(--gray-200); border-radius: 8px; margin-bottom: 6px;
}
/* 指定单位勾选面板 */
.bt-check-panel { border: 1px solid var(--gray-200); border-radius: 8px; padding: 10px; }
.bt-check-list { max-height: 240px; overflow-y: auto; font-size: 13px; }
.bt-check-item { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
/* 设计器基本信息表单行 */
.bt-dsg .form-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.bt-dsg .form-row > label { width: 110px; font-size: 13px; color: var(--gray-600); flex-shrink: 0; }
.modal-lg { max-width: 960px; width: 92%; }
/* T4 20260911：发票导入预览弹窗加宽（15列宽表，叠加 .modal-lg 之上放宽宽度上限） */
.modal-xl { max-width: 1280px; width: 94%; }
@media (max-width: 600px) { .modal-xl { width: 100%; max-width: 100%; } }

/* ---- 二轮需求1：设计器商品组合分组样式（统一底色/边线标识一组） ---- */
.bt-combo { border: 1px solid var(--gray-300, #d1d5db); border-left: 3px solid var(--primary); border-radius: 8px; background: var(--gray-50, #f9fafb); padding: 8px; margin-bottom: 10px; }
.bt-combo-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.bt-combo .bt-col-row { border-style: dashed; background: transparent; }
.bt-mini-select { font-size: 12.5px; padding: 2px 6px; border: 1px solid var(--gray-300, #d1d5db); border-radius: 6px; margin-left: 4px; background: #fff; }

/* ---- 三轮：商品选择器 / 勾选面板块级行（修复漂移） / 偏移输入收窄 ---- */
.modal-sm.bt-picker { max-width: 420px; width: 92%; }
.bt-picker-list { max-height: 300px; overflow-y: auto; margin-top: 10px; }
.bt-picker-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 1px solid var(--gray-200); border-radius: 8px; margin-bottom: 6px; cursor: pointer; font-size: 13.5px; }
.bt-picker-item:hover { background: var(--gray-50); }
.bt-picker-item.disabled { cursor: not-allowed; opacity: .6; }
/* 勾选面板：每单位一行块级布局（checkbox+名称 | 偏移输入），不再用行内元素拼行 */
.bt-check-actions { display: flex; gap: 8px; margin-bottom: 8px; }
.bt-check-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 0; }
.bt-check-item { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; min-width: 0; }
.bt-check-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bt-off-input { width: 80px; flex: none; }
/* 手机端（≤600px）：设计器/选择器/弹层全宽，预览表格外滚，触控区放大 */
@media (max-width: 600px) {
  .modal.modal-lg { width: 100%; max-width: 100%; max-height: 94vh; }
  .modal-lg .modal-body { max-height: 70vh; }
  .bt-check-row { flex-wrap: wrap; }
  .bt-check-item { flex: 1 1 100%; padding: 6px 0; }
  .bt-off-input { width: 96px; }
  .bt-picker-item { padding: 12px 10px; }
  .bt-combo-head { flex-wrap: wrap; row-gap: 6px; }
  .bt-col-row { flex-wrap: wrap; row-gap: 6px; }
}

/* ================ 仓库模块重设计（0036）：卡片页 / 开关 / 调拨列表 ================ */
.wh-summary-bar { display:flex; align-items:center; gap:12px; font-size:14px; color:var(--gray-500,#6b7280); }
.wh-summary-bar b { color:var(--ink,#111827); font-size:16px; }
.wh-summary-sep { width:1px; height:16px; background:var(--gray-200,#e5e7eb); display:inline-block; }
.wh-card-grid { display:grid; grid-template-columns:repeat(3, 1fr); gap:14px; }
.wh-card { border:1px solid var(--gray-200,#e5e7eb); border-radius:10px; padding:14px 16px; background:var(--card,#fff); display:flex; flex-direction:column; gap:12px; }
.wh-card-head { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.wh-stats { display:grid; grid-template-columns:repeat(3, 1fr); gap:8px; }
.wh-stat { background:var(--gray-50,#f9fafb); border-radius:8px; padding:8px 10px; }
.wh-stat-num { font-size:15px; font-weight:600; }
.wh-stat-label { font-size:11px; color:var(--gray-400,#9ca3af); margin-top:2px; }
/* 纯 CSS 开关：滑块为固定尺寸的流内子元素，label 宽度自适应——
   卡片启停开关（label 只含 input+slider）与「显示金额」带文字开关共用，
   文字排在滑块右侧（inline margin），不再被绝对定位 slider 覆盖（二轮修复2） */
.switch { position:relative; display:inline-flex; flex-direction:row; align-items:center; height:20px; flex:none; max-width:100%; }
.switch > span:not(.slider) { white-space:nowrap; flex:none; }
.switch input { opacity:0; width:0; height:0; position:absolute; }
.switch .slider { position:relative; width:36px; height:20px; flex:none; background:var(--gray-300,#d1d5db); border-radius:20px; transition:background .15s; cursor:pointer; }
.switch .slider::before { content:''; position:absolute; left:2px; top:2px; width:16px; height:16px; background:#fff; border-radius:50%; transition:transform .15s; box-shadow:0 1px 2px rgba(0,0,0,.15); }
.switch input:checked + .slider { background:#16a34a; }
.switch input:checked + .slider::before { transform:translateX(16px); }
.transfer-list .tbl { min-width:720px; }
@media (max-width: 600px) {
  .wh-card-grid { grid-template-columns:1fr; }
  .wh-summary-bar { flex-wrap:wrap; font-size:13px; }
}

/* ================ 四轮：分仓结存工具条 / 按仓分块 ================ */
.stock-toolbar .toolbar-left { gap: 14px; }
.stock-amt-toggle { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; flex: none; }
.stock-amt-label { font-size: 13px; }
.stock-toolbar-count { font-size: 13px; white-space: nowrap; }
.wh-block { border: 1px solid var(--gray-200, #e5e7eb); border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; background: var(--card, #fff); }
.wh-block-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
@media (max-width: 600px) {
  .stock-toolbar .toolbar-left { gap: 10px; }
  .stock-amt-label, .stock-toolbar-count { white-space: normal; }
}

/* ================ 游戏化方块视图：库存格子 / 格子操作菜单 ================ */
.stock-tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 9px; padding: 2px 0; }
.stock-tile { border: 1px solid var(--gray-200, #e5e7eb); border-radius: 8px; padding: 10px; background: var(--gray-50, #f9fafb); cursor: pointer; display: flex; flex-direction: column; gap: 4px; min-width: 0; transition: box-shadow .12s, transform .12s, border-color .12s, background .12s; }
.stock-tile:hover { border-color: var(--brand, #2563eb); background: var(--card, #fff); box-shadow: 0 3px 10px rgba(0, 0, 0, .10); transform: translateY(-1px); }
.stock-tile:active { transform: translateY(0); box-shadow: 0 1px 4px rgba(0, 0, 0, .08); }
.stock-tile-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stock-tile-qty { font-size: 20px; font-weight: 700; line-height: 1.1; color: var(--ink, #111827); }
.stock-tile-unit { font-size: 12px; font-weight: 400; color: var(--gray-400, #9ca3af); margin-left: 3px; }
.stock-tile-amt { font-size: 12px; }
/* 格子操作菜单弹窗：纵向按钮列表 */
.stock-tile-menu { max-width: 360px; }
.stock-tile-menu-btns { display: flex; flex-direction: column; gap: 8px; }
.stock-tile-menu-btn { justify-content: flex-start; width: 100%; }
@media (max-width: 600px) {
  .stock-tile-grid { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 7px; }
  .stock-tile { padding: 8px; border-radius: 7px; }
  .stock-tile-name { font-size: 12px; }
  .stock-tile-qty { font-size: 17px; }
  .stock-tile-amt { font-size: 11px; }
}

/* ================ 包装换算率（0037）：行内单位切换 ================ */
.dc-uom { border: 1px solid var(--gray-200, #e5e7eb); border-radius: 6px; font-size: 12px; padding: 2px 4px; margin-bottom: 2px; background: var(--gray-50, #f9fafb); max-width: 64px; }
.dc-uom-slot { display: inline-block; margin-right: 4px; }

/* ================ 换算率二轮：填空句式换算行 ================ */
.spd-alt-sentence { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; margin-top: 4px; }
.spd-alt-sentence input { border: 1px solid var(--gray-200, #e5e7eb); border-radius: 6px; padding: 5px 8px; font-size: 13px; }

/* ================ 生产弹窗手机端适配（≤600px）：整体限高、内容内滚、明细横滑、表头不换行、保存按钮吸底 ================ */
@media (max-width: 600px) {
  .modal.modal-prod { display: flex; flex-direction: column; max-height: 92vh; }
  .modal-prod .modal-body { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .modal-prod .modal-foot { position: sticky; bottom: 0; background: var(--bg, #fff); padding: 12px 0 4px; }
  /* 类型/日期/备注 三列 → 单列，避免挤压换行错位 */
  .modal-prod .form-grid { grid-template-columns: 1fr !important; }
  /* 明细表格横向滚动不挤压；表头（从哪个仓领/入哪个仓等）不换行 */
  .modal-prod .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .modal-prod .goods-tbl { min-width: 640px; }
  .modal-prod .goods-tbl thead th { white-space: nowrap; }
}

/* ================ 0905 组合改造：明细行单位切换对齐 + 仓库卡片按钮两端分布 ================ */
/* 生产/进销明细行：[包|斤] 切换与数量输入框左对齐、宽度贴合、提示行距统一 */
.dc-uom-slot { display: inline-flex; margin: 0; flex: none; }
.dc-uom-slot .dc-uom { width: auto; max-width: 120px; font-size: 12px; padding: 3px 6px; }
.dc-conv-hint { line-height: 1.4; margin-top: 3px; }
/* 仓库卡片底部按钮：进入仓库在左、编辑在最右 */
.wh-card .actions { display: flex; justify-content: space-between; align-items: center; gap: 6px; }

/* ================ 0905 菜单三级结构：二级菜单项样式 ================ */
.nav-item.nav-sub { padding-left: 34px; font-size: 13px; border-left: 2px solid transparent; }
.nav-item.nav-sub .nav-icon { opacity: 0.65; }
.nav-item.nav-sub:hover { background: rgba(0, 0, 0, 0.03); }
.nav-item.nav-sub.active { border-left-color: var(--primary, #2563eb); font-weight: 500; }

/* ================ 0905 菜单收敛+三模块微调（克制，不动大布局） ================ */
/* 工具条元素间距统一 12px（原 left/right 10px，与 .toolbar gap 对齐） */
.toolbar-left, .toolbar-right { gap: 12px; }
/* 仓库卡片三格统计：数字右对齐 + 等宽数字，三格视觉对齐 */
.wh-stat-num { text-align: right; font-variant-numeric: tabular-nums; }
/* 汇总栏/块头小计数字等宽（跳动不晃） */
.wh-summary-bar b, .wh-block-head .muted { font-variant-numeric: tabular-nums; }
/* 已停用区与在用区之间间距略拉开（mt-16 基础上再+8） */
.wh-card-grid.mt-16 { margin-top: 16px; }

/* ================ 0905 交互优化：商品名链接样式 + 明细数字框去 spinner ================ */
.cell-link { color: var(--primary, #2563eb); cursor: pointer; }
.cell-link:hover { text-decoration: underline; }
/* 0906 Bug1：明细表整体最小宽（手机端防列挤压——商品列被其余定宽列挤到一字宽）；
   .table-wrap 全局 overflow-x:auto → 窄屏横滚不破版 */
.goods-tbl { min-width: 900px; }
.goods-tbl .dc-input { min-width: 120px; }
.goods-tbl input[type="number"]::-webkit-outer-spin-button,
.goods-tbl input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.goods-tbl input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

/* ================ 0905 明细行精细二：删除按钮单行 + 仓下拉自适应基础 ================ */
.goods-tbl .link-btn { white-space: nowrap; padding: 4px 6px; width: 56px; box-sizing: border-box; text-align: center; }

/* ================ 0905 明细行终版修订：表头列名居中（输入框内容恢复默认左对齐） ================ */
.goods-tbl thead th { text-align: center !important; }

/* [包|斤] 切换：与输入框同边框/圆角/高度/白底 */
.goods-tbl .dc-uom {
  border: 1px solid var(--gray-300, #d1d5db); border-radius: 8px; background: #fff;
  padding: 6px 8px; font-size: 13px; font-family: inherit; color: var(--gray-800);
  height: auto; -webkit-appearance: auto;
}

/* ================ 0906 账单模板修正：指定单位勾选面板文字出界根修 ================ */
/* 行内溢出兜底：label 弹性收缩 + span 截断生效 + 覆盖天数输入框不挤压 */
.bt-check-row { overflow: hidden; }
.bt-check-item { flex: 1 1 50%; min-width: 0; }
.bt-check-item span { min-width: 0; }
.bt-check-row .bt-off-input { flex: none; }

/* ================ 0906 账单视图：单元格格线（Excel/文件风格） + 打印 ================ */
.bt-bill-block table.table { border-collapse: collapse; }
.bt-bill-block table.table th, .bt-bill-block table.table td { border: 1px solid #d9d9d9; padding: 6px 10px; }
.bt-bill-block table.table thead th { background: #fafafa; }
.bt-bill-block table.table thead tr:first-child th { text-align: center; }
.bt-bill-block table.table td.num, .bt-bill-block table.table th.num { text-align: right; }
.bt-bill-block table.table td.ctr, .bt-bill-block table.table th.ctr { text-align: center; }
/* 合计行（每表末行）加粗 + 上边框加重 */
.bt-bill-block table.table tbody tr:last-child td { font-weight: 700; border-top: 2px solid #9ca3af; background: #fbfbfb; }
.bt-bill-block { margin-bottom: 18px; }

/* 打印：只出账单区域，保留格线底色，多单位每张一页 */
@media print {
  @page { margin: 12mm; }
  .sidebar, .topbar, .toolbar, #toast-root, .page-sub, nav, aside, .btn { display: none !important; }
  .content { padding: 0 !important; }
  main, .main, .app-main, .content { margin: 0 !important; max-width: none !important; }
  body * { visibility: hidden; }
  #bt-bill-body, #bt-bill-body * { visibility: visible; }
  #bt-bill-body { position: absolute; left: 0; top: 0; width: 100%; }
  .bt-bill-block { page-break-after: always; }
  .bt-bill-block:last-child { page-break-after: auto; }
  .bt-bill-block table.table th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ================ 0906 账单模板卡片排版 ================ */
.bt-tpl-card-list { display: flex; flex-direction: column; gap: 12px; }
.bt-tpl-card { border: 1px solid var(--gray-200, #e5e7eb); border-radius: 10px; padding: 12px 16px; background: var(--card, #fff); }
.bt-tpl-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bt-tpl-card-name { font-size: 15px; font-weight: 700; color: var(--gray-900, #111827); }
.bt-tpl-card-line { margin-top: 4px; font-size: 13px; color: var(--gray-600, #4b5563); }
.bt-tpl-card-line.muted { color: var(--gray-400, #9ca3af); font-size: 12.5px; }
.bt-tpl-card-actions { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--gray-100, #f3f4f6); display: flex; justify-content: flex-end; gap: 6px; }

/* ================ 0906 生产弹窗样式整体调整 ================ */
/* 电脑端：弹窗限高 + 内容内滚（永不超屏）；宽度已由内联 min(1100px,94vw) 控制 */
.modal.modal-prod { max-height: 92vh; display: flex; flex-direction: column; }
.modal-prod .modal-body { flex: 1; min-height: 0; overflow-y: auto; }
.modal-prod .modal-foot { flex: none; }
/* 领用原料摘要表紧凑化：按内容宽度、原料列占满左、数量/金额固定窄列右对齐 */
.p-link-scroll { overflow-x: auto; max-width: 480px; }
.p-link-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.p-link-tbl th, .p-link-tbl td { padding: 4px 8px; text-align: left; }
.p-link-tbl th:first-child, .p-link-tbl td:first-child { text-align: left; padding-left: 0; }
.p-link-tbl th.num, .p-link-tbl td.num { text-align: right; width: 90px; }
/* 手机端：摘要表横滚（min-width 由内容保证） */
@media (max-width: 600px) {
  .p-link-scroll { max-width: 100%; }
  .p-link-tbl th.num, .p-link-tbl td.num { width: 72px; }
}

/* ================ 0906 勾选面板强化：与摘要同宽、单行不换行、勾选状态面板内可见 ================ */
#p-link-list { max-width: 480px; }
#p-link-list label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#p-link-list label span { font-size: 13px; }
@media (max-width: 600px) {
  #p-link-list { max-width: 100%; }
}

/* ================ 0907 领用原料合并单表：无横滚、超长省略号 ================ */
.p-link-scroll { max-width: 480px; }
.p-link-tbl { table-layout: fixed; }
.p-link-tbl th:first-child, .p-link-tbl td.p-mat { width: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-link-tbl td.num { width: 90px; }
.p-link-tbl { min-width: 0 !important; }  /* 覆盖全局 table.tbl min-width:900（合并单表不横滚） */

/* ================ 0907 摘要表补金额列（三列，压实） ================ */
.p-link-tbl td.num { width: 64px; }
.p-link-tbl td.num + td.num { width: 80px; }
.p-link-tbl th.num { width: auto; }
.p-link-tbl th.num:last-child { width: 80px; }
.p-link-tbl th.num:first-of-type { width: 64px; }

/* ================ 0907 摘要表加单位列（四列） ================ */
.p-link-tbl td.u-col, .p-link-tbl th:nth-child(3) { width: 64px; min-width: 64px; text-align: center; white-space: nowrap; }

/* ================ 0907 生产单据查看展开+打印 ================ */
.prod-doc { background: #fff; }
.prod-doc-title { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.prod-doc-meta { font-size: 12.5px; color: #6b7280; margin-bottom: 2px; }
.prod-doc .prod-doc-tbl { margin-top: 8px; min-width: 560px; }
#doc-print-body { display: none; }
/* 注意：本块可见性依赖/复制自 1400-1412 账单打印块的 body * hidden 机制；改动旧块时需同步此处自兜底规则 */
@media print {
  body * { visibility: hidden; }
  #doc-print-body { display: block; position: absolute; left: 0; top: 0; width: 100%; background: #fff; }
  #doc-print-body, #doc-print-body * { visibility: visible; color: #000 !important; background: #fff !important; }
  .doc-print-block { page-break-after: always; padding: 6mm 0; }
  .doc-print-block:last-child { page-break-after: auto; }
  .doc-print-block .prod-doc-title { text-align: center; font-size: 22px; margin-bottom: 10px; }
  .doc-print-block .prod-doc-meta { font-size: 13px; color: #000 !important; margin-bottom: 3px; }
  .doc-print-block .prod-doc-tbl { width: 100%; min-width: 0; border-collapse: collapse; margin-top: 10px; }
  .doc-print-block .prod-doc-tbl th, .doc-print-block .prod-doc-tbl td { border: 1px solid #000; padding: 5px 8px; }
  .doc-print-block .prod-doc-tbl tbody tr:last-child td { border-bottom: 2px solid #000 !important; }   /* Pr2b：collapse 冲突下 1px 被压成 0.67px 不可见，强制 2px */   /* Pr2：补表格底边框（全局样式去掉末行底边，打印需闭合） */
  .doc-print-block .prod-doc-tbl thead th { text-align: left; }
  .doc-print-block .badge { display: inline-block; }
}

/* ============================================================
   0040 项目管理模块（pj* 前缀）：分组树 / 筛选药丸 / 数字条 / 透视矩阵
   ============================================================ */
.pj-layout { align-items: start; }
.pj-tree { background: #fff; border: 1px solid var(--gray-200); border-radius: 12px; padding: 12px; }
.pj-tree-title { font-weight: 700; font-size: 13.5px; color: var(--gray-800); margin-bottom: 8px; }
.pj-tree-item { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 8px; font-size: 13.5px; color: var(--gray-700); cursor: pointer; }
.pj-tree-item:hover { background: var(--gray-100); }
.pj-tree-item.active { background: #eef2ff; color: var(--primary); font-weight: 600; }
.pj-tree-kid { padding-left: 22px; font-size: 13px; }
.pj-filter-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.pj-filterbar { flex: 1; min-width: 260px; }
.pj-filterbar-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pj-pills, .pj-views { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pj-pill { display: inline-flex; align-items: center; gap: 5px; background: #eef2ff; color: var(--primary); font-size: 12.5px; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.pj-pill-x { cursor: pointer; font-weight: 700; margin-left: 2px; color: inherit; opacity: .65; text-decoration: none; }
.pj-pill-x:hover { opacity: 1; }
.pj-view-chip { display: inline-flex; align-items: center; gap: 5px; background: var(--gray-100); border: 1px dashed var(--gray-300); color: var(--gray-700); font-size: 12.5px; padding: 3px 10px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.pj-view-chip:hover { border-color: var(--primary); color: var(--primary); }
.pj-tag { display: inline-block; background: #f0fdf4; color: #15803d; font-size: 12px; padding: 2px 8px; border-radius: 999px; margin: 1px 2px 1px 0; white-space: nowrap; }
.pj-tag-x a { cursor: pointer; font-weight: 700; margin-left: 4px; opacity: .65; }
.pj-tag-chips { display: flex; flex-wrap: wrap; gap: 4px; min-height: 22px; }
.pj-numstrip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.pj-num-cell { background: #fff; border: 1px solid var(--gray-200); border-radius: 12px; padding: 12px 14px; }
.pj-num-cell .k { font-size: 12.5px; color: var(--gray-500); }
.pj-num-cell .v { font-size: 19px; font-weight: 700; color: var(--gray-900); margin-top: 6px; font-variant-numeric: tabular-nums; }
.pj-num-cell .v.in { color: #16a34a; }
.pj-num-cell .v.out { color: #dc2626; }
.pj-matrix td { vertical-align: top; }
.pj-cell { min-width: 110px; font-size: 12.5px; line-height: 1.5; }
.pj-cat-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 4px; border-bottom: 1px dashed var(--gray-100); font-size: 13.5px; }
.pj-cat-ops { display: inline-flex; gap: 8px; }
@media (max-width: 900px) {
  .pj-layout { grid-template-columns: 1fr !important; }
  .pj-numstrip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ============================================================
   P16-总览改版（dash2* 前缀，2026-09-08）：紧凑工作台布局
   布局基准 web-ui/ui-preview-demo.html（pv- → dash2-），只追加不改动既有规则
   ============================================================ */
.dash2-wrap { max-width: 1180px; margin: 0 auto; }
.dash2-banner { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.dash2-banner h1 { font-size: 17px; font-weight: 700; color: var(--gray-800); margin: 0; }
.dash2-sub { font-weight: 400; font-size: 12.5px; color: var(--gray-400); }
.dash2-date { font-size: 12.5px; color: var(--gray-500); }
/* 顶排数字条：小卡片横排 */
.dash2-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 14px; }
.dash2-kpi { background: #fff; border: 1px solid var(--gray-200); border-radius: 8px; padding: 10px 12px; }
.dash2-kpi .k { font-size: 11.5px; color: var(--gray-500); margin-bottom: 4px; }
.dash2-kpi .v { font-size: 19px; font-weight: 700; color: var(--gray-800); }
.dash2-kpi .v.up { color: #059669; }
.dash2-kpi .v.down { color: #dc2626; }
/* T20（09-09）：全站通用总览小卡（与 .dash2-kpi 同款视觉，独立命名，不影响 dash2/stat 原类） */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kpi-card { background: #fff; border: 1px solid var(--gray-200); border-radius: 8px; padding: 10px 12px; }
.kpi-card .k { font-size: 11.5px; color: var(--gray-500); margin-bottom: 4px; }
.kpi-card .v { font-size: 19px; font-weight: 700; color: var(--gray-800); }
.kpi-card .v.up { color: #059669; }
.kpi-card .v.down { color: #dc2626; }
.kpi-card .foot { font-size: 11.5px; color: var(--gray-500); margin-top: 2px; line-height: 1.5; }
@media (max-width: 900px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
/* 快捷录单按钮行 */
.dash2-quick { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.dash2-qb { flex: 1; min-width: 110px; background: #2563eb; color: #fff; border-radius: 8px; padding: 11px 0; text-align: center; font-size: 13.5px; font-weight: 600; cursor: pointer; user-select: none; }
.dash2-qb:hover { background: #1d4ed8; }
.dash2-qb.alt { background: #fff; color: #2563eb; border: 1px solid #bfdbfe; }
.dash2-qb.alt:hover { background: #eff6ff; }
/* 两栏：左最近单据（1.6fr）+ 右概览列（1fr） */
.dash2-cols { display: grid; grid-template-columns: 1fr; gap: 12px; } /* T12（09-09）：最近单据移出双列后改单列铺开 */
.dash2-card { background: #fff; border: 1px solid var(--gray-200); border-radius: 8px; }
.dash2-card .h { font-size: 13px; font-weight: 700; color: var(--gray-700); padding: 10px 12px 6px; }
.dash2-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 12px; border-top: 1px solid var(--gray-100); font-size: 12px; }
.dash2-row:first-child { border-top: 0; }
.dash2-row .t { color: var(--gray-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1 1 auto; }
.dash2-row .m { color: var(--gray-500); white-space: nowrap; }
.dash2-row .amt { font-weight: 600; white-space: nowrap; }
.dash2-list { max-height: 218px; overflow-y: auto; }
.dash2-row .money-in, .dash2-row .money-out { font-weight: 600; }
/* 欠款 TOP5 小表 */
.dash2-top5 { width: 100%; border-collapse: collapse; font-size: 12px; }
.dash2-top5 td { padding: 5px 12px; border-top: 1px solid var(--gray-100); }
.dash2-top5 tr:first-child td { border-top: 0; }
.dash2-top5 td:last-child { text-align: right; font-weight: 700; color: #dc2626; }
/* 状态小徽章 */
.dash2-badge { font-size: 11px; padding: 1px 8px; border-radius: 10px; white-space: nowrap; }
.dash2-b-green { background: #d1fae5; color: #059669; }
.dash2-b-orange { background: #fef3c7; color: #b45309; }
.dash2-b-gray { background: var(--gray-100); color: var(--gray-500); }
/* 待办提醒行 */
.dash2-todo { padding: 8px 12px; border-top: 1px solid var(--gray-100); font-size: 12.5px; display: flex; justify-content: space-between; align-items: center; }
.dash2-todo:first-of-type { border-top: 0; }
.dash2-todo .n { font-weight: 700; color: #dc2626; }
.dash2-todo .ok { color: #059669; font-weight: 700; }
.dash2-todo a { color: var(--primary); text-decoration: none; font-weight: 600; }
/* 手机适配：≤900px 数字条两列、左右栏单列；≤600px 数字条两列、录单按钮两列、欠款表全宽 */
@media (max-width: 900px) {
  .dash2-kpis { grid-template-columns: repeat(2, 1fr); }
  .dash2-cols { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .dash2-kpis { grid-template-columns: repeat(2, 1fr); }
  .dash2-qb { min-width: 46%; }
  .dash2-top5 { width: 100%; display: block; }
  /* T12（09-09）：手机端禁止横向滚动——.t 截断优先（min-width:0 使 ellipsis 生效），金额/徽章缩小，容器兜底裁剪 */
  .dash2-wrap { max-width: 100%; overflow-x: hidden; }
  .dash2-card { max-width: 100%; overflow-x: hidden; }
  .dash2-row .t { min-width: 0; }
  .dash2-row .m { font-size: 11px; }
  .dash2-row .amt { font-size: 11px; }
  .dash2-badge { font-size: 10px; padding: 1px 6px; }
}
