/* css/style.css - 资金管理系统 Web 版（PC + H5 响应式） */

/* ===== 设计令牌 ===== */
:root {
  --primary: #2563eb;
  --primary-light: #3b82f6;
  --primary-dark: #1d4ed8;
  --primary-bg: #eff6ff;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.08);
  --sidebar-w: 240px;
  --header-h: 60px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ===== 布局骨架 ===== */
.app-layout { display: flex; min-height: 100vh; }

/* 侧边栏（PC） */
.sidebar {
  width: var(--sidebar-w);
  background: var(--gray-900);
  color: #fff;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.3s;
}
.sidebar-header {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-logo {
  width: 40px; height: 40px;
  background: var(--primary);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.sidebar-title { font-size: 16px; font-weight: 700; }
.sidebar-sub { font-size: 11px; color: var(--gray-400); }

.sidebar-user {
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-user .avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; flex-shrink: 0;
}
.sidebar-user .info { flex: 1; min-width: 0; }
.sidebar-user .name { font-size: 13px; font-weight: 600; }
.sidebar-user .role { font-size: 11px; color: var(--gray-400); }

.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 24px;
  color: var(--gray-300);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  border-left: 3px solid transparent;
  text-decoration: none;
}
.nav-item:hover { background: rgba(255,255,255,0.05); color: #fff; }
.nav-item.active { background: rgba(37,99,235,0.2); color: #fff; border-left-color: var(--primary); }
.nav-icon { font-size: 18px; width: 24px; text-align: center; }

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.logout-btn {
  width: 100%; padding: 10px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.logout-btn:hover { background: rgba(239,68,68,0.2); border-color: var(--danger); color: #fff; }

/* 主内容区 */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* 顶部栏 */
.topbar {
  height: var(--header-h);
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-title { font-size: 18px; font-weight: 700; color: var(--gray-900); flex: 1; }
.topbar-breadcrumb { font-size: 12px; color: var(--gray-400); }
.menu-toggle {
  display: none;
  width: 36px; height: 36px;
  background: transparent; border: none;
  font-size: 22px; cursor: pointer;
  align-items: center; justify-content: center;
}

.content-body { flex: 1; padding: 24px; }

/* 底部导航（H5） */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #fff;
  border-top: 1px solid var(--gray-200);
  z-index: 100;
}
.bottom-nav-item {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 8px 0 12px;
  color: var(--gray-400);
  font-size: 11px;
  cursor: pointer;
  text-decoration: none;
  gap: 2px;
}
.bottom-nav-item.active { color: var(--primary); font-weight: 600; }
.bottom-nav-icon { font-size: 20px; }

/* 遮罩层（H5 侧边栏） */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}
.sidebar-overlay.show { display: block; }

/* ===== 响应式：H5 移动端（<=1024px） ===== */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .menu-toggle { display: flex; }
  .bottom-nav { display: flex; }
  .content-body { padding: 16px; padding-bottom: 80px; }
  .topbar { padding: 0 12px; }
  .topbar-title { font-size: 16px; }
}

/* ===== 通用组件 ===== */
.card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow);
}
.card-pad { padding: 20px; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500;
  background: var(--gray-100);
  color: var(--gray-700);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.btn:hover { opacity: 0.9; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--gray-300); color: var(--gray-700); }
.btn-outline-primary { background: transparent; border: 1px solid var(--primary); color: var(--primary); }
.btn-outline-danger { background: transparent; border: 1px solid var(--danger); color: var(--danger); }
.btn-sm { padding: 4px 12px; font-size: 12px; }
.btn-block { display: flex; width: 100%; }
.btn-lg { padding: 12px 24px; font-size: 16px; }

/* 表单 */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; }
.form-label .req { color: var(--danger); }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: #fff;
  color: var(--gray-800);
  transition: border 0.2s;
  font-family: inherit;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.form-input.error { border-color: var(--danger); }
.form-textarea { min-height: 120px; resize: vertical; }

/* ===== 自定义下拉菜单（解决 H5 select 定位问题） ===== */
.custom-select-trigger {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: #fff;
  color: var(--gray-800);
  cursor: pointer;
  transition: border 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  min-height: 40px;
}
.custom-select-trigger:hover,
.custom-select-trigger.open { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.custom-select-trigger.placeholder { color: var(--gray-400); }
.custom-select-trigger .arrow {
  transition: transform 0.2s;
  color: var(--gray-400);
  font-size: 12px;
  margin-left: 8px;
  flex-shrink: 0;
}
.custom-select-trigger.open .arrow { transform: rotate(180deg); }

.custom-select-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: transparent;
}

.custom-select-dropdown {
  position: fixed;
  z-index: 1001;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  max-height: 260px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: dropdownIn 0.15s ease;
}
.custom-select-dropdown.up { animation: dropdownUp 0.15s ease; }

@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes dropdownUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.custom-select-option {
  padding: 10px 14px;
  font-size: 14px;
  color: var(--gray-700);
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid var(--gray-50);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.custom-select-option:last-child { border-bottom: none; }
.custom-select-option:hover,
.custom-select-option.hovered { background: var(--primary-bg); color: var(--primary); }
.custom-select-option.selected {
  background: var(--primary-bg);
  color: var(--primary);
  font-weight: 600;
}
.custom-select-option.selected::after {
  content: '✓';
  margin-left: 8px;
  font-weight: 700;
}
.custom-select-empty {
  padding: 20px;
  text-align: center;
  color: var(--gray-400);
  font-size: 13px;
}

/* 筛选器下拉尺寸 */
.filter-trigger {
  padding: 8px 12px;
  min-height: 38px;
  font-size: 14px;
}

.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }
.form-hint { font-size: 12px; color: var(--gray-400); margin-top: 4px; }

/* ===== 支付弹窗 ===== */
.pay-modal {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.pay-card {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 380px;
  overflow: hidden;
  animation: payCardIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes payCardIn {
  from { opacity: 0; transform: scale(0.85) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.pay-header {
  background: linear-gradient(135deg, #1677ff, #0958d9);
  color: #fff;
  padding: 24px 24px 20px;
  text-align: center;
}
.pay-header .pay-title { font-size: 16px; font-weight: 600; opacity: 0.9; }
.pay-header .pay-amount {
  font-size: 40px; font-weight: 700; margin-top: 8px;
  font-family: ' DIN Alternate', -apple-system, sans-serif;
}
.pay-header .pay-amount .currency { font-size: 22px; font-weight: 400; vertical-align: top; margin-right: 2px; }
.pay-header .pay-desc { font-size: 13px; opacity: 0.8; margin-top: 6px; }

.pay-body { padding: 24px; }

.pay-qr-section {
  text-align: center;
  margin-bottom: 20px;
}
.pay-qr-box {
  display: inline-block;
  padding: 16px;
  background: #fff;
  border: 2px solid var(--gray-100);
  border-radius: 12px;
  position: relative;
}
.pay-qr-mock {
  width: 180px; height: 180px;
  background:
    linear-gradient(45deg, #000 25%, transparent 25%) 0 0 / 12px 12px,
    linear-gradient(-45deg, #000 25%, transparent 25%) 0 0 / 12px 12px,
    linear-gradient(45deg, transparent 75%, #000 75%) 0 0 / 12px 12px,
    linear-gradient(-45deg, transparent 75%, #000 75%) 0 0 / 12px 12px,
    #fff;
  border-radius: 8px;
  position: relative;
}
.pay-qr-mock::before {
  content: '';
  position: absolute; inset: 0; margin: auto;
  width: 36px; height: 36px;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 0 0 3px #fff;
}
.pay-qr-mock::after {
  content: '💰';
  position: absolute; inset: 0; margin: auto;
  width: 28px; height: 28px;
  font-size: 28px;
  line-height: 28px;
  text-align: center;
}
.pay-qr-tip { font-size: 13px; color: var(--gray-400); margin-top: 12px; }

.pay-info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-50);
  font-size: 14px;
}
.pay-info-row:last-child { border-bottom: none; }
.pay-info-row .label { color: var(--gray-400); }
.pay-info-row .value { color: var(--gray-800); font-weight: 500; }
.pay-info-row .value.highlight { color: #1677ff; font-weight: 700; }

.pay-status-section {
  text-align: center;
  padding: 20px 0;
}
.pay-status-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
}
.pay-status-icon.pending { background: #fff7e6; }
.pay-status-icon.loading { background: #e6f4ff; animation: paySpin 1s linear infinite; }
.pay-status-icon.success { background: #f6ffed; }
.pay-status-icon.fail { background: #fff1f0; }
@keyframes paySpin { to { transform: rotate(360deg); } }

.pay-status-text { font-size: 16px; font-weight: 600; }
.pay-status-text.pending { color: var(--warning); }
.pay-status-text.loading { color: #1677ff; }
.pay-status-text.success { color: var(--success); }
.pay-status-text.fail { color: var(--danger); }
.pay-status-sub { font-size: 13px; color: var(--gray-400); margin-top: 4px; }

.pay-footer { padding: 0 24px 24px; }
.pay-btn {
  width: 100%; padding: 14px;
  border: none; border-radius: 24px;
  font-size: 16px; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.pay-btn-alipay {
  background: linear-gradient(135deg, #1677ff, #0958d9);
  color: #fff;
}
.pay-btn-alipay:hover { box-shadow: 0 4px 16px rgba(22,119,255,0.3); transform: translateY(-1px); }
.pay-btn-alipay:active { transform: translateY(0); }
.pay-btn-alipay:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }
.pay-btn-cancel {
  background: var(--gray-100);
  color: var(--gray-600);
  margin-top: 10px;
}
.pay-btn-cancel:hover { background: var(--gray-200); }

/* 支付状态徽章 */
.badge-paid { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
.badge-unpaid { background: #fff7e6; color: #fa8c16; border: 1px solid #ffd591; }
.badge-pending { background: #e6f4ff; color: #1677ff; border: 1px solid #91caff; }
.badge-cancelled { background: #fff1f0; color: #ff4d4f; border: 1px solid #ffa39e; }

/* 充值金额选择按钮 */
.recharge-amount-btn {
  padding: 14px 8px;
  text-align: center;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-700);
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.recharge-amount-btn:hover { border-color: var(--primary); color: var(--primary); }
.recharge-amount-btn.active {
  border-color: var(--primary);
  background: var(--primary-bg);
  color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

@media (max-width: 640px) {
  .pay-card { max-width: 100%; }
  .pay-qr-mock { width: 160px; height: 160px; }
}

/* 工具栏 */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.search-box {
  display: flex; align-items: center;
  background: #fff; border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  flex: 1; min-width: 200px;
  height: 40px;
}
.search-box input {
  flex: 1; border: none; outline: none;
  font-size: 14px; background: transparent;
}
.search-box .icon { color: var(--gray-400); }
.filter-select {
  height: 40px; padding: 0 12px;
  background: #fff; border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm); font-size: 14px; color: var(--gray-700);
}

/* 状态徽章 */
.badge {
  display: inline-block; padding: 2px 10px;
  border-radius: 20px; font-size: 12px; font-weight: 600;
}
.badge.normal { background: #d1fae5; color: #065f46; }
.badge.abnormal { background: #fee2e2; color: #991b1b; }
.badge.active { background: #dbeafe; color: #1e40af; }
.badge.inactive { background: #f3f4f6; color: #6b7280; }
.badge.disbursed { background: #dbeafe; color: #1e40af; }
.badge.completed { background: #d1fae5; color: #065f46; }
.badge.overdue { background: #fee2e2; color: #991b1b; }
.badge.first { background: #dbeafe; color: #1e40af; }
.badge.renew { background: #fef3c7; color: #92400e; }
.badge.admin { background: #dbeafe; color: #1e40af; }
.badge.manager { background: #d1fae5; color: #065f46; }
.badge.staff { background: #f1f5f9; color: #475569; }

/* 数据表格（PC） */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.data-table th {
  background: var(--gray-50);
  padding: 12px 16px;
  text-align: left;
  font-size: 13px; font-weight: 600;
  color: var(--gray-600);
  border-bottom: 2px solid var(--gray-200);
  white-space: nowrap;
}
.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
  font-size: 14px;
  color: var(--gray-700);
}
.data-table tr:hover td { background: var(--gray-50); }
.data-table tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); }

/* 卡片列表（H5） */
.card-list-item {
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: box-shadow 0.2s;
}
.card-list-item:hover { box-shadow: var(--shadow-lg); }
.card-list-item .item-header {
  display: flex; align-items: center; gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gray-100);
}
.card-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; color: #fff; flex-shrink: 0;
}
.card-avatar.blue { background: var(--primary); }
.card-avatar.red { background: var(--danger); }
.card-avatar.green { background: var(--success); }
.card-avatar.gray { background: var(--gray-400); }
.card-actions { display: flex; gap: 8px; padding-top: 12px; border-top: 1px solid var(--gray-100); }
.card-actions .btn { flex: 1; }

/* 统计卡片网格 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: #fff; border-radius: var(--radius);
  border: 1px solid var(--gray-200); box-shadow: var(--shadow);
  padding: 20px;
}
.stat-top { display: flex; justify-content: space-between; align-items: flex-start; }
.stat-label { font-size: 13px; color: var(--gray-500); }
.stat-value { font-size: 24px; font-weight: 700; color: var(--gray-900); margin: 6px 0; }
.stat-sub { font-size: 11px; color: var(--gray-400); }
.stat-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.icon-blue { background: #eff6ff; color: var(--primary); }
.icon-green { background: #d1fae5; color: var(--success); }
.icon-yellow { background: #fef3c7; color: var(--warning); }
.icon-red { background: #fee2e2; color: var(--danger); }
.icon-purple { background: #ede9fe; color: #6d28d9; }
.icon-indigo { background: #e0e7ff; color: #4338ca; }

/* ===== 看板：核心 KPI 卡片 ===== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.kpi-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.kpi-card:hover { box-shadow: var(--shadow-lg); }
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
}
.kpi-card.kpi-blue::before { background: var(--primary); }
.kpi-card.kpi-green::before { background: var(--success); }
.kpi-card.kpi-indigo::before { background: #4338ca; }
.kpi-card.kpi-red::before { background: var(--danger); }
.kpi-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.kpi-label { font-size: 13px; color: var(--gray-500); font-weight: 500; }
.kpi-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.kpi-value { font-size: 28px; font-weight: 800; color: var(--gray-900); line-height: 1.2; margin-bottom: 8px; }
.kpi-footer { display: flex; align-items: center; gap: 8px; }
.kpi-sub { font-size: 12px; color: var(--gray-400); }
.kpi-trend { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 12px; }
.kpi-trend.up { background: #d1fae5; color: #065f46; }
.kpi-trend.down { background: #fee2e2; color: #991b1b; }
.kpi-trend.flat { background: var(--gray-100); color: var(--gray-500); }

/* 次要指标 */
.secondary-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.mini-card {
  background: #fff;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.mini-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.mini-info { min-width: 0; }
.mini-label { font-size: 11px; color: var(--gray-400); display: block; }
.mini-value { font-size: 16px; font-weight: 700; color: var(--gray-800); }

/* 筛选栏 */
.dashboard-filter {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.filter-tabs {
  display: flex;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.filter-tab {
  padding: 8px 16px;
  font-size: 13px;
  color: var(--gray-500);
  cursor: pointer;
  border: none;
  background: transparent;
  transition: all 0.2s;
}
.filter-tab:hover { background: var(--gray-50); }
.filter-tab.active { background: var(--primary); color: #fff; font-weight: 600; }

/* 日期范围选择器 */
.date-range-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.date-input {
  padding: 8px 12px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--gray-700);
  background: #fff;
}
.date-input:focus { outline: none; border-color: var(--primary); }
.date-sep { font-size: 13px; color: var(--gray-400); }

/* 区间信息 */
.range-info {
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 20px;
  padding: 10px 16px;
  background: var(--primary-bg);
  border-radius: var(--radius-sm);
}
.range-info strong { color: var(--primary); }
.range-days { color: var(--gray-400); margin-left: 4px; }

/* 图表切换 */
.chart-toggle { display: flex; gap: 4px; }
.chart-toggle .btn { padding: 4px 12px; font-size: 12px; }

/* 分页 */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--gray-100);
}
.page-info { font-size: 13px; color: var(--gray-500); }
.pagination .btn[disabled] { opacity: 0.4; cursor: not-allowed; }

/* 图表行 */
.chart-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

/* SVG 折线图 */
.line-chart-svg { width: 100%; height: 280px; }
.line-chart-grid line { stroke: var(--gray-100); stroke-width: 1; }
.line-chart-axis text { font-size: 11px; fill: var(--gray-400); }
.line-chart-line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.line-chart-area { opacity: 0.08; }
.line-chart-dot { stroke: #fff; stroke-width: 2; cursor: pointer; }
.line-chart-dot:hover { r: 6; }

/* 渠道排名 */
.ranking-list { display: flex; flex-direction: column; gap: 12px; }
.ranking-item { display: flex; align-items: center; gap: 12px; }
.ranking-rank {
  width: 28px; height: 28px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.ranking-rank.r1 { background: #fef3c7; color: #92400e; }
.ranking-rank.r2 { background: var(--gray-100); color: var(--gray-600); }
.ranking-rank.r3 { background: #fed7aa; color: #9a3412; }
.ranking-rank.rn { background: var(--gray-50); color: var(--gray-400); }
.ranking-info { flex: 1; min-width: 0; }
.ranking-name { font-size: 13px; font-weight: 600; color: var(--gray-700); }
.ranking-bar-bg { height: 6px; background: var(--gray-100); border-radius: 3px; margin-top: 4px; overflow: hidden; }
.ranking-bar { height: 100%; border-radius: 3px; transition: width 0.5s; }
.ranking-value { font-size: 13px; font-weight: 700; color: var(--gray-800); text-align: right; min-width: 80px; }

/* 柱状图 */
.chart-card { background: #fff; border-radius: var(--radius); border: 1px solid var(--gray-200); box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; }
.chart-title { font-size: 16px; font-weight: 600; color: var(--gray-700); margin-bottom: 12px; }
.chart-legend { display: flex; gap: 16px; margin-bottom: 12px; font-size: 13px; color: var(--gray-500); }
.legend-dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 4px; vertical-align: middle; }
.bar-chart { display: flex; align-items: flex-end; justify-content: space-around; height: 240px; padding: 12px 0; border-bottom: 1px solid var(--gray-200); gap: 8px; }
.bar-group { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.bar-bars { display: flex; align-items: flex-end; gap: 4px; height: 100%; }
.bar { width: 24px; border-radius: 4px 4px 0 0; transition: height 0.5s; }
.bar-blue { background: var(--primary-light); }
.bar-green { background: var(--success); }
.bar-label { font-size: 12px; color: var(--gray-500); margin-top: 8px; }
.bar-value { font-size: 11px; color: var(--gray-600); margin-top: 2px; }

/* 环形图 */
.pie-section { display: flex; align-items: center; gap: 32px; flex-wrap: wrap; }
.pie-ring {
  width: 160px; height: 160px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.pie-center {
  width: 100px; height: 100px; background: #fff; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.pie-center-label { font-size: 12px; color: var(--gray-400); }
.pie-center-value { font-size: 18px; font-weight: 700; color: var(--gray-900); }
.pie-legend { flex: 1; min-width: 200px; }
.pie-legend-item { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.pie-legend-color { width: 16px; height: 16px; border-radius: 4px; flex-shrink: 0; }
.pie-legend-info { flex: 1; }
.pie-legend-name { font-size: 14px; font-weight: 600; color: var(--gray-700); }
.pie-legend-value { font-size: 12px; color: var(--gray-400); }

/* 模态框 */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.5);
  display: none;
  align-items: center; justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.modal-overlay.show { display: flex; }
.modal {
  background: #fff;
  border-radius: var(--radius);
  width: 100%; max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-100);
  display: flex; justify-content: space-between; align-items: center;
}
.modal-title { font-size: 18px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--gray-400); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--gray-100); display: flex; gap: 12px; justify-content: flex-end; }

/* Toast */
.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  background: rgba(15,23,42,0.9); color: #fff;
  padding: 10px 24px; border-radius: var(--radius-sm);
  font-size: 14px; z-index: 2000;
  opacity: 0; transition: opacity 0.3s, top 0.3s;
  pointer-events: none;
}
.toast.show { opacity: 1; top: 40px; }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

/* 空状态 */
.empty-state { text-align: center; padding: 60px 20px; color: var(--gray-400); }
.empty-state .emoji { font-size: 56px; margin-bottom: 12px; }
.empty-state .text { font-size: 16px; }

/* 登录页 */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.login-card {
  background: #fff;
  border-radius: 20px;
  padding: 40px;
  width: 100%; max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo .icon { font-size: 56px; }
.login-logo .title { font-size: 24px; font-weight: 700; color: var(--gray-900); }
.login-logo .sub { font-size: 13px; color: var(--gray-400); }
.login-demo { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--gray-100); }
.demo-item { padding: 10px 14px; background: var(--gray-50); border-radius: var(--radius-sm); margin-bottom: 8px; cursor: pointer; }
.demo-role { font-size: 13px; font-weight: 700; color: var(--primary); }
.demo-account { font-size: 12px; color: var(--gray-600); font-family: monospace; }
.demo-desc { font-size: 11px; color: var(--gray-400); }

/* 模板解析面板 */
.parse-panel { background: #fff; border-radius: var(--radius); border: 1px solid var(--gray-200); box-shadow: var(--shadow); margin-bottom: 20px; overflow: hidden; }
.parse-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; cursor: pointer; }
.parse-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; }
.parse-body { padding: 0 20px 20px; }
.parse-tip { background: var(--primary-bg); border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 16px; font-size: 13px; color: var(--primary-dark); }
.template-box { background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius-sm); padding: 16px; margin-bottom: 16px; }
.template-title-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--gray-700); }
.template-content { font-size: 13px; color: var(--gray-600); line-height: 2; font-family: monospace; white-space: pre-wrap; }
.parse-result { padding: 10px 16px; border-radius: var(--radius-sm); font-size: 13px; text-align: center; margin-top: 12px; }
.parse-result.success { background: #d1fae5; color: #065f46; }
.parse-result.fail { background: #fee2e2; color: #991b1b; }

/* 用户卡片 */
.user-card { padding: 20px; margin-bottom: 16px; }
.user-card-header { display: flex; gap: 16px; align-items: flex-start; padding-bottom: 16px; border-bottom: 1px solid var(--gray-100); }
.user-avatar-lg { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; color: #fff; flex-shrink: 0; }
.user-avatar-lg.admin { background: var(--primary); }
.user-avatar-lg.manager { background: var(--success); }
.user-avatar-lg.staff { background: var(--gray-400); }
.user-permissions { padding: 16px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.perm-label { font-size: 13px; color: var(--gray-500); }
.perm-tag { font-size: 12px; color: var(--primary); background: var(--primary-bg); padding: 4px 12px; border-radius: 12px; }

/* 页面标题 */
.page-title { font-size: 24px; font-weight: 700; color: var(--gray-900); margin-bottom: 6px; }
.page-subtitle { font-size: 13px; color: var(--gray-400); margin-bottom: 24px; }

/* 信息网格 */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px 0; }
.info-item .label { font-size: 11px; color: var(--gray-400); display: block; }
.info-item .value { font-size: 13px; color: var(--gray-700); font-weight: 500; }

/* PC 和 H5 显示切换 */
.hide-on-pc { display: none; }
.hide-on-mobile { display: block; }
@media (max-width: 1024px) {
  .hide-on-pc { display: block; }
  .hide-on-mobile { display: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row { flex-direction: column; gap: 0; }
  .pie-section { flex-direction: column; gap: 20px; }
  /* 看板响应式 */
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .secondary-grid { grid-template-columns: 1fr 1fr 1fr; }
  .chart-row { grid-template-columns: 1fr; }
  .kpi-value { font-size: 22px; }
  .line-chart-svg { height: 220px; }
}
@media (max-width: 640px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .secondary-grid { grid-template-columns: 1fr 1fr; }
  .filter-tabs { width: 100%; }
  .filter-tab { flex: 1; text-align: center; padding: 6px 8px; font-size: 12px; }
  .date-range-picker { width: 100%; }
  .date-input { flex: 1; min-width: 0; }
  .pagination { flex-wrap: wrap; gap: 8px; justify-content: center; }
  .range-info { font-size: 12px; }
}

/* 滚动条 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--gray-100); border-radius: 4px; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }
