[v-cloak] { display: none; }

html {
  width: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden !important;
  overflow-y: auto;
  max-width: 100vw;
  /* 防止动画导致高度变化触发滚动条 */
  height: 100%;
}

body {
  width: 100%;
  margin: 0;
  padding: 0;
  max-width: 100vw;
  overflow-x: hidden !important;
  /* 防止动画导致高度变化触发滚动条 */
  min-height: 100vh;
  height: auto;
}

/* 科技风格渐变背景 - 柔和渐变无分界，固定到视口 */
body {
  background: 
    radial-gradient(ellipse 120% 80% at 20% 30%, rgba(99, 102, 241, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse 120% 80% at 80% 70%, rgba(168, 85, 247, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse 100% 100% at 50% 50%, rgba(59, 130, 246, 0.06) 0%, transparent 70%),
    linear-gradient(180deg, #0f172a 0%, #131829 20%, #161c36 40%, #161c36 60%, #131829 80%, #0f172a 100%);
  background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%;
  background-position: 0% 50%, 0% 0%, 0% 0%, 0% 50%;
  background-attachment: fixed, fixed, fixed, fixed;
  position: relative;
  min-height: 100vh;
  height: auto;
  overflow-y: auto;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
  /* 防止动画导致布局重排 */
  will-change: auto;
  transform: translateZ(0);
}

/* 移除所有动画，避免触发滚动条 */
/* @keyframes gradientShift {
  0% { background-position: 0% 50%, 0% 0%, 0% 0%, 0% 50%; }
  50% { background-position: 0% 50%, 0% 0%, 0% 0%, 25% 50%; }
  100% { background-position: 0% 50%, 0% 0%, 0% 0%, 0% 50%; }
} */

/* @keyframes backgroundPulse {
  0%, 100% { filter: brightness(1) contrast(1); }
  50% { filter: brightness(1.05) contrast(1.02); }
} */

/* 网格与光晕层随整页延伸，避免 100vh 处出现横线分界 */
body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 100vh;
  background-image: 
    linear-gradient(rgba(99, 102, 241, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(168, 85, 247, 0.05) 2px, transparent 2px),
    linear-gradient(90deg, rgba(168, 85, 247, 0.05) 2px, transparent 2px),
    radial-gradient(circle at 15% 25%, rgba(99, 102, 241, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 85% 75%, rgba(168, 85, 247, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.08) 0%, transparent 55%);
  background-size: 40px 40px, 40px 40px, 200px 200px, 200px 200px, 60% 60%, 60% 60%, 80% 80%;
  background-repeat: repeat, repeat, repeat, repeat, no-repeat, no-repeat, no-repeat;
  pointer-events: none;
  z-index: 0;
  opacity: 0.95;
}

body::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 100vh;
  background: 
    radial-gradient(ellipse 80% 50% at 10% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 55%),
    radial-gradient(ellipse 70% 45% at 90% 80%, rgba(168, 85, 247, 0.08) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 50% 50%, rgba(59, 130, 246, 0.05) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

/* 移除所有动画，避免触发滚动条 */
/* @keyframes gridPulse {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; }
} */

/* @keyframes gridMove {
  0% { background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0; }
  100% { background-position: 40px 40px, 40px 40px, 200px 200px, 200px 200px, 100px 100px, -100px -100px, 50px 50px; }
} */

/* @keyframes lightMove {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.8; }
  33% { transform: translate(20px, -30px) scale(1.05); opacity: 1; }
  66% { transform: translate(-20px, 30px) scale(0.95); opacity: 0.9; }
} */

#app {
  position: relative;
  z-index: 1;
  max-width: 100%;
  overflow-x: hidden;
}

/* 星点层随 #app 整页延伸，避免与网格层产生分界 */
#app::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 100vh;
  background-image: 
    radial-gradient(2px 2px at 20% 30%, rgba(99, 102, 241, 0.5), transparent),
    radial-gradient(2px 2px at 60% 70%, rgba(168, 85, 247, 0.5), transparent),
    radial-gradient(1px 1px at 50% 50%, rgba(59, 130, 246, 0.6), transparent),
    radial-gradient(1px 1px at 80% 20%, rgba(99, 102, 241, 0.4), transparent),
    radial-gradient(2px 2px at 30% 80%, rgba(168, 85, 247, 0.4), transparent);
  background-repeat: repeat;
  background-size: 200px 200px, 300px 300px, 150px 150px, 250px 250px, 180px 180px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
}

/* 移除 sparkle 动画，避免 transform 触发滚动条 */
/* @keyframes sparkle {
  0%, 100% { opacity: 0.4; transform: translate(0, 0); }
  25% { opacity: 0.8; transform: translate(10px, -10px); }
  50% { opacity: 0.6; transform: translate(-10px, 10px); }
  75% { opacity: 0.9; transform: translate(5px, 5px); }
} */

.finance-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
  table-layout: fixed;
}

/* 为财务总报表表格设置固定布局，确保100%显示 */
.table-container .finance-table {
  width: 100%;
  table-layout: fixed;
}

.finance-table th {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(147, 51, 234, 0.15) 100%);
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 10px 6px;
  text-align: center;
  font-weight: 600;
  white-space: normal;
  word-wrap: break-word;
  position: sticky;
  top: 0;
  z-index: 10;
  overflow: hidden;
}
/* 平台直通车表头：不透明背景 */
.finance-table.direct-train-table th {
  background: linear-gradient(135deg, #1e3a5f 0%, #2d1b4e 100%);
  border-color: rgba(59, 130, 246, 0.5);
}

.finance-table td {
  border: 1px solid rgba(59, 130, 246, 0.2);
  padding: 8px 6px;
  text-align: center;
  white-space: normal;
  word-wrap: break-word;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 日总业绩与特殊收支：表头/行高像素级统一 */
.daily-summary-table th,
.store-detail-table th {
  min-height: 44px;
  height: 44px;
  padding-top: 10px;
  padding-bottom: 10px;
}
.daily-summary-table td,
.store-detail-table td {
  min-height: 38px;
  height: 38px;
  padding-top: 5px;
  padding-bottom: 5px;
  vertical-align: middle;
}
.daily-summary-table th:first-child,
.daily-summary-table td:first-child,
.store-detail-table th:first-child,
.store-detail-table td:first-child {
  min-width: 138px !important;
  width: 138px !important;
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
}
/* 收支表输入框收敛尺寸，避免行高被明显撑大 */
.store-detail-table .editable-cell input {
  min-height: 28px;
  height: 28px;
  padding: 3px 4px;
  font-size: 12px;
  line-height: 1.2;
}

.finance-table tbody tr {
  transition: background-color 0.15s ease;
}

.finance-table tbody tr:hover {
  background-color: rgba(59, 130, 246, 0.15);
}

.editable-cell {
  /* 去掉原来的黄灰色背景，改为与整体风格统一的深色输入底色 */
  background-color: transparent;
  position: relative;
}

.editable-cell input {
  width: 100%;
  border: 1px solid rgba(56, 189, 248, 0.45); /* 青色描边，稍微突出 */
  background: rgba(15, 23, 42, 0.92); /* 深蓝底色，与整体背景协调 */
  text-align: center;
  padding: 6px 4px;
  font-size: 13px;
  color: #e2e8f0;
  font-weight: 500;
  box-sizing: border-box;
  border-radius: 4px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.editable-cell input:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.9);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.35);
  background-color: rgba(15, 23, 42, 0.98);
}

.summary-row {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.9) 50%, rgba(99, 102, 241, 0.2) 100%) !important;
  font-weight: 700;
  color: #e2e8f0;
  border-top: 1px solid rgba(99, 102, 241, 0.5);
}

