:root {
  --primary: #0E9F6E;
  --primary-light: #E6F6EF;
  --primary-dark: #087A54;
  --bg: #f5faf7;
  --card: #ffffff;
  --border: #dde8e1;
  --text: #0B2E21;
  --text-sub: #5C7A6C;
  --success: #0E9F6E;
  --danger: #E5484D;
  --warning: #F0A000;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(6, 78, 59, .08), 0 1px 2px rgba(6, 78, 59, .04);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

.app { display: flex; min-height: 100vh; }

/* ===== 侧边栏 ===== */
.sidebar {
  width: 200px; background: #134A37; border-right: 1px solid rgba(255,255,255,.08);
  display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0;
  z-index: 10;
}
.logo { display: flex; align-items: center; gap: 10px; padding: 18px 16px; border-bottom: 1px solid rgba(255,255,255,.1); }
.logo-icon {
  width: 55px; height: 36px; border-radius: 0; background: transparent;
  display: flex; align-items: center; justify-content: center; overflow: visible;
}
.logo-icon img { width: 100%; height: 100%; object-fit: contain; display: block; }
.logo-title { font-weight: 600; font-size: 15px; color: #fff; }
.logo-sub { font-size: 11px; color: rgba(255,255,255,.55); margin-top: 2px; }

.nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
/* ===== 菜单按权限过滤（CSS 门控）：未授权 wrap/sub 默认隐藏，由 applyNavPermissions 标记可见 ===== */
.nav-flyout-wrap, .nav-group { display: none; }
.nav-flyout-wrap.perm-visible, .nav-group.perm-visible { display: block; }
.nav-group.perm-visible { display: block; }
.nav-group  { font-size: 11px; color: rgba(255,255,255,.4); padding: 12px 10px 6px; letter-spacing: .06em; }
.nav-item {
  display: flex; align-items: center; gap: 9px; padding: 9px 12px; margin-bottom: 2px;
  border-radius: 8px; cursor: pointer; color: rgba(255,255,255,.78); text-decoration: none;
  transition: background .15s, color .15s;
}
.nav-parent-item { width: 100%; border: 0; background: transparent; font: inherit; text-align: left; }
.nav-item:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; font-weight: 600; }
.nav-icon { font-size: 15px; }
.nav-flyout-wrap { position: relative; }
.nav-flyout-wrap.perm-visible { display: block; }
.nav-parent-item span:nth-child(2) { flex: 1; }
.nav-parent-arrow { margin-left: auto; color: rgba(255,255,255,.55); font-size: 20px; line-height: 1; }
.nav-flyout-wrap.is-open .nav-parent-arrow { transform: rotate(90deg); color: #fff; }
.nav-flyout-menu {
  display: none; position: fixed; left: 188px; z-index: 80; width: 190px; padding: 7px;
  border: 1px solid var(--border); border-radius: 6px; background: #fff; box-shadow: 0 14px 30px rgba(11,46,33,.18);
}
.nav-flyout-wrap.is-open .nav-flyout-menu { display: grid; }
.nav-flyout-menu button { min-height: 40px; padding: 8px 13px; border: 0; border-radius: 4px; background: #fff; color: var(--text); text-align: left; font-size: 13px; cursor: pointer; white-space: nowrap; }
.nav-flyout-menu button:hover { background: var(--primary-light); color: var(--primary-dark); }
.nav-flyout-menu button.active { background: var(--primary); color: #fff; font-weight: 600; }
.nav-flyout-wrap[data-disabled-module] .nav-parent-item { opacity: 0.55; cursor: not-allowed; }
.nav-flyout-wrap[data-disabled-module] .nav-parent-item:hover { background: transparent; color: inherit; }
.nav-flyout-wrap[data-disabled-module] .nav-flyout-menu button { color: var(--text-sub); cursor: not-allowed; }
.nav-flyout-wrap[data-disabled-module] .nav-flyout-menu button::before { content: "🔒 "; font-size: 11px; }
.nav-flyout-wrap[data-disabled-module] .nav-flyout-menu button:hover { background: var(--bg-page); color: var(--text-sub); }
.sidebar-footer { padding: 12px 16px; font-size: 11px; color: rgba(255,255,255,.45); border-top: 1px solid rgba(255,255,255,.1); }

/* ===== 主区域 ===== */
.main { flex: 1; min-width: 0; margin-left: 200px; display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  height: 56px; background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 24px;
  position: sticky; top: 0; z-index: 5;
}
.page-title { font-size: 17px; font-weight: 700; }
.topbar-right { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13px; color: var(--text-sub); }
.topbar-health { display: flex; align-items: center; gap: 7px; margin-right: 4px; white-space: nowrap; }
.topbar-links { display: flex; align-items: center; gap: 2px; height: 100%; }
.topbar-link,
.topbar-icon-button,
.topbar-user-button {
  height: 34px; border: 0; border-radius: 4px; background: transparent; color: var(--text);
  font: inherit; cursor: pointer; white-space: nowrap;
}
.workspace-tabs-shell {
  position: sticky; top: 56px; z-index: 5; display: flex; align-items: flex-end; gap: 5px;
  min-height: 44px; padding: 6px 20px 0; overflow-x: auto; border-bottom: 1px solid var(--border); background: var(--bg);
}
.workspace-tabs-shell[hidden] { display: none; }
.workspace-tab {
  display: inline-flex; flex: 0 0 auto; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px;
  border: 1px solid transparent; border-bottom: 0; border-radius: 5px 5px 0 0; background: #eef3f0;
  color: var(--text-sub); font-size: 13px; cursor: pointer;
}
.workspace-tab:hover { color: var(--primary-dark); background: var(--primary-light); }
.workspace-tab.active { background: var(--primary); color: #fff; font-weight: 600; }
.workspace-tab i { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-style: normal; font-size: 16px; font-weight: 400; line-height: 1; }
.workspace-tab i:hover { background: rgba(255,255,255,.22); }
.workspace-tabs-visible .module-sticky,
.workspace-tabs-visible .module-card-head,
.workspace-tabs-visible .content > .card > .card-head { top: 100px; }
.topbar-link { padding: 0 11px; }
.topbar-link:hover,
.topbar-icon-button:hover,
.topbar-user-button:hover { background: var(--primary-light); color: var(--primary-dark); }
.topbar-guide-link { background: var(--primary); color: #fff; font-weight: 600; }
.topbar-guide-link:hover { background: var(--primary-dark); color: #fff; }
.topbar-more-button { display: inline-flex; align-items: center; gap: 5px; }
.topbar-more-button span,
.topbar-user-button > span:last-child { font-size: 15px; color: var(--text-sub); }
.topbar-divider { width: 1px; height: 24px; margin: 0 3px; background: var(--border); }
.topbar-menu-wrap { position: relative; display: flex; align-items: center; }
.topbar-icon-button { position: relative; display: grid; place-items: center; width: 34px; padding: 0; font-size: 16px; }
.topbar-notification-dot {
  position: absolute; top: 5px; right: 5px; width: 7px; height: 7px;
  border: 2px solid #fff; border-radius: 50%; background: var(--danger);
}
.topbar-notification-dot.is-empty { display: none; }
.topbar-user-button { display: flex; align-items: center; gap: 7px; padding: 0 7px 0 4px; }
.topbar-avatar {
  display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid rgba(14,159,110,.25);
  border-radius: 50%; background: var(--primary-light); color: var(--primary-dark); font-size: 12px; font-weight: 700;
}
.topbar-user-name { max-width: 92px; overflow: hidden; text-overflow: ellipsis; }
.topbar-dropdown {
  display: none; position: absolute; top: calc(100% + 10px); right: 0; z-index: 90;
  width: 220px; overflow: hidden; border: 1px solid var(--border); border-radius: 6px;
  background: #fff; box-shadow: 0 14px 32px rgba(11,46,33,.16);
}
.topbar-dropdown.is-open { display: block; }
.topbar-more-menu { right: auto; left: 0; }
.topbar-notification-menu { width: 340px; }
.topbar-user-menu { width: 290px; }
.topbar-dropdown-head {
  display: flex; align-items: center; justify-content: space-between; min-height: 44px;
  padding: 0 14px; border-bottom: 1px solid var(--border); color: var(--text);
}
.topbar-dropdown-head button { border: 0; background: transparent; color: var(--primary-dark); cursor: pointer; font-size: 12px; }
.topbar-dropdown-body { max-height: min(420px, calc(100vh - 110px)); overflow-y: auto; }
.topbar-menu-item {
  display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; gap: 9px;
  width: 100%; min-height: 42px; padding: 7px 13px; border: 0; border-bottom: 1px solid #eef3f0;
  background: #fff; color: var(--text); text-align: left; cursor: pointer;
}
.topbar-menu-item:last-child { border-bottom: 0; }
.topbar-menu-item:hover { background: var(--primary-light); }
.topbar-menu-item > span:first-child {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: #f1f7f4; color: var(--primary-dark); font-size: 13px; font-weight: 700;
}
.topbar-menu-item b { overflow: hidden; text-overflow: ellipsis; font-size: 13px; font-weight: 500; }
.topbar-mobile-only { display: none; }
.topbar-menu-empty { padding: 28px 16px; color: var(--text-sub); text-align: center; font-size: 12px; }
.topbar-notification-item { padding: 11px 14px; border-bottom: 1px solid #eef3f0; }
.topbar-notification-item:last-child { border-bottom: 0; }
.topbar-notification-title { color: var(--text); font-size: 13px; font-weight: 600; }
.topbar-notification-meta { margin-top: 4px; color: var(--text-sub); font-size: 11px; line-height: 1.45; }
.topbar-user-summary { padding: 16px; border-bottom: 1px solid var(--border); background: #f8fbf9; }
.topbar-user-summary strong { display: block; color: var(--text); font-size: 15px; }
.topbar-user-summary span { display: block; margin-top: 5px; color: var(--text-sub); font-size: 12px; line-height: 1.45; }
.topbar-resource-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.topbar-resource-item {
  display: grid; gap: 5px; min-height: 92px; padding: 14px; border: 1px solid var(--border);
  border-radius: 6px; background: #fff; color: var(--text); text-align: left; cursor: pointer;
}
.topbar-resource-item:hover { border-color: var(--primary); background: var(--primary-light); }
.topbar-resource-item b { font-size: 14px; }
.topbar-resource-item span { color: var(--text-sub); font-size: 12px; line-height: 1.5; }
.modal.topbar-resource-modal { width: min(700px, calc(100vw - 32px)); }
.modal.topbar-calculator-modal { width: min(520px, calc(100vw - 32px)); }
.topbar-calculator-grid { display: grid; grid-template-columns: 110px minmax(0, 1fr); align-items: center; gap: 12px; }
.topbar-calculator-grid label { color: var(--text-sub); text-align: right; }
.topbar-calculator-grid .input { width: 100%; }
.topbar-calculator-result { color: var(--primary-dark); font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.health-dot { width: 8px; height: 8px; border-radius: 50%; background: #9ca3af; }
.health-dot.ok { background: var(--success); }
.health-dot.bad { background: var(--danger); }

@media (max-width: 1080px) {
  #healthText, .topbar-user-name { display: none; }
  .topbar-health { margin-right: 0; }
}
@media (max-width: 820px) {
  .topbar { padding: 0 12px; }
  .page-title { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-secondary-link { display: none; }
  .topbar-mobile-only { display: grid; }
  .topbar-notification-menu { width: min(340px, calc(100vw - 32px)); }
}
@media (max-width: 560px) {
  .topbar-guide-link { display: none; }
  .topbar-divider { display: none; }
  .topbar-resource-grid { grid-template-columns: 1fr; }
  .topbar-calculator-grid { grid-template-columns: 1fr; gap: 6px; }
  .topbar-calculator-grid label { text-align: left; margin-top: 6px; }
}

.content { padding: 12px 20px 16px; flex: 1; min-width: 0; }
.module-sticky {
  position: sticky;
  top: 56px;
  z-index: 4;
  background: var(--bg);
  padding-top: 2px;
  padding-bottom: 2px;
}
.tabs.module-sticky { background: var(--bg); }
.module-card-head {
  position: sticky;
  top: 56px;
  z-index: 4;
  background: var(--card);
}
.content > .card > .card-head {
  position: sticky;
  top: 56px;
  z-index: 4;
  background: var(--card);
}

/* ===== 卡片与统计 ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card {
  background: var(--card); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.stat-card .stat-label { font-size: 12px; color: var(--text-sub); }
.stat-card .stat-value { font-size: 28px; font-weight: 300; margin-top: 6px; letter-spacing: -0.5px; font-variant-numeric: tabular-nums; }
.stat-card .stat-value.green { color: var(--success); }
.stat-card .stat-value.red { color: var(--danger); }
.stat-card .stat-value.blue { color: var(--primary); }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); margin-bottom: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; gap: 8px; }
.card-title { font-size: 15px; font-weight: 700; }
.card-body { padding: 12px 16px; }

/* 权限矩阵分组分隔条：平台层 ↔ 租户业务层 */
.perm-matrix-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0 14px; }
.perm-matrix-divider-line { flex: 1; height: 1px; background: linear-gradient(to right, transparent, var(--border), transparent); }
.perm-matrix-divider-label { font-size: 12px; color: var(--text-sub); padding: 4px 12px; border: 1px dashed var(--border); border-radius: 9999px; white-space: nowrap; }

/* 基础资料子页面由左侧二级菜单切换，内容区统一使用紧凑密度。 */
.basic-module-body .card { margin-bottom: 10px; }
.basic-module-body .card-head { padding: 9px 14px; gap: 6px; }
.basic-module-body .card-title { font-size: 14px; }
.basic-module-body .card-body { padding: 8px 14px; }
.basic-module-body table.data-table { font-size: 12px; }
.basic-module-body .data-table th { padding: 8px 10px; font-size: 12px; }
.basic-module-body .data-table td { padding: 7px 10px; }
.basic-module-body .form-row { margin-bottom: 8px; }
.basic-module-body .btn:not(.sm) { padding: 7px 14px; }
.basic-module-body .btn.sm { padding: 4px 10px; font-size: 11px; }

/* MSKU 映射是基础资料中的独立工作窗口，保留内容区边界但不再嵌套卡片阴影。 */
.basic-module-body .sku-mapping-window {
  border-radius: 6px;
  box-shadow: none;
}
.basic-module-body .sku-mapping-window .table-wrap { max-height: calc(100vh - 245px); overflow: auto; }

/* ===== 表单 ===== */
.form-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.form-row label { font-size: 13px; color: var(--text-sub); white-space: nowrap; }
.input, select.input, textarea.input {
  padding: 7px 10px; border: 1px solid rgba(14,159,110,.32); border-radius: 6px; font-size: 13px;
  background: #fff; color: var(--text); outline: none; min-width: 0;
}
.input:hover { border-color: rgba(14,159,110,.6); }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(14,159,110,.15); }
select.input {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none'><path d='M1 1.5l5 5 5-5' stroke='%230E9F6E' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 12px 8px;
  cursor: pointer;
}
.input.small { width: 120px; }
.input.medium { width: 180px; }
.input.account-book-select {
  width: clamp(300px, 24vw, 420px);
  max-width: 100%;
}

@media (max-width: 760px) {
  .input.account-book-select { width: 100%; }
}

.btn {
  padding: 8px 16px; border: none; border-radius: 9999px; font-size: 13px; cursor: pointer;
  background: var(--primary); color: #fff; transition: opacity .15s, background .15s;
  box-shadow: 0 1px 3px rgba(14,159,110,.3), 0 4px 12px rgba(14,159,110,.18);
}
.btn:hover { background: var(--primary-dark); opacity: 1; }
.btn.secondary { background: #fff; color: var(--primary-dark); border: 1px solid var(--primary); box-shadow: none; }
.btn.secondary:hover { background: var(--primary-light); }
.btn.danger { background: var(--danger); box-shadow: 0 1px 3px rgba(229,72,77,.3), 0 4px 12px rgba(229,72,77,.18); }
.btn.success { background: var(--success); }
.btn.warning { background: var(--warning); color: #fff; }
.btn.sm { padding: 5px 12px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.voucher-batch-menu-wrap { position: relative; display: inline-flex; }
.voucher-batch-menu-wrap > .btn span { margin-left: 3px; font-size: 12px; }
.voucher-batch-menu {
  display: none; position: absolute; top: calc(100% + 6px); right: 0; z-index: 80;
  min-width: 118px; padding: 5px; border: 1px solid var(--border); border-radius: 6px;
  background: #fff; box-shadow: 0 8px 22px rgba(11, 46, 33, .16);
}
.voucher-batch-menu-wrap.is-open .voucher-batch-menu { display: grid; gap: 2px; }
.voucher-batch-menu button {
  min-height: 34px; padding: 7px 10px; border: 0; border-radius: 4px;
  background: #fff; color: var(--text); text-align: left; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.voucher-batch-menu button:hover { background: var(--primary-light); color: var(--primary-dark); }

/* 发出商品/采购退货：上传时明确选择成本来源。 */
.cost-mode-selector {
  display: inline-flex;
  align-items: center;
  gap: 0;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
}
.cost-mode-selector > span { padding: 6px 8px; color: var(--text-sub); background: #f8fafc; border-right: 1px solid #cbd5e1; }
.cost-mode-btn { padding: 6px 9px; border: 0; border-right: 1px solid #cbd5e1; background: #fff; color: var(--text-sub); font-size: 12px; cursor: pointer; }
.cost-mode-btn:last-child { border-right: 0; }
.cost-mode-btn:hover { background: var(--primary-light); color: var(--primary); }
.cost-mode-btn.active { background: var(--primary); color: #fff; font-weight: 600; }

/* 文件导入：上传字节进度 + 服务端解析状态。 */
.import-upload-controls { align-items: center; }
.import-upload-status-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 34px;
  margin: -2px 0 10px;
  flex-wrap: wrap;
}
.import-template-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 auto;
  flex-wrap: wrap;
}
.upload-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 360px;
  min-width: 320px;
  max-width: none;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid #dbe4fb;
  border-radius: 6px;
  background: #f8faff;
  color: var(--text-sub);
  font-size: 12px;
}
.upload-progress[hidden] { display: none; }
.upload-progress-track {
  width: 88px;
  height: 7px;
  flex: 0 0 88px;
  overflow: hidden;
  border-radius: 4px;
  background: #e5eaf5;
}
.upload-progress-percent,
.upload-progress-eta {
  flex: 0 0 auto;
  white-space: nowrap;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.upload-progress-percent { font-weight: 600; color: var(--primary-dark); }
.upload-progress-eta { color: var(--text-sub); }
.upload-progress-divider { color: #c4ccdc; flex: 0 0 auto; }
.upload-progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width .2s ease;
}
.upload-progress.is-processing .upload-progress-bar {
  width: 42%;
  animation: upload-processing 1.25s ease-in-out infinite;
}
.upload-progress-text {
  min-width: 0;
  flex: 1 1 auto;
  white-space: normal;
  overflow: visible;
  line-height: 1.45;
}
.cost-recalc-progress {
  display: grid;
  grid-template-columns: 160px max-content max-content minmax(180px, 1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 10px 0 2px;
  padding: 9px 12px;
  border: 1px solid #b9d1ff;
  border-radius: 6px;
  background: #f6f9ff;
  color: var(--text-sub);
  font-size: 13px;
}
.cost-recalc-progress[hidden] { display: none; }
.cost-recalc-progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: #dfe8f8;
}
.cost-recalc-progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width .25s ease;
}
.cost-recalc-progress-percent { color: var(--primary-dark); font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cost-recalc-progress-eta { color: var(--text-sub); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cost-recalc-progress-stage { min-width: 0; overflow-wrap: anywhere; }
.cost-recalc-progress.is-complete { border-color: #9fd8b4; background: #f2fbf5; }
.cost-recalc-progress.is-error { border-color: #f0c2a4; background: #fff8f1; }
@keyframes upload-processing {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(270%); }
}
@media (max-width: 760px) {
  .import-upload-status-row { align-items: stretch; }
  .upload-progress { width: 100%; min-width: 0; flex-basis: 100%; }
  .upload-progress-text { flex-basis: 100%; }
  .import-template-links { width: 100%; }
  .cost-recalc-progress { grid-template-columns: 1fr max-content; }
  .cost-recalc-progress-track, .cost-recalc-progress-stage { grid-column: 1 / -1; }
}

/* ===== 表格 ===== */
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  background: #EFF9F4; padding: 10px 12px; text-align: left; font-weight: 500; font-size: 12px;
  color: #1E4538; border-bottom: 1px solid #D8EDE2; white-space: nowrap; position: sticky; top: 0;
}
.data-table td { padding: 9px 12px; border-bottom: 1px solid #edf3f0; }
.data-table tr:hover td { background: #E6F6EF; }
.analysis-dimension-page { min-width: 0; max-width: 100%; }
.analysis-dimension-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.analysis-dimension-toolbar .account-book-select { width: min(320px, 30vw); }
.analysis-dimension-picker { position: relative; }
.analysis-dimension-picker-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 280px; max-height: min(480px, calc(100vh - 180px)); overflow: auto; padding: 8px; border: 1px solid var(--border); border-radius: 6px; background: #fff; box-shadow: 0 12px 28px rgba(11, 46, 33, .16); }
.analysis-dimension-picker-menu label { display: flex; align-items: center; gap: 8px; min-height: 30px; padding: 3px 5px; color: var(--text); cursor: pointer; }
.analysis-dimension-picker-menu input { margin: 0; accent-color: var(--primary); }
.analysis-dimension-picker-all { border-bottom: 1px solid var(--border); font-weight: 600; }
.analysis-dimension-picker-options { padding-top: 4px; }
.analysis-dimension-column-delete { margin-left: auto; width: 22px; height: 22px; padding: 0; border: 0; background: transparent; color: var(--danger, #d92d20); font-size: 18px; line-height: 1; cursor: pointer; }
.analysis-dimension-table-wrap { max-width: 100%; min-height: 180px; max-height: calc(100vh - 230px); overflow: auto; }
.analysis-dimension-table { width: max-content; min-width: 100%; table-layout: fixed; }
.analysis-dimension-table th, .analysis-dimension-table td { width: 138px; min-width: 138px; max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.analysis-dimension-blank-row td { height: 118px; }
@media (max-width: 720px) {
  .analysis-dimension-toolbar { justify-content: flex-start; }
  .analysis-dimension-toolbar .account-book-select { width: 100%; }
  .analysis-dimension-picker-menu { left: 0; right: auto; width: min(280px, calc(100vw - 40px)); }
}
.table-wrap.mapping-table-wrap {
  max-width: 100%;
  max-height: calc(100vh - 320px);
  min-height: 180px;
  overflow: auto;
  position: relative;
  overflow-anchor: none;
}
.mapping-filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 10px;
}
.mapping-filter-item { display: flex; align-items: center; gap: 6px; }
.mapping-filter-item label { font-size: 13px; color: var(--text-sub); white-space: nowrap; }
.mapping-filter-item .input { width: 132px; }
.mapping-filter-item:nth-child(2) .input { width: 148px; }
.mapping-filter-item:nth-child(3) .input { width: 116px; }
.mapping-filter-item:nth-child(4) .input { width: 108px; }
.mapping-filter-item:nth-child(5) .input { width: 142px; }
.mapping-filter-summary { font-size: 12px; color: var(--text-sub); white-space: nowrap; }
.mapping-table {
  width: 1430px !important;
  min-width: 1430px;
  table-layout: fixed;
}
.mapping-table th:nth-child(1), .mapping-table td:nth-child(1) { width: 78px; }
.mapping-table th:nth-child(2), .mapping-table td:nth-child(2) { width: 84px; }
.mapping-table th:nth-child(3), .mapping-table td:nth-child(3) { width: 82px; }
.mapping-table th:nth-child(4), .mapping-table td:nth-child(4) { width: 66px; }
.mapping-table th:nth-child(5), .mapping-table td:nth-child(5) { width: 72px; }
.mapping-table th:nth-child(6), .mapping-table td:nth-child(6),
.mapping-table th:nth-child(7), .mapping-table td:nth-child(7) { width: 120px; }
.mapping-table th:nth-child(8), .mapping-table td:nth-child(8),
.mapping-table th:nth-child(9), .mapping-table td:nth-child(9) { width: 150px; }
.mapping-table th:nth-child(10), .mapping-table td:nth-child(10) { width: 112px; }
.mapping-table th:nth-child(11), .mapping-table td:nth-child(11) { width: 140px; }
.mapping-table th:nth-child(12), .mapping-table td:nth-child(12) { width: 128px; }
.mapping-table th:nth-child(13), .mapping-table td:nth-child(13) { width: 128px; }
.mapping-table .mapping-source-field,
.mapping-table .mapping-subject-cell { white-space: normal; overflow-wrap: anywhere; word-break: break-word; line-height: 1.4; }
.mapping-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #EFF9F4;
  box-shadow: 0 1px 0 #D8EDE2;
}
.mapping-table th:nth-child(13) {
  position: sticky;
  right: 0;
  z-index: 4;
  background: #EFF9F4;
  box-shadow: -6px 0 10px rgba(11, 46, 33, .08);
}
.mapping-table .mapping-actions {
  position: sticky;
  right: 0;
  z-index: 2;
  background: #fff;
  white-space: nowrap;
  box-shadow: -6px 0 10px rgba(11, 46, 33, .08);
}
.mapping-table tr:hover .mapping-actions { background: #E6F6EF; }
.mapping-action-buttons { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
@media (max-width: 720px) {
  .mapping-filter-bar { align-items: stretch; }
  .mapping-filter-item { flex: 1 1 100%; }
  .mapping-filter-item .input,
  .mapping-filter-item:nth-child(2) .input,
  .mapping-filter-item:nth-child(3) .input,
  .mapping-filter-item:nth-child(4) .input,
  .mapping-filter-item:nth-child(5) .input { flex: 1; width: auto; }
}
.inventory-report-table .inventory-subject-row td {
  background: #eef4ff; border-top: 1px solid #c9d8f5; border-bottom: 1px solid #c9d8f5;
  color: #1e3a68; padding-top: 7px; padding-bottom: 7px;
}
.inventory-report-table .inventory-subject-row:hover td { background: #e5efff; }
.inventory-report-table .inventory-subject-row .btn { min-width: 26px; margin-right: 8px; padding-left: 6px; padding-right: 6px; }
.inventory-report-table th:first-child, .inventory-report-table td:first-child { min-width: 124px; }
.inventory-report-table th:nth-child(1), .inventory-report-table td:nth-child(1),
.inventory-report-table th:nth-child(2), .inventory-report-table td:nth-child(2) { white-space: nowrap; }
.inventory-report-wrap { max-height: calc(100vh - 270px); }
.inventory-report-wrap.inventory-report-collapsed { overflow-x: auto; }
.inventory-report-wrap.inventory-report-collapsed .inventory-report-table {
  width: max-content; min-width: max-content; table-layout: auto;
}
.inventory-report-wrap.inventory-report-collapsed .inventory-report-table th,
.inventory-report-wrap.inventory-report-collapsed .inventory-report-table td {
  overflow-wrap: break-word; word-break: normal;
  padding-left: 7px; padding-right: 7px;
}
.inventory-report-wrap.inventory-report-collapsed .inventory-report-table th:nth-child(1),
.inventory-report-wrap.inventory-report-collapsed .inventory-report-table td:nth-child(1) { width: 94px; }
.inventory-report-wrap.inventory-report-collapsed .inventory-report-table th:nth-child(2),
.inventory-report-wrap.inventory-report-collapsed .inventory-report-table td:nth-child(2) { width: 132px; }
.inventory-report-wrap.inventory-report-collapsed .inventory-report-table th:nth-child(3),
.inventory-report-wrap.inventory-report-collapsed .inventory-report-table td:nth-child(3) { width: 112px; }
.inventory-report-wrap.inventory-report-collapsed .inventory-report-table th:nth-child(4),
.inventory-report-wrap.inventory-report-collapsed .inventory-report-table td:nth-child(4),
.inventory-report-wrap.inventory-report-collapsed .inventory-report-table th:nth-child(5),
.inventory-report-wrap.inventory-report-collapsed .inventory-report-table td:nth-child(5) { width: 116px; }
.inventory-report-wrap.inventory-report-collapsed .inventory-report-table th:nth-child(6),
.inventory-report-wrap.inventory-report-collapsed .inventory-report-table td:nth-child(6) { width: 100px; }
.inventory-report-wrap.inventory-report-collapsed .inventory-report-table th:nth-child(7),
.inventory-report-wrap.inventory-report-collapsed .inventory-report-table td:nth-child(7) { width: 108px; }
.inventory-report-wrap.inventory-report-collapsed .inventory-report-table th:nth-child(8),
.inventory-report-wrap.inventory-report-collapsed .inventory-report-table td:nth-child(8),
.inventory-report-wrap.inventory-report-collapsed .inventory-report-table th:nth-child(9),
.inventory-report-wrap.inventory-report-collapsed .inventory-report-table td:nth-child(9) { width: 72px; }
.inventory-report-wrap.inventory-report-collapsed .inventory-report-table th:nth-child(10),
.inventory-report-wrap.inventory-report-collapsed .inventory-report-table td:nth-child(10),
.inventory-report-wrap.inventory-report-collapsed .inventory-report-table th:nth-child(11),
.inventory-report-wrap.inventory-report-collapsed .inventory-report-table td:nth-child(11) { width: 108px; }
.inventory-report-wrap.inventory-report-collapsed .inventory-report-table th.num,
.inventory-report-wrap.inventory-report-collapsed .inventory-report-table td.num { width: 78px; }
.inventory-report-wrap.inventory-report-expanded { overflow-x: auto; }
.inventory-report-wrap.inventory-report-expanded .inventory-report-table {
  width: max-content; min-width: 1800px;
}
.inventory-report-table th { z-index: 3; }
.inventory-report-table th.num,
.inventory-report-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.inventory-report-table .inventory-subject-row td,
.inventory-report-table .inventory-sku-total td { text-align: left !important; }
.inventory-report-table .inventory-subject-row td.num { text-align: right !important; }
.inventory-report-table .inventory-sku-total td.num { text-align: right !important; }
.inventory-report-table .inventory-sku-total td { background: #f8fbff; color: #334155; font-weight: 600; }
.inventory-report-table .inventory-cogs-parent-row td {
  background: #f3f7ff; color: #1e3a68; border-top: 1px solid #b9cdeb; font-weight: 700;
}
.inventory-report-table .inventory-cogs-parent-row .btn {
  min-width: 26px; margin-right: 8px; padding-left: 6px; padding-right: 6px;
}
.inventory-report-table .inventory-cogs-component-row td {
  background: #fbfdff; color: #475569;
}
.inventory-report-table .inventory-cogs-component-row:hover td { background: #f2f7ff; }
.inventory-report-table .inventory-grand-total td {
  background: #dce9ff; color: #1e3a68; border-top: 2px solid #8eaddf;
  border-bottom: 1px solid #8eaddf; font-weight: 700;
}
.inventory-report-table .inventory-grand-total td.num { text-align: right; font-variant-numeric: tabular-nums; }
.inventory-report-table .inventory-cost-detail-hidden { display: none; }
.inventory-detail-toggle {
  width: 22px; height: 22px; margin-right: 6px; padding: 0; border: 1px solid #b8c9e8;
  border-radius: 4px; background: #fff; color: #2459a6; font-size: 16px; line-height: 18px; cursor: pointer;
}
.inventory-detail-toggle:hover { background: #e9f1ff; }
.inventory-document-row td { padding: 8px 18px 12px 46px; background: #f8fbff; }
.inventory-document-table { width: min(780px, 100%); border-collapse: collapse; background: #fff; font-size: 12px; }
.inventory-document-table th, .inventory-document-table td { padding: 7px 10px; border: 1px solid #dce6f5; text-align: left; }
.inventory-document-table th { position: static; background: #eef4ff; color: #38557f; font-weight: 600; }
.business-module-toolbar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:14px; }
.business-module-toolbar label { color:var(--text-sub); font-size:13px; }
.business-kpi-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:10px; margin-bottom:14px; }
.business-kpi { background:#f8fafc; border:1px solid var(--border); border-radius:7px; padding:12px 14px; }
.business-kpi .label { color:var(--text-sub); font-size:12px; margin-bottom:5px; }
.business-kpi .value { color:var(--text); font-size:20px; font-weight:700; }
.business-module-note { color:var(--text-sub); font-size:12px; margin-top:8px; }
.module-placeholder { min-height: 180px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--text-sub); text-align: center; }
.module-placeholder-title { color: var(--primary-dark); font-size: 15px; font-weight: 700; }
.module-placeholder-text { font-size: 13px; }
.budget-module-tabs { margin-bottom: 14px; }
.budget-module-panel { min-height: 230px; padding: 16px; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.budget-module-title { color: var(--text); font-size: 16px; font-weight: 700; }
.budget-module-note { margin-top: 6px; color: var(--text-sub); font-size: 13px; }
.budget-module-panel .module-placeholder { min-height: 145px; }
.budget-import-toolbar { display:flex; align-items:flex-end; gap:10px; margin-top:16px; flex-wrap:wrap; }
.budget-import-selector { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-top:16px; padding:10px 12px; border:1px solid var(--border); border-radius:6px; background:#f8fafc; }
.budget-import-selector label { color:var(--text-sub); font-size:13px; font-weight:600; white-space:nowrap; }
.budget-import-selector .input { min-width:260px; height:34px; }
.budget-import-selected-note { color:var(--text-sub); font-size:12px; }
.budget-import-module-placeholder { min-height:190px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px; padding:24px; text-align:center; color:var(--text-sub); }
.budget-import-module-placeholder .module-placeholder-title { color:var(--primary-dark); }
.budget-import-module-placeholder .module-placeholder-text { max-width:680px; line-height:1.7; }
.budget-import-placeholder-action { margin-top:4px; }
.budget-upload-field { display:grid; gap:6px; min-width:min(460px,100%); }
.budget-upload-field label, .sales-target-filter label { color:var(--text-sub); font-size:12px; font-weight:600; }
.budget-import-tip { margin:12px 0; line-height:1.7; }
.budget-subsection-title { margin:16px 0 8px; color:var(--text); font-size:14px; font-weight:700; }
.budget-import-table { min-width:820px; }
.budget-import-errors { max-height:230px; margin-top:8px; }
.budget-import-result-action { margin-top:8px; }
.text-danger { color:var(--danger) !important; }
.sales-target-toolbar { display:flex; align-items:flex-end; gap:14px; margin:14px 0 10px; flex-wrap:wrap; }
.sales-target-filter { display:grid; gap:5px; }
.sales-target-row-count { color:var(--text-sub); font-size:12px; margin:0 0 8px; text-align:right; }
.budget-company-filter { position:relative; min-width:300px; }
.budget-company-trigger { min-width:300px; display:flex; justify-content:space-between; align-items:center; background:#fff; cursor:pointer; text-align:left; }
.budget-company-menu { position:absolute; z-index:40; top:58px; left:0; width:min(440px,calc(100vw - 64px)); max-height:310px; overflow:hidden; border:1px solid var(--border); border-radius:6px; background:#fff; box-shadow:0 12px 28px rgba(15,23,42,.16); }
.budget-company-options { max-height:250px; overflow:auto; padding:4px 0; }
.budget-company-option { display:flex; align-items:flex-start; gap:9px; padding:8px 12px; cursor:pointer; line-height:1.35; }
.budget-company-option:hover { background:#f5f8ff; }
.budget-company-option input { margin-top:2px; flex:0 0 auto; }
.budget-company-option-all { border-bottom:1px solid var(--border); background:#f8fafc; font-weight:700; }
.book-position-row { align-items:flex-start; }
.book-position-multi { position:relative; flex:1 1 auto; min-width:0; }
.book-position-trigger { width:100%; min-height:36px; display:flex; align-items:center; justify-content:space-between; gap:12px; background:#fff; cursor:pointer; text-align:left; }
.book-position-trigger > span:first-child { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.book-position-menu { top:40px; left:0; width:100%; max-height:260px; overflow:auto; }
.report-consolidation-filter { position:relative; min-width:300px; }
.report-consolidation-trigger { min-width:300px; }
.report-consolidation-menu { top:38px; }
.sales-target-table-wrap { max-height:calc(100vh - 365px); min-height:300px; border:1px solid var(--border); }
.sales-target-table { width:4300px; min-width:4300px; table-layout:fixed; }
.sales-target-table th { white-space:normal; line-height:1.3; vertical-align:middle; }
.sales-target-table td { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sales-target-table .st-company { width:250px; }
.sales-target-table .st-brand { width:120px; }
.sales-target-table .st-channel { width:170px; }
.sales-target-table .st-region { width:110px; }
.sales-target-table .st-category { width:145px; }
.sales-target-table .st-department { width:130px; }
.sales-target-table .st-platform-sku { width:150px; }
.sales-target-table .st-status { width:120px; }
.sales-target-table .st-sku { width:150px; }
.sales-target-table .st-currency { width:78px; }
.sales-target-table .st-month { width:105px; }
.sales-target-table .st-total { width:125px; }
.sales-target-table tfoot td { position:sticky; bottom:0; z-index:3; background:#eaf1fb; border-top:2px solid #94a9c7; font-weight:700; }
.sales-target-table tfoot td:first-child { text-align:right; padding-right:18px; }
.sales-target-table .st-row-total { font-weight:700; background:#f8fafc; }
.budget-tax-toolbar { display:flex; justify-content:flex-end; align-items:center; gap:12px; margin:14px 0 10px; }
.budget-module-toolbar { display:flex; align-items:center; gap:12px; margin:0 0 12px; padding:4px 0 10px; border-bottom:1px solid var(--border); }
.budget-import-entry { cursor:pointer; }
.budget-module-picker { display:inline-flex; align-items:center; gap:8px; color:var(--text-sub); font-size:13px; white-space:nowrap; }
.budget-module-picker .input { min-width:300px; height:34px; }
.budget-tax-count { color:var(--text-sub); font-size:12px; }
.budget-tax-table-wrap { min-height:260px; max-height:calc(100vh - 370px); border:1px solid var(--border); }
.budget-tax-table { width:100%; min-width:1270px; table-layout:fixed; }
.budget-tax-table .bt-company { width:230px; }
.budget-tax-table .bt-enterprise { width:150px; }
.budget-tax-table .bt-tax { width:145px; }
.budget-tax-table .bt-base { width:230px; }
.budget-tax-table .bt-rate { width:110px; }
.budget-tax-table .bt-period { width:145px; }
.budget-tax-table .bt-actions { width:150px; }
.budget-tax-table .bt-remark { width:220px; }
.budget-tax-table .bt-updated { width:170px; }
.budget-tax-table td { vertical-align:middle; }
.budget-tax-table .budget-tax-remark { white-space:normal; overflow-wrap:anywhere; color:var(--text-sub); line-height:1.45; }
.budget-tax-actions { display:flex; align-items:center; gap:6px; }
.budget-tax-form { display:grid; gap:11px; }
.budget-tax-form .form-row { display:grid; grid-template-columns:120px minmax(0,1fr); align-items:center; }
.budget-tax-form .form-row > label { color:var(--text-sub); font-size:13px; }
.budget-tax-form textarea.input { min-height:76px; resize:vertical; }
.budget-tax-rate-input { display:grid; grid-template-columns:minmax(0,1fr) 30px; align-items:center; gap:6px; }
.budget-tax-rate-input span { color:var(--text-sub); font-weight:700; }
.modal.budget-tax-modal { width:min(620px,calc(100vw - 32px)); }
.text-muted { color: var(--text-sub); font-size: 12px; font-weight: 400; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 9999px; font-size: 11px; font-weight: 500; }
.tag.green { background: #E6F6EF; color: #087A54; }
.tag.red { background: #FDECEC; color: #C43D42; }
.tag.blue { background: #E0F0FF; color: #0B5AA6; }
.tag.gray { background: #F1F4F8; color: #4A5568; }
.tag.orange { background: #FFF4E0; color: #8A5A00; }
.tag.teal { background: #E0F7F4; color: #0F766E; }
.tag.pink { background: #FDE7F0; color: #9D174D; }
.tag.amber { background: #FFF6DB; color: #92400E; }
.opening-status { display: inline-flex; align-items: center; gap: 6px; margin-left: 4px; }
.inventory-report-toolbar { justify-content: flex-start; margin-bottom: 12px; }
.inventory-transfer-check {
  display: inline-flex; align-items: center; gap: 8px; min-height: 34px;
  margin-left: auto; padding: 6px 10px; border-left: 3px solid currentColor;
  border-radius: 4px; font-size: 13px; line-height: 1.35; font-variant-numeric: tabular-nums;
}
.inventory-transfer-check[hidden] { display: none; }
.inventory-transfer-check.is-success { color: #166534; background: #f0fdf4; }
.inventory-transfer-check.is-error { color: #b42318; background: #fff1f0; }
.inventory-transfer-check.is-empty { color: var(--text-sub); background: #f8fafc; }
.inventory-transfer-check-icon {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 20px;
  width: 20px; height: 20px; border: 2px solid currentColor; border-radius: 50%;
  font-size: 13px; font-weight: 800; line-height: 1;
}
@media (max-width: 1180px) {
  .inventory-transfer-check { flex-basis: 100%; margin-left: 0; }
}
.tag.purple { background: #EFEDFF; color: #5B21B6; }
.tenant-admin-table td { vertical-align: top; }
.tenant-org-list { max-width: 260px; line-height: 1.5; white-space: normal; }
.tenant-admin-note { margin-top: 12px; }
.saas-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:14px; margin-bottom:16px; }
.saas-panel, .saas-auth { background:#fff; border:1px solid var(--border); border-radius:8px; padding:18px; box-shadow:var(--shadow); }
.saas-panel h3, .saas-auth h3 { font-size:15px; margin-bottom:10px; }
.saas-panel p { margin-bottom:10px; line-height:1.7; }
.saas-inner-card { margin-top:14px; }
.saas-auth { max-width:460px; margin:30px auto; }
.guide-list { margin:0; padding-left:24px; line-height:2; color:var(--text-sub); }
.guide-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:12px; }
/* 设置页（充值与订阅） */
.settings-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:14px; margin-bottom:16px; }
.settings-panel { background:var(--card,#fff); border:1px solid var(--border); border-radius:10px; padding:18px; box-shadow:var(--shadow); }
.settings-panel h3 { font-size:15px; margin-bottom:10px; }
.settings-panel p { margin-bottom:10px; line-height:1.7; }
.guide-step { margin:0; box-shadow:none; border-radius:8px; }
.guide-step .card-head { background:#f8fafc; padding:10px 12px; }
.guide-step .card-title { font-size:14px; color:var(--primary-dark); }
.guide-step .card-body { color:var(--text-sub); line-height:1.8; padding:10px 12px; min-height:70px; }
@media (max-width:700px) { .guide-grid { grid-template-columns:1fr; } }

/* ===== 模态框 ===== */
.modal-mask {
  position: fixed; inset: 0; background: rgba(11, 46, 33, .45); z-index: 100;
  display: flex; align-items: flex-start; justify-content: center; padding: 60px 20px;
}
.modal {
  background: #fff; border-radius: 12px; width: 640px; max-width: 95vw; max-height: 82vh;
  overflow-y: auto; box-shadow: 0 20px 50px rgba(6, 78, 59, .24);
}
.modal.modal-lg {
  width: 960px; max-width: 98vw; max-height: 90vh;
}
.modal.modal-lg.voucher-modal {
  width: 1280px; max-width: calc(100vw - 48px); max-height: calc(100vh - 40px);
}
.voucher-modal .modal-body { padding: 24px 28px 20px; }
.voucher-modal .modal-head { padding: 18px 26px; }
.modal.modal-lg.voucher-detail-modal { width: 1180px; max-width: calc(100vw - 48px); }
.voucher-detail-table { min-width: 1040px; table-layout: fixed; }
.voucher-detail-table col.voucher-detail-subject { width: 120px; }
.voucher-detail-table col.voucher-detail-aux { width: 160px; }
.voucher-detail-table col.voucher-detail-summary { width: 220px; }
.voucher-detail-table col.voucher-detail-currency { width: 76px; }
.voucher-detail-table col.voucher-detail-original { width: 130px; }
.voucher-detail-table col.voucher-detail-rate { width: 105px; }
.voucher-detail-table col.voucher-detail-amount { width: 125px; }
.voucher-detail-currency-cell { text-align: center; font-weight: 600; }
.voucher-action-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 0 0 18px; border-bottom: 1px solid var(--border); }
.voucher-action-main, .voucher-action-links { display: flex; align-items: center; gap: 8px; }
.voucher-action-main .btn { min-width: 86px; }
.voucher-link-btn { border: 0; background: transparent; color: var(--primary); cursor: pointer; font-size: 14px; padding: 6px 8px; }
.voucher-link-btn:hover { background: #eef4ff; border-radius: 5px; }
.voucher-meta-row {
  display: grid; grid-template-columns: minmax(300px, 1.6fr) minmax(180px, 0.8fr) minmax(230px, 1fr);
  gap: 16px; align-items: center; padding: 2px 0 20px; border-bottom: 1px solid var(--border);
}
.voucher-meta-item { display: flex; align-items: center; gap: 10px; min-width: 0; }
.voucher-meta-item label { color: var(--text-sub); white-space: nowrap; }
.voucher-meta-item .input { flex: 1; min-width: 0; }
.voucher-number-controls { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.voucher-number-controls select { width: 64px; flex: 0 0 64px; }
.voucher-number-controls input { min-width: 0; flex: 1; }
.voucher-number-controls span { color: var(--text-sub); white-space: nowrap; }
.voucher-meta-value { flex: 1; min-width: 0; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; background: #f8fafc; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voucher-attachments { margin-top: 10px; }
.voucher-attachment-title { color: var(--text-sub); font-size: 12px; margin-bottom: 6px; }
.voucher-attachment-list { display: flex; flex-wrap: wrap; gap: 6px; }
.voucher-attachment-chip { display: inline-flex; align-items: center; gap: 5px; max-width: 300px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 5px; background: #f8fafc; font-size: 12px; }
.voucher-attachment-chip a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--primary); }
.voucher-attachment-chip button { border: 0; background: transparent; color: var(--danger); cursor: pointer; font-size: 16px; line-height: 1; }
.voucher-attachment-chip.pending { color: var(--text-sub); }
.voucher-attachment-chip em { font-style: normal; color: var(--warning); font-size: 11px; }
.voucher-lines-head { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 8px; font-size: 15px; }
.voucher-table-wrap { overflow-x: auto; }
.voucher-form-table { min-width: 1080px; table-layout: fixed; }
.voucher-form-table th { padding: 11px 10px; }
.voucher-form-table td { padding: 9px 8px; }
.voucher-form-table .voucher-line-no { text-align: center; color: var(--text-sub); font-variant-numeric: tabular-nums; }
.voucher-form-table .input { width: 100%; box-sizing: border-box; }
.voucher-modal .modal-foot { padding: 15px 26px; }
.voucher-maker { display: flex; align-items: center; gap: 4px; margin-top: 16px; color: var(--text-sub); font-size: 13px; }
.voucher-maker-icon { color: var(--primary); font-size: 18px; }
.voucher-maker .input { width: 120px; padding: 4px 7px; }
.voucher-inline-page { margin-top: 0; }
.voucher-inline-page > .card-head { position: relative; justify-content: center; padding: 12px 16px; }
.voucher-inline-page > .card-head > button { position: absolute; right: 16px; }
.voucher-inline-page > .card-head .voucher-action-bar { position: absolute; left: 16px; right: 16px; top: 50%; transform: translateY(-50%); width: auto; display: flex; align-items: center; gap: 10px; padding: 0; border: 0; }
.voucher-inline-page > .card-head .voucher-action-main { display: flex; align-items: center; gap: 8px; }
.voucher-inline-page > .card-head .voucher-action-links { display: flex; position: absolute; right: 0; top: 50%; transform: translateY(-50%); }
.voucher-inline-page > .card-head .voucher-action-main .btn { padding: 7px 14px; }
.voucher-inline-page > .card-body { padding: 18px 20px 20px; }
.voucher-inline-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
@media (max-width: 720px) {
  .modal.modal-lg.voucher-modal { width: 96vw; max-width: 96vw; max-height: calc(100vh - 24px); }
  .voucher-modal .modal-body { padding: 18px 14px 14px; }
  .voucher-modal .modal-head { padding: 15px 16px; }
  .voucher-meta-row { display: flex; flex-direction: column; align-items: stretch; gap: 10px; padding-bottom: 14px; }
  .voucher-action-bar { align-items: stretch; flex-direction: column; gap: 8px; }
  .voucher-action-main, .voucher-action-links { justify-content: flex-start; flex-wrap: wrap; }
  .voucher-number-controls input { min-width: 0; }
  .voucher-lines-head { margin-top: 14px; }
  .voucher-inline-page > .card-head { min-height: 48px; }
  .voucher-inline-page > .card-head .voucher-action-bar { position: static; transform: none; }
  .voucher-inline-page > .card-head .voucher-action-links { display: flex; position: static; transform: none; margin-left: 0; }
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close { cursor: pointer; font-size: 18px; color: var(--text-sub); background: none; border: none; }
.modal-body { padding: 18px 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.modal.tax-target-sales-modal { width: min(860px, calc(100vw - 40px)); max-width: calc(100vw - 40px); max-height: calc(100vh - 40px); }
.tax-target-sales-modal .modal-body { padding: 20px 24px 12px; }
.tax-target-sales-editor { min-width: 0; }
.tax-target-sales-editor .tax-modal-note { margin-bottom: 14px; line-height: 1.6; }
.tax-target-sales-editor .table-wrap { overflow-x: auto; }

/* ===== 编辑弹窗表格：4 列布局（销售额 / 净利润） ===== */
/* 列宽：公司主体 28% · 期间 8% · 数据列 32% × 2 ；input 限宽 160px 容纳 8 位数 + 小数 */
.tax-target-sales-editor .tax-table { width: 100%; min-width: 0; table-layout: fixed; }
.tax-target-sales-editor .tax-table th { vertical-align: middle; }
.tax-target-sales-editor .tax-table td { vertical-align: top; padding-top: 14px; }
.tax-target-sales-editor .tax-table:not(.tax-target-gross-profit-editor-table) th:nth-child(1),
.tax-target-sales-editor .tax-table:not(.tax-target-gross-profit-editor-table) td:nth-child(1) {
  width: 28%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tax-target-sales-editor .tax-table:not(.tax-target-gross-profit-editor-table) th:nth-child(2),
.tax-target-sales-editor .tax-table:not(.tax-target-gross-profit-editor-table) td:nth-child(2) {
  width: 8%; text-align: center; white-space: nowrap;
}
.tax-target-sales-editor .tax-table:not(.tax-target-gross-profit-editor-table) th:nth-child(n + 3),
.tax-target-sales-editor .tax-table:not(.tax-target-gross-profit-editor-table) td:nth-child(n + 3) { width: 32%; }
.tax-target-sales-editor .tax-table:not(.tax-target-gross-profit-editor-table) td:nth-child(n + 3) .input {
  display: block; width: 100%; max-width: 160px; margin-left: auto; height: 34px; box-sizing: border-box;
  text-align: right; font-variant-numeric: tabular-nums; font-weight: 600;
}

/* ===== 编辑弹窗表格：6 列布局（毛利润 / 毛利率） ===== */
/* 列宽：公司主体 22% · 期间 8% · 数据列 17.5% × 4 ；input 限宽 130px */
.tax-target-sales-editor .tax-target-gross-profit-editor-table th:nth-child(1),
.tax-target-sales-editor .tax-target-gross-profit-editor-table td:nth-child(1) {
  width: 22%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tax-target-sales-editor .tax-target-gross-profit-editor-table th:nth-child(2),
.tax-target-sales-editor .tax-target-gross-profit-editor-table td:nth-child(2) {
  width: 8%; text-align: center; white-space: nowrap;
}
.tax-target-sales-editor .tax-target-gross-profit-editor-table th:nth-child(3),
.tax-target-sales-editor .tax-target-gross-profit-editor-table td:nth-child(3),
.tax-target-sales-editor .tax-target-gross-profit-editor-table th:nth-child(4),
.tax-target-sales-editor .tax-target-gross-profit-editor-table td:nth-child(4),
.tax-target-sales-editor .tax-target-gross-profit-editor-table th:nth-child(5),
.tax-target-sales-editor .tax-target-gross-profit-editor-table td:nth-child(5),
.tax-target-sales-editor .tax-target-gross-profit-editor-table th:nth-child(6),
.tax-target-sales-editor .tax-target-gross-profit-editor-table td:nth-child(6) { width: 17.5%; }
.tax-target-sales-editor .tax-target-gross-profit-editor-table td .input {
  display: block; width: 100%; max-width: 130px; margin-left: auto; height: 34px; box-sizing: border-box;
  text-align: right; font-variant-numeric: tabular-nums; font-weight: 600;
}

/* 特殊场景：带 % 单位的输入框保持窄 */
.tax-target-sales-editor .tax-table td:has(.tax-inline-input-unit) { white-space: nowrap; }
.tax-target-sales-editor .tax-table td:has(.tax-inline-input-unit) .input { width: 64px; flex: 0 0 64px; max-width: 64px; }
.tax-target-sales-editor .tax-inline-input-unit { display: inline-block; width: 20px; margin-left: 4px; color: var(--text-sub); text-align: left; }

/* input placeholder 右对齐 + 视觉降级（与实际数字位置一致，避免"未配置"行视觉错位） */
.tax-target-sales-editor .tax-table .input::placeholder,
.tax-target-sales-editor .tax-table .input::-webkit-input-placeholder,
.tax-target-sales-editor .tax-table .input::-moz-placeholder,
.tax-target-sales-editor .tax-table .input:-ms-input-placeholder {
  text-align: right !important;
  color: rgba(92, 122, 108, .55) !important;
  font-weight: 400 !important;
  font-style: normal !important;
  opacity: 1 !important;
}
.tax-target-sales-editor .tax-table .input:focus::placeholder,
.tax-target-sales-editor .tax-table .input:focus::-webkit-input-placeholder,
.tax-target-sales-editor .tax-table .input:focus::-moz-placeholder,
.tax-target-sales-editor .tax-table .input:focus:-ms-input-placeholder {
  color: rgba(92, 122, 108, .35) !important;
}
.tax-project-form input[type="number"],
.tax-modal-amount-input {
  width: 92px !important;
  min-width: 92px !important;
  height: 34px;
  text-align: right;
}
@media (max-width: 720px) {
  .modal.tax-target-sales-modal { width: calc(100vw - 24px); max-width: calc(100vw - 24px); max-height: calc(100vh - 24px); }
  .tax-target-sales-modal .modal-body { padding: 16px 14px 10px; }
  .tax-target-sales-editor .tax-table { min-width: 940px; }
}
.contract-template-modal { width: 1080px; max-width: calc(100vw - 48px); max-height: calc(100vh - 40px); }
.contract-template-modal .modal-head { position: sticky; top: 0; z-index: 2; background: #fff; }
.contract-template-modal .modal-body { padding: 20px 26px 8px; }
.contract-template-modal .modal-foot { position: sticky; bottom: 0; z-index: 2; background: #fff; }
.contract-template-note { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-left: 3px solid var(--primary); background: #f6f8ff; color: var(--text-sub); font-size: 13px; }
.contract-template-note strong { color: var(--primary-dark); white-space: nowrap; }
.contract-template-section { padding: 18px 0; border-bottom: 1px solid var(--border); }
.contract-template-section:last-child { border-bottom: 0; }
.contract-template-section h3 { margin: 0 0 12px; font-size: 14px; }
.contract-section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.contract-section-title h3 { margin: 0; }
.contract-section-title span { color: var(--text-sub); font-size: 12px; }
.contract-basic-grid { display: grid; grid-template-columns: max-content minmax(180px, 1fr) max-content minmax(180px, 1fr); align-items: center; gap: 10px 12px; }
.contract-basic-grid label { color: var(--text-sub); text-align: right; white-space: nowrap; }
.contract-basic-grid .input { width: 100%; box-sizing: border-box; resize: vertical; }
.contract-variable-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 10px; }
.contract-variable-grid.product-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.contract-variable-option { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px; background: #fff; cursor: pointer; }
.contract-variable-option:hover { border-color: #b9c6f8; background: #f8faff; }
.contract-variable-option input { width: 16px; height: 16px; accent-color: var(--primary); flex: 0 0 auto; }
.contract-variable-option span { min-width: 0; overflow-wrap: anywhere; }
.contract-clause-list { display: grid; gap: 12px; }
.contract-clause-item { padding: 12px; border: 1px solid var(--border); border-radius: 6px; background: #fafbfe; }
.contract-clause-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; color: var(--text-sub); font-size: 12px; font-weight: 600; }
.contract-clause-item .input { width: 100%; box-sizing: border-box; }
.contract-clause-title { margin-bottom: 8px; font-weight: 600; }
.contract-clause-content { min-height: 104px; resize: vertical; line-height: 1.55; }
@media (max-width: 760px) {
  .contract-template-modal { width: 96vw; max-width: 96vw; max-height: calc(100vh - 24px); }
  .contract-template-modal .modal-body { padding: 16px 14px 6px; }
  .contract-template-note { align-items: flex-start; flex-direction: column; gap: 4px; }
  .contract-basic-grid { grid-template-columns: max-content minmax(0, 1fr); }
  .contract-basic-grid > span { display: none; }
  .contract-variable-grid, .contract-variable-grid.product-columns { grid-template-columns: 1fr; }
  .contract-section-title { align-items: flex-start; flex-direction: column; }
}
.finance-account-modal { width: 900px; max-width: 94vw; max-height: 88vh; }
.finance-account-modal .modal-body { padding: 24px 28px 18px; }
.finance-account-modal .form-row { display: grid; grid-template-columns: max-content minmax(150px, 1fr) max-content minmax(150px, 1fr); align-items: center; column-gap: 12px; row-gap: 8px; margin-bottom: 14px; }
.finance-account-modal .form-row label { text-align: right; }
.finance-account-modal .form-row .input { width: 100%; box-sizing: border-box; }
.finance-account-modal .form-row:has(> :only-child),
.finance-account-modal .form-row:has(> label:only-child) { display: block; }
@media (max-width: 720px) {
  .finance-account-modal { width: 96vw; max-height: 90vh; }
  .finance-account-modal .modal-body { padding: 18px 16px 12px; }
  .finance-account-modal .form-row { grid-template-columns: max-content minmax(120px, 1fr); }
  .finance-account-modal .form-row label:nth-of-type(2) { grid-column: 1; }
.finance-account-modal .form-row label:nth-of-type(2) + * { grid-column: 2; }
}
.finance-flow-modal { width: 980px; max-width: 96vw; max-height: 90vh; }
.finance-flow-modal .modal-body { padding: 22px 28px 16px; }
.flow-form-grid { display: grid; grid-template-columns: max-content minmax(180px, 1fr) max-content minmax(180px, 1fr); align-items: center; gap: 12px 14px; }
.flow-form-grid label { text-align: right; color: var(--text-sub); white-space: nowrap; }
.flow-form-grid .input { width: 100%; box-sizing: border-box; }
.flow-form-grid .flow-note { min-height: 70px; resize: vertical; grid-column: 2 / -1; }
.finance-flow-table { min-width: 1480px; }
.third-party-flow-table { min-width: 2100px; }
.finance-flow-table th, .finance-flow-table td { white-space: nowrap; }
.finance-flow-table .flow-actions { display: flex; gap: 6px; }
.finance-flow-table .flow-select-cell { width: 34px; min-width: 34px; text-align: center; padding-left: 5px; padding-right: 5px; }
.finance-flow-table .flow-select-cell input { width: 15px; height: 15px; vertical-align: middle; }
.finance-flow-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; padding: 4px 0 6px; }
.finance-flow-toolbar label { color: var(--text-sub); font-size: 13px; }
.finance-flow-summary { width: min(100%, 760px); margin: 8px 0 10px; border: 1px solid var(--border); background: var(--surface-muted, #fafafa); }
.finance-flow-summary-title { padding: 7px 10px; color: var(--text-main); font-size: 13px; font-weight: 600; border-bottom: 1px solid var(--border); }
.finance-flow-summary .table-wrap { overflow-x: visible; }
.finance-flow-summary-table { width: 100%; min-width: 0; table-layout: fixed; }
.finance-flow-summary-table th, .finance-flow-summary-table td { padding: 6px 10px; white-space: nowrap; }
.finance-flow-summary-table th:first-child, .finance-flow-summary-table td:first-child { width: 90px; text-align: left; }
.finance-flow-summary-table th:not(:first-child), .finance-flow-summary-table td:not(:first-child) { text-align: right; }
.finance-reconciliation { margin: 10px 0 14px; padding: 12px 14px; border: 1px solid #cbd5e1; border-left: 4px solid #64748b; background: #f8fafc; }
.finance-reconciliation.is-ok { border-left-color: #16a34a; background: #f0fdf4; }
.finance-reconciliation.is-error { border-left-color: #dc2626; background: #fff7f7; }
.finance-reconciliation-error { color: #b42318; }
.finance-reconciliation-head { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.finance-reconciliation-hint { color: #64748b; font-size: 12px; }
.finance-reconciliation-grid { display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)); gap: 8px 18px; }
.finance-reconciliation-grid > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 26px; }
.finance-reconciliation-grid span:first-child { color: #475569; }
.finance-reconciliation-grid b { color: #0f172a; font-weight: 600; text-align: right; }
@media (max-width: 900px) { .finance-reconciliation-grid { grid-template-columns: 1fr; } }
.required-mark { color: var(--danger); margin-left: 2px; }
.finance-posting-hint { display: inline-flex; align-items: center; min-height: 30px; padding: 0 10px; border: 1px solid #bfdbfe; border-radius: 6px; color: #1d4ed8; background: #eff6ff; font-size: 12px; white-space: nowrap; }
.receipt-statement-box { width: 520px; height: 190px; box-sizing: border-box; margin: 0 0 6px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; background: #fafbff; overflow: auto; }
.receipt-statement-box.collapsed { height: 52px; overflow: hidden; }
.receipt-statement-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 28px; flex-wrap: nowrap; }
.receipt-statement-head strong { color: var(--text-main); }
.receipt-statement-body { margin-top: 4px; }
.receipt-upload-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.receipt-file-input { flex: 1; min-width: 0; font-size: 12px; padding: 5px 6px; }
.receipt-upload-row .input:disabled { cursor: not-allowed; opacity: .55; }
.receipt-hint { color: var(--text-sub); font-size: 11px; margin-bottom: 8px; }
.receipt-files { display: flex; flex-direction: column; gap: 8px; }
.receipt-file-card { border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; background: #fff; font-size: 12px; }
.receipt-file-main { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.receipt-file-main a { color: var(--primary); text-decoration: none; font-weight: 500; word-break: break-all; }
.receipt-file-main a:hover { text-decoration: underline; }
.receipt-file-main span { color: var(--text-sub); white-space: nowrap; }
.receipt-file-actions { display: flex; gap: 5px; }
.receipt-file-actions a { text-decoration: none; }
.receipt-empty { color: var(--text-sub); }
.finance-flow-table th { padding-top: 7px; padding-bottom: 7px; }
.finance-flow-table td { padding-top: 6px; padding-bottom: 6px; }
.manual-voucher-flow-modal { width: 760px; max-width: 96vw; }
.manual-voucher-flow-modal .alert { margin-bottom: 14px; }
.voucher-flow-form-grid .flow-note { min-height: 70px; }
@media (max-width: 760px) {
  .receipt-statement-box { width: 100%; height: 190px; }
  .receipt-upload-row { flex-wrap: wrap; }
  .receipt-file-input { width: 100%; }
}
@media (max-width: 720px) {
  .finance-flow-modal { width: 96vw; }
  .finance-flow-modal .modal-body { padding: 18px 16px 12px; }
  .flow-form-grid { grid-template-columns: max-content minmax(120px, 1fr); }
  .flow-form-grid label { text-align: right; }
  .flow-form-grid .flow-note { grid-column: 2; }
}

/* ===== 提示 ===== */
.toast-wrap { position: fixed; top: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #fff; border-radius: 8px; box-shadow: 0 4px 16px rgba(6, 78, 59, .16);
  padding: 11px 16px; font-size: 13px; display: flex; align-items: center; gap: 8px;
  border-left: 4px solid var(--primary); animation: slideIn .25s ease;
  max-width: 480px; word-break: break-all;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

@media print {
  body > * { display: none !important; }
  #modalMask { display: block !important; position: static !important; padding: 0 !important; background: #fff !important; }
  #modalBox { display: block !important; width: 100% !important; max-width: none !important; max-height: none !important; overflow: visible !important; box-shadow: none !important; }
  #modalBox .modal-close, #modalBox .modal-foot, #modalBox .voucher-action-bar,
  #modalBox .voucher-attachment-chip button { display: none !important; }
}

.empty { text-align: center; color: var(--text-sub); padding: 40px 0; font-size: 13px; }
.loading { text-align: center; color: var(--text-sub); padding: 60px 0; }

/* ===== 子选项卡 ===== */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.tab {
  padding: 8px 16px; cursor: pointer; font-size: 13px; color: var(--text-sub);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.report-drill-link { border: 0; padding: 0; background: transparent; color: var(--primary); cursor: pointer; font: inherit; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 2px; }
.report-drill-link:hover { color: var(--primary-dark, #1d4ed8); text-decoration-style: solid; }
.voucher-drill-link { font-weight: 600; }
.ledger-drill-notice { display: flex; align-items: center; gap: 14px; margin: 0 0 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--primary-light); color: var(--text-sub); font-size: 12px; }
.ledger-drill-notice b { color: var(--primary-dark); }
.ledger-drill-notice .btn { margin-left: auto; }
.consolidated-management-wrap { max-width: 100%; }
.consolidated-management-table { min-width: max-content; }
.consolidated-management-table .consolidated-book-head { background: #eaf1fb; color: #1f2937; white-space: nowrap; }
.consolidated-management-table .consolidated-item-col { width: 220px; }
.consolidated-management-table .consolidated-line-col { width: 54px; }
.consolidated-management-table .consolidated-amount-col,
.consolidated-management-table .consolidated-total-col { width: 116px; }
.consolidated-income-management-wrap { width: 100%; max-width: 100%; margin: 0 auto; }
.consolidated-income-management-table { table-layout: fixed; }
.consolidated-income-management-table .consolidated-book-head {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

/* 资产负债表（金蝶常用版式） */
.balance-sheet-card { max-width: 1280px; margin-left: auto; margin-right: auto; }
.balance-sheet-card .card-body { position: relative; padding: 14px 16px 16px; }
.bs-report-head { position: relative; margin-bottom: 10px; text-align: center; }
.bs-report-head h2 { margin: 0; font-size: 22px; line-height: 1.3; font-weight: 700; letter-spacing: 0; color: var(--text); }
.bs-report-date { margin-top: 3px; font-size: 13px; color: var(--text-sub); font-variant-numeric: tabular-nums; }
.bs-report-meta { display: flex; justify-content: space-between; gap: 16px; margin-top: 8px; text-align: left; font-size: 12px; color: var(--text-sub); }
.tax-plan-report-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.tax-plan-report-actions .btn { white-space: nowrap; }
.bs-table-wrap { border: 1px solid var(--border); }
.kingdee-bs-table { min-width: 960px; border-collapse: collapse; table-layout: fixed; font-size: 12px; }
.kingdee-bs-table .bs-item-col { width: 20%; }
.kingdee-bs-table .bs-line-col { width: 5%; }
.kingdee-bs-table .bs-amount-col { width: 12.5%; }
.kingdee-bs-table th { background: var(--primary-light); color: var(--primary-dark); border: 1px solid var(--border); padding: 6px 5px; font-weight: 700; }
.kingdee-bs-table td { height: 26px; border: 1px solid var(--border); padding: 4px 6px; background: var(--card); }
.kingdee-bs-table tr:hover td { background: inherit; }
.kingdee-bs-table .bs-line-no { text-align: center; color: var(--text-sub); font-variant-numeric: tabular-nums; }
.kingdee-bs-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.kingdee-bs-table .bs-row-section { background: var(--primary-light); color: var(--primary-dark); font-weight: 700; }
.kingdee-bs-table .bs-row-subtotal { background: var(--card); font-weight: 700; }
.kingdee-bs-table .bs-row-total { background: var(--primary-light); color: var(--text); font-weight: 800; border-top: 2px solid var(--primary); }
.kingdee-bs-table .bs-row-deduction { color: var(--text-sub); }
.kingdee-bs-table .bs-row-spacer { background: var(--card); }
.bs-trial-status { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 12px; border: 1px solid; border-radius: 6px; font-size: 13px; }
.bs-trial-status.is-balanced { color: #166534; border-color: #86c99a; background: #f0fdf4; }
.bs-trial-status.is-unbalanced { color: #b42318; border-color: #f1a7a0; background: #fff1f0; }
.bs-trial-status > div { display: flex; align-items: baseline; gap: 10px; min-width: 0; flex-wrap: wrap; }
.bs-trial-status b { font-size: 14px; }
.bs-trial-status span { font-variant-numeric: tabular-nums; }
.bs-trial-icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 22px; width: 22px; height: 22px; border: 2px solid currentColor; border-radius: 50%; font-weight: 800; }
.bs-trial-difference { margin-left: auto; white-space: nowrap; font-weight: 700; }
.bs-ratio-summary {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-top: 10px;
  padding: 9px 14px;
  border: 1px solid #dbe4f2;
  border-radius: 6px;
  background: #f7faff;
  color: var(--text-sub);
  font-size: 13px;
}
.bs-ratio-summary span { display: inline-flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.bs-ratio-summary b { color: var(--text); font-weight: 600; }
.bs-ratio-summary strong { color: var(--primary-dark); font-variant-numeric: tabular-nums; }
.bs-ratio-summary small { flex-basis: 100%; color: var(--text-sub); font-size: 11px; line-height: 1.4; }
.bs-ratio-summary-multi { flex-wrap: wrap; gap: 10px 28px; }
.consolidation-scope-option { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.consolidation-scope-list { display: grid; grid-template-columns: repeat(2, minmax(220px, 1fr)); gap: 8px; }
@media (max-width: 760px) {
  .bs-ratio-summary { align-items: flex-start; flex-direction: column; gap: 6px; }
  .bs-ratio-summary-multi { flex-direction: row; }
  .consolidation-scope-list { grid-template-columns: 1fr; }
}
.bs-multi-table { width: max-content; min-width: 1100px; }
table.bs-management-table { width: max-content; min-width: 650px; margin: 0; }
.bs-management-table { width: 100%; min-width: 720px; table-layout: fixed; }
.bs-management-table .bs-management-item-col { width: 32%; }
.bs-management-table .bs-management-line-col { width: 50px; }
.bs-management-table .bs-management-amount-col { width: 18%; }
.bs-management-table .bs-management-ratio-col { width: 70px; }
.bs-management-table .bs-management-ratio-col,
.bs-management-table th.bs-management-ratio-head,
.bs-management-table td.bs-ratio-cell { background: var(--primary-light); }
.bs-management-table .bs-ratio-cell { color: var(--text-sub); }
.bs-management-table tr:hover td.bs-ratio-cell { background: var(--primary-light); }
/* 利润表与资产负债表共用同一套报表视觉规范 */
.income-statement-card { max-width: 900px; }
.income-statement-table { width: 100%; min-width: 720px; }
.income-statement-table .is-item-col { width: 52%; }
.income-statement-table .is-line-col { width: 8%; }
.income-statement-table .is-amount-col { width: 20%; }
.income-statement-table .is-ratio-col { width: 10%; }
.income-statement-table:has(.is-ratio-col) .is-item-col { width: 42%; }
.income-statement-table:has(.is-ratio-col) .is-line-col { width: 8%; }
.income-statement-table:has(.is-ratio-col) .is-amount-col { width: 16%; }
.income-statement-table td:first-child { white-space: normal; line-height: 1.35; }
.income-statement-multi-card { max-width: 1280px; }
.income-statement-multi-table { width: max-content; min-width: 900px; }
.income-statement-multi-table .is-item-col { width: 360px; }
.income-statement-multi-table .is-line-col { width: 56px; }
.income-statement-multi-table .is-amount-col { width: 132px; }
.income-statement-multi-table .is-ratio-col { width: 70px; }
.income-statement-multi-table th.bs-management-ratio-head,
.income-statement-multi-table td.bs-ratio-cell { background: var(--primary-light); }
.income-statement-multi-table .bs-ratio-cell { color: var(--text-sub); }
.income-statement-multi-table tr:hover td.bs-ratio-cell { background: var(--primary-light); }
.tax-plan-report-card { max-width: 1040px; }
.tax-plan-source-note { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; padding: 8px 10px; border: 1px solid #b9d7c1; background: #f1fbf4; color: #25633a; font-size: 12px; }
.tax-plan-source-note b { font-size: 13px; }
.tax-plan-source-note.planned { border-color: #e4bf72; background: #fff8e8; color: #925d00; }
.tax-plan-projection-card .kingdee-bs-table th { background: #fff1cf; }
.tax-plan-projection-card .kingdee-bs-table td.bs-ratio-cell { background: #fff9eb; }
.tax-plan-projection-card .bs-trial-status { border-color: #e4bf72; background: #fff8e8; }
.tax-plan-income-table { min-width: 900px; }
.tax-plan-period-bar { align-items: center; gap: 8px; margin-bottom: 16px; }
.tax-plan-period-hint { color: var(--text-muted); font-size: 12px; margin-right: auto; white-space: nowrap; }
.tax-plan-validation-status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 9px;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  background: #f8fafc;
  color: #475467;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.tax-plan-validation-status.is-ok { border-color: #9bc8a7; background: #eef9f1; color: #216e39; }
.tax-plan-validation-status.is-error { border-color: #efb4b4; background: #fff1f1; color: #b42318; }
.tax-plan-validation-status.is-pending,
.tax-plan-validation-status.is-empty { border-color: #d0d5dd; background: #f8fafc; color: #667085; }
.tax-plan-multi-card { width: 100%; max-width: none; }
.tax-plan-multi-table-wrap { width: 100%; overflow-x: auto; }
.tax-plan-multi-table { width: max-content; min-width: 860px; margin: 0; table-layout: fixed; }
.tax-plan-multi-table .bs-management-item-col { width: 260px; }
.tax-plan-multi-table .bs-management-line-col { width: 56px; }
.tax-plan-multi-table .bs-management-amount-col { width: 126px; }
.tax-plan-multi-table .bs-management-ratio-col { width: 70px; }
.tax-plan-multi-table .is-item-col { width: 340px; }
.tax-plan-multi-table .is-line-col { width: 56px; }
.tax-plan-multi-table .is-amount-col { width: 126px; }
.tax-plan-multi-table .is-ratio-col { width: 70px; }
.tax-plan-multi-table th,
.tax-plan-multi-table td { white-space: nowrap; }
.tax-plan-multi-table th:first-child,
.tax-plan-multi-table td:first-child { white-space: normal; overflow-wrap: anywhere; }
.tax-plan-multi-table .bs-ratio-cell,
.tax-plan-multi-table th.bs-management-ratio-head { background: #eef4ff; color: #475467; }
.tax-plan-multi-table tr:hover td.bs-ratio-cell { background: #e5efff; }
.tax-plan-row-label { display: inline-flex; align-items: center; min-width: 0; }
.tax-plan-row-label > span { min-width: 0; overflow-wrap: anywhere; }
.tax-plan-row-action {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; margin: 0 5px 0 -2px; padding: 0;
  border: 1px solid #a9dcc7; border-radius: 3px; background: #edf9f3;
  color: #087a57; cursor: pointer; font-size: 14px; font-weight: 700; line-height: 1;
  flex: 0 0 auto;
}
.tax-plan-row-action.is-add { margin-left: -2px; }
.tax-plan-row-action.is-remove { border-color: #f5c6d2; background: #fdf3f5; color: #b4234d; }
.tax-plan-row-action:disabled { border-color: #d0d5dd; background:#f2f4f7; color:#98a2b3; cursor:not-allowed; opacity:.8; }
.tax-plan-row-action:hover { border-color: var(--primary); background: var(--primary-light); color: var(--primary-dark); }
.tax-plan-row-action:disabled:hover { border-color:#d0d5dd; background:#f2f4f7; color:#98a2b3; }
.tax-plan-expand-row { flex: 0 0 auto; font-size: 11px; }
.tax-plan-subject-row-form { display: grid; gap: 9px; }
.tax-plan-subject-row-form label { color: var(--text-sub); font-size: 13px; }
.tax-plan-subject-row-form .tax-plan-import-file-note { margin: 3px 0 0; }
.tax-plan-adjustment-input {
  width: 100%;
  min-width: 0;
  height: 26px;
  padding: 2px 5px;
  border: 1px solid #98a2b3;
  background: #fff;
  color: #172b4d;
  font: inherit;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.tax-plan-adjustment-input:focus { border-color: #2563eb; outline: 2px solid rgba(37, 99, 235, 0.16); outline-offset: 0; }
.tax-plan-planning-input {
  width: 100%;
  min-width: 0;
  height: 26px;
  padding: 2px 5px;
  border: 1px solid #98a2b3;
  background: #fff;
  color: #172b4d;
  font: inherit;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.tax-plan-planning-input:focus { border-color: #2563eb; outline: 2px solid rgba(37, 99, 235, 0.16); outline-offset: 0; }
.tax-plan-planning-input[readonly], .tax-plan-planning-input:disabled { background: #f2f4f7; color: #667085; cursor: not-allowed; }
.tax-plan-period-head { min-width: 196px; text-align: center; vertical-align: middle; }
.tax-plan-period-head span { display: block; font-weight: 700; }
.tax-plan-period-head small { display: block; margin-top: 3px; font-size: 11px; font-weight: 500; color: #667085; }
.tax-plan-period-head.actual { background: #eaf3ff; color: #1d4f91; }
.tax-plan-period-head.manual { background: #f0ecff; color: #5b3c9d; }
.tax-plan-period-head.planned { background: #fff1cf; color: #925d00; }
.tax-plan-period-head.missing { background: #f2f4f7; color: #667085; }
.tax-plan-period-head.total { background: #dce9f8; color: #172b4d; }
.tax-plan-source-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px; border: 1px solid #b9d7c1; background: #f1fbf4; color: #25633a; white-space: nowrap; }
.tax-plan-source-chip.actual { border-color: #b7d2f4; background: #eef6ff; color: #1d4f91; }
.tax-plan-source-chip.planned { border-color: #e4bf72; background: #fff8e8; color: #925d00; }
.tax-plan-source-chip.manual { border-color: #c9b9f4; background: #f5f1ff; color: #5b3c9d; }
.tax-plan-source-chip.missing { border-color: #d0d5dd; background: #f8fafc; color: #667085; }
.tax-plan-source-chip.template { border-color: #cbd5e1; background: #f8fafc; color: #64748b; }
.tax-plan-source-description { color: #667085; margin-left: auto; }
.tax-plan-actual-cell { background: #fbfdff; }
.tax-plan-manual-cell { background: #fcfaff; }
.tax-plan-planned-cell { background: #fffdf8; }
.tax-plan-missing-cell { color: #98a2b3; background: #f8fafc; }
.tax-plan-template-cell { color: #667085; background: #f8fafc; }
.tax-plan-total-cell { background: #f1f6fc; font-weight: 600; }
.tax-plan-tax-metric-row td { background: #f7fafc; border-top-color: #c7d2e0; }
.tax-plan-tax-metric-row td:first-child { font-weight: 600; color: #1f3b5b; }
.tax-plan-tax-metric-row td.tax-plan-total-cell { background: #eaf1f8; }
.tax-plan-pending-card { max-width: none; }
.tax-plan-import-modal { width: min(560px, calc(100vw - 32px)); }
.tax-plan-import-intro, .tax-plan-import-file-note { color: #667085; font-size: 13px; line-height: 1.6; margin-bottom: 14px; }
.tax-plan-import-nature { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.tax-plan-import-nature label { display: flex; align-items: flex-start; gap: 9px; padding: 12px; border: 1px solid #d0d5dd; background: #fff; cursor: pointer; }
.tax-plan-import-nature label:has(input:checked) { border-color: var(--primary); background: var(--primary-light); box-shadow: 0 0 0 2px var(--primary-ring); }
.tax-plan-import-nature input { margin-top: 3px; accent-color: var(--primary); }
.tax-plan-import-nature b, .tax-plan-import-nature small { display: block; }
.tax-plan-import-nature small { margin-top: 3px; color: #667085; font-size: 12px; line-height: 1.45; }
.tax-plan-import-options { display: grid; gap: 10px; }
.tax-plan-import-option { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; border: 1px solid #d0d5dd; background: #fff; text-align: left; cursor: pointer; color: #172b4d; }
.tax-plan-import-option:hover { border-color: #5b8def; background: #f7faff; }
.tax-plan-import-option-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 6px; background: #eaf3ff; color: #1d4f91; font-weight: 700; }
.tax-plan-import-option:nth-child(2) .tax-plan-import-option-icon { background: #fff1cf; color: #925d00; }
.tax-plan-import-option:nth-child(3) .tax-plan-import-option-icon { background: #f0ecff; color: #5b3c9d; }
.tax-plan-import-option b, .tax-plan-import-option small { display: block; }
.tax-plan-import-option small { margin-top: 3px; color: #667085; font-size: 12px; }
.tax-plan-import-option-arrow { margin-left: auto; font-size: 22px; color: #98a2b3; }
.tax-plan-import-file-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tax-plan-file-picker { cursor: pointer; }
.tax-plan-import-file-name { margin-top: 12px; padding: 9px 10px; background: #f8fafc; color: #475467; font-size: 12px; }
.tax-plan-source-note.pending { border-color: #d0d5dd; background: #f8fafc; color: #475467; margin: 0; }
@media (max-width: 900px) {
  .tax-plan-period-bar { align-items: flex-start; }
  .tax-plan-period-hint { width: 100%; white-space: normal; margin-right: 0; }
  .tax-plan-validation-status { max-width: 100%; white-space: normal; }
  .tax-plan-source-note { align-items: flex-start; flex-wrap: wrap; }
  .tax-plan-source-description { width: 100%; margin-left: 0; }
}
.report-signatures { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding: 10px 4px 0; color: #334155; font-size: 12px; }
.balance-sheet-card.report-sheet-card {
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}
/* 仅管理报表的连续多期利润表占满报表区域；申报表维持原有版心和边距。 */
#repBody .management-balance-sheet-multi-card,
#repBody .management-income-statement-multi-card { width: 100%; max-width: none; margin-left: 0; margin-right: 0; }
#repBody .management-balance-sheet-multi-card .card-body,
#repBody .management-income-statement-multi-card .card-body { padding-left: 8px; padding-right: 8px; }
#repBody .management-income-statement-multi-card .income-statement-multi-table { min-width: max-content; table-layout: fixed; }
#repBody .management-income-statement-multi-card .income-statement-multi-table th,
#repBody .management-income-statement-multi-card .income-statement-multi-table td { white-space: nowrap; }
#repBody .management-income-statement-multi-card .income-statement-multi-table th:first-child,
#repBody .management-income-statement-multi-card .income-statement-multi-table td:first-child { white-space: normal; overflow-wrap: anywhere; }
.report-row-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; margin: 0 6px 0 -4px; padding: 0;
  border: 1px solid var(--border); border-radius: 3px; background: var(--card);
  color: var(--primary-dark); cursor: pointer; font-size: 14px; font-weight: 700; line-height: 1;
  vertical-align: -1px;
}
.report-row-toggle:hover { border-color: var(--primary); background: var(--primary-light); }
.report-data-table { width: 100%; min-width: 900px; }
.report-freeze-header-wrap {
  overflow: auto;
  position: relative;
  overflow-anchor: none;
}
.report-freeze-header-wrap .report-data-table thead th {
  position: sticky;
  top: 0;
  z-index: 6;
  background: var(--primary-light);
  color: var(--primary-dark);
  box-shadow: 0 1px 0 var(--border);
}
.report-data-table .report-parent-row td { background: var(--primary-light); color: var(--primary-dark); font-weight: 700; }
.report-data-table .report-total-row td { background: #f3fbf7; color: var(--text); font-weight: 800; border-top: 2px solid var(--border); }
.report-note {
  margin: 0 0 10px;
  padding: 8px 12px;
  border-left: 3px solid var(--primary);
  background: var(--primary-light);
  color: var(--text-sub);
  font-size: 12px;
}
.auxiliary-balance-table { width: max-content; min-width: 1180px; table-layout: fixed; }
.auxiliary-balance-table col.aux-type-col { width: 120px; }
.auxiliary-balance-table col.aux-code-col { width: 120px; }
.auxiliary-balance-table col.aux-name-col { width: 190px; }
.auxiliary-balance-table col.aux-subject-code-col { width: 110px; }
.auxiliary-balance-table col.aux-subject-name-col { width: 220px; }
.auxiliary-balance-table col.aux-direction-col { width: 60px; }
.auxiliary-balance-table col.aux-amount-col { width: 125px; }
.auxiliary-balance-table col.aux-period-col { width: 96px; }
.auxiliary-balance-table col.aux-date-col { width: 102px; }
.auxiliary-balance-table col.aux-voucher-col { width: 150px; }
.auxiliary-balance-table col.aux-summary-col { width: 240px; }
.auxiliary-balance-table th { white-space: normal; line-height: 1.25; text-align: center; }
.auxiliary-balance-table td { white-space: nowrap; }
.auxiliary-balance-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.auxiliary-detail-table { min-width: 1700px; }
.auxiliary-detail-table col.aux-type-col { width: 130px; }
.auxiliary-detail-table col.aux-code-col { width: 110px; }
.auxiliary-detail-table col.aux-name-col { width: 210px; }
.auxiliary-detail-table col.aux-subject-code-col { width: 110px; }
.auxiliary-detail-table col.aux-subject-name-col { width: 230px; }
.auxiliary-detail-table col.aux-amount-col { width: 125px; }
.trial-balance-table { width: max-content; min-width: 1180px; table-layout: fixed; }
.trial-balance-table col.trial-code-col { width: 100px; }
.trial-balance-table col.trial-name-col { width: 260px; }
.trial-balance-table col.trial-category-col { width: 70px; }
.trial-balance-table col.trial-direction-col { width: 55px; }
.trial-balance-table col.trial-currency-col { width: 92px; }
.trial-balance-table col.trial-quantity-col { width: 96px; }
.trial-balance-table col.trial-amount-col { width: 122px; }
.trial-balance-table th, .trial-balance-table td { white-space: nowrap; }
.trial-balance-table th { text-align: center; }
.trial-balance-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.ledger-report-table { min-width: 1420px; table-layout: fixed; }
.ledger-report-table col.ledger-voucher-col { width: 108px; }
.ledger-report-table col.ledger-date-col { width: 94px; }
.ledger-report-table col.ledger-period-col { width: 88px; }
.ledger-report-table col.ledger-code-col { width: 102px; }
.ledger-report-table col.ledger-name-col { width: 190px; }
.ledger-report-table col.ledger-summary-col { width: 205px; }
.ledger-report-table col.ledger-aux-col,
.ledger-report-table col.ledger-counterpart-col { width: 145px; }
.ledger-report-table col.ledger-currency-col { width: 64px; }
/* 原币借方/贷方/余额 + 综合本位币借方/贷方/余额，共 6 列统一宽度。 */
.ledger-report-table col.ledger-original-amount-col,
.ledger-report-table col.ledger-base-amount-col { width: 118px; }
.ledger-report-table th { white-space: normal; line-height: 1.25; text-align: left; }
.ledger-report-table td { white-space: nowrap; }
.ledger-report-table td.num,
.ledger-report-table th:nth-last-child(-n + 6) { text-align: right; }
.general-ledger-table { width: max-content; min-width: 1165px; table-layout: fixed; border: 1px solid var(--border); }
.general-ledger-table col.ledger-code-col { width: 130px; }
.general-ledger-table col.ledger-name-col { width: 250px; }
.general-ledger-table col.ledger-period-col { width: 105px; }
.general-ledger-table col.ledger-summary-col { width: 180px; }
.general-ledger-table col.ledger-currency-col { width: 70px; }
.general-ledger-table col.ledger-original-amount-col { width: 130px; }
.general-ledger-table col.ledger-base-amount-col { width: 140px; }
.general-ledger-table col.ledger-direction-col { width: 80px; }
.general-ledger-table th {
  white-space: normal;
  line-height: 1.25;
  padding: 8px 10px;
  background: var(--primary-light);
  color: var(--primary-dark);
  border: 1px solid var(--border);
}
.general-ledger-table td {
  white-space: nowrap;
  padding: 7px 10px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  font-weight: 400;
}
.general-ledger-table tbody tr:hover td { background: var(--primary-light); }
.general-ledger-table td.num,
.general-ledger-table th:nth-last-child(-n + 3) { text-align: right; }
.general-ledger-table .general-ledger-subject-row td {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 800;
  border-top: 1px solid var(--primary);
}
.general-ledger-table .report-total-row td {
  background: var(--bg);
  color: var(--text);
  font-weight: 600;
  border-top: 1px solid var(--border);
}
.general-ledger-table .report-opening-row td { background: var(--bg); color: var(--text-sub); }
.general-ledger-table .general-ledger-subject-row span { margin-left: 18px; }
/* 总账与科目汇总表采用同一套紧凑金蝶表格节奏。 */
.general-ledger-table th { padding: 6px 5px; text-align: center; }
.general-ledger-table td { padding: 4px 6px; border: 1px solid var(--border); }
.general-ledger-table .general-ledger-subject-row td {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 700;
  border-top: 1px solid var(--primary);
}
.general-ledger-table .report-total-row td { background: var(--card); font-weight: 400; }
.general-ledger-table .report-total-row td:nth-child(4) { font-weight: 600; }
.general-ledger-table .report-total-row td.num { font-weight: 400 !important; }
.general-ledger-table .report-opening-row td { background: var(--card); color: var(--text); }
.table-col-resizer {
  position: absolute;
  top: 0;
  right: -4px;
  bottom: 0;
  width: 8px;
  cursor: col-resize;
  touch-action: none;
  z-index: 5;
}
.table-col-resizer::after {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 3px;
  width: 1px;
  background: transparent;
  transition: background .15s;
}
.table-col-resizer:hover::after,
body.is-column-resizing .table-col-resizer::after { background: var(--primary); }
.report-column-tools {
  position: absolute;
  right: 0;
  top: 0;
  z-index: 8;
  display: inline-flex;
  align-items: center;
}
.report-add-column-btn {
  min-width: 32px;
  min-height: 28px;
  padding: 3px 11px !important;
  font-size: 18px !important;
  line-height: 20px;
}
.report-add-column-btn:hover { background: var(--primary-light); }
.report-column-menu {
  position: absolute;
  top: 34px;
  right: 0;
  width: 190px;
  max-height: 320px;
  overflow: auto;
  padding: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: left;
}
.report-column-menu-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 4px;
  color: var(--text);
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}
.report-column-menu-item:hover { background: var(--primary-light); }
body.is-column-resizing,
body.is-column-resizing * { cursor: col-resize !important; user-select: none !important; }
.cash-flow-card { max-width: 980px; }
@media (max-width: 760px) {
  .balance-sheet-card .card-body { padding: 14px 10px; }
  .bs-report-head h2 { font-size: 20px; }
  .bs-report-meta { flex-direction: column; gap: 2px; }
  .tax-plan-report-actions { position: static; justify-content: flex-end; margin-top: 8px; }
  .bs-trial-status { align-items: flex-start; }
  .bs-trial-difference { margin-left: 32px; }
  .report-signatures { grid-template-columns: 1fr; gap: 3px; }
}

@media print {
  @page { size: A4 landscape; margin: 8mm; }
  html, body { width: auto !important; min-width: 0 !important; background: #fff !important; }
  body > .app { display: block !important; min-height: 0 !important; }
  body > #modalMask, .sidebar, .topbar, #content > .tabs, #content > .form-row,
  .bs-print-button, .bs-trial-status { display: none !important; }
  .table-col-resizer { display: none !important; }
  .report-column-tools { display: none !important; }
  .main { display: block !important; min-height: 0 !important; margin-left: 0 !important; }
  .content { display: block !important; padding: 0 !important; }
  #repBody { display: block !important; }
  .balance-sheet-card { max-width: none !important; margin: 0 !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; }
  .balance-sheet-card .card-body { padding: 0 !important; }
  .bs-report-head { margin-bottom: 5mm !important; }
  .bs-report-head h2 { font-size: 16pt !important; line-height: 1.15 !important; }
  .bs-report-date { margin-top: 1mm !important; font-size: 9pt !important; }
  .bs-report-meta { margin-top: 3mm !important; font-size: 9pt !important; }
  .bs-table-wrap { overflow: visible !important; border: 1px solid #333 !important; }
  .report-freeze-header-wrap { max-height: none !important; overflow: visible !important; }
  .report-freeze-header-wrap .report-data-table thead th { position: static !important; }
  .kingdee-bs-table { width: 100% !important; min-width: 0 !important; font-size: 8.5pt !important; }
  .kingdee-bs-table th { padding: 2px 3px !important; border-color: #333 !important; }
  .kingdee-bs-table td { height: 20px !important; padding: 1px 4px !important; border-color: #666 !important; }
  .kingdee-bs-table tr { break-inside: avoid; page-break-inside: avoid; }
  .kingdee-bs-table th, .kingdee-bs-table td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .income-statement-table { width: 100% !important; min-width: 0 !important; }
  .report-signatures { padding-top: 3mm !important; font-size: 9pt !important; }
}

.alert { padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 12px; }
.alert.info { background: var(--primary-light); color: var(--primary-dark); }
.alert.success { background: #dcfce7; color: #166534; }
.alert.warning { background: #ffedd5; color: #9a3412; }
.alert.error { background: #fee2e2; color: #991b1b; }
.opening-balance-summary { display: flex; align-items: center; justify-content: flex-start; gap: 8px 24px; flex-wrap: wrap; }
.opening-balance-summary span { white-space: normal; }
.opening-balance-summary .opening-reclass-note { flex-basis: 100%; padding-top: 7px; border-top: 1px solid rgba(22, 101, 52, .2); color: #166534; }

.balance-bar { display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 600; padding: 10px 14px; background: var(--primary-light); border-radius: 8px; color: var(--primary-dark); }

/* 期间范围选择器 */
.period-range { display: flex; flex-direction: column; gap: 6px; padding: 4px 0; }
.pr-summary { display: inline-block; width: fit-content; min-width: 138px; padding: 8px 14px; border-radius: 4px; background: #3caf4a; color: #fff; font-size: 15px; font-weight: 600; white-space: nowrap; }
.batch-period-filter { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; background: #f8fafc; }
.import-context-row { align-items: center; flex-wrap: nowrap; }
.import-context-row .import-context-label,
.batch-period-filter-form .import-context-label { color: var(--text-sub); font-size: 14px; font-weight: 400; line-height: 1; white-space: nowrap; }
.import-context-row #impBook,
.batch-period-toolbar .period-month-display { height: 40px; min-height: 40px; box-sizing: border-box; font-size: 14px; }
.batch-period-toolbar { flex: 1 1 auto; min-width: 0; margin-left: 10px; }
.batch-period-toolbar .batch-period-filter { padding: 0; border: 0; background: transparent; }
.batch-period-toolbar .period-month-field { width: 230px; }
.upload-period-toolbar .period-month-field { width: 180px; }
.upload-period-link-note { color: var(--text-sub); font-size: 12px; white-space: nowrap; }
.import-company-position-select { min-width: 132px; width: 150px; }
.platform-multi-select { position: relative; display: inline-flex; width: 190px; min-width: 160px; }
.platform-multi-trigger { display: inline-flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; height: 40px; padding: 0 11px; border: 1px solid var(--border); border-radius: 4px; background: #fff; color: var(--text); font-size: 14px; cursor: pointer; text-align: left; }
.platform-multi-trigger:hover, .platform-multi-trigger[aria-expanded="true"] { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(46, 171, 69, .1); }
.platform-multi-trigger > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.platform-multi-menu { display: none; position: absolute; z-index: 1200; top: calc(100% + 4px); left: 0; width: 100%; max-height: 250px; overflow-y: auto; padding: 6px; border: 1px solid #dbe3ec; border-radius: 5px; background: #fff; box-shadow: 0 8px 22px rgba(19, 42, 73, .16); }
.platform-multi-menu.is-open { display: grid; gap: 2px; }
.platform-multi-menu label { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 7px; border-radius: 3px; color: var(--text); font-size: 13px; cursor: pointer; }
.platform-multi-menu label:hover { background: #f3f7fb; }
.platform-multi-menu input { width: 15px; height: 15px; margin: 0; accent-color: var(--primary); }
.platform-multi-empty { display: block; padding: 8px; color: var(--text-sub); font-size: 12px; }
.rate-management-toolbar { margin: 0; }
.platform-rate-currency-row { align-items: flex-start; }
.platform-rate-currency-row > label { padding-top: 7px; }
.platform-rate-currencies { display: flex; flex: 1 1 0; flex-wrap: wrap; gap: 8px 14px; max-height: 132px; overflow-y: auto; padding: 7px 0; }
.platform-rate-currencies .checkbox-label { display: inline-flex; align-items: center; gap: 5px; color: var(--text); white-space: nowrap; cursor: pointer; }
.platform-rate-currencies input { width: 15px; height: 15px; margin: 0; accent-color: var(--primary); }
.platform-rate-currencies .platform-rate-all { font-weight: 600; }
.rate-period-toolbar .batch-period-filter { padding: 0; border: 0; background: transparent; }
.rate-period-toolbar .period-month-field { width: 230px; }
.rate-period-toolbar .period-month-display { height: 40px; min-height: 40px; box-sizing: border-box; font-size: 14px; }
.rate-list-toggle { display: flex; justify-content: flex-end; padding-top: 14px; }
.rate-pagination { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-height: 38px; color: var(--text-sub); font-size: 13px; }
.rate-pagination-total { margin-right: 2px; white-space: nowrap; }
.rate-pagination-arrow { width: 30px; height: 30px; padding: 0; border: 0; background: transparent; color: #8d99a8; font-size: 27px; line-height: 28px; cursor: pointer; }
.rate-pagination-arrow:hover:not(:disabled) { color: var(--primary); }
.rate-pagination-arrow:disabled { color: #d2d8df; cursor: not-allowed; }
.rate-pagination-current { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 5px; background: #eaf1ff; color: #2f6fed; font-weight: 600; }
.rate-pagination-size, .rate-pagination-input { height: 34px; box-sizing: border-box; border: 1px solid var(--border); border-radius: 4px; background: #fff; color: var(--text); font-size: 13px; }
.rate-pagination-size { min-width: 92px; padding: 0 8px; }
.rate-pagination-jump { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.rate-pagination-input { width: 44px; padding: 0 6px; text-align: center; }
.rate-pagination-go { height: 30px; padding: 0 8px; border: 1px solid var(--border); border-radius: 4px; background: #fff; color: var(--text-sub); cursor: pointer; }
.rate-pagination-go:hover { border-color: var(--primary); color: var(--primary); }
@media (max-width: 720px) { .rate-list-toggle { justify-content: center; overflow-x: auto; } .rate-pagination { justify-content: center; min-width: max-content; } }
.batch-period-filter-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.batch-period-filter-form label, .batch-period-separator { color: var(--text-sub); font-size: 14px; white-space: nowrap; }
.batch-period-input { width: 156px; min-height: 38px; box-sizing: border-box; }
.period-month-field { display: inline-flex; position: relative; width: 156px; }
.period-month-field .period-month-display { width: 100%; min-height: 38px; box-sizing: border-box; padding-right: 34px; cursor: pointer; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%238894a7' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='17' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") no-repeat right 10px center; }
.batch-period-range-field { width: 230px; }
.month-picker-popup { display: none; position: fixed; z-index: 2000; width: 280px; padding: 10px; border: 1px solid #dbe3ec; border-radius: 6px; background: #fff; box-shadow: 0 8px 24px rgba(19, 42, 73, .18); }
.month-picker-popup.is-open { display: block; }
.month-picker-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 4px 12px; border-bottom: 1px solid #e8edf3; color: #243b5a; font-size: 18px; }
.month-picker-nav { width: 42px; height: 34px; border: 0; background: transparent; color: #546274; font-size: 25px; line-height: 1; cursor: pointer; }
.month-picker-nav:hover { background: #f0f7f2; color: #2eab45; }
.month-picker-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 8px; padding: 16px 8px 8px; }
.month-picker-range-hint { padding: 9px 8px 0; color: var(--primary-dark); font-size: 12px; font-weight: 600; }
.month-picker-month { height: 42px; border: 0; border-radius: 22px; background: #fff; color: #243b5a; font-size: 15px; cursor: pointer; }
.month-picker-month:hover { background: #edf7ef; color: #2eab45; }
.month-picker-month.in-range { border-radius: 6px; background: #e6f6eb; color: #177a38; }
.month-picker-month.active { background: #3caf4a; color: #fff; font-weight: 600; }
.batch-period-count { color: var(--primary); font-size: 13px; font-weight: 600; white-space: nowrap; }
.batch-period-count.is-error { color: var(--danger); }
.import-batch-card { margin-top: 6px; }
.import-batch-card .card-body { padding: 8px 12px; }
.import-batch-table-wrap { max-height: calc(100vh - 245px); }
.import-batch-table { font-size: 12px; }
.import-batch-table th { padding: 8px 10px; font-size: 12px; }
.import-batch-table td { padding: 7px 10px; }
.import-batch-table .tag { font-size: 11px; }
.import-batch-table .btn.sm { padding: 4px 10px; font-size: 11px; }
.pr-mode { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-sub); flex-wrap: wrap; }
.period-mode-btn { height: 28px; padding: 0 10px; border: 1px solid var(--border); border-radius: 4px; background: #fff; color: var(--text-sub); cursor: pointer; font-size: 13px; }
.period-mode-btn:hover { border-color: var(--primary); color: var(--primary); }
.period-mode-btn.active { border-color: var(--primary); background: #eef4ff; color: var(--primary); font-weight: 600; }
.report-format-options { display: inline-flex; align-items: center; gap: 14px; margin-left: 4px; }
.report-format-options[hidden] { display: none; }
.report-format-option { display: inline-flex; align-items: center; gap: 5px; color: var(--text); cursor: pointer; white-space: nowrap; }
.report-format-option[hidden] { display: none; }
.report-format-option input { width: 15px; height: 15px; margin: 0; accent-color: var(--primary); cursor: pointer; }
.accounting-standard-options { display: inline-flex; align-items: center; gap: 12px; margin-left: 4px; padding-left: 12px; border-left: 1px solid var(--border); }
.accounting-standard-options[hidden] { display: none; }
.trial-display-options { display: inline-flex; align-items: center; gap: 12px; margin-left: 4px; padding-left: 12px; border-left: 1px solid var(--border); }
.trial-display-options[hidden] { display: none; }
.trial-filter-entry { display: flex; align-items: center; min-height: 34px; }
.trial-filter-entry .report-options-host { flex: 1; min-width: 0; }
.trial-filter-summary { display: inline-flex; align-items: center; gap: 9px; min-height: 34px; padding: 0 12px; border: 1px solid #b8c7dc; border-radius: 5px; background: #fff; color: #243b5a; cursor: pointer; font-size: 13px; transition: border-color .15s, background .15s, box-shadow .15s; }
.trial-filter-summary:hover { border-color: var(--primary); background: #f5f8ff; box-shadow: 0 1px 3px rgba(30, 64, 175, .12); }
.trial-filter-summary-label { color: var(--text-sub); }
.trial-filter-summary strong { font-weight: 600; color: var(--primary-dark); font-variant-numeric: tabular-nums; }
.trial-filter-funnel { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-left: 1px solid var(--border); padding-left: 8px; color: var(--primary); font-size: 16px; line-height: 1; }
.trial-filter-modal { width: 620px; max-width: 94vw; }
.trial-filter-modal .modal-body { padding: 20px 24px 18px; }
.trial-filter-modal-body { display: flex; flex-direction: column; gap: 18px; }
.trial-filter-section { padding-bottom: 16px; border-bottom: 1px solid #e5eaf2; }
.trial-filter-section:last-child { padding-bottom: 0; border-bottom: 0; }
.trial-filter-section-title { margin-bottom: 12px; color: #1e3a5f; font-size: 14px; font-weight: 700; }
.trial-filter-grid { display: grid; grid-template-columns: 74px minmax(150px, 1fr) 74px minmax(150px, 1fr); align-items: center; gap: 11px 12px; }
.trial-filter-grid > label { color: var(--text-sub); text-align: right; white-space: nowrap; }
.trial-filter-grid .input { width: 100%; box-sizing: border-box; }
.trial-filter-period-grid { grid-template-columns: 74px minmax(160px, 1fr) 24px minmax(160px, 1fr); }
.tax-plan-period-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tax-plan-period-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tax-plan-period-field label { color: var(--text-sub); font-size: 13px; }
.tax-plan-period-field .input { width: 100%; box-sizing: border-box; }
.tax-plan-period-range-field { display: flex; align-items: center; gap: 10px; width: 100%; }
.tax-plan-period-range-field .period-month-field { flex: 1 1 0; min-width: 0; }
.tax-plan-period-range-field .period-month-display { width: 100%; box-sizing: border-box; }
.tax-plan-period-range-separator { color: var(--text-sub); flex: 0 0 auto; }
.trial-filter-to { color: var(--text-sub); text-align: center; }
.trial-filter-month { min-height: 34px; }
.trial-filter-level { display: flex; align-items: center; gap: 8px; min-width: 0; }
.trial-filter-level .input { width: 100%; min-width: 0; }
.trial-filter-level span { color: var(--text-sub); flex: 0 0 auto; }
.trial-filter-checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 22px; padding-left: 4px; }
.trial-filter-check { display: inline-flex; align-items: center; gap: 8px; color: var(--text); cursor: pointer; white-space: nowrap; }
.trial-filter-check input { width: 15px; height: 15px; margin: 0; accent-color: var(--primary); }
.voucher-filter-modal { width: 680px; max-width: 94vw; }
.voucher-filter-modal .modal-body { padding: 20px 24px 18px; }
.voucher-filter-modal-body { display: flex; flex-direction: column; gap: 16px; }
.voucher-filter-period-panel { padding: 12px 14px; border: 1px solid #dce8e0; border-radius: 6px; background: #f7fbf8; }
.voucher-filter-period-title { margin-bottom: 8px; color: var(--text-sub); font-size: 13px; font-weight: 600; }
.voucher-filter-period-fields { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.voucher-filter-period-fields .voucher-period-range-field { width: 280px; }
.voucher-filter-period-fields .batch-period-count { font-weight: 400; }
.voucher-filter-auxiliary-pair { display: flex; gap: 8px; min-width: 0; }
.voucher-filter-auxiliary-pair .input { min-width: 0; }
.voucher-filter-auxiliary-pair .input:first-child { flex: 0 0 42%; }
.voucher-filter-auxiliary-pair .input:last-child { flex: 1 1 auto; }
.voucher-filter-subject-field { min-width: 0; }
.voucher-filter-subject-field .input { display: block; }
.voucher-filter-modal .checkbox-label { display: inline-flex; align-items: center; gap: 6px; color: var(--text); white-space: nowrap; cursor: pointer; }
.voucher-filter-modal .checkbox-label input { width: 15px; height: 15px; margin: 0; accent-color: var(--primary); }
.voucher-table th.num,
.voucher-table td.num { text-align: left; }
.voucher-filter-grid { display: grid; grid-template-columns: 88px minmax(160px, 1fr) 88px minmax(160px, 1fr); align-items: center; gap: 11px 12px; }
.voucher-filter-grid > label { color: var(--text-sub); text-align: right; white-space: nowrap; }
.voucher-filter-grid .input { width: 100%; box-sizing: border-box; }
.voucher-filter-range { display: flex; align-items: center; gap: 8px; min-width: 0; }
.voucher-filter-range .input { min-width: 0; }
.voucher-filter-range span { color: var(--text-sub); flex: 0 0 auto; }
.voucher-filter-sort { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; color: var(--text-sub); }
.voucher-filter-sort label { display: inline-flex; align-items: center; gap: 5px; color: var(--text); cursor: pointer; white-space: nowrap; }
.voucher-filter-sort input { width: 15px; height: 15px; margin: 0; accent-color: var(--primary); }
.voucher-subject-picker { position: relative; width: 100%; }
.voucher-subject-cell { vertical-align: top; }
.voucher-combined-control { display: flex; align-items: stretch; flex-wrap: wrap; width: 100%; min-height: 38px; border: 1px solid #b9dfd2; border-radius: 6px; background: #fff; overflow: visible; }
.voucher-combined-control:focus-within { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(15, 157, 111, .12); }
.voucher-combined-control .voucher-subject-picker { flex: 1 1 60%; min-width: 0; }
.voucher-combined-control .voucher-subject-picker > .input { height: 100%; min-width: 0; border: 0; border-radius: 5px 0 0 5px; background: transparent; box-shadow: none; }
.voucher-aux-inline-control { position: relative; flex: 1 1 40%; min-width: 120px; }
.voucher-aux-inline-control .input { width: 100%; height: 100%; min-height: 36px; border: 0; border-radius: 0 5px 5px 0; background: transparent; box-shadow: none; }
.voucher-subject-menu { display: none; position: fixed; z-index: 1200; min-width: 360px; max-width: min(900px, calc(100vw - 24px)); max-height: min(320px, calc(100vh - 24px)); overflow-y: auto; padding: 4px 0; border: 1px solid #b9c8d8; border-radius: 4px; background: #fff; box-shadow: 0 6px 18px rgba(20, 40, 70, .16); }
.voucher-subject-menu.is-open { display: block; }
.voucher-subject-option { display: block; width: 100%; padding: 8px 10px; border: 0; background: #fff; color: var(--text); text-align: left; font: inherit; line-height: 1.35; overflow-wrap: anywhere; cursor: pointer; }
.voucher-subject-option[hidden] { display: none; }
.voucher-subject-option:hover { background: #eef6ff; }
.voucher-subject-option:focus { outline: 2px solid var(--primary); outline-offset: -2px; }
.voucher-subject-empty { padding: 10px; color: var(--text-sub); text-align: center; font-size: 12px; }
.voucher-form-table td:has(select[data-field="auxiliary_item_id"]) { position: relative; }
.voucher-aux-menu { display: none; position: fixed; z-index: 1200; min-width: 260px; max-width: min(420px, calc(100vw - 24px)); max-height: min(360px, calc(100vh - 24px)); overflow: hidden; padding: 8px; border: 1px solid #b9c8d8; border-radius: 5px; background: #fff; box-shadow: 0 8px 22px rgba(20, 40, 70, .18); }
.voucher-aux-menu.is-open { display: block; }
.voucher-aux-menu-head { display: flex; align-items: center; gap: 6px; margin-bottom: 7px; }
.voucher-aux-menu-head .input { min-width: 0; flex: 1; }
.voucher-aux-menu-close { width: 28px; height: 30px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--text-sub); font-size: 20px; line-height: 1; cursor: pointer; }
.voucher-aux-menu-close:hover { background: #eef4ff; color: var(--text); }
.voucher-aux-options { max-height: 190px; overflow-y: auto; border: 1px solid #e4eaf1; border-radius: 4px; }
.voucher-aux-option { display: block; width: 100%; padding: 8px 10px; border: 0; border-bottom: 1px solid #eef2f6; background: #fff; color: var(--text); text-align: left; font: inherit; line-height: 1.35; overflow-wrap: anywhere; cursor: pointer; }
.voucher-aux-option:last-child { border-bottom: 0; }
.voucher-aux-option:hover { background: #eef6ff; color: var(--primary-dark); }
.voucher-aux-option[hidden] { display: none; }
.voucher-aux-add { display: block; width: 100%; margin-top: 8px; padding: 8px 10px; border: 1px solid #b8dfcb; border-radius: 4px; background: #f1fbf5; color: var(--primary-dark); text-align: center; font: inherit; cursor: pointer; }
.voucher-aux-add:hover { border-color: var(--primary); background: #e6f7ed; }
.voucher-aux-inline-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) auto; gap: 6px; margin-top: 8px; }
.voucher-aux-inline-form .input { min-width: 0; }
.voucher-aux-empty { padding: 12px 8px; color: var(--text-sub); text-align: center; font-size: 12px; }
.trial-tree-toggle { width: 20px; height: 20px; margin-right: 5px; padding: 0; border: 1px solid var(--border); border-radius: 3px; background: #fff; color: var(--primary); font-size: 14px; line-height: 18px; vertical-align: middle; cursor: pointer; }
.trial-tree-toggle:hover { border-color: var(--primary); background: var(--primary-light); }
.accounting-standard-label { color: var(--text-sub); white-space: nowrap; }
.pr-quick { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.pr-fields { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pr-single, .pr-range { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-sub); }
.pr-range .input, .period-month-input { width: 156px; min-height: 38px; box-sizing: border-box; }
.pr-count { font-size: 12px; color: var(--primary); font-weight: 600; margin-left: 4px; }
.input.tiny { padding: 5px 6px; font-size: 12px; min-width: 70px; }
.pr-single, .pr-range { gap: 4px; }
@media (max-width: 760px) {
  .import-context-row { align-items: stretch; flex-direction: column; }
  .import-company-position-select, .platform-multi-select { width: 100%; min-width: 0; }
  .batch-period-toolbar { width: 100%; margin-left: 0; }
  .batch-period-filter { align-items: stretch; flex-direction: column; gap: 8px; }
  .batch-period-filter-form { align-items: flex-start; flex-direction: column; }
  .report-format-options { flex-basis: 100%; margin-left: 0; }
  .accounting-standard-options { flex-basis: 100%; margin-left: 0; padding-left: 0; border-left: 0; flex-wrap: wrap; }
  .trial-display-options { flex-basis: 100%; margin-left: 0; padding-left: 0; border-left: 0; flex-wrap: wrap; }
  .trial-filter-modal .modal-body { padding: 16px; }
  .trial-filter-grid, .trial-filter-period-grid { grid-template-columns: 1fr 1fr; }
  .tax-plan-period-fields { grid-template-columns: 1fr; gap: 10px; }
  .tax-plan-period-range-field { align-items: stretch; flex-direction: column; gap: 6px; }
  .tax-plan-period-range-separator { display: none; }
  .trial-filter-grid > label { text-align: left; }
  .trial-filter-period-grid .trial-filter-to { display: none; }
  .trial-filter-checks { grid-template-columns: 1fr; }
  .voucher-filter-modal .modal-body { padding: 16px; }
  .voucher-filter-grid { grid-template-columns: 1fr 1fr; }
  .voucher-filter-grid > label { text-align: left; }
  .voucher-filter-period-fields .voucher-period-range-field { width: min(100%, 280px); }
  .voucher-filter-auxiliary-pair { flex-direction: column; }
  .voucher-filter-auxiliary-pair .input:first-child,
  .voucher-filter-auxiliary-pair .input:last-child { flex: 1 1 auto; width: 100%; }
  .voucher-filter-sort { gap: 10px; }
}

/* 多期表格（横向滚动） */
.table-wrap { overflow-x: auto; max-width: 100%; }
table.data-table th.sticky-left { position: sticky; left: 0; background: #f8fafc; z-index: 1; }
table.data-table td.sticky-left { position: sticky; left: 0; background: #fff; z-index: 1; }
table.data-table tfoot td.sticky-left { background: #f8fafc; font-weight: 700; }

/* 指定业务表格：滚动明细时保持表头可见；仅由对应模块显式启用。 */
.freeze-header-wrap {
  max-height: calc(100vh - 250px);
  overflow: auto;
  position: relative;
  /* 列表刷新后由脚本恢复位置，禁止浏览器滚动锚定将其带回顶部。 */
  overflow-anchor: none;
}
.freeze-header-wrap .data-table {
  min-width: max-content;
}
.freeze-header-wrap .data-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f8fafc;
  box-shadow: 0 1px 0 var(--border);
}
/* 科目体系表头与基础资料其它列表统一使用浅绿色。 */
.basic-module-body .freeze-header-wrap .data-table thead th {
  background: #EFF9F4;
  color: #1E4538;
  border-bottom-color: #D8EDE2;
}
.freeze-header-wrap .data-table thead th.sticky-left {
  z-index: 4;
}
.freeze-header-wrap .data-table tbody td.sticky-left,
.freeze-header-wrap .data-table tfoot td.sticky-left {
  z-index: 2;
}

/* 凭证列表附件列 */
.voucher-list-attachments { display: flex; align-items: center; gap: 4px; min-width: 120px; }
.voucher-list-attachment { display: inline-block; max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--primary); font-size: 12px; }
.voucher-list-attachment-more { color: var(--text-sub); font-size: 12px; white-space: nowrap; }
.voucher-list-no-attachment { color: var(--text-sub); min-width: 8px; }
.voucher-list-upload { margin-left: auto; flex: 0 0 auto; }
.voucher-action-cell {
  min-width: 240px;
  width: 240px;
}
.voucher-list-scroll {
  max-height: none;
  overflow-x: auto;
  overflow-y: hidden;
  position: relative;
  overflow-anchor: none;
}
.voucher-list-scroll .data-table {
  min-width: max-content;
}
.voucher-list-scroll .voucher-table th:last-child,
.voucher-list-scroll .voucher-table td.voucher-action-cell {
  position: sticky;
  right: 0;
  z-index: 2;
  background: var(--card);
  box-shadow: -1px 0 0 var(--border);
}
.voucher-list-scroll .voucher-table thead th:last-child {
  z-index: 4;
  background: #EFF9F4;
}
.voucher-list-scroll .voucher-table tr:hover td.voucher-action-cell {
  background: #E6F6EF;
}
.voucher-list-actions {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  min-width: 224px;
  white-space: nowrap;
}
.voucher-period-toolbar { display: inline-flex; align-items: center; justify-content: flex-start; gap: 8px; min-width: 0; flex: 0 0 auto; margin-left: 0; margin-right: 0; }
.voucher-period-toolbar .period-month-field { width: 178px; }
.voucher-period-toolbar .period-month-display,
.voucher-period-toolbar .btn { min-height: 40px; height: 40px; box-sizing: border-box; }

/* 凭证展开后的分录行 */
.line-row { background: #fafbff; }
.line-row:hover td { background: #eef3ff !important; }
.line-row td { font-size: 13px; padding: 6px 10px; }

/* 账务处理页紧凑布局：缩短卡片/表单间距，避免顶部大块空白 */
#accBody .card { margin-bottom: 8px; }
#accBody .card-body { padding: 10px 14px; }
#accBody .form-row { margin-bottom: 8px; }
.agg-matrix-toolbar {
  display: flex;
  align-items: center;
  gap: 8px 12px;
  flex-wrap: wrap;
  padding: 8px 10px;
  margin-bottom: 10px;
  border: 1px solid #e2e8f5;
  border-radius: 6px;
  background: #fafbff;
}
.agg-matrix-toolbar-main {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}
.agg-matrix-toolbar #aggActionBtns { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.agg-matrix-toolbar #aggScopeHint { flex-basis: 100%; }
.agg-matrix-transposed { min-width: max-content; }
.agg-matrix-transposed .agg-matrix-type-head { min-width: 150px; max-width: 220px; vertical-align: top; line-height: 1.35; }
.agg-matrix-transposed .agg-matrix-type-head label { display: flex; align-items: flex-start; gap: 5px; justify-content: flex-start; text-align: left; white-space: normal; cursor: pointer; }
.agg-matrix-transposed .agg-matrix-type-head label input { flex: 0 0 auto; margin-top: 2px; }
.agg-matrix-transposed .agg-matrix-type-head small { display: block; margin-top: 4px; color: var(--text-sub); font-size: 11px; font-weight: 400; white-space: normal; word-break: break-word; }
.agg-matrix-transposed .agg-matrix-type-head em { display: block; margin-top: 3px; color: var(--warning,#b7791f); font-size: 11px; font-style: normal; font-weight: 400; white-space: normal; }
.acc-gen-top { display: flex; gap: 12px; align-items: flex-start; width: 100%; flex-wrap: nowrap; }
.acc-gen-top > .card { align-self: flex-start; flex-shrink: 0; }
.acc-gen-top > .card:first-child { flex: 1; min-width: 0; }
#accFilterRow { margin-top: 0; margin-bottom: 6px; flex-wrap: nowrap; }
#accFilterRow { align-items: center; justify-content: flex-start; }
#accFilterRow > select.input,
#accFilterRow #accPlatWrap > select.input,
#accFilterRow #accSiteWrap > select.input,
#accFilterRow .accounting-period-toolbar .period-month-display,
#accFilterRow .accounting-period-toolbar .btn {
  height: 40px;
  min-height: 40px;
  box-sizing: border-box;
}
#accFilterRow .accounting-period-toolbar { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
#accFilterRow #g_pr_range { flex: 0 0 auto; min-width: 0; }
#accFilterRow #pa_pr_range { flex: 0 0 auto; min-width: 0; }
#accFilterRow #g_pr_range .period-month-field { width: 178px; }
#accFilterRow #pa_pr_range .period-month-field { width: 178px; }
#accFilterRow #g_pr_range .btn { flex: 0 0 auto; }
#accFilterRow #pa_pr_range .btn { flex: 0 0 auto; }
#accFilterRow .accounting-period-range-field { width: 210px; }
#accFilterRow .accounting-scope-select { width: 145px; }
#accFilterRow #accSite { width: 125px; }
#accFilterRow #g_pr_range .period-range { flex-direction: row; align-items: center; gap: 8px; padding: 0; }
#accFilterRow #g_pr_range .pr-summary { min-width: 112px; padding: 7px 10px; font-size: 13px; }
#accFilterRow #g_pr_range .pr-mode { gap: 4px; flex-wrap: nowrap; }
#accFilterRow #g_pr_range .pr-quick { margin-left: 4px; gap: 3px; }
#accFilterRow #g_pr_range .pr-fields { flex-wrap: nowrap; }
#accFilterRow #g_pr_range .pr-single,
#accFilterRow #g_pr_range .pr-range { flex-wrap: nowrap; }
#accFilterRow #g_pr_range .pr-range .period-month-field { width: 142px; }
#accFilterRow #g_pr_range .pr-single .period-month-field { width: 142px; }
.pending-alloc-top-period { display: inline-flex; align-items: center; gap: 8px; }
.pdfverify-filter-row {
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
}
.pdfverify-filter-row #g_pr_range {
  order: 3;
  flex: 1 1 760px;
  min-width: 0;
}
.pdfverify-filter-row #accSiteWrap {
  order: 2;
  flex: 0 0 auto;
  padding-top: 0;
}
.pdfverify-filter-row #accSiteWrap .accounting-scope-select { width: 150px; }
.operation-log-table,
.platform-audit-table { width: 100%; table-layout: fixed; }
/* 固定信息列，剩余宽度只由最右侧详情列承接，避免中间列被拉开。 */
.freeze-header-wrap .platform-audit-table.platform-only { min-width: 1120px; }
.freeze-header-wrap .platform-audit-table.has-tenant-column { min-width: 1400px; }
.platform-audit-table-wrap {
  /* 审计记录在同一容器内横纵滚动，表头随容器纵向滚动固定。 */
  max-height: calc(100vh - 310px);
  min-height: 240px;
}
.platform-audit-table th,
.platform-audit-table td { padding: 8px 9px; }
.platform-audit-table .audit-id { width: 54px; }
.platform-audit-table .audit-scope { width: 104px; }
.platform-audit-table .audit-tenant { width: 230px; }
.platform-audit-table .audit-username { width: 100px; }
.platform-audit-table .audit-time { width: 158px; }
.platform-audit-table .audit-action { width: 210px; }
.platform-audit-table .audit-target { width: 100px; }
.platform-audit-table .audit-detail {
  min-width: 300px;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.45;
}
.operation-log-table th:nth-child(1) { width: 64px; }
.operation-log-table th:nth-child(2) { width: 84px; }
.operation-log-table th:nth-child(3) { width: 230px; }
.operation-log-table th:nth-child(4) { width: 120px; }
.operation-log-table th:nth-child(5) { width: 170px; }
.operation-log-table th:nth-child(6) { width: 330px; }
.operation-log-table th:nth-child(7) { width: 150px; }
.operation-log-table th:nth-child(8) { width: 300px; }
.operation-log-table td,
.platform-audit-table td { padding: 8px 9px; vertical-align: middle; }
.operation-log-action { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.operation-log-detail { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.35; color: var(--text-sub); }
@media (max-width: 1050px) {
  #accFilterRow { flex-wrap: wrap; }
  #accFilterRow .accounting-period-toolbar { width: auto; }
  #accFilterRow .accounting-period-range-field { width: 190px; }
  .pdfverify-filter-row { flex-wrap: wrap; }
  .pdfverify-filter-row #g_pr_range { flex-basis: 100%; }
  .pdfverify-filter-row #accSiteWrap { padding-top: 0; }
}
#gResult:empty { display: none; }
#gResult:not(:empty) { margin-top: 8px; }

/* ============================================================
   Diana 设计规范（Stripe 风格）· 税筹看板 / 税务筹划 作用域样式
   全部规则限定在 .tax-page 容器内，不外溢到其他页面；
   只改视觉，不改任何数据与交互逻辑。
   令牌：主色 #0E9F6E · 墨色 #0B2E21 · tnum 等宽金额 · 药丸按钮
   ============================================================ */
.tax-page {
  --diana-primary: #0E9F6E;
  --diana-primary-strong: #087A54;
  --diana-primary-soft: #E6F6EF;
  --diana-primary-ring: rgba(14, 159, 110, .14);
  --diana-ink: #0B2E21;
  --diana-ink-soft: #5C7A6C;
  --diana-line: #E6E8F0;
  --diana-warn: #E5484D;
  --diana-ok: #0E9F6E;
  font-family: Inter, "Inter var", -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--diana-ink);
  width: 100%;
  min-width: 0;
  max-width: 1280px;
  margin-right: auto;
  margin-left: auto;
}
.tax-page > *,
.tax-page .tax-dashboard-grid,
.tax-page .tax-analysis-stack,
.tax-page .tax-analysis-card,
.tax-page .tax-card,
.tax-page .tax-card > .card-body,
.tax-page .tax-card .table-wrap {
  min-width: 0;
  max-width: 100%;
}
.tax-page .tnum,
.tax-page td.num,
.tax-page th.num,
.tax-page .tax-kpi-value,
.tax-page .tax-plan-adjustment-input { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

/* ---- 筛选栏：白卡片 + 蓝调阴影 ---- */
.tax-page .tax-filter-bar {
  padding: 12px 16px;
  margin-bottom: 16px;
  border: 1px solid var(--diana-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 55, 112, .05), 0 8px 24px rgba(0, 55, 112, .06);
}
.tax-page .tax-filter-bar label { color: var(--diana-ink-soft); font-size: 13px; }
.tax-page .tax-dashboard-period-toolbar { display: inline-flex; align-items: center; min-width: 0; }
.tax-page .tax-filter-bar > select.input,
.tax-page .tax-dashboard-period-toolbar .period-month-display,
.tax-page .tax-book-multi-select .platform-multi-trigger,
.tax-page .tax-filter-bar > .btn {
  height: 40px;
  min-height: 40px;
  box-sizing: border-box;
  font-size: 14px;
}
.tax-page .tax-filter-bar > .btn { display: inline-flex; align-items: center; justify-content: center; }
.tax-page .tax-book-multi-select { width: clamp(300px, 24vw, 420px); }
.tax-page .tax-book-multi-select .platform-multi-trigger { border-color: var(--border); border-radius: 8px; }
.tax-page .tax-book-multi-select .platform-multi-menu { border-color: var(--border); box-shadow: 0 8px 22px var(--shadow); }

/* ---- 药丸按钮（品牌形态，勿缩小圆角） ---- */
.tax-page .btn {
  border: 0;
  border-radius: 9999px;
  background: var(--diana-primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(14, 159, 110, .3), 0 4px 12px rgba(14, 159, 110, .22);
  transition: background .15s, box-shadow .15s, transform .15s;
}
.tax-page .btn:hover { background: var(--diana-primary-strong); box-shadow: 0 2px 4px rgba(14, 159, 110, .32), 0 8px 20px rgba(14, 159, 110, .28); }
.tax-page .btn:active { transform: translateY(1px); }
.tax-page .btn.secondary {
  border: 1px solid var(--diana-line);
  background: #fff;
  color: var(--diana-ink);
  box-shadow: 0 1px 2px rgba(0, 55, 112, .06);
}
.tax-page .btn.secondary:hover { background: var(--diana-primary-soft); color: var(--diana-primary-strong); border-color: #B5E3CE; box-shadow: 0 1px 2px rgba(6, 78, 59, .08); }
.tax-page .btn.secondary:focus-visible,
.tax-page .btn:focus-visible { outline: 2px solid var(--diana-primary-ring); outline-offset: 2px; }

/* ---- 输入控件：主色聚焦环 ---- */
.tax-page .input { border-color: var(--diana-line); border-radius: 8px; color: var(--diana-ink); }
.tax-page .input:hover { border-color: #B5E3CE; }
.tax-page .input:focus { border-color: var(--diana-primary); outline: 3px solid var(--diana-primary-ring); outline-offset: 0; box-shadow: none; }

/* ---- 税负预警条 ---- */
.tax-page .tax-alert {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-bottom: 16px;
  padding: 12px 18px;
  border: 1px solid #F5C6D2;
  border-radius: 12px;
  background: #FDF3F5;
  color: #8E2946;
  font-size: 13px;
}
.tax-page .tax-alert > b { font-size: 13px; }
.tax-page .tax-alert-item { display: inline-flex; gap: 6px; }
.tax-page .tax-alert-item b { color: var(--diana-warn); }

/* ---- 深色墨色 KPI 看板（汇兑损益看板同款） ---- */
.tax-page .tax-kpi-board {
  margin-bottom: 16px;
  padding: 22px 24px;
  border-radius: 16px;
  background: linear-gradient(135deg, #0B2E21 0%, #0E4A33 55%, #0B2E21 100%);
  color: #E7ECF5;
  box-shadow: 0 2px 4px rgba(13, 37, 61, .18), 0 16px 40px rgba(13, 37, 61, .22);
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
.tax-page .tax-kpi-board-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.tax-page .tax-kpi-board-title { font-size: 16px; font-weight: 700; letter-spacing: .2px; color: #fff; }
.tax-page .tax-kpi-board-sub { margin-top: 4px; font-size: 12px; color: rgba(231, 236, 245, .6); }
.tax-page .tax-kpi-board-badge {
  padding: 4px 12px;
  border: 1px solid rgba(127, 224, 184, .45);
  border-radius: 9999px;
  background: rgba(14, 159, 110, .28);
  color: #7FE0B8;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.tax-page .tax-kpi-grid {
  display: grid;
  /* 12 张 KPI 在 1280px 视口下排成 6×2 整齐两行；minmax 下限收紧避免长 label 撑大列宽 */
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  min-width: 0;
}
.tax-page .tax-kpi {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  min-height: 108px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 12px;
  background: rgba(255, 255, 255, .045);
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.tax-page .tax-kpi:hover { transform: translateY(-1px); border-color: rgba(127, 224, 184, .35); background: rgba(255, 255, 255, .08); }
.tax-page .tax-kpi-label { font-size: 12px; font-weight: 600; color: rgba(231, 236, 245, .62); letter-spacing: .2px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tax-page .tax-kpi-value { font-size: 24px; font-weight: 700; line-height: 1.2; color: #fff; font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.tax-page .tax-kpi-hint { font-size: 11.5px; color: rgba(231, 236, 245, .5); }
.tax-page .tax-kpi.is-accent { border-color: rgba(127, 224, 184, .38); background: linear-gradient(160deg, rgba(14, 159, 110, .3), rgba(14, 159, 110, .12)); }
.tax-page .tax-kpi.is-accent .tax-kpi-value { color: #7FE0B8; }
.tax-page .tax-kpi.is-warn .tax-kpi-value { color: #FF9AAE; }
.tax-page .tax-kpi.is-warn .tax-kpi-hint { color: rgba(255, 154, 174, .85); }
.tax-page .tax-kpi.is-ok .tax-kpi-hint { color: rgba(123, 224, 184, .9); }

/* 税筹看板首屏采用紧凑工作台密度，优先呈现核心指标与分析表。 */
.tax-page .tax-filter-bar { padding: 8px 12px; margin-bottom: 12px; border-radius: 10px; }
.tax-page .tax-filter-bar > select.input,
.tax-page .tax-dashboard-period-toolbar .period-month-display,
.tax-page .tax-book-multi-select .platform-multi-trigger,
.tax-page .tax-filter-bar > .btn { height: 34px; min-height: 34px; font-size: 13px; }
.tax-page .tax-alert { gap: 3px 12px; margin-bottom: 12px; padding: 8px 12px; border-radius: 8px; font-size: 12px; line-height: 1.45; }
.tax-page .tax-alert > b { font-size: 12px; }
.tax-page .tax-consistency-banner { gap: 10px; margin-bottom: 12px; padding: 9px 12px; }
.tax-page .tax-consistency-icon { width: 24px; height: 24px; }
.tax-page .tax-consistency-banner strong { font-size: 13px; }
.tax-page .tax-kpi-board { margin-bottom: 12px; padding: 14px 16px; border-radius: 12px; }
.tax-page .tax-kpi-board-head { margin-bottom: 12px; }
.tax-page .tax-kpi-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); min-width: 0; gap: 8px; }
.tax-page .tax-kpi { min-width: 0; min-height: 78px; padding: 10px 12px; border-radius: 9px; }
.tax-page .tax-kpi-value { font-size: 20px; }
.tax-page .tax-kpi-hint { font-size: 11px; }

/* ---- 卡片（月度趋势 / 税务筹划报表） ---- */
.tax-page .card {
  border: 1px solid var(--diana-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 55, 112, .05), 0 8px 24px rgba(0, 55, 112, .06);
}
.tax-page .card .card-title { color: var(--diana-ink); font-weight: 700; }

/* ---- 月度趋势表 ---- */
.tax-page .tax-table th {
  padding: 12px 14px;
  border-bottom: 1px solid var(--diana-line);
  background: #F7F8FC;
  color: var(--diana-ink-soft);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .4px;
  text-transform: uppercase;
  white-space: nowrap;
}
.tax-page .tax-table th.num { text-align: right; }
.tax-page .tax-table td { padding: 9px 12px; font-size: 13px; color: var(--diana-ink); border-bottom: 1px solid #F0F1F7; }
.tax-page .tax-table td.num { text-align: right; }
.tax-page .tax-table tbody tr:hover td { background: var(--diana-primary-soft); }
.tax-page .tax-table th.sticky-left { background: #F7F8FC; }
.tax-page .tax-table td.sticky-left { background: #fff; font-weight: 600; }
.tax-page .tax-table tbody tr:hover td.sticky-left { background: var(--diana-primary-soft); }

/* 分析区域表格（销售额/毛利润/毛利率/净利润/净利率/综合税务）增强立体 */
.tax-page .tax-analysis-table { font-variant-numeric: tabular-nums; }
.tax-page .tax-analysis-table thead th {
  background: linear-gradient(180deg, #F4FBF6 0%, #E7F3EC 100%);
  color: var(--diana-primary-strong);
  border-bottom: 2px solid var(--diana-primary);
  padding: 13px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  text-shadow: none;
}
.tax-page .tax-analysis-table thead th:first-child {
  border-top-left-radius: 8px;
}
.tax-page .tax-analysis-table thead th:last-child {
  border-top-right-radius: 8px;
}
.tax-page .tax-analysis-table tbody td {
  padding: 13px 14px;
  font-size: 13.5px;
  border-bottom: 1px solid #E8F1EB;
  transition: background .15s ease;
}
.tax-page .tax-analysis-table tbody td.num { font-weight: 600; color: var(--diana-ink); }
.tax-page .tax-analysis-table tbody tr:last-child td { border-bottom: 1px solid #D5E7DD; }
.tax-page .tax-analysis-table tbody tr:hover td { background: linear-gradient(90deg, #F4FBF6 0%, #ECF6EF 100%); }
.tax-page .tax-analysis-table tbody tr td:first-child { font-weight: 600; color: var(--diana-ink); }
.tax-page .tax-analysis-table tfoot td {
  padding: 13px 14px;
  font-size: 13.5px;
  background: rgba(14, 159, 110, .05);
  border-top: 1.5px solid var(--diana-primary);
  border-bottom: none;
  color: var(--diana-ink);
  font-weight: 700;
}
.tax-page .tax-analysis-table tfoot td:first-child {
  border-bottom-left-radius: 8px;
}
.tax-page .tax-analysis-table tfoot td:last-child {
  border-bottom-right-radius: 8px;
}
.tax-page .tax-analysis-table tfoot td.num { color: var(--diana-primary-strong); font-weight: 700; }
.tax-page .tax-card {
  position: relative;
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid #D9E8E0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(11, 46, 33, .06), 0 2px 6px rgba(11, 46, 33, .04), 0 14px 28px rgba(11, 46, 33, .06);
  transition: box-shadow .2s ease, transform .2s ease;
}
.tax-page .tax-card:hover { box-shadow: 0 2px 4px rgba(11, 46, 33, .08), 0 6px 12px rgba(11, 46, 33, .06), 0 22px 40px rgba(11, 46, 33, .10); }
.tax-page .tax-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--diana-primary) 0%, #087A54 100%);
  content: "";
}
.tax-page .tax-card > .card-head {
  min-height: 56px;
  padding: 14px 18px;
  border-bottom: 1px solid #D5E7DD;
  background: linear-gradient(180deg, #F1F8F4 0%, #E7F3EC 100%);
  position: relative;
}
.tax-page .tax-card > .card-head::after {
  position: absolute;
  left: 4px; right: 0; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, var(--diana-primary) 0%, transparent 18%);
  content: "";
}
.tax-page .tax-card > .card-body { padding: 16px 18px 18px; }
.tax-page .tax-analysis-card > .card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}
.tax-page .tax-analysis-card > .card-head > * { min-width: 0; }
.tax-page .tax-analysis-card > .card-head .tax-card-actions { justify-self: end; }
/* 分析卡片头部深绿底白字（与上方 KPI 看板同色系，提升视觉级别） */
.tax-page .tax-analysis-card > .card-head {
  background: linear-gradient(180deg, #0E3F2D 0%, #0B2E21 100%);
  border-bottom: 1px solid rgba(127, 224, 184, .25);
  box-shadow: inset 0 1px 0 rgba(127, 224, 184, .18);
  min-height: 60px;
}
.tax-page .tax-analysis-card > .card-head::after {
  background: linear-gradient(90deg, rgba(127, 224, 184, .65) 0%, transparent 35%);
}
.tax-page .tax-analysis-card > .card-head .card-title {
  position: relative;
  padding-left: 14px;
  font-size: 16.5px;
  font-weight: 800;
  letter-spacing: -.2px;
  color: #fff;
}
.tax-page .tax-analysis-card > .card-head .card-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 18px;
  border-radius: 2px;
  background: linear-gradient(180deg, #7FE0B8 0%, #34C58A 100%);
  box-shadow: 0 0 8px rgba(127, 224, 184, .4);
}
.tax-page .tax-analysis-card > .card-head .tax-card-subtitle { color: rgba(231, 236, 245, .65); }
/* 深绿头内的按钮：白字描边（与默认 secondary 风格区分） */
.tax-page .tax-analysis-card > .card-head .btn.secondary {
  background: rgba(255, 255, 255, .08);
  color: #fff;
  border-color: rgba(255, 255, 255, .35);
  box-shadow: none;
}
.tax-page .tax-analysis-card > .card-head .btn.secondary:hover {
  background: rgba(255, 255, 255, .18);
  border-color: rgba(255, 255, 255, .55);
  color: #fff;
  box-shadow: none;
}
.tax-page .tax-analysis-card > .card-head .btn.secondary:focus-visible { outline-color: rgba(127, 224, 184, .55); }
.tax-page .tax-card-subtitle { margin-top: 4px; color: var(--text-sub); font-size: 12px; font-weight: 400; }
.tax-page .tax-data-quality-alert { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 16px; }
.tax-page .tax-data-quality-alert span { color: var(--text-sub); font-size: 12px; }
.tax-page .tax-consistency-banner {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 4px 16px var(--shadow);
}
.tax-page .tax-consistency-banner.is-ok { background: var(--primary-light); }
.tax-page .tax-consistency-banner.is-warning { border-color: var(--danger); }
.tax-page .tax-consistency-icon { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: var(--card); font-weight: 700; }
.tax-page .tax-consistency-banner.is-warning .tax-consistency-icon { background: var(--danger); }
.tax-page .tax-consistency-banner > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tax-page .tax-consistency-banner strong { color: var(--text); font-size: 14px; }
.tax-page .tax-consistency-banner > div span { color: var(--text-sub); font-size: 12px; }
.tax-page .tax-dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.tax-page .tax-resource-grid { grid-template-columns: minmax(0, 1fr); }
.tax-page .tax-refund-grid { grid-template-columns: minmax(0, 1fr); }
.tax-page .tax-comparison-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.tax-page .tax-comparison-grid > .tax-card { min-width: 0; }
.tax-page .tax-card-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tax-page .tax-vertical-compare-table { min-width: 720px; }
.tax-page .tax-vertical-compare-table thead th { text-align: center; white-space: normal; }
.tax-page .tax-vertical-compare-table thead th:first-child,
.tax-page .tax-vertical-compare-table tbody th { width: 190px; min-width: 190px; text-align: left; background: #f7faf8; color: var(--text); font-weight: 600; }
.tax-page .tax-table.tax-vertical-compare-table td { min-width: 160px; text-align: center; }
.tax-page .tax-vertical-compare-table .tax-group-total-cell { background: var(--primary-light); font-weight: 700; }
.tax-page .tax-comparison-edit-row th { color: var(--diana-primary-strong); }
.tax-page .tax-comparison-override-input { width: min(100%, 132px); height: 32px; padding: 4px 8px; text-align: right; font-variant-numeric: tabular-nums; }
.tax-page .tax-comparison-value { font-variant-numeric: tabular-nums; }
.tax-page .tax-comparison-edit-row td { background: #F4FBF7; }
.tax-page .tax-comparison-edit-row:hover td { background: #E9F8F0 !important; }
.tax-page .tax-overall-target-row th { color: var(--diana-primary-strong); }
.tax-page .tax-overall-target-row td { background: #F4FBF7; vertical-align: middle; }
.tax-page .tax-overall-target-value { min-width: 250px; color: var(--text); font-variant-numeric: tabular-nums; font-weight: 600; }
.tax-page .tax-overall-target-editor { display: flex; justify-content: center; gap: 8px; min-width: 250px; }
.tax-page .tax-overall-target-bound { display: grid; grid-template-columns: auto minmax(58px, 76px) auto; align-items: center; gap: 4px; color: var(--text-sub); font-size: 11px; }
.tax-page .tax-overall-target-bound i { color: var(--text-sub); font-style: normal; font-weight: 600; }
.tax-page .tax-rate-target-input { width: 100%; min-width: 0; height: 30px; padding: 4px 6px; text-align: center; }
.tax-page .tax-target-position-note { display: block; margin-top: 4px; color: var(--text-sub); font-size: 10px; text-align: center; }
.tax-page .tax-plan-target-conflict { align-items: flex-start; flex-direction: column; gap: 7px; }
.tax-page .tax-plan-target-conflict-note { color: var(--text-sub); font-size: 12px; }
.tax-page .tax-wide-table { min-width: 1500px; }
.tax-page .tax-table tfoot td { padding: 10px 12px; border-top: 1px solid #BDE1CE; background: #EAF7F0; color: var(--diana-ink); font-weight: 700; }
.tax-page .tax-table .is-positive { color: var(--success); }
.tax-page .tax-table .is-negative { color: var(--danger); }
.tax-page .tax-table .tax-no-data { color: var(--text-sub); }
.tax-page .tax-planning-ledger { margin-top: 0; }
.tax-page .tax-project-table { min-width: 1120px; }
.tax-page .tax-project-policy { max-width: 320px; white-space: normal; line-height: 1.55; }
.tax-page .tax-project-actions { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.tax-project-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.tax-project-form .form-row { align-items: flex-start; margin: 0; }
.tax-project-form .form-row label { flex: 0 0 76px; padding-top: 9px; }
.tax-project-form .form-row .input { min-width: 0; width: 100%; }
.tax-project-form .tax-project-form-wide { grid-column: 1 / -1; }
.tax-page .tax-resource-grid .card-body { min-height: 82px; }
.tax-page .tax-compact-empty { padding: 20px 10px; }
.tax-page .tax-legend { color: var(--text-sub); }
.tax-page .tax-legend i.actual { background: var(--primary); }
.tax-page .tax-legend i.benchmark { height: 0; border-top: 2px dashed var(--warning); background: transparent; }
@media (max-width: 980px) {
  .tax-page .tax-dashboard-grid,
  .tax-page .tax-comparison-grid { grid-template-columns: 1fr; }
  .tax-page .tax-book-multi-select { width: min(100%, 420px); }
}
@media (max-width: 640px) {
  .tax-plan-import-nature { grid-template-columns: 1fr; }
  .tax-page .tax-consistency-banner { grid-template-columns: 34px minmax(0, 1fr); }
  .tax-page .tax-consistency-banner > .tag { grid-column: 2; justify-self: start; }
  .tax-project-form { grid-template-columns: 1fr; }
  .tax-project-form .tax-project-form-wide { grid-column: auto; }
}

/* ---- 税务筹划报表（金蝶版式）：轻量品牌化 ---- */
.tax-page .bs-report-head h2 { color: var(--diana-ink); }
.tax-page .tax-plan-validation-status { border-radius: 9999px; }
.tax-page .tax-plan-validation-status.is-ok { border-color: #A9DCC7; background: #EDF9F3; color: var(--diana-ok); }
.tax-page .tax-plan-validation-status.is-error { border-color: #F5C6D2; background: #FDF3F5; color: var(--diana-warn); }
.tax-page .tax-plan-source-note { border-radius: 10px; border-color: #C9E5D4; }
.tax-page .tax-plan-source-chip,
.tax-page .tax-plan-period-head { border-radius: 8px; }
.tax-page .tax-plan-period-head.actual { background: var(--diana-primary-soft); color: var(--diana-primary-strong); }
.tax-page .tax-plan-source-chip.actual { border-color: #B5E3CE; background: var(--diana-primary-soft); color: var(--diana-primary-strong); }
.tax-page .tax-plan-adjustment-input { border-radius: 6px; border-color: var(--diana-line); }
.tax-page .tax-plan-adjustment-input:focus { border-color: var(--diana-primary); outline: 2px solid var(--diana-primary-ring); outline-offset: 0; }
.tax-page .tax-plan-planning-input { border-radius: 6px; border-color: var(--diana-line); }
.tax-page .tax-plan-planning-input:focus { border-color: var(--diana-primary); outline: 2px solid var(--diana-primary-ring); outline-offset: 0; }
.tax-page .tax-plan-report-actions .btn,
.tax-page .tax-plan-report-actions .btn.secondary { margin-left: 6px; }

/* ---- 打印：深色看板回退为浅色，节省墨量且保持可读 ---- */
@media print {
  .tax-page .tax-kpi-board { background: #fff !important; color: var(--diana-ink) !important; box-shadow: none !important; border: 1px solid #333 !important; }
  .tax-page .tax-kpi-board-title { color: var(--diana-ink) !important; }
  .tax-page .tax-kpi { border-color: #999 !important; background: #fff !important; }
  .tax-page .tax-kpi-label { color: #444 !important; }
  .tax-page .tax-kpi-value { color: #000 !important; }
  .tax-page .tax-kpi-hint { color: #666 !important; }
  .tax-page .tax-kpi.is-accent .tax-kpi-value,
  .tax-page .tax-kpi.is-warn .tax-kpi-value { color: #000 !important; }
  .tax-page .tax-filter-bar { box-shadow: none !important; }
}

/* ===== 税筹看板图表（纯 SVG） ===== */
.tax-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; margin-bottom: 16px; }
.tax-chart { width: 100%; height: auto; display: block; }
.tax-legend { display: inline-flex; align-items: center; gap: 14px; font-size: 12px; color: #5C7A6C; flex-wrap: wrap; }
.tax-legend span { display: inline-flex; align-items: center; gap: 5px; }
.tax-legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.tax-legend-line { width: 20px; height: 4px; flex: none; overflow: visible; }

/* 税筹分析：主体对比表与月度趋势图 */
.tax-page .tax-analysis-stack { display: grid; gap: 16px; margin-bottom: 16px; }
.tax-page .tax-analysis-card { margin-bottom: 0; }
.tax-page .tax-analysis-table { width: 100%; min-width: 0; table-layout: fixed; }
.tax-page .tax-analysis-card .table-wrap { width: 100%; overflow-x: auto; }
.tax-page .tax-analysis-table th:first-child,
.tax-page .tax-analysis-table td:first-child { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
.tax-page .tax-analysis-table th.num,
.tax-page .tax-analysis-table td.num { min-width: 0; }
.tax-page .tax-analysis-amount-table th:nth-child(1),
.tax-page .tax-analysis-amount-table td:nth-child(1) { width: 25%; }
.tax-page .tax-analysis-amount-table th:nth-child(2),
.tax-page .tax-analysis-amount-table td:nth-child(2),
.tax-page .tax-analysis-amount-table th:nth-child(3),
.tax-page .tax-analysis-amount-table td:nth-child(3),
.tax-page .tax-analysis-amount-table th:nth-child(5),
.tax-page .tax-analysis-amount-table td:nth-child(5) { width: 17%; }
.tax-page .tax-analysis-amount-table th:nth-child(4),
.tax-page .tax-analysis-amount-table td:nth-child(4),
.tax-page .tax-analysis-amount-table th:nth-child(6),
.tax-page .tax-analysis-amount-table td:nth-child(6) { width: 12%; }
.tax-page .tax-analysis-rate-table th:nth-child(1),
.tax-page .tax-analysis-rate-table td:nth-child(1) { width: 34%; }
.tax-page .tax-analysis-rate-table th:nth-child(n + 2),
.tax-page .tax-analysis-rate-table td:nth-child(n + 2) { width: 22%; }
.tax-page .tax-analysis-gross-rate-table th:nth-child(1),
.tax-page .tax-analysis-gross-rate-table td:nth-child(1) { width: 27%; }
.tax-page .tax-analysis-gross-rate-table th:nth-child(2),
.tax-page .tax-analysis-gross-rate-table td:nth-child(2) { width: 19%; }
.tax-page .tax-analysis-gross-rate-table th:nth-child(n + 3),
.tax-page .tax-analysis-gross-rate-table td:nth-child(n + 3) { width: 18%; }
.tax-page .tax-analysis-net-profit-rate-table th:nth-child(1),
.tax-page .tax-analysis-net-profit-rate-table td:nth-child(1) { width: 22%; }
.tax-page .tax-analysis-net-profit-rate-table th:nth-child(2),
.tax-page .tax-analysis-net-profit-rate-table td:nth-child(2),
.tax-page .tax-analysis-net-profit-rate-table th:nth-child(3),
.tax-page .tax-analysis-net-profit-rate-table td:nth-child(3) { width: 17%; }
.tax-page .tax-analysis-net-profit-rate-table th:nth-child(n + 4),
.tax-page .tax-analysis-net-profit-rate-table td:nth-child(n + 4) { width: 22%; }
.tax-page .tax-combined-tax-table th:nth-child(1),
.tax-page .tax-combined-tax-table td:nth-child(1) { width: 22%; }
.tax-page .tax-combined-tax-table th:nth-child(2),
.tax-page .tax-combined-tax-table td:nth-child(2) { width: 15%; }
.tax-page .tax-combined-tax-table th:nth-child(3),
.tax-page .tax-combined-tax-table td:nth-child(3) { width: 13%; }
.tax-page .tax-combined-tax-table th:nth-child(4),
.tax-page .tax-combined-tax-table td:nth-child(4),
.tax-page .tax-combined-tax-table th:nth-child(5),
.tax-page .tax-combined-tax-table td:nth-child(5) { width: 15%; }
.tax-page .tax-combined-tax-table th:nth-child(6),
.tax-page .tax-combined-tax-table td:nth-child(6) { width: 11%; }
.tax-page .tax-combined-tax-table th:nth-child(7),
.tax-page .tax-combined-tax-table td:nth-child(7) { width: 9%; }
.tax-page .tax-combined-tax-table .tax-combined-target-tax-inline-input { width: 100%; min-width: 0; }
.tax-page .tax-combined-tax-table .tax-combined-target-rate-inline-input { width: calc(100% - 24px); min-width: 0; }
.tax-page .tax-combined-tax-table .tax-inline-edit-with-unit { display: inline-flex; align-items: center; justify-content: flex-end; width: 100%; }
.tax-page .tax-combined-tax-table .tax-inline-input-unit { flex: 0 0 18px; }
.tax-page .tax-combined-tax-editor-table th:nth-child(1),
.tax-page .tax-combined-tax-editor-table td:nth-child(1) { width: 22%; }
.tax-page .tax-combined-tax-editor-table th:nth-child(n + 2),
.tax-page .tax-combined-tax-editor-table td:nth-child(n + 2) { width: 19.5%; }
.tax-page .tax-combined-tax-editor-table td:nth-child(n + 2) .input {
  display: block; width: 100%; height: 32px; padding: 4px 10px;
  text-align: right; font-variant-numeric: tabular-nums; font-weight: 600;
  box-sizing: border-box;
}
.tax-page .tax-combined-tax-target-editor-table th:nth-child(1),
.tax-page .tax-combined-tax-target-editor-table td:nth-child(1) { width: 25%; }
.tax-page .tax-combined-tax-target-editor-table th:nth-child(2),
.tax-page .tax-combined-tax-target-editor-table td:nth-child(2) { width: 14%; }
.tax-page .tax-combined-tax-target-editor-table th:nth-child(3),
.tax-page .tax-combined-tax-target-editor-table td:nth-child(3),
.tax-page .tax-combined-tax-target-editor-table th:nth-child(4),
.tax-page .tax-combined-tax-target-editor-table td:nth-child(4) { width: 30.5%; }
.tax-page .tax-combined-tax-target-editor-table td:nth-child(n + 3) .input {
  display: block; width: 100%; min-width: 0; height: 32px; padding: 4px 10px;
  text-align: right; font-variant-numeric: tabular-nums; font-weight: 600;
  box-sizing: border-box;
}
.tax-page .tax-combined-tax-target-editor-table .tax-inline-edit-with-unit { display: inline-flex; align-items: center; width: 100%; }
.tax-page .tax-combined-tax-target-editor-table .tax-combined-target-rate-editor-input { width: calc(100% - 24px); min-width: 0; }
.tax-page .tax-combined-tax-target-editor-table .tax-inline-input-unit { flex: 0 0 18px; }
.tax-page .tax-combined-tax-range-editor-wrap { margin-top: 16px; }
.tax-target-sales-editor .tax-combined-tax-editor-table {
  width: 100%; min-width: 0; table-layout: fixed;
}
.tax-target-sales-editor .tax-combined-tax-editor-table th,
.tax-target-sales-editor .tax-combined-tax-editor-table td {
  min-width: 0;
}
.tax-target-sales-editor .tax-combined-tax-editor-table th {
  white-space: normal; line-height: 1.35; overflow-wrap: anywhere;
}
.tax-target-sales-editor .tax-combined-tax-editor-table th:nth-child(1),
.tax-target-sales-editor .tax-combined-tax-editor-table td:nth-child(1) {
  width: 25% !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tax-target-sales-editor .tax-combined-tax-editor-table th:nth-child(n + 2),
.tax-target-sales-editor .tax-combined-tax-editor-table td:nth-child(n + 2) {
  width: 18.75% !important;
}
.tax-target-sales-editor .tax-combined-tax-editor-table td:nth-child(n + 2) .input {
  display: block; width: 100%; min-width: 0; max-width: none; height: 32px;
  padding: 4px 8px; box-sizing: border-box;
  text-align: right; font-variant-numeric: tabular-nums; font-weight: 600;
}
.tax-page .tax-card-actions { flex: 0 0 auto; white-space: nowrap; }
.tax-page .combined-rate-edit-pair {
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
}
.tax-page .combined-rate-edit-input {
  width: 58px; height: 28px; padding: 2px 6px; box-sizing: border-box;
  text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 12px;
}
.tax-page .combined-rate-edit-tilde { color: var(--text-sub); font-size: 12px; padding: 0 2px; }
.tax-page .tax-analysis-table .tax-target-gross-profit-inline-input,
.tax-page .tax-analysis-table .tax-target-gross-profit-rate-inline-input { width: calc(100% - 24px); }
.tax-page .tax-analysis-table .tax-inline-input-unit { display: inline-block; width: 20px; margin-left: 4px; color: var(--text-sub); text-align: left; }
.tax-page .tax-analysis-chart-block {
  margin-top: 18px;
  padding: 18px 18px 14px;
  border-top: 1.5px solid var(--diana-primary-soft);
  background: linear-gradient(180deg, #FAFDFC 0%, #EFF8F2 100%);
  border-radius: 0 0 10px 10px;
  position: relative;
}
.tax-page .tax-analysis-chart-block::before {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: -1.5px;
  height: 1.5px;
  background: linear-gradient(90deg, var(--diana-primary) 0%, transparent 22%);
}
.tax-page .tax-analysis-chart-title {
  margin-bottom: 12px;
  color: var(--diana-ink);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -.1px;
  position: relative;
  padding-left: 12px;
}
.tax-page .tax-analysis-chart-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--diana-primary) 0%, var(--diana-primary-strong) 100%);
}
.tax-page .tax-analysis-chart-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.tax-page .tax-analysis-legend { margin-bottom: 8px; color: var(--text-sub); }
.tax-page .tax-analysis-chart-meta .tax-analysis-legend { margin-bottom: 0; }
.tax-page .tax-analysis-chart-unit { flex: none; color: var(--text-sub); font-size: 12px; white-space: nowrap; }
.tax-page .tax-analysis-legend i { border-radius: 9999px; }
.tax-page .tax-analysis-note { padding: 12px 14px; border-left: 3px solid var(--warning); background: var(--primary-light); color: var(--text-sub); font-size: 13px; line-height: 1.6; }
.tax-page .tax-chart-value-label { font-size: 11px; font-weight: 700; paint-order: stroke; stroke: #fff; stroke-width: 3px; stroke-linejoin: round; }
.tax-page .tax-combined-tax-chart-block { display: grid; gap: 20px; }
.tax-page .tax-combined-tax-trend + .tax-combined-tax-trend { padding-top: 18px; border-top: 1px solid var(--border); }
@media (max-width: 900px) {
  .tax-page .tax-analysis-table { min-width: 900px; }
}
@media (max-width: 640px) {
  .tax-page .tax-analysis-card > .card-head { grid-template-columns: minmax(0, 1fr); }
  .tax-page .tax-analysis-card > .card-head .tax-card-actions { justify-self: start; }
  .tax-page .tax-analysis-chart-block { margin-top: 14px; padding-top: 14px; }
}

/* ===== 租户侧组织/权限页面（org.js 依赖；与既有 modal-head/modal-foot 并存） ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  padding: 20px;
}
.modal-card {
  background: #fff;
  border-radius: 14px;
  width: min(520px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28), 0 2px 8px rgba(15, 23, 42, 0.08);
  display: flex; flex-direction: column; overflow: hidden;
  animation: modal-pop .18s ease-out;
}
@keyframes modal-pop {
  from { transform: translateY(8px) scale(.98); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px; border-bottom: 1px solid var(--border, #e5e8ee);
}
.modal-header .modal-title {
  font-size: 16px; font-weight: 700; color: var(--text, #1f2430);
  letter-spacing: -.2px;
}
.modal-header .modal-close {
  cursor: pointer; font-size: 20px; line-height: 1; color: var(--text-sub, #6b7280);
  background: none; border: none; padding: 4px 8px; border-radius: 8px;
  transition: background .15s;
}
.modal-header .modal-close:hover { background: #f4f6fa; color: var(--text, #1f2430); }
.modal-body { padding: 20px 22px; overflow: auto; flex: 1 1 auto; }
.modal-footer {
  padding: 14px 22px; border-top: 1px solid var(--border, #e5e8ee);
  display: flex; justify-content: flex-end; gap: 10px; background: #fafbfc;
}

/* ===== 页面卡片 + 筛选条（用户管理 / 部门管理 / 角色管理 三页通用） ===== */
.page-card {
  background: #fff;
  border-radius: 14px;
  padding: 22px 24px;
  border: 1px solid var(--border, #e5e8ee);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03), 0 8px 24px rgba(15, 23, 42, 0.04);
}
.page-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; padding-bottom: 14px;
  border-bottom: 1px solid var(--border, #e5e8ee);
}
.page-card-header h2 {
  margin: 0; font-size: 18px; font-weight: 700; color: var(--text, #1f2430);
  letter-spacing: -.2px;
}
.page-card-actions { display: flex; gap: 8px; align-items: center; }
.page-card-actions .btn-primary {
  padding: 8px 18px; font-weight: 600;
  box-shadow: 0 4px 12px rgba(14, 159, 110, 0.22);
}
.page-card-actions .btn-primary:hover {
  box-shadow: 0 6px 18px rgba(14, 159, 110, 0.32);
  transform: translateY(-1px);
}
.page-card-actions .btn {
  border-radius: 9999px; padding: 7px 16px; font-size: 13px;
}

/* ===== 筛选条（filter-bar） ===== */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  padding: 14px 16px; margin-bottom: 16px;
  background: linear-gradient(180deg, #f7f9fc 0%, #f1f4f9 100%);
  border: 1px solid var(--border, #e5e8ee);
  border-radius: 12px;
}
.filter-bar label {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--text-sub, #6b7280); font-weight: 500;
}
.filter-bar input,
.filter-bar select {
  padding: 7px 12px; border: 1px solid var(--border, #e5e8ee);
  border-radius: 8px; font-size: 13px; background: #fff;
  color: var(--text, #1f2430); min-width: 180px;
  transition: border .15s, box-shadow .15s;
}
.filter-bar input:focus,
.filter-bar select:focus {
  border-color: var(--primary, #0E9F6E);
  outline: none; box-shadow: 0 0 0 3px rgba(14, 159, 110, 0.12);
}
.filter-bar .btn-sm { padding: 6px 16px; }

/* ===== 表单网格（form-grid）—— 编辑/新增弹窗 ===== */
.form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px;
}
.form-grid label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 12.5px; color: var(--text-sub, #6b7280); font-weight: 500;
}
.form-grid label:has(span.required)::after {
  content: ' *'; color: #e15050; font-weight: 700;
}
.form-grid input,
.form-grid select {
  padding: 8px 12px; border: 1px solid var(--border, #e5e8ee);
  border-radius: 8px; font-size: 13px; background: #fff;
  color: var(--text, #1f2430);
  transition: border .15s, box-shadow .15s;
}
.form-grid input:focus,
.form-grid select:focus {
  border-color: var(--primary, #0E9F6E);
  outline: none; box-shadow: 0 0 0 3px rgba(14, 159, 110, 0.12);
}
.form-grid input:disabled {
  background: #f4f6fa; color: var(--text-sub, #6b7280); cursor: not-allowed;
}
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
}

/* ===== 徽章（badge）—— 角色/细分角色 ===== */
.badge {
  display: inline-block;
  padding: 2px 10px; border-radius: 9999px;
  font-size: 11.5px; font-weight: 500;
  background: var(--border, #dde8e1); color: var(--text-sub, #5C7A6C);
  margin-right: 4px; white-space: nowrap;
}
.badge-role {
  background: var(--primary-light, #E6F6EF);
  color: var(--primary-dark, #087A54);
  font-weight: 600;
}
.badge-sub {
  background: #FFF4E0; color: #8A5A00;
}
.badge-info {
  background: #E0F0FF; color: #0B5AA6;
}

/* ===== 用户管理表格专属美化 ===== */
.org-users-table thead th {
  background: linear-gradient(180deg, #f7f9fc 0%, #eef2f7 100%);
  color: var(--text, #1f2430); font-weight: 700;
  font-size: 12px; letter-spacing: .3px;
  border-bottom: 2px solid var(--primary, #0E9F6E);
  padding: 12px 10px; white-space: nowrap;
}
.org-users-table tbody td {
  padding: 10px 10px; font-size: 13px; vertical-align: middle;
  border-bottom: 1px solid var(--border-soft, #eef1f6);
}
.org-users-table tbody tr:hover { background: #fafbfc; }
.org-users-table .col-user strong { color: var(--text, #1f2430); font-weight: 700; }
.org-users-table .col-muted { color: var(--text-sub, #6b7280); font-size: 12.5px; }
.org-users-table .col-time { color: var(--text-sub, #6b7280); font-size: 12px; white-space: nowrap; }
.org-users-table .col-num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.org-users-table .ops-cell {
  display: flex; flex-direction: column; gap: 5px; min-width: 96px;
}
.org-users-table .ops-cell .btn {
  padding: 4px 10px; font-size: 12px; border-radius: 9999px;
  min-width: 88px; text-align: center; transition: transform .12s, box-shadow .12s;
}
.org-users-table .ops-cell .btn:hover { transform: translateY(-1px); }

/* ===== muted 文本辅助（仅 org 页生效，不扰动历史页面） ===== */
.org-depts-layout .muted, .org-roles-layout .muted,
.org-users-table .muted { color: var(--text-sub, #6b7280); }
.data-table td.muted { text-align: center; padding: 24px; }
#org-dept-detail.muted, #org-role-detail.muted,
#org-dept-tree > .muted, #org-role-list > .muted { text-align: center; padding: 24px; }
.load-error {
  color: #c43d42; background: #fdf1f0; border: 1px solid #f3c1bf;
  border-radius: 10px; padding: 16px 18px; margin: 10px 0;
  font-size: 13px; line-height: 1.7; text-align: left;
}

/* ===== 部门/角色页共用骨架 ===== */
.org-depts-layout {
  display: grid; grid-template-columns: 320px 1fr; gap: 18px;
}
@media (max-width: 900px) {
  .org-depts-layout { grid-template-columns: 1fr; }
}
.dept-tree-wrap {
  background: #fff; border: 1px solid var(--border, #e5e8ee);
  border-radius: 12px; padding: 14px; min-height: 320px;
}

/* ===== 部门管理：树 + 成员面板 ===== */
.dept-tree-actions {
  display: flex; justify-content: flex-end; margin-bottom: 10px;
}
.dept-tree-actions .btn { border-radius: 9999px; padding: 5px 14px; font-size: 12px; }
.dept-tree { font-size: 13px; }
.dept-tree-node {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 7px 10px; margin: 2px 0; border-radius: 8px; cursor: pointer;
  transition: background .12s;
}
.dept-tree-node:hover { background: #f4f8f6; }
.dept-tree-node.selected {
  background: linear-gradient(180deg, #e7f5ee 0%, #d4ecde 100%);
  box-shadow: inset 3px 0 0 var(--primary, #0E9F6E);
}
.dept-name { flex: 1 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.dept-ops { display: inline-flex; gap: 2px; opacity: 0; transition: opacity .12s; }
.dept-tree-node:hover .dept-ops,
.dept-tree-node.selected .dept-ops { opacity: 1; }
.dept-ops button {
  width: 22px; height: 22px; border-radius: 9999px; cursor: pointer;
  border: 1px solid var(--border, #e5e8ee); background: #fff; color: var(--text-sub, #6b7280);
  font-size: 13px; line-height: 1; display: inline-flex; align-items: center; justify-content: center;
  transition: all .12s;
}
.dept-ops button:hover { border-color: var(--primary, #0E9F6E); color: var(--primary, #0E9F6E); }
.dept-members {
  background: #fff; border: 1px solid var(--border, #e5e8ee);
  border-radius: 12px; padding: 16px; min-height: 320px; overflow-x: auto;
}
.dept-detail-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px;
}
.dept-detail-header h3 { margin: 0; font-size: 16px; font-weight: 700; color: var(--text, #1f2430); }

/* ===== 角色管理：两级列表 + 详情 ===== */
.org-roles-layout {
  display: grid; grid-template-columns: 360px 1fr; gap: 18px;
}
@media (max-width: 900px) {
  .org-roles-layout { grid-template-columns: 1fr; }
}
.role-list-wrap {
  background: #fff; border: 1px solid var(--border, #e5e8ee);
  border-radius: 12px; padding: 12px; min-height: 320px; overflow: auto;
}
.role-list { font-size: 13px; }
.role-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 10px; margin: 2px 0; border-radius: 8px; cursor: pointer;
  transition: background .12s;
}
.role-top:hover { background: #f4f8f6; }
.role-top.selected {
  background: linear-gradient(180deg, #e7f5ee 0%, #d4ecde 100%);
  box-shadow: inset 3px 0 0 var(--primary, #0E9F6E);
}
.role-top-name { display: flex; align-items: center; gap: 6px; font-weight: 600; min-width: 0; }
.role-top-name > .muted { flex: 0 0 auto; }
.role-top-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary, #0E9F6E); flex: none;
}
.role-sub {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 10px 7px 34px; margin: 2px 0; border-radius: 8px; cursor: pointer;
  color: var(--text, #1f2430);
  transition: background .12s;
}
.role-sub:hover { background: #f4f8f6; }
.role-sub.selected {
  background: linear-gradient(180deg, #fdf2e0 0%, #fae6c2 100%);
  box-shadow: inset 3px 0 0 #d99a2b;
}
.role-sub-indent { color: var(--text-sub, #6b7280); font-size: 11px; flex: none; }
.role-sub .muted { flex: 0 0 auto; }
.role-sub-ops { display: inline-flex; gap: 4px; margin-left: auto; opacity: 0; transition: opacity .12s; }
.role-sub:hover .role-sub-ops,
.role-sub.selected .role-sub-ops { opacity: 1; }
.btn-mini {
  border: 1px solid var(--border, #e5e8ee); background: #fff; color: var(--text-sub, #6b7280);
  border-radius: 9999px; font-size: 12px; cursor: pointer;
  padding: 2px 10px; transition: all .12s; white-space: nowrap;
}
.btn-mini:hover { border-color: var(--primary, #0E9F6E); color: var(--primary, #0E9F6E); }
.btn-mini.danger:hover { border-color: #d9534f; color: #d9534f; background: #fdf1f0; }
.role-detail {
  background: #fff; border: 1px solid var(--border, #e5e8ee);
  border-radius: 12px; padding: 16px; min-height: 320px; overflow-x: auto;
}

/* ===== org 页内小字号辅助文本（不污染全局 .small 语义） ===== */
.org-roles-layout .small, .org-depts-layout .small { font-size: 12px; }
.page-card-actions .small { font-size: 12px; line-height: 1.5; }

/* ===== 分配用户弹窗：左右双选框 ===== */
.assign-grid {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: start;
}
.assign-grid h5 { margin: 0 0 8px; font-size: 12.5px; color: var(--text-sub, #6b7280); font-weight: 600; }
.assign-grid select {
  width: 100%; border: 1px solid var(--border, #e5e8ee); border-radius: 8px;
  padding: 6px; font-size: 13px; background: #fff; color: var(--text, #1f2430);
}
.assign-grid select option { padding: 3px 4px; }
.assign-actions { display: flex; flex-direction: column; align-items: center; align-self: center; gap: 6px; }
.assign-actions .btn { border-radius: 9999px; font-size: 12px; padding: 5px 14px; min-width: 40px; }
.assign-grid .assign-search {
  width: 100%; box-sizing: border-box; margin-bottom: 8px;
  border: 1px solid var(--border, #e5e8ee); border-radius: 8px;
  padding: 7px 12px; font-size: 13px; background: #fff; color: var(--text, #1f2430);
}
.assign-grid .assign-search:focus { border-color: var(--primary, #0E9F6E); outline: none; box-shadow: 0 0 0 3px rgba(14, 159, 110, 0.12); }

/* ===== 角色详情：头部 + 权限编辑 ===== */
.role-detail-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px; margin-bottom: 10px;
}
.role-detail-header h3 { margin: 0; font-size: 16px; font-weight: 700; color: var(--text, #1f2430); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.role-detail-header .btn { border-radius: 9999px; font-size: 12px; padding: 5px 14px; }
.role-detail > p { margin: 6px 0; line-height: 1.6; }
.role-detail details { margin: 10px 0 14px; }
.role-detail summary { cursor: pointer; user-select: none; display: inline-block; padding: 6px 12px; background: #f6f8fa; border-radius: 8px; border: 1px solid var(--border, #e5e8ee); font-weight: 500; }
.role-detail summary:hover { border-color: var(--primary, #0E9F6E); color: var(--primary, #0E9F6E); }
.perm-list {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 10px 0 8px; padding: 12px; background: #fafbfc;
  border: 1px solid var(--border, #e5e8ee); border-radius: 10px;
}
.perm-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: #fff; border: 1px solid var(--border, #e5e8ee);
  border-radius: 9999px; padding: 4px 12px; font-size: 12px; cursor: pointer;
  transition: all .12s;
}
.perm-chip:hover { border-color: var(--primary, #0E9F6E); }
.perm-chip input { accent-color: var(--primary, #0E9F6E); cursor: pointer; }
.org-dept-member-table, .org-role-member-table { min-width: 480px; }
.role-list-wrap select, .dept-tree-wrap select { max-width: 100%; }

/* ===== ICP 备案页脚 ===== */
.icp-footer {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 6px 14px; padding: 12px 24px 14px;
  border-top: 1px solid var(--border, #dde8e1);
  font-size: 12px; color: var(--text-sub, #5C7A6C); background: transparent;
}
.icp-link { color: inherit; text-decoration: none; }
.icp-link:hover { color: var(--primary, #0E9F6E); text-decoration: underline; }
