/* ============================================
   典当行SaaS管理系统 - 全局样式
   风格: 科技感 / 现代 / 大气
   ============================================ */

/* --- CSS 变量 --- */
:root {
  /* 主色 */
  --primary: #6C5CE7;
  --primary-light: #A29BFE;
  --primary-dark: #4834D4;
  /* 渐变 */
  --gradient-primary: linear-gradient(135deg, #6C5CE7 0%, #00CECE 100%);
  --gradient-sidebar: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  --gradient-card: linear-gradient(145deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
  --gradient-btn: linear-gradient(135deg, #6C5CE7 0%, #00CECE 100%);
  /* 背景色 */
  --bg-body: #0F0F1A;
  --bg-sidebar: #1a1a2e;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --bg-input: rgba(255, 255, 255, 0.06);
  --bg-table-header: rgba(108, 92, 231, 0.15);
  --bg-table-row-hover: rgba(108, 92, 231, 0.08);
  /* 文字色 */
  --text-primary: #E8E8F0;
  --text-secondary: #8B8BA7;
  --text-muted: #5A5A72;
  --text-accent: #00CECE;
  /* 边框 */
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(108, 92, 231, 0.6);
  /* 状态色 */
  --success: #00B894;
  --warning: #FDCB6E;
  --danger: #E17055;
  --info: #74B9FF;
  /* 尺寸 */
  --sidebar-width: 260px;
  --sidebar-collapsed: 72px;
  --header-height: 64px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  /* 阴影 */
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-elevated: 0 8px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(108, 92, 231, 0.2);
  /* 动画 */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- 白色主题 --- */
[data-theme="light"] {
  --gradient-sidebar: linear-gradient(180deg, #f8f9fc 0%, #ffffff 100%);
  --gradient-card: linear-gradient(145deg, rgba(108,92,231,0.03) 0%, rgba(108,92,231,0.01) 100%);
  --bg-body: #f5f6fa;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: rgba(108, 92, 231, 0.06);
  --bg-input: #f5f6fa;
  --bg-table-header: rgba(108, 92, 231, 0.08);
  --bg-table-row-hover: rgba(108, 92, 231, 0.04);
  --text-primary: #1a1a2e;
  --text-secondary: #5a5a72;
  --text-muted: #8b8ba7;
  --border-color: rgba(108, 92, 231, 0.12);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.08);
  --shadow-elevated: 0 8px 40px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 30px rgba(108, 92, 231, 0.15);
}

/* --- 重置与基础 --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background-color: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

a {
  color: var(--primary-light);
  text-decoration: none;
  transition: var(--transition);
}
a:hover {
  color: var(--text-accent);
}

/* 滚动条 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(108, 92, 231, 0.3);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(108, 92, 231, 0.5);
}

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

/* --- 侧边导航栏 --- */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--gradient-sidebar);
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  overflow: hidden;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-header {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.sidebar-logo {
  width: 42px;
  height: 42px;
  background: var(--gradient-btn);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 15px rgba(108, 92, 231, 0.4);
}

.sidebar-title {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  letter-spacing: 0.5px;
}

.sidebar-title small {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 400;
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
}

.nav-group {
  margin-bottom: 8px;
}

.nav-group-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 12px 14px 6px;
  white-space: nowrap;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  white-space: nowrap;
  font-size: 13.5px;
}

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

.nav-item.active {
  color: #fff;
  background: rgba(108, 92, 231, 0.25);
}

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

.nav-item i {
  font-size: 18px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.nav-item .badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 10px;
  font-weight: 500;
}

.nav-submenu {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
}

.nav-submenu.open {
  max-height: 600px;
}

.nav-submenu .nav-item {
  padding-left: 48px;
  font-size: 13px;
}

.nav-submenu .nav-item::before {
  content: '';
  position: absolute;
  left: 30px;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: var(--transition);
}

.nav-submenu .nav-item.active::before {
  left: 0;
  width: 3px;
  height: 60%;
  border-radius: 0 3px 3px 0;
  background: var(--gradient-btn);
}

/* --- 折叠菜单箭头 --- */
.nav-item.has-submenu {
  cursor: pointer;
  user-select: none;
}

.nav-item.has-submenu > .submenu-arrow {
  margin-left: auto;
  font-size: 10px;
  color: var(--text-muted);
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.nav-item.has-submenu.open > .submenu-arrow {
  transform: rotate(90deg);
}

.nav-item.has-submenu > .badge {
  position: relative;
  z-index: 1;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.user-card:hover {
  background: rgba(255, 255, 255, 0.06);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient-btn);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 11px;
  color: var(--text-muted);
}

/* --- 主内容区 --- */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: var(--transition);
}

/* --- 顶部栏 --- */
.top-header {
  height: var(--header-height);
  background: rgba(15, 15, 26, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}

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

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.sidebar-toggle:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.06);
}

.page-title-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-title-bar h1 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.breadcrumb span {
  color: var(--text-secondary);
}

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

.header-btn {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  font-size: 16px;
}
.header-btn:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.15);
}
.header-btn .dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  background: var(--danger);
  border-radius: 50%;
}

