:root {
  --sidebar-width: 220px;
  --sidebar-bg: #1e293b;
  --sidebar-text: #cbd5e1;
  --sidebar-hover: #334155;
  --sidebar-active: #3b82f6;
  --header-height: 56px;
}

/* ===== 布局 ===== */
body { background: #f1f5f9; font-size: 0.92rem; }

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

/* ===== 侧边栏 ===== */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-header {
  padding: 1.2rem 1rem;
  border-bottom: 1px solid #334155;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.sidebar-logo i { font-size: 1.4rem; color: #3b82f6; }

.sidebar-menu {
  list-style: none;
  padding: 0.5rem 0;
  margin: 0;
}

.menu-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  padding: 1rem 1rem 0.3rem;
  font-weight: 600;
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 1rem;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: 0;
  transition: background 0.15s;
  font-size: 0.88rem;
}

.sidebar-menu a:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar-menu a.active { background: var(--sidebar-active); color: #fff; font-weight: 600; }
.sidebar-menu a i { font-size: 0.95rem; min-width: 18px; }

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid #334155;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--sidebar-text);
  font-size: 0.85rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

/* ===== 主内容区 ===== */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 1.5rem;
  min-width: 0;
}

/* ===== 页面头部 ===== */
.page-header {
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e2e8f0;
}

/* ===== 统计卡片 ===== */
.stat-card { border-radius: 10px; }
.stat-icon {
  width: 48px; height: 48px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.bg-primary-light { background: #dbeafe; }
.bg-success-light { background: #dcfce7; }
.bg-warning-light { background: #fef9c3; }
.stat-label { font-size: 0.8rem; color: #64748b; margin-bottom: 0.15rem; }
.stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1.2; }

/* ===== 登录页 ===== */
.login-page {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  display: flex; align-items: center; justify-content: center;
  padding-bottom: 40px;
}

.login-container { width: 100%; max-width: 400px; padding: 1rem; }
.login-card { border-radius: 12px; border: none; }
.login-icon { line-height: 1; }

/* ===== 上传区域 ===== */
.upload-area {
  border: 2px dashed #cbd5e1;
  border-radius: 8px;
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #f8fafc;
  user-select: none;
}
.upload-area:hover, .upload-area.drag-over { border-color: #3b82f6; background: #eff6ff; }
.upload-area.has-file { border-color: #22c55e; background: #f0fdf4; }

/* ===== 表格优化 ===== */
.table th { font-size: 0.8rem; text-transform: none; font-weight: 600; color: #475569; white-space: nowrap; }
.table td { vertical-align: middle; }

/* ===== 报表表格 ===== */
.report-table {
  table-layout: fixed;
}
.report-table th,
.report-table td {
  text-align: center;
  vertical-align: middle;
  word-break: break-word;
}
.report-table .header-total {
  background: #e8f1ff;
  color: #1d4ed8;
}
.report-table .header-supplier-0 {
  background: #eefbf3;
  color: #15803d;
}
.report-table .header-supplier-1 {
  background: #fff6e8;
  color: #b45309;
}
.report-table .header-supplier-2 {
  background: #f3f0ff;
  color: #6d28d9;
}
.report-table .header-supplier-3 {
  background: #ecfeff;
  color: #0f766e;
}
.report-table .detail-table th,
.report-table .detail-table td {
  text-align: center;
}
.report-table .name-button {
  display: inline-block;
  text-align: center;
}

/* ===== 备案 footer ===== */
footer.beian-footer {
  position: fixed;
  bottom: 0;
  left: var(--sidebar-width);
  right: 0;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  padding: 6px 0;
  z-index: 100;
}
.main-content { padding-bottom: 40px; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .main-content { margin-left: 0; padding: 1rem; }
  footer.beian-footer { left: 0; }
}

/* ===== 其他 ===== */
.sticky-top { position: sticky; top: 0; z-index: 1; }
code { background: #f1f5f9; padding: 0.1em 0.4em; border-radius: 3px; color: #e11d48; font-size: 0.85em; }