.summary-row td {
  border-top: 2px solid rgba(99, 102, 241, 0.5);
  border-bottom: 2px solid rgba(99, 102, 241, 0.4);
  padding: 10px 6px;
}

.name-link {
  color: #60a5fa;
  cursor: pointer;
  font-weight: 500;
  transition: color 0.2s;
}

.name-link:hover {
  color: #93c5fd;
  text-decoration: underline;
}

/* .tech-card / .kpi-card 见 /css/tech-surface.css */

.kpi-change {
  font-size: 12px;
  margin-top: 4px;
}

.kpi-change.positive {
  color: #34d399;
}

.kpi-change.negative {
  color: #f87171;
}

.table-container {
  max-height: 600px;
  overflow-x: auto;
  overflow-y: auto;
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: 6px;
  width: 100%;
  position: relative;
  background: var(--tech-surface-nested);
}

/* 日总业绩表和店铺内详计表：100%显示，无高度限制 */
.table-container-full-height {
  overflow-x: auto;
  overflow-y: visible;
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: 6px;
  width: 100%;
  position: relative;
  background: var(--tech-surface-nested);
}

/* 确保表格在容器内100%显示，不溢出 */
.table-container .finance-table,
.table-container-full-height .finance-table {
  width: 100%;
  table-layout: fixed;
}

/* 响应式调整：在小屏幕上优化表格显示 */
@media (max-width: 1400px) {
  .table-container .finance-table th,
  .table-container .finance-table td {
    font-size: 12px;
    padding: 8px 6px;
  }
}

@media (max-width: 1200px) {
  .table-container .finance-table th,
  .table-container .finance-table td {
    font-size: 11px;
    padding: 6px 4px;
  }
}

.table-container::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.table-container::-webkit-scrollbar-track {
  background: rgba(30, 41, 59, 0.5);
}

.table-container::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.4);
  border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
  background: rgba(59, 130, 246, 0.6);
}

/* 表格横向滚动：移动端触摸友好 */
.table-container,
.table-container-full-height {
  -webkit-overflow-scrolling: touch;
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 4px 6px rgba(59, 130, 246, 0.3);
}

.form-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.2s;
}
.form-input:focus {
  outline: none;
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.btn-secondary {
  background: white;
  color: #475569;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid #cbd5e1;
  transition: all 0.2s;
  cursor: pointer;
}

.btn-secondary:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid rgba(59, 130, 246, 0.5);
}

/* 标签页样式 - 与产品价格库一致 */
.tab-button {
  padding: 12px 24px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #cbd5e1;
  border-radius: 8px 8px 0 0;
  transition: all 0.2s ease;
  cursor: pointer;
  font-weight: 500;
}
.tab-button.active {
  background: rgba(99, 102, 241, 0.3);
  border-color: rgba(99, 102, 241, 0.6);
  color: #e0e7ff;
  border-bottom-color: transparent;
}
.tab-button:hover:not(.active) {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(99, 102, 241, 0.5);
}
.return-audit-desc {
  color: #cbd5e1 !important;
}
.return-audit-desc strong {
  color: #f8fafc !important;
}
.return-audit-hint {
  color: #67e8f9 !important;
}
.return-audit-overdue-tip {
  color: #fda4af !important;
}

.dept-label {
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-size: 20px;
  font-weight: 700;
  color: #e2e8f0;
  letter-spacing: 0.1em;
  padding: 8px 4px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(147, 51, 234, 0.15) 100%);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 4px;
}

.chart-container {
  position: relative;
  height: 250px;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 6px;
  padding: 12px;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(59, 130, 246, 0.3);
  border-top-color: #60a5fa;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(30, 41, 59, 0.9);
  padding: 12px 20px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(12px);
  z-index: 1000;
  animation: slideIn 0.3s ease;
  color: #e2e8f0;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast.success {
  border-left: 4px solid #34d399;
  background: rgba(16, 185, 129, 0.9);
}

.toast.error {
  border-left: 4px solid #f87171;
  background: rgba(239, 68, 68, 0.9);
}