/* --- 页面内容 --- */
.page-content {
  padding: 24px 28px;
  min-height: calc(100vh - 64px);
}

/* --- 统计卡片 --- */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.stat-cards .stat-card {
  padding: 16px;
  text-align: center;
}
.stat-cards .stat-card .stat-icon {
  margin: 0 auto 10px;
}
.stat-cards .stat-card .stat-info {
  text-align: center;
}
.stat-cards .stat-card .stat-value {
  font-size: 20px;
}
.stat-cards .stat-card .stat-label {
  font-size: 12px;
}
.stat-cards .stat-card .stat-trend {
  justify-content: center;
  margin-top: 6px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}
.stat-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(108, 92, 231, 0.3);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  opacity: 0.06;
  transform: translate(30%, -30%);
}

.stat-card.purple::after { background: var(--primary); }
.stat-card.green::after { background: var(--success); }
.stat-card.blue::after { background: var(--info); }
.stat-card.orange::after { background: var(--warning); }
.stat-card.red::after { background: var(--danger); }

.stat-card .stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 14px;
}

.stat-card.purple .stat-icon { background: rgba(108,92,231,0.15); color: var(--primary-light); }
.stat-card.green .stat-icon { background: rgba(0,184,148,0.15); color: var(--success); }
.stat-card.blue .stat-icon { background: rgba(116,185,255,0.15); color: var(--info); }
.stat-card.orange .stat-icon { background: rgba(253,203,110,0.15); color: var(--warning); }
.stat-card.red .stat-icon { background: rgba(225,112,85,0.15); color: var(--danger); }

.stat-label {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.stat-value .unit {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-secondary);
  margin-left: 4px;
}

.stat-trend {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  font-size: 12px;
}

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

/* --- 卡片容器 --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

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

.card-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-body {
  padding: 24px;
}

.card-body.no-padding {
  padding: 0;
}

/* --- 表格 --- */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead th {
  padding: 13px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--bg-table-header);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table tbody td {
  padding: 14px 16px;
  font-size: 13.5px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: var(--transition);
}

.data-table tbody tr:hover {
  background: var(--bg-table-row-hover);
}

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

/* --- 状态标签 --- */
.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.status-tag::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-tag.active { background: rgba(0,184,148,0.12); color: var(--success); }
.status-tag.active::before { background: var(--success); }

.status-tag.warning { background: rgba(253,203,110,0.12); color: var(--warning); }
.status-tag.warning::before { background: var(--warning); }

.status-tag.danger { background: rgba(225,112,85,0.12); color: var(--danger); }
.status-tag.danger::before { background: var(--danger); }

.status-tag.info { background: rgba(116,185,255,0.12); color: var(--info); }
.status-tag.info::before { background: var(--info); }

