/* ===== WPS 风格样式 ===== */
/* 简洁、专业、商务风格 */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', sans-serif;
  font-size: 14px;
  color: #333;
  background: #f4f5f7;
  min-height: 100vh;
}

[v-cloak] { display: none; }

/* ===== 启动画面 ===== */
.splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(2px);
}

.splash-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  background: #fff;
  border: 1px solid #e5e7eb;
}

.splash-icon {
  animation: spin 1.5s linear infinite;
}

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

.splash-title {
  font-size: 20px;
  font-weight: 600;
  color: #1f2937;
  text-align: center;
}


/* ===== 布局 ===== */
.layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ===== 侧边栏 ===== */
.sidebar {
  width: 200px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  transition: width 0.3s ease;
}

/* 侧边栏折叠状态 */
.sidebar.collapsed {
  width: 64px;
}

.sidebar.collapsed .sidebar-logo {
  justify-content: center;
  padding: 0;
}

.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 0 16px;
}

.sidebar.collapsed .sidebar-collapse-btn {
  justify-content: center;
}

.sidebar-logo {
  height: 56px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #e5e7eb;
  font-weight: 600;
  color: #1f2937;
}

.sidebar-nav {
  flex: 1;
  padding: 8px 0;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 16px;
  cursor: pointer;
  color: #6b7280;
  font-size: 14px;
  transition: all 0.2s;
}

.nav-item:hover {
  background: #f9fafb;
  color: #374151;
}

.nav-item.active {
  background: #EEF3FF;
  color: #2B5EE8;
  font-weight: 500;
  border-left: 3px solid #2B5EE8;
}

.nav-badge {
  margin-left: auto;
  font-size: 12px;
  background: #ef4444;
  color: white;
  padding: 2px 6px;
  border-radius: 10px;
}

/* 侧边栏底部 */
.sidebar-bottom {
  padding: 8px 0;
  border-top: 1px solid #e5e7eb;
}

.sidebar-collapse-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 16px;
  cursor: pointer;
  color: #6b7280;
  font-size: 13px;
  transition: all 0.2s;
}

.sidebar-collapse-btn:hover {
  background: #f9fafb;
  color: #374151;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
}

.user-name {
  font-size: 13px;
  color: #374151;
}