/* ========== 分项导出弹窗（字体与模块卡片） ========== */
.export-modal-backdrop {
  z-index: 100;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.export-modal-shell {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', 'PingFang SC', sans-serif;
  -webkit-font-smoothing: antialiased;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.42);
}
.export-modal-shell--wide {
  max-width: min(88rem, 96vw);
}
.export-modal-head {
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
}
.export-modal-title {
  font-size: 1.125rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  color: #f8fafc;
  line-height: 1.35;
}
@supports not (font-weight: 650) {
  .export-modal-title { font-weight: 600; }
}
.export-modal-sub {
  font-size: 0.8125rem;
  color: rgba(148, 163, 184, 0.92);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.5;
  margin-top: 0.4rem;
  max-width: 36rem;
}
.export-modal-close {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.5);
  color: rgba(226, 232, 240, 0.9);
  font-size: 1.125rem;
  line-height: 1;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.export-modal-close:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(248, 113, 113, 0.45);
  color: #fecaca;
}
.export-modal-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .export-modal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.125rem;
  }
}
@media (min-width: 1024px) {
  .export-modal-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .export-modal-card--half-row {
    grid-column: span 2;
  }
}
.export-modal-card {
  border-radius: 0.75rem;
  padding: 1rem 1.05rem 1.125rem;
  background: linear-gradient(155deg, rgba(30, 41, 59, 0.72) 0%, rgba(15, 23, 42, 0.58) 100%);
  border: 1px solid rgba(100, 116, 139, 0.2);
  border-left-width: 4px;
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
}
.export-modal-card:hover {
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  border-color: rgba(148, 163, 184, 0.32);
}
.export-modal-card--cyan { border-left-color: rgba(34, 211, 238, 0.88); }
.export-modal-card--green { border-left-color: rgba(74, 222, 128, 0.88); }
.export-modal-card--orange { border-left-color: rgba(251, 146, 60, 0.88); }
.export-modal-card--orange .export-modal-card-title {
  color: #ffedd5;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}
.export-modal-card--purple { border-left-color: rgba(192, 132, 252, 0.88); }
.export-modal-card--blue { border-left-color: rgba(96, 165, 250, 0.88); }
.export-modal-card--blue .export-modal-card-title {
  color: #dbeafe;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}
.export-modal-card--pink { border-left-color: rgba(244, 114, 182, 0.88); }
.export-modal-card--pink .export-modal-card-title {
  color: #f9a8d4;
}
.export-modal-card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
  line-height: 1.35;
}
.export-modal-card-hint {
  font-size: 0.6875rem;
  color: rgba(148, 163, 184, 0.88);
  letter-spacing: 0.02em;
  line-height: 1.45;
  margin-bottom: 0.75rem;
}
.export-modal-card-fields {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}
.export-modal-field label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.75);
  margin-bottom: 0.25rem;
}
.export-modal-card .form-input {
  font-size: 0.8125rem;
  padding: 0.5rem 0.65rem;
  min-height: 2.375rem;
  border-radius: 0.5rem;
}
.export-modal-month-input {
  color-scheme: dark;
}
.export-modal-card .btn-primary {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 0.55rem 0.75rem;
  border-radius: 0.5rem;
  margin-top: 0.125rem;
}
.export-modal-card .btn-primary:disabled {
  opacity: 0.65;
}
.export-modal-dates {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}
@media (min-width: 480px) {
  .export-modal-dates {
    grid-template-columns: 1fr 1fr;
  }
}