.status-tag.purple { background: rgba(108,92,231,0.12); color: var(--primary-light); }
.status-tag.purple::before { background: var(--primary-light); }

.status-tag.muted { background: rgba(255,255,255,0.06); color: var(--text-muted); }
.status-tag.muted::before { background: var(--text-muted); }

/* --- 按钮 --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-btn);
  color: #fff;
  box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
}
.btn-primary:hover {
  box-shadow: 0 6px 25px rgba(108, 92, 231, 0.5);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.btn-outline:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.2);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 12px;
}
.btn-ghost:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.06);
}

.btn-danger {
  background: rgba(225, 112, 85, 0.12);
  color: var(--danger);
}
.btn-danger:hover {
  background: rgba(225, 112, 85, 0.2);
}

.btn-success {
  background: rgba(0, 184, 148, 0.12);
  color: var(--success);
}
.btn-success:hover {
  background: rgba(0, 184, 148, 0.2);
}

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

.btn-lg {
  padding: 12px 28px;
  font-size: 15px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
}

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

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 7px;
}

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

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.12);
  background: rgba(255, 255, 255, 0.08);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238B8BA7' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-select option {
  background: #1a1a2e;
  color: var(--text-primary);
}

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

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

/* --- 搜索栏 --- */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  min-width: 280px;
  transition: var(--transition);
}
.search-box:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.12);
}

.search-box i {
  color: var(--text-muted);
  font-size: 14px;
}

.search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 13.5px;
  padding: 9px 0;
  width: 100%;
  font-family: inherit;
}
.search-box input::placeholder {
  color: var(--text-muted);
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.filter-group select {
  padding: 9px 32px 9px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238B8BA7' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: var(--transition);
}
.filter-group select:focus {
  border-color: var(--border-focus);
}
.filter-group select option {
  background: #1a1a2e;
}

/* --- 分页 --- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
}

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

.pagination-pages {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pagination-pages button {
  min-width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}
.pagination-pages button:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
}
.pagination-pages button.active {
  background: var(--gradient-btn);
  color: #fff;
  border-color: transparent;
}

/* --- 模态框 --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}
.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: #1E1E2E;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 640px;
  max-height: 85vh;
  margin: auto;
  overflow-y: auto;
  box-shadow: var(--shadow-elevated);
  transform: scale(0.95);
  transition: var(--transition);
}
.modal-overlay.show .modal {
  transform: scale(1);
}

.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: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 18px;
  transition: var(--transition);
}
.modal-close:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
}

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

/* --- 标签页 --- */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
}

.tab-item {
  padding: 12px 20px;
  font-size: 13.5px;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}
.tab-item:hover {
  color: var(--text-primary);
}
.tab-item.active {
  color: var(--primary-light);
  border-bottom-color: var(--primary);
}

/* --- 空状态 --- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}
.empty-state i {
  font-size: 48px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.empty-state p {
  color: var(--text-secondary);
  font-size: 14px;
}

/* --- 金额显示 --- */
.amount {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.amount.positive { color: var(--success); }
.amount.negative { color: var(--danger); }

/* --- 两栏布局 --- */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* --- 进度条 --- */
.progress-bar {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar .fill {
  height: 100%;
  border-radius: 3px;
  background: var(--gradient-btn);
  transition: width 0.6s ease;
}

/* --- 工具提示 --- */
[data-tooltip] {
  position: relative;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 10px;
  background: #2d2d44;
  color: var(--text-primary);
  font-size: 12px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  pointer-events: none;
  z-index: 999;
}
[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
}

/* --- 动画 --- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.animate-in {
  animation: fadeInUp 0.25s ease forwards;
}

.animate-delay-1 { animation-delay: 0.05s; opacity: 0; }
.animate-delay-2 { animation-delay: 0.1s; opacity: 0; }
.animate-delay-3 { animation-delay: 0.15s; opacity: 0; }
.animate-delay-4 { animation-delay: 0.2s; opacity: 0; }

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

.toast {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  background: #2d2d44;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-elevated);
  animation: fadeInUp 0.3s ease;
  min-width: 280px;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.info { border-left: 3px solid var(--info); }

/* --- 图片上传 --- */
.upload-area {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 30px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}
.upload-area:hover {
  border-color: var(--primary);
  background: rgba(108, 92, 231, 0.05);
}
.upload-area i {
  font-size: 32px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.upload-area p {
  color: var(--text-secondary);
  font-size: 13px;
}

.photo-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.photo-thumb {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-color);
  position: relative;
}
.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo-thumb .remove-photo {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(225, 112, 85, 0.9);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition);
}
.photo-thumb:hover .remove-photo {
  opacity: 1;
}

/* --- 响应式 --- */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
  }
  .sidebar-toggle {
    display: flex;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .form-row-3 {
    grid-template-columns: 1fr;
  }
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .page-content {
    padding: 16px;
  }
  .top-header {
    padding: 0 16px;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .search-box {
    min-width: auto;
  }
}

/* --- 侧边遮罩 (移动端) --- */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
  display: none;
}
.sidebar-overlay.show {
  display: block;
}

/* --- 详情展示 --- */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 32px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-item .label {
  font-size: 12px;
  color: var(--text-muted);
}

.detail-item .value {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
}

.detail-item.full {
  grid-column: 1 / -1;
}

/* --- 操作按钮组 --- */
.action-group {
  display: flex;
  gap: 6px;
}

.action-group .btn-icon {
  width: 32px;
  height: 32px;
  font-size: 14px;
}

/* --- 拖拽指示线 --- */
.drag-hint {
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
  padding: 20px;
}

/* --- 白色主题补充样式 --- */
[data-theme="light"] .sidebar {
  border-right-color: var(--border-color);
}
[data-theme="light"] .sidebar-header {
  border-bottom-color: var(--border-color);
}
[data-theme="light"] .sidebar-title {
  color: var(--text-primary);
}
[data-theme="light"] .sidebar-title small {
  color: var(--text-muted);
}
[data-theme="light"] .nav-item {
  color: var(--text-secondary);
}
[data-theme="light"] .nav-item:hover {
  background: var(--bg-card-hover);
  color: var(--primary);
}
[data-theme="light"] .nav-item.active {
  background: rgba(108, 92, 231, 0.1);
  color: var(--primary);
}
[data-theme="light"] .nav-item.has-submenu .submenu-arrow {
  color: var(--text-muted);
}
[data-theme="light"] .nav-submenu {
  background: rgba(108, 92, 231, 0.03);
}
[data-theme="light"] .sidebar-footer {
  border-top-color: var(--border-color);
}
[data-theme="light"] .user-card {
  background: var(--bg-card);
}
[data-theme="light"] .user-avatar {
  background: var(--gradient-btn);
}
[data-theme="light"] .user-name {
  color: var(--text-primary);
}
[data-theme="light"] .user-role {
  color: var(--text-muted);
}
[data-theme="light"] .top-header {
  background: var(--bg-sidebar);
  border-bottom-color: var(--border-color);
}
[data-theme="light"] .breadcrumb {
  color: var(--text-secondary);
}
[data-theme="light"] .header-btn {
  background: var(--bg-card);
  color: var(--text-secondary);
}
[data-theme="light"] .header-btn:hover {
  background: var(--bg-card-hover);
  color: var(--primary);
}
[data-theme="light"] .modal-overlay .modal {
  background: var(--bg-card);
}
[data-theme="light"] .modal-header {
  border-bottom-color: var(--border-color);
}
[data-theme="light"] .modal-footer {
  border-top-color: var(--border-color);
}
[data-theme="light"] .toast {
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
}

/* --- 主题切换按钮 --- */
.theme-toggle {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.theme-toggle:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary-light);
}
.theme-toggle i {
  font-size: 16px;
  color: var(--text-secondary);
  transition: var(--transition);
}
.theme-toggle:hover i {
  color: var(--primary);
}