/* ===== 主内容区 ===== */
.main-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ===== 顶部栏 ===== */
.topbar {
  height: 48px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.topbar-title {
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===== 标签页容器 ===== */
.tabs-container {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding: 16px 12px 0 12px;
  min-height: 56px;
  display: flex;
  align-items: flex-end;
}

.main-tabs {
  --el-tabs-header-height: 40px;
}

.main-tabs .el-tabs__header {
  margin: 0;
  border-bottom: none;
}

.main-tabs .el-tabs__nav-wrap::after {
  display: none;
}

.main-tabs .el-tabs__item {
  padding: 0 16px;
  height: 40px;
  line-height: 40px;
  font-size: 13px;
  color: #606266;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  margin-right: 4px;
  transition: all 0.2s;
}

.main-tabs .el-tabs__item:hover {
  color: #2B5EE8;
  background: #f5f7fa;
}

.main-tabs .el-tabs__item.is-active {
  color: #2B5EE8;
  background: #f4f5f7;
  border-color: #e5e7eb;
  font-weight: 500;
}

.main-tabs .el-tabs__item .is-icon-close {
  width: 14px;
  height: 14px;
  margin-left: 6px;
  border-radius: 50%;
  transition: all 0.2s;
}

.main-tabs .el-tabs__item .is-icon-close:hover {
  background: #c0c4cc;
  color: #fff;
}

.tab-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ===== 内容区 ===== */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: #f4f5f7;
}

/* ===== 页面标题 ===== */
.page-title-bar {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
}

.page-title-bar h2 {
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
}

.page-sub {
  font-size: 13px;
  color: #6b7280;
}

/* ===== 卡片样式 ===== */
.section-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

/* ===== 统计卡片 ===== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.stat-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #f3f4f6;
}

.stat-num {
  font-size: 20px;
  font-weight: 600;
  color: #1f2937;
}

.stat-desc {
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
}

/* ===== 快速操作 ===== */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.quick-item {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.quick-item:hover {
  border-color: #2B5EE8;
  color: #2B5EE8;
  transform: translateY(-1px);
}

/* ===== 工具栏 ===== */
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 分页栏 */
.pagination-bar {
  display: flex;
  justify-content: center;
  padding: 16px 0;
  margin-top: 16px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

/* ===== 筛选工具栏 ===== */
.filter-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 12px;
}

.filter-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===== 简洁数据表格（CSS Flexbox 实现） ===== */
.data-grid {
  background: #fff;
  border: 1px solid #ebeef5;
  border-radius: 8px;
  overflow-x: auto;
}

/* 表头 */
.data-grid-header {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #ebeef5;
  min-width: max-content;
}

.data-grid-header .data-grid-cell {
  color: #909399;
  font-size: 14px;
  font-weight: 400;
}

/* 可排序的表头 */
.data-grid-header .data-grid-cell.sortable {
  cursor: pointer;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s;
}

.data-grid-header .data-grid-cell.sortable:hover {
  color: #606266;
}

.data-grid-header .data-grid-cell.sortable.active {
  color: #2B5EE8;
  font-weight: 500;
}

.data-grid-header .data-grid-cell .sort-icon {
  font-size: 12px;
  color: #2B5EE8;
  font-weight: bold;
}

/* 数据行 */
.data-grid-body {
  /* 容器 */
}

.data-grid-row {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #ebeef5;
  cursor: pointer;
  transition: background-color 0.15s;
  min-width: max-content;
}

.data-grid-row:last-child {
  border-bottom: none;
}

.data-grid-row:hover {
  background-color: #f5f7fa;
}

/* 单元格 */
.data-grid-cell {
  color: #606266;
  font-size: 14px;
  padding-right: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

.data-grid-cell:last-child {
  padding-right: 0;
}

/* 空状态 */
.data-grid-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: #909399;
}

.data-grid-empty p {
  margin-top: 12px;
  font-size: 14px;
}

/* 迷你版本（仪表盘用） */
.data-grid-mini {
  border: none;
  border-radius: 0;
}

.data-grid-mini .data-grid-header {
  padding: 12px 0;
  border-bottom: 1px solid #ebeef5;
}

.data-grid-mini .data-grid-row {
  padding: 12px 0;
}

.data-grid-mini .data-grid-row:hover {
  background-color: transparent;
}

/* ===== 按钮样式 ===== */
/* 统一系统主题色 #2B5EE8 */
.el-button {
  border-radius: 6px;
  font-weight: 500;
  font-size: 13px;
  transition: all 0.2s;
}

.el-button--primary {
  --el-button-bg-color: #2B5EE8;
  --el-button-border-color: #2B5EE8;
  --el-button-hover-bg-color: #4A7AFF;
  --el-button-hover-border-color: #4A7AFF;
  --el-button-active-bg-color: #1E4BC6;
  --el-button-active-border-color: #1E4BC6;
  --el-button-disabled-bg-color: #94B3F4;
  --el-button-disabled-border-color: #94B3F4;
}

/* 默认按钮 - 与系统风格统一 */
.el-button--default {
  --el-button-bg-color: #fff;
  --el-button-border-color: #e5e7eb;
  --el-button-text-color: #374151;
  --el-button-hover-bg-color: #f0f5ff;
  --el-button-hover-border-color: #2B5EE8;
  --el-button-hover-text-color: #2B5EE8;
  --el-button-active-bg-color: #e0eaff;
  --el-button-active-border-color: #1E4BC6;
  --el-button-active-text-color: #1E4BC6;
}

/* plain 按钮 */
.el-button--primary.is-plain {
  --el-button-bg-color: #EEF3FF;
  --el-button-border-color: #B3C8F7;
  --el-button-text-color: #2B5EE8;
  --el-button-hover-bg-color: #2B5EE8;
  --el-button-hover-border-color: #2B5EE8;
  --el-button-hover-text-color: #fff;
}

/* link 按钮 */
.el-button.is-link {
  color: #2B5EE8;
}
.el-button.is-link:hover {
  color: #3a6cf6;
}

/* text 按钮 */
.el-button.is-text:not(.is-disabled):hover {
  background-color: #f0f5ff;
}

/* danger 按钮 */
.el-button--danger.is-link {
  color: #F56C6C;
}
.el-button--danger.is-link:hover {
  color: #f89898;
}

/* 覆盖 Element Plus 菜单选中状态 */
.el-menu-item.is-active {
  color: #2B5EE8 !important;
  background-color: #EEF3FF !important;
}

/* 覆盖分页器选中状态 */
.el-pagination.is-background .el-pager li.is-active {
  background-color: #2B5EE8 !important;
}

/* 覆盖输入框聚焦状态 */
.el-input__wrapper.is-focus {
  box-shadow: 0 0 0 1px #2B5EE8 inset !important;
}

/* ===== 上传区域 ===== */
.upload-section {
  display: flex;
  justify-content: center;
  padding: 40px 20px;
}

.upload-dragger {
  width: 100%;
  max-width: 600px;
}

/* ===== 金额样式 ===== */
.amount-text {
  color: #1f2937;
  font-weight: 500;
}

.amount-text-lg {
  color: #ef4444;
  font-weight: 600;
  font-size: 16px;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .sidebar {
    display: none;
  }
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .quick-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .content {
    padding: 12px;
  }
}

/* ===== 设置页面样式 ===== */
.setting-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.setting-label {
  width: 120px;
  font-size: 14px;
  color: #374151;
  font-weight: 500;
  text-align: right;
}

.setting-control {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-tip {
  font-size: 12px;
  color: #6b7280;
  margin: 4px 0 0 0;
}

/* ===== 报表卡片 ===== */
.report-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.report-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.2s;
}

.report-card:hover {
  border-color: #2B5EE8;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.report-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #f3f4f6;
}

.report-card-body {
  flex: 1;
}

.report-card-body h4 {
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 4px 0;
}

.report-card-body p {
  font-size: 13px;
  color: #6b7280;
  margin: 0;
}

/* ===== 滚动条 ===== */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* ===== 批量上传列表 ===== */
.batch-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.batch-item {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}

.batch-item-error {
  border-color: #ffc107;
}

.batch-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}

.batch-item-index {
  font-weight: 600;
  color: #374151;
}

.batch-item-warning {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #e6a23c;
  font-size: 13px;
}

.batch-item-body {
  display: flex;
  padding: 16px;
  gap: 16px;
}

.batch-item-preview {
  width: 120px;
  height: 160px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #f5f7fa;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
}

.batch-item-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.batch-item-preview span {
  font-size: 12px;
  color: #909399;
  margin-top: 4px;
}

.batch-item-form {
  flex: 1;
  min-width: 0;
}

.batch-form-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.batch-form-row:last-child {
  margin-bottom: 0;
}

.batch-form-item {
  flex: 1;
  min-width: 0;
}

.batch-form-item label {
  display: block;
  font-size: 12px;
  color: #909399;
  margin-bottom: 4px;
}

/* ===== Element Plus 覆盖 ===== */
.el-menu-item.is-active {
  color: #2B5EE8;
}

.el-pagination.is-background .el-pager li.is-active {
  background-color: #2B5EE8;
}

/* ===== 响应式调整 ===== */
@media (max-width: 1024px) {
  .report-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .report-grid {
    grid-template-columns: 1fr;
  }
  .setting-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .setting-label {
    text-align: left;
    width: 100%;
  }
}