/* ========== 移动端适配（≤768px）按清单：导航、表格、弹窗、筛选、按钮、字体、触摸 ========== */
@media (max-width: 768px) {
  html {
    font-size: 15px;
    -webkit-text-size-adjust: 100%;
  }
  /* 顶部导航：换行、间距、标题缩小 */
  nav .px-6 {
    padding-left: 1rem;
    padding-right: 1rem;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
  }
  nav h1 {
    font-size: 1.125rem;
    line-height: 1.3;
    max-width: 50%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  nav .flex.items-center.gap-3 {
    gap: 0.5rem;
    justify-content: flex-end;
  }
  nav a, nav button, nav span {
    font-size: 0.75rem;
    padding: 0.375rem 0.5rem;
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
  }
  /* 主内容区内边距；底部预留安全区（刘海/全面屏） */
  .max-w-\[2120px\].mx-auto.px-4 {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    padding-top: 0.75rem;
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
  }
  /* 筛选/操作栏：小屏减小内边距、换行、间距 */
  .tech-card.rounded-lg.p-6.mb-6 {
    padding: 1rem;
    /* 移动端高频操作区固定在视口上方，减少来回滚动 */
    position: sticky;
    top: calc(64px + env(safe-area-inset-top));
    z-index: 35;
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(99, 102, 241, 0.3);
    backdrop-filter: none;
  }
  .tech-card.rounded-lg.p-6.mb-6 .flex.flex-wrap,
  .tech-card.rounded-lg.p-6.mb-6 .flex.gap-6 {
    gap: 0.75rem;
  }
  .tech-card.rounded-lg.p-6.mb-6 .flex.gap-2 {
    gap: 0.5rem;
    flex-wrap: wrap;
  }
  .tech-card.rounded-lg.p-6.mb-6 .form-input.w-40 {
    width: 100%;
    min-width: 120px;
    font-size: 16px;
  }
  /* 筛选操作区移动端：第一行「报表周期」+「刷新」，第二行月份占满 */
  .finance-filter-bar {
    gap: 12px;
  }
  .finance-filter-left {
    width: 100%;
    flex: 1 1 100%;
  }
  .finance-filter-left-block {
    display: contents;
  }
  .finance-filter-left label {
    order: 1;
    font-size: 16px;
    font-weight: 500;
    white-space: nowrap;
    color: #e2e8f0;
    margin-bottom: 0;
  }
  .finance-filter-refresh {
    order: 2;
    margin-left: auto;
    min-height: 44px;
    padding: 8px 16px;
    font-size: 15px;
  }
  .finance-filter-month-row {
    order: 3;
    width: 100%;
    flex: 1 1 100%;
  }
  .finance-filter-month-row .finance-month-picker {
    flex: 1;
    min-width: 0;
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    font-size: 16px;
    box-sizing: border-box;
  }
  .finance-filter-month-row .month-arrow {
    min-height: 44px;
    min-width: 44px;
    padding: 8px;
    flex-shrink: 0;
    box-sizing: border-box;
  }
  .finance-filter-bar .btn-primary {
    min-height: 44px;
    padding: 10px 16px;
  }
  .finance-filter-bar .filter-btn-text {
    display: none;
  }
  .finance-filter-bar .flex.gap-2.flex-wrap .btn-primary {
    min-height: 44px;
  }
  /* 按钮：触摸友好 */
  .btn-primary {
    min-height: 44px;
    padding: 10px 16px;
    font-size: 14px;
  }
  .btn-secondary {
    min-height: 44px;
    padding: 10px 16px;
  }
  /* KPI 卡片：移动端两两一行、两列、间距与样式增强 */
  .kpi-grid {
    flex-wrap: wrap;
    gap: 12px;
    padding: 0 4px 20px;
  }
  .kpi-grid .kpi-card {
    flex: 1 1 calc(50% - 6px);
    min-width: 120px;
    padding: 20px 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: none;
    border: 1px solid rgba(99, 102, 241, 0.3);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
    transition: transform 0.15s ease;
  }
  .kpi-grid .kpi-card:active {
    transform: scale(0.98);
  }
  .kpi-label {
    font-size: 14px;
    font-weight: 500;
    color: #94a3b8;
    letter-spacing: 0.3px;
    text-transform: uppercase;
  }
  .kpi-value {
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.2;
  }
  .kpi-value:empty::before {
    content: "—";
    color: #64748b;
    font-size: 1.125rem;
    font-weight: 600;
  }
  /* 标签页：移动端改为单行横向滑动，减少纵向占位 */
  .finance-tabs {
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    padding-bottom: 2px;
  }
  .finance-tabs .tab-button:first-child {
    flex: 0 0 auto;
  }
  .finance-tabs .tab-button:nth-child(2),
  .finance-tabs .tab-button:nth-child(3) {
    flex: 0 0 auto;
  }
  .finance-tabs .tab-button:nth-child(4),
  .finance-tabs .tab-button:nth-child(5) {
    flex: 0 0 auto;
  }
  .mb-6.flex.gap-2 {
    flex-wrap: nowrap;
    gap: 0.5rem;
  }
  .tab-button {
    padding: 9px 12px;
    min-height: 44px;
    font-size: 12px;
    flex: 0 0 auto;
    min-width: 104px;
    white-space: nowrap;
  }
  .finance-tabs::-webkit-scrollbar {
    height: 4px;
  }
  .finance-tabs::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.35);
  }
  .finance-tabs::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.65);
    border-radius: 999px;
  }
  /* 表格容器与表体 */
  .table-container,
  .table-container-full-height {
    max-height: 70vh;
    border-radius: 4px;
  }
  .table-container,
  .table-container-full-height {
    overscroll-behavior: contain;
  }
  /* 移动端让 full-height 容器也参与滚动上下文，避免 sticky 表头与页面层冲突 */
  .table-container-full-height {
    overflow-y: auto;
  }
  .table-container .finance-table,
  .table-container-full-height .finance-table {
    min-width: 760px;
    table-layout: auto;
  }
  .table-container .finance-table th,
  .table-container .finance-table td,
  .table-container-full-height .finance-table th,
  .table-container-full-height .finance-table td {
    font-size: 12px;
    padding: 6px 4px;
  }
  /* 表格首列固定，横向滚动时便于对齐阅读 */
  .table-container .finance-table th:first-child,
  .table-container .finance-table td:first-child,
  .table-container-full-height .finance-table th:first-child,
  .table-container-full-height .finance-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: rgba(15, 23, 42, 0.95);
  }
  /* 表头层级高于首列与数据单元，防止「顶行标题」与内容重叠 */
  .table-container .finance-table thead th,
  .table-container-full-height .finance-table thead th {
    z-index: 5;
    top: 0;
  }
  .table-container .finance-table thead th:first-child,
  .table-container-full-height .finance-table thead th:first-child {
    z-index: 6;
  }
  /* 直通车页：日期列固定 + 右侧数值列给最小宽度，避免输入框挤压 */
  .finance-table.direct-train-table th:first-child,
  .finance-table.direct-train-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 3;
    background: rgba(15, 23, 42, 0.95);
  }
  .finance-table.direct-train-table th:nth-child(2),
  .finance-table.direct-train-table th:nth-child(3),
  .finance-table.direct-train-table th:nth-child(4),
  .finance-table.direct-train-table td:nth-child(2),
  .finance-table.direct-train-table td:nth-child(3),
  .finance-table.direct-train-table td:nth-child(4) {
    min-width: 86px;
  }
  .finance-table.direct-train-table .editable-cell input {
    min-width: 76px;
  }
  .editable-cell input,
  .form-input {
    min-height: 44px;
    font-size: 16px;
  }
  /* 减轻移动端图层合成压力 */
  body::before,
  body::after,
  #app::before {
    opacity: 0.45;
  }
  nav {
    backdrop-filter: none !important;
  }
  .section-title {
    font-size: 16px;
    margin-bottom: 12px;
  }
  /* 部门竖排标签：小屏缩小 */
  .dept-label {
    font-size: 14px;
    padding: 4px 2px;
  }
  .chart-container {
    height: 220px;
    padding: 8px;
  }
  /* Toast：不贴边、易点；底部预留安全区避免被手势条遮挡 */
  .toast {
    left: 10px;
    right: 10px;
    top: auto;
    bottom: max(1rem, env(safe-area-inset-bottom));
    max-width: calc(100vw - 20px);
    padding: 12px 16px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* 无障碍：减弱动效（用户开启「减少动态效果」时） */
@media (prefers-reduced-motion: reduce) {
  .nav-drawer-panel,
  .nav-drawer-overlay,
  .toast {
    transition: none;
  }
  .nav-drawer-overlay,
  .toast {
    animation: none;
  }
}

/* 打印优化 */
@media print {
  .no-print,
  .tech-card.rounded-lg.p-6.mb-6,
  .kpi-grid,
  .finance-tabs,
  .export-section {
    display: none !important;
  }
  body {
    background: white !important;
    margin: 0;
    padding: 0;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  #app {
    background: white !important;
  }
  .table-container,
  .table-container-full-height {
    border: 1px solid #ddd !important;
    background: white !important;
    box-shadow: none !important;
  }
  .finance-table th,
  .finance-table td {
    border: 1px solid #000 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .finance-table th {
    background-color: #f0f0f0 !important;
    color: #000 !important;
  }
  .finance-table {
    background-color: white !important;
  }
  .tech-card {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
    background: white !important;
    backdrop-filter: none !important;
  }
  body::before,
  body::after,
  #app::before {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .kpi-grid .kpi-card {
    flex: 1 1 calc(50% - 6px);
  }
  nav h1 {
    font-size: 1rem;
  }
  .tab-button {
    min-width: 96px;
    font-size: 11px;
    padding: 8px 10px;
  }
  /* 极窄屏表格：略减宽度与字号，减少横向滚动 */
  .table-container .finance-table,
  .table-container-full-height .finance-table {
    min-width: 680px;
  }
  .table-container .finance-table th,
  .table-container .finance-table td,
  .table-container-full-height .finance-table th,
  .table-container-full-height .finance-table td {
    font-size: 11px;
    padding: 4px 3px;
  }
}

