/* ============ 像素脉络 - Light Mode Design System ============ */

/* CSS 变量 - Light Mode（品牌色：主色 #495EFF，辅助色 #47E0BA） */
:root {
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-secondary: #f8fafc;
  --bg-card-inner: #f1f5f9;
  --bg-card-hover: #f8fafc;
  --bg-sidebar: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-soft: #94a3b8;
  --brand-primary: #495EFF;
  --brand-aux: #47E0BA;
  --accent-blue: #495EFF;
  --accent-cyan: #38b9a8;
  --accent-green: #16a34a;
  --accent-orange: #d97706;
  --accent-red: #dc2626;
  --border-color: #e2e8f0;
  --stroke-light: 1px solid rgba(0, 0, 0, 0.06);
  --radius: 32px;
  --radius-lg: 24px;
  --radius-sm: 12px;
  --radius-xs: 8px;
}

/* Design System 工具类 */

/* 毛玻璃效果 */
.frosted-glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.frosted-glass-strong {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.frosted-glass-dark {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.card-base {
  background: #ffffff;
  border: var(--stroke-light);
  border-radius: var(--radius);
}

/* 访问趋势卡片：上留白充足，日期与柱状图严格对齐 */
.visit-trend-card {
  padding: 40px 24px 24px;
  margin-top: 12px;
}

/* 日期选择器：文字单行、整块可点、风格与 form-input 一致 */
.visit-date-picker-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  position: relative;
}
.visit-date-label {
  flex-shrink: 0;
  font-size: 13px;
  color: var(--text-muted);
}
.visit-date-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 160px;
  cursor: pointer;
  padding: 10px 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.visit-date-trigger .visit-date-display {
  flex: 1;
  font-size: 13.5px;
  color: var(--text-primary);
  text-align: left;
}
.visit-date-trigger:hover {
  border-color: rgba(73, 94, 255, 0.4);
}
.visit-date-trigger:focus-within {
  border-color: rgba(73, 94, 255, 0.5);
  outline: 2px solid rgba(73, 94, 255, 0.12);
}
.visit-date-icon {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* 自定义日期弹层 - 与项目设计一致 */
.visit-date-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 100;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  padding: 16px;
  min-width: 260px;
}
.visit-date-dropdown.open {
  display: block;
}
.visit-date-calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.visit-date-month {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.visit-date-nav {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: var(--bg-primary);
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s, color 0.2s;
}
.visit-date-nav:hover {
  background: var(--bg-secondary);
  color: var(--brand-primary);
}
.visit-date-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 8px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}
.visit-date-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.visit-date-day {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: var(--radius-xs);
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.visit-date-day.empty {
  cursor: default;
  visibility: hidden;
}
.visit-date-day:hover:not(.empty) {
  background: var(--bg-secondary);
  color: var(--brand-primary);
}
.visit-date-day.selected {
  background: var(--brand-primary);
  color: white;
}

.input-minimal {
  background: var(--bg-primary) !important;
  border: 1px solid transparent !important;
  border-radius: 12px !important;
}

.input-minimal:focus {
  border-color: rgba(73, 94, 255, 0.4) !important;
  outline: 2px solid rgba(73, 94, 255, 0.12) !important;
}

.progress-bar-track {
  height: 10px;
  background: var(--bg-secondary);
  border-radius: 9999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent-blue);
  border-radius: 9999px;
  transition: width 0.3s ease;
}

/* 统计卡片半圆仪表盘容器（右上角绝对定位） */
.stat-gauge {
  flex-shrink: 0;
  width: 88px;
  min-width: 88px;
  height: 52px;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}
.stat-gauge-tr {
  position: absolute;
  top: 24px;
  right: 24px;
}
.stat-gauge svg {
  overflow: visible;
}

/* 状态气泡单行 */
.stat-label-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.stat-label-row .stat-label,
.stat-label-row .stat-change {
  margin: 0;
}

[data-lucide] { stroke-width: 1.5; }

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f8fafc;
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
  letter-spacing: 0.02em;
}

/* ============ 布局 ============ */
.app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* ============ 侧边栏 ============ */
.sidebar {
  width: 280px;
  min-width: 280px;
  background: transparent;
  border-right: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  padding: 24px 20px 16px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.sidebar-logo .logo-icon {
  width: 40px;
  height: 40px;
  background: var(--brand-primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.sidebar-logo h1 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.2;
}

.sidebar-logo h1 span {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 2px;
  letter-spacing: 0;
}

/* 应用切换器 */
.app-switcher {
  position: relative;
}

.app-switcher-btn {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  transition: all 0.2s;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.app-switcher-btn:hover {
  border-color: rgba(73, 94, 255, 0.3);
  background: var(--bg-card-hover);
}

.app-switcher-btn .app-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  flex-shrink: 0;
}

.app-switcher-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(0, 0, 0, 0.08);
  z-index: 100;
  max-height: 220px;
  overflow-y: auto;
  display: none;
}

.app-switcher-dropdown.open {
  display: block;
}

.app-switcher-dropdown .app-option {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s;
}

.app-switcher-dropdown .app-option:hover {
  background: var(--bg-primary);
  color: var(--text-primary);
}

.app-switcher-dropdown .app-option.active {
  color: var(--accent-blue);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: var(--radius-sm);
}

/* 导航菜单 */
.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 8px 12px 6px;
  margin-top: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.15s;
  margin-bottom: 2px;
  position: relative;
}

.nav-item:hover {
  background: rgba(73, 94, 255, 0.06);
  color: var(--text-primary);
}

.nav-item.active {
  background: #ffffff;
  color: var(--accent-blue);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--brand-primary);
  border-radius: 0 2px 2px 0;
}

.nav-item .nav-icon {
  width: 20px;
  text-align: center;
  font-size: 16px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.top-bar {
  height: 64px;
  min-height: 64px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
}

.top-bar h2 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.top-bar .top-bar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-bar-subtitle {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
  background: transparent;
}

/* ============ 统计卡片（顶部5个为最大模块） ============ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
  border: none;
}

/* 主统计卡片：纯白、浅色描边、最大尺寸 */
.stat-card {
  padding: 24px;
  border-radius: var(--radius);
  background: #ffffff;
  border: var(--stroke-light);
  transition: border-color 0.2s;
  cursor: default;
  overflow: visible;
  position: relative;
}

.stat-card:hover {
  border-color: rgba(0, 0, 0, 0.1);
}

/* 收入卡片：强调色左边框 */
.stat-card--featured {
  border: var(--stroke-light);
  border-left: 4px solid var(--accent-blue);
}

.stat-card .stat-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--text-primary);
  flex-shrink: 0;
  background: rgba(15, 23, 42, 0.06);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(15, 23, 42, 0.1);
}

.stat-card--featured .stat-icon {
  color: var(--text-primary);
  background: rgba(15, 23, 42, 0.06);
  border-color: rgba(15, 23, 42, 0.1);
}

/* 统计卡片主体：右侧留空给仪表盘 */
.stat-card-body {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  padding-right: 96px;
}
.stat-card-main {
  min-width: 0;
  flex: 1;
}

.stat-card .stat-icon svg {
  width: 20px;
  height: 20px;
}

.stat-card .stat-value {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 12px;
  color: var(--text-primary);
}

/* 顶部5模块：状态固定在右下角 */
.stat-card-status {
  position: absolute;
  bottom: 24px;
  right: 24px;
}

.stat-card .stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-card .stat-change {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}

.stat-change.up { background: rgba(71, 224, 186, 0.2); color: #47E0BA; }
.stat-change.down { background: rgba(220, 38, 38, 0.12); color: var(--accent-red); }

.floating-card {
  background: #ffffff;
  border: var(--stroke-light);
}

.stats-grid-top {
  margin-bottom: 16px;
}

/* ============ 数据表格 ============ */
.data-table-wrap {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: var(--stroke-light);
}

.data-table-header {
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}

.data-table-header h3 {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  padding: 12px 24px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 14px 24px;
  font-size: 13.5px;
  color: var(--text-secondary);
  font-weight: 500;
  border-bottom: 1px solid var(--border-color);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: rgba(73, 94, 255, 0.04);
}

/* ============ 按钮 ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius-xs);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-blue);
  color: white;
  border: 1px solid rgba(73, 94, 255, 0.3);
}

.btn-primary:hover {
  opacity: 0.95;
  border-color: rgba(73, 94, 255, 0.5);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.btn-danger {
  background: rgba(220, 38, 38, 0.1);
  color: var(--accent-red);
}

.btn-danger:hover { background: rgba(220, 38, 38, 0.18); }

.btn-sm { padding: 6px 14px; font-size: 12px; }

/* ============ 表单 ============ */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 13.5px;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  font-family: inherit;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: rgba(73, 94, 255, 0.5);
  outline: 2px solid rgba(73, 94, 255, 0.12);
}

.form-textarea { resize: vertical; min-height: 80px; }

/* ============ 状态徽章 ============ */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
}

