/* 万店投—铺货系统 通用样式 */

/* === 全局重置 === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  color: #333;
  background-color: #f5f5f5;
  min-width: 1200px;
  line-height: 1.5;
}

a {
  text-decoration: none;
  color: inherit;
}

ul, ol {
  list-style: none;
}

/* === CSS变量 === */
:root {
  --primary-color: #e02020;
  --primary-hover: #c61a1a;
  --success-color: #52c41a;
  --warning-color: #fa8c16;
  --error-color: #e02020;
  --info-color: #1890ff;
  --disabled-color: #d9d9d9;
  --text-primary: #333;
  --text-secondary: #666;
  --text-tertiary: #999;
  --border-color: #e8e8e8;
  --bg-color: #f5f5f5;
  --card-bg: #ffffff;
  --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.12);
  --radius-small: 4px;
  --radius-medium: 6px;
  --radius-large: 8px;
}

/* === 顶部导航栏 === */
.top-header {
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.top-header-inner {
  max-width: 1920px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 48px;
}

.logo {
  font-size: 20px;
  font-weight: 600;
  color: var(--primary-color);
}

.main-nav {
  display: flex;
  gap: 0;
}

.main-nav a {
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  color: var(--text-primary);
  font-size: 15px;
  position: relative;
  transition: color 0.3s;
}

.main-nav a:hover {
  color: var(--primary-color);
}

.main-nav a.active {
  color: var(--primary-color);
  font-weight: 500;
}

.main-nav a.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary-color);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 24px;
  color: var(--text-secondary);
  font-size: 14px;
}

.account-balance {
  display: flex;
  align-items: center;
  gap: 4px;
}

.balance-amount {
  color: var(--primary-color);
  font-weight: 500;
}

.brand-name {
  color: var(--text-primary);
  font-weight: 500;
}

.user-dropdown {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-small);
  transition: background 0.3s;
}

.user-dropdown:hover {
  background: var(--bg-color);
}

/* === 页面容器 === */
.page-container {
  max-width: 1920px;
  margin: 0 auto;
  padding: 24px;
}

/* === 页面标题区 === */
.page-header {
  background: var(--card-bg);
  padding: 24px;
  border-radius: var(--radius-medium);
  margin-bottom: 16px;
  box-shadow: var(--shadow-light);
}

.page-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.page-title-area h1 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.page-description {
  color: var(--text-secondary);
  font-size: 14px;
}

.breadcrumb {
  color: var(--text-tertiary);
  font-size: 14px;
  margin-bottom: 12px;
}

.breadcrumb a {
  color: var(--text-tertiary);
  transition: color 0.3s;
}

.breadcrumb a:hover {
  color: var(--primary-color);
}

.breadcrumb span {
  margin: 0 8px;
}

/* === 二级导航 === */
.sub-nav {
  background: var(--card-bg);
  padding: 0 24px;
  border-radius: var(--radius-medium);
  margin-bottom: 16px;
  box-shadow: var(--shadow-light);
  display: flex;
  gap: 32px;
}

.sub-nav a {
  padding: 16px 0;
  color: var(--text-primary);
  font-size: 15px;
  position: relative;
  transition: color 0.3s;
}

.sub-nav a:hover {
  color: var(--primary-color);
}

.sub-nav a.active {
  color: var(--primary-color);
  font-weight: 500;
}

.sub-nav a.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary-color);
}

/* === 内容卡片 === */
.content-card {
  background: var(--card-bg);
  padding: 24px;
  border-radius: var(--radius-medium);
  box-shadow: var(--shadow-light);
  margin-bottom: 16px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

/* === 数据概览卡片 === */
.data-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.data-card {
  background: var(--card-bg);
  padding: 20px;
  border-radius: var(--radius-medium);
  box-shadow: var(--shadow-light);
  transition: box-shadow 0.3s;
}

.data-card:hover {
  box-shadow: var(--shadow-medium);
}

.data-card-label {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 12px;
}

.data-card-value {
  font-size: 28px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.data-card-trend {
  font-size: 12px;
  color: var(--text-tertiary);
}

.trend-up {
  color: var(--success-color);
}

.trend-down {
  color: var(--error-color);
}

/* === 筛选区域 === */
.filter-section {
  background: var(--card-bg);
  padding: 20px;
  border-radius: var(--radius-medium);
  box-shadow: var(--shadow-light);
  margin-bottom: 16px;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

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

.filter-label {
  color: var(--text-primary);
  font-size: 14px;
  white-space: nowrap;
  min-width: 70px;
}

.filter-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  flex: 1;
}

.filter-actions {
  display: flex;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
  margin-top: 8px;
}

/* === 表格 === */
.table-container {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
}

.data-table thead {
  background: #fafafa;
}

.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 500;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

.data-table tr:hover {
  background: #fafafa;
}

/* === 分页 === */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}

.pagination-info {
  color: var(--text-tertiary);
  font-size: 14px;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-number {
  min-width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-small);
  cursor: pointer;
  transition: all 0.3s;
  background: var(--card-bg);
  color: var(--text-primary);
}

.page-number:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.page-number.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
}

.page-number.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-number.disabled:hover {
  border-color: var(--border-color);
  color: var(--text-primary);
}

/* === 空状态 === */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-tertiary);
}

.empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-text {
  font-size: 14px;
  margin-bottom: 16px;
}

/* === 加载状态 === */
.loading-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-tertiary);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 0.8s linear infinite;
}

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

/* === 工具类 === */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-success { color: var(--success-color); }
.text-warning { color: var(--warning-color); }
.text-error { color: var(--error-color); }
.text-info { color: var(--info-color); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }

.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }

.cursor-pointer { cursor: pointer; }

/* === 响应式调整 === */
@media (max-width: 1440px) {
  .data-overview {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

@media (max-width: 1280px) {
  .page-container {
    padding: 16px;
  }

  .data-overview {
    grid-template-columns: repeat(2, 1fr);
  }
}