/* ========== 汉堡菜单：右侧滑出 + 遮罩 + 当前页高亮 ========== */
.hamburger-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: 8px;
  color: #e0e7ff;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.hamburger-btn:hover {
  background: rgba(59, 130, 246, 0.35);
  border-color: rgba(59, 130, 246, 0.6);
}
.hamburger-btn svg {
  width: 24px;
  height: 24px;
}
.nav-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  animation: nav-overlay-in 0.25s ease;
}
@keyframes nav-overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.nav-drawer-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 75%;
  max-width: 320px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 41, 59, 0.98) 100%);
  border-left: 1px solid rgba(59, 130, 246, 0.4);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.4);
  z-index: 1001;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.nav-drawer-panel .nav-drawer-links {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.nav-drawer-panel.open {
  transform: translateX(0);
}
.nav-drawer-panel .nav-drawer-user {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  font-size: 14px;
}
.nav-drawer-panel .nav-drawer-user strong {
  color: #e0e7ff;
}
.nav-drawer-panel a {
  display: block;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #e0e7ff;
  font-size: 16px;
  text-decoration: none;
  min-height: 44px;
  box-sizing: border-box;
  transition: background 0.2s;
}
.nav-drawer-panel a:hover {
  background: rgba(59, 130, 246, 0.15);
}
.nav-drawer-panel a.active {
  background: rgba(59, 130, 246, 0.25);
  color: #93c5fd;
  font-weight: 600;
  border-left: 3px solid #60a5fa;
}
.nav-drawer-panel .nav-drawer-logout {
  display: block;
  width: 100%;
  padding: 14px 20px;
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: none;
  background: transparent;
  color: #f87171;
  font-size: 16px;
  text-align: left;
  cursor: pointer;
  min-height: 44px;
  box-sizing: border-box;
  transition: background 0.2s;
}
.nav-drawer-panel .nav-drawer-logout:hover {
  background: rgba(248, 113, 113, 0.15);
}
@media (max-width: 768px) {
  .hamburger-btn {
    display: flex;
  }
  .nav-links-desktop {
    display: none !important;
  }
}
@media (min-width: 769px) {
  .nav-drawer-overlay,
  .nav-drawer-panel {
    display: none !important;
  }
}

/* ========== 移动端横屏优化（仅小屏横屏，不影响桌面）
    控制点：横屏宽度 850px 为优化起点；896px 为小屏横屏上限 ========== */
@media (orientation: landscape) and (max-width: 896px) {
  /* 整体：减少上下内边距，节省纵向空间 */
  .max-w-\[2120px\].mx-auto.px-4 {
    padding-top: 8px;
    padding-bottom: 8px;
  }
  nav h1 {
    white-space: nowrap;
  }
  .tech-card.rounded-lg.p-6.mb-6 {
    padding: 12px 16px;
    margin-bottom: 12px;
  }
  /* 筛选区：恢复一行排列（覆盖竖屏的 display:contents 与 100% 宽） */
  .finance-filter-bar {
    flex-wrap: nowrap;
  }
  .finance-filter-bar > .finance-filter-left,
  .finance-filter-bar > .flex.gap-2.flex-wrap {
    flex-shrink: 0;
  }
  .finance-filter-bar .flex.gap-2.flex-wrap {
    flex-wrap: nowrap;
  }
  .finance-filter-bar .btn-primary {
    white-space: nowrap;
  }
  .finance-filter-left-block {
    display: block;
  }
  .finance-filter-left {
    width: auto;
    flex: 0 1 auto;
    flex-wrap: nowrap;
  }
  .finance-filter-left label {
    order: unset;
    margin-bottom: 0.25rem;
  }
  .finance-filter-refresh {
    order: unset;
    margin-left: 0;
  }
  .finance-filter-month-row {
    order: unset;
    width: auto;
    flex: 0 1 auto;
  }
  .finance-filter-month-row .finance-month-picker {
    width: 160px;
    min-width: 140px;
    flex: 0 1 auto;
  }
  /* KPI：横屏略减内边距与数值字号；标题不折行、超出省略 */
  .kpi-grid {
    padding: 0 4px 12px;
  }
  .kpi-grid .kpi-card {
    padding: 16px 12px;
    min-width: 160px;
  }
  .kpi-grid .kpi-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
  }
  .kpi-value {
    font-size: 1.25rem;
  }
  /* 表格：略大字号便于横屏阅读 */
  .table-container .finance-table th,
  .table-container .finance-table td,
  .table-container-full-height .finance-table th,
  .table-container-full-height .finance-table td {
    font-size: 13px;
    padding: 6px 6px;
  }
}