.badge-active { background: rgba(71, 224, 186, 0.2); color: #47E0BA; }
.badge-inactive { background: rgba(100, 116, 139, 0.15); color: var(--text-muted); }
.badge-paid { background: rgba(71, 224, 186, 0.2); color: #47E0BA; }
.badge-pending { background: rgba(217, 119, 6, 0.12); color: var(--accent-orange); }
.badge-refund { background: rgba(220, 38, 38, 0.12); color: var(--accent-red); }
.badge-cancel { background: rgba(100, 116, 139, 0.15); color: var(--text-muted); }

/* ============ 弹窗 / Modal ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: #ffffff;
  border: var(--stroke-light);
  border-radius: var(--radius);
  width: 90%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 { font-size: 16px; font-weight: 700; color: var(--text-primary); }

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-xs);
  font-size: 18px;
  transition: all 0.15s;
}

.modal-close:hover { background: var(--bg-primary); color: var(--text-primary); }

.modal-body { padding: 24px; }

.modal-footer {
  padding: 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ============ 各应用数据 - 次卡片风格，与顶部主卡片区分 ============ */
.section-header {
  padding: 0;
  margin-bottom: 12px;
  border: none;
}

.section-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.app-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.app-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

/* 应用卡片：浅灰底，单一模块无分割 */
.app-stat-card {
  flex: 1 1 260px;
  min-width: 260px;
  max-width: 340px;
  background: var(--bg-card-secondary);
  border: var(--stroke-light);
  border-radius: var(--radius);
  padding: 24px;
  transition: all 0.2s;
}

.app-stat-card:hover {
  border-color: rgba(0, 0, 0, 0.1);
}

/* 应用卡片：单一模块，所有元素共享同一区域 */
.app-stat-card .app-stat-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.app-stat-card .app-stat-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.app-stat-card .app-stat-main {
  flex: 1;
  min-width: 0;
}

/* 顶部一行：名称、状态、金额 同一行 无分割 */
.app-stat-card .app-stat-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.app-stat-card .app-stat-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.app-stat-card .app-stat-revenue {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-left: auto;
  flex-shrink: 0;
}

.app-stat-card .app-stat-name-row .badge,
.app-stat-card .app-stat-top .badge {
  font-size: 11px;
  padding: 2px 8px;
  flex-shrink: 0;
}

.app-stat-card .app-stat-id-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}

.app-stat-card .app-stat-id {
  font-size: 11px;
  color: var(--text-muted);
}

.app-stat-card .app-stat-id-row .app-stat-badge {
  margin-left: auto;
  flex-shrink: 0;
}

/* 底部：同一背景、数据左对齐（无状态） */
.app-stat-card .app-stat-footer {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin-top: 20px;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-sm);
  width: 100%;
}

.app-stat-card .app-stat-meta {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
}

.app-stat-card .app-stat-meta small {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 400;
  margin-left: 2px;
}

.app-stat-card .app-stat-meta-sep {
  color: var(--text-muted);
  font-size: 11px;
}

.app-stat-card .app-stat-badge {
  flex-shrink: 0;
  font-size: 11px;
  padding: 2px 8px;
}

/* ============ 配置编辑器 ============ */
.config-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.config-item {
  background: var(--bg-card);
  border: var(--stroke-light);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: border-color 0.2s;
}

.config-item:hover {
  border-color: rgba(0, 0, 0, 0.1);
}

.config-item .config-key {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-blue);
  min-width: 140px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.config-item .config-value {
  flex: 1;
}

.config-item .config-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  min-width: 100px;
}

/* Toggle 开关 */
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--bg-secondary);
  border-radius: 24px;
  transition: 0.3s;
}

.toggle-slider:before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent-blue);
  border: 1px solid rgba(73, 94, 255, 0.2);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

/* ============ 分页 ============ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 20px;
}

.pagination .page-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s;
}

.pagination .page-btn:hover { border-color: var(--accent-blue); color: var(--accent-blue); }
.pagination .page-btn.active {
  background: var(--accent-blue);
  color: white;
  border-color: var(--accent-blue);
}
.pagination .page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

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

.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state .empty-icon svg { width: 48px; height: 48px; margin: 0 auto; color: var(--text-muted); }
.empty-state p { font-size: 14px; }

/* ============ Toast 通知 ============ */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius-lg);
  font-size: 13px;
  font-weight: 500;
  animation: toastIn 0.3s ease;
  max-width: 360px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.toast-success { background: rgba(71, 224, 186, 0.9); color: white; }
.toast-error { background: rgba(220, 38, 38, 0.9); color: white; }
.toast-info { background: rgba(73, 94, 255, 0.9); color: white; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ============ 滚动条 ============ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ============ 加载 ============ */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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