@media (orientation: landscape) and (min-width: 850px) {
  /* 横屏宽度 ≥850px：导航一行、标签一行、KPI 三列 */
  /* 导航：恢复一行显示，隐藏汉堡与抽屉；导航项不换行 */
  .hamburger-btn {
    display: none !important;
  }

  .nav-mobile-actions {
    display: none !important;
  }
  nav .px-6.py-4 {
    flex-wrap: nowrap;
  }
  .nav-links-desktop {
    display: flex !important;
    flex-wrap: nowrap;
    white-space: nowrap;
  }
  .nav-links-desktop a,
  .nav-links-desktop span {
    white-space: nowrap;
    flex-shrink: 0;
  }
  .nav-drawer-overlay,
  .nav-drawer-panel {
    display: none !important;
  }
  /* 标签页：恢复一行 */
  .finance-tabs {
    flex-wrap: nowrap;
  }
  .finance-tabs .tab-button:first-child,
  .finance-tabs .tab-button:nth-child(2),
  .finance-tabs .tab-button:nth-child(3),
  .finance-tabs .tab-button:nth-child(4),
  .finance-tabs .tab-button:nth-child(5) {
    flex: 1 1 auto;
  }
  /* KPI：三列 */
  .kpi-grid .kpi-card {
    flex: 1 1 calc(33.333% - 8px);
  }
}

@media (orientation: landscape) and (min-width: 896px) {
  /* 横屏宽度 ≥896px：KPI 四列 */
  .kpi-grid .kpi-card {
    flex: 1 1 calc(25% - 8px);
  }
}
