/* CSS 变量定义 - 默认主题（经典蓝） */
:root {
  /* 色彩系统 */
  --primary-500: #4A69FF;
  --primary-400: #6b82ff;
  --primary-100: #E9EDFF;
  --primary-700: #3852C4;
  --bg-page: #F8F9FA;
  --bg-surface: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-input: #fafafa;
  --bg-item: #f0f4f8;
  --bg-hover: #f8f9fa;
  --bg-secondary: #f8f9fa;
  --bg-sidebar: linear-gradient(180deg, #ffffff 0%, #f8f9fc 100%);
  --bg-table-header: #ffe4e1;
  --border: #E9ECEF;
  --border-color: #dee2e6;
  --border-color-light: #e8e8e8;
  --border-color-strong: #ffb6b0;
  --text-secondary: #6C757D;
  --text-primary: #212529;
  --text-nav: #4a5568;
  --success: #28A745;
  --warning: #FFC107;
  --error: #DC3545;
  --shadow-color: rgba(74, 105, 255, 0.1);
  --nav-hover-bg: linear-gradient(90deg, rgba(74, 105, 255, 0.06) 0%, rgba(74, 105, 255, 0.02) 100%);
  --nav-active-bg: linear-gradient(90deg, rgba(74, 105, 255, 0.12) 0%, rgba(74, 105, 255, 0.04) 100%);

  /* 字体系统 */
  --font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;

  /* 间距系统 */
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-xxl: 48px;

  /* 圆角 */
  --radius-sm: 6px;
  --radius-md: 8px;

  /* 阴影 */
  --shadow-sm: 0 2px 4px rgba(74, 105, 255, 0.06);
  --shadow-md: 0 4px 12px rgba(74, 105, 255, 0.1);

  /* 过渡 */
  --transition: 200ms ease-out;
  --transition-fast: 150ms ease-in-out;
}

/* ============================================ */
/* 🌙 暗夜黑主题 (Dark Mode) */
/* ============================================ */
[data-theme="dark"] {
  --primary-500: #667EEA;
  --primary-400: #7c96ff;
  --primary-100: #2D3748;
  --primary-700: #5468d6;
  --bg-page: #0F172A;
  --bg-surface: #1E293B;
  --bg-card: #1E293B;
  --bg-input: #1E293B;
  --bg-item: #334155;
  --bg-hover: #334155;
  --bg-secondary: #1E293B;
  --bg-sidebar: linear-gradient(180deg, #1E293B 0%, #0F172A 100%);
  --bg-table-header: #0F172A;
  --border: #334155;
  --border-color: #334155;
  --border-color-light: #475569;
  --border-color-strong: #475569;
  --text-secondary: #94A3B8;
  --text-primary: #F1F5F9;
  --text-nav: #CBD5E1;
  --success: #34D399;
  --warning: #FBBF24;
  --error: #F87171;
  --shadow-color: rgba(0, 0, 0, 0.5);
  --nav-hover-bg: linear-gradient(90deg, rgba(102, 126, 234, 0.2) 0%, rgba(102, 126, 234, 0.1) 100%);
  --nav-active-bg: linear-gradient(90deg, rgba(102, 126, 234, 0.3) 0%, rgba(102, 126, 234, 0.15) 100%);
}

/* 暗夜主题特效 */
[data-theme="dark"] body {
  background: #0F172A;
}

[data-theme="dark"] .sidebar {
  background: linear-gradient(180deg, #1E293B 0%, #0F172A 100%);
  border-right: 1px solid #334155;
  box-shadow: 2px 0 20px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .sidebar-header {
  background: rgba(102, 126, 234, 0.1);
  border-bottom: 1px solid rgba(102, 126, 234, 0.2);
}

[data-theme="dark"] .sidebar-header h1 {
  background: linear-gradient(135deg, #667EEA 0%, #818CF8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

[data-theme="dark"] .nav-item {
  color: #CBD5E1;
}

[data-theme="dark"] .nav-item:hover {
  background: linear-gradient(90deg, rgba(102, 126, 234, 0.2) 0%, rgba(102, 126, 234, 0.1) 100%);
  color: #F1F5F9;
}

[data-theme="dark"] .nav-item.active {
  background: linear-gradient(90deg, rgba(102, 126, 234, 0.3) 0%, rgba(102, 126, 234, 0.15) 100%);
  color: #FFFFFF;
  border-left: 3px solid #667EEA;
}

[data-theme="dark"] .top-bar {
  background: #1E293B;
  border-bottom: 1px solid #334155;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .stat-card {
  background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
  border: 1px solid #334155;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .stat-card:hover {
  background: linear-gradient(135deg, #334155 0%, #1E293B 100%);
  box-shadow: 0 12px 32px rgba(102, 126, 234, 0.3);
  border-color: rgba(102, 126, 234, 0.4);
}

[data-theme="dark"] .stat-card h3,
[data-theme="dark"] .stat-card p {
  color: #F1F5F9;
}

[data-theme="dark"] .stat-icon {
  background: rgba(102, 126, 234, 0.2);
  border: 2px solid rgba(102, 126, 234, 0.3);
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

[data-theme="dark"] .chart-card {
  background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
  border: 1px solid #334155;
}

[data-theme="dark"] .chart-card h3 {
  color: #F1F5F9;
}

[data-theme="dark"] .chart-bar-label,
[data-theme="dark"] .chart-bar-value {
  color: #CBD5E1;
}

[data-theme="dark"] .chart-bar-fill {
  background: linear-gradient(90deg, #667EEA 0%, #818CF8 100%);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

[data-theme="dark"] .data-table {
  background: #1E293B;
  border: 1px solid #334155;
}

[data-theme="dark"] .data-table th {
  background: #0F172A;
  color: #F1F5F9;
  border-bottom: 1px solid #334155;
}

[data-theme="dark"] .data-table td {
  color: #CBD5E1;
  border-color: #334155;
}

[data-theme="dark"] .data-table tr:hover {
  background: rgba(102, 126, 234, 0.1);
}

[data-theme="dark"] .btn-primary {
  background: linear-gradient(135deg, #667EEA 0%, #818CF8 100%);
  color: white;
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

[data-theme="dark"] .btn-primary:hover {
  background: linear-gradient(135deg, #5468d6 0%, #6366F1 100%);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

[data-theme="dark"] .btn-secondary {
  background: #334155;
  color: #CBD5E1;
  border: 1px solid #475569;
}

[data-theme="dark"] .btn-secondary:hover {
  background: #475569;
  color: #F1F5F9;
}

[data-theme="dark"] .modal-content {
  background: #1E293B;
  border: 1px solid #334155;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .modal-header {
  border-bottom: 1px solid #334155;
}

[data-theme="dark"] .modal-header h2 {
  color: #F1F5F9;
}

[data-theme="dark"] .form-group label {
  color: #CBD5E1;
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea {
  background: #0F172A;
  border: 1px solid #334155;
  color: #F1F5F9;
}

[data-theme="dark"] .form-group input::placeholder,
[data-theme="dark"] .form-group textarea::placeholder {
  color: #64748B;
}

[data-theme="dark"] .form-group input:focus,
[data-theme="dark"] .form-group select:focus,
[data-theme="dark"] .form-group textarea:focus {
  border-color: #667EEA;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

[data-theme="dark"] .filter-tag {
  background: #1E293B;
  border: 1px solid #334155;
  color: #CBD5E1;
}

[data-theme="dark"] .filter-tag:hover {
  background: #334155;
  border-color: #475569;
}

[data-theme="dark"] .filter-tag.active {
  background: linear-gradient(135deg, #667EEA 0%, #818CF8 100%);
  color: white;
  border-color: transparent;
}

[data-theme="dark"] .search-input,
[data-theme="dark"] .filter-select {
  background: #0F172A;
  border: 1px solid #334155;
  color: #F1F5F9;
}

[data-theme="dark"] .search-input:focus,
[data-theme="dark"] .filter-select:focus {
  border-color: #667EEA;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

[data-theme="dark"] .page-title {
  color: #F1F5F9;
}

[data-theme="dark"] .user-name {
  color: #CBD5E1;
}

[data-theme="dark"] .user-avatar {
  background: linear-gradient(135deg, #667EEA 0%, #818CF8 100%);
  color: white;
}

[data-theme="dark"] .results-tab {
  background: #1E293B;
  color: #94A3B8;
  border: 1px solid #334155;
}

[data-theme="dark"] .results-tab:hover {
  background: #334155;
  color: #CBD5E1;
}

[data-theme="dark"] .results-tab.active {
  background: linear-gradient(135deg, #667EEA 0%, #818CF8 100%);
  color: white;
  border-color: transparent;
}



/* ============================================ */
/* 新拟态主题 (Neumorphism) */
/* ============================================ */
[data-theme="neumorphism"] {
  --primary-500: #6366F1;
  --primary-400: #818CF8;
  --primary-100: #E0E7FF;
  --primary-700: #4F46E5;
  --bg-page: #E5E7EB;
  --bg-surface: #E5E7EB;
  --bg-card: #E5E7EB;
  --bg-input: #E5E7EB;
  --bg-item: #E5E7EB;
  --bg-hover: #D1D5DB;
  --bg-secondary: #F3F4F6;
  --bg-sidebar: #E5E7EB;
  --bg-table-header: #E5E7EB;
  --border: transparent;
  --border-color: #D1D5DB;
  --border-color-light: #D1D5DB;
  --border-color-strong: #9CA3AF;
  --text-secondary: #6B7280;
  --text-primary: #1F2937;
  --text-nav: #374151;
  --success: #10B981;
  --warning: #F59E0B;
  --error: #EF4444;
  --shadow-color: rgba(0, 0, 0, 0.1);
  --nav-hover-bg: #E5E7EB;
  --nav-active-bg: #E5E7EB;
  /* 新拟态特殊阴影 */
  --neu-shadow-light: 8px 8px 16px rgba(163, 177, 198, 0.6);
  --neu-shadow-dark: -8px -8px 16px rgba(255, 255, 255, 0.8);
  --neu-inset-light: inset 4px 4px 8px rgba(163, 177, 198, 0.5);
  --neu-inset-dark: inset -4px -4px 8px rgba(255, 255, 255, 0.8);
}



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

body {
  font-family: var(--font-family);
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

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

/* 侧边导航栏 */
.sidebar {
  width: 240px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 2px 0 20px var(--shadow-color);
  transition: all 0.3s ease;
}

.sidebar-header {
  padding: 28px var(--space-lg);
  border-bottom: 1px solid rgba(74, 105, 255, 0.1);
  background: linear-gradient(135deg, rgba(74, 105, 255, 0.08) 0%, rgba(74, 105, 255, 0.02) 100%);
  position: relative;
}

.sidebar-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--primary-500) 50%, transparent 100%);
  opacity: 0.3;
}

.sidebar-header h1 {
  font-size: 17px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-500) 0%, #6b82ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.3px;
  line-height: 1.6;
  text-align: center;
}

.nav-menu {
  list-style: none;
  padding: var(--space-lg) 0;
  position: relative;
}

.nav-menu::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 20px;
  right: 20px;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(74, 105, 255, 0.15) 50%, transparent 100%);
}

.nav-menu li {
  margin: 6px 12px;
}

/* 导航分隔线 */
.nav-divider {
  font-size: 12px;
  color: var(--text-tertiary);
  padding: 12px 16px 8px 16px;
  margin-top: 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
}

.nav-divider::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 16px;
  right: 16px;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(74, 105, 255, 0.15) 50%, transparent 100%);
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 13px 16px;
  color: var(--text-nav);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 10px;
  position: relative;
  overflow: hidden;
  background: transparent;
  letter-spacing: 0.2px;
}

.nav-icon {
  margin-right: 12px;
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  transition: transform 0.3s ease;
}

.nav-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--primary-500) 0%, #6b82ff 100%);
  border-radius: 0 2px 2px 0;
  transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(74, 105, 255, 0.08) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.nav-item:hover {
  background: var(--nav-hover-bg);
  color: var(--primary-500);
  transform: translateX(4px);
  box-shadow: 0 2px 8px var(--shadow-color);
}

.nav-item:hover::before {
  height: 60%;
}

.nav-item:hover::after {
  opacity: 1;
}

.nav-item:hover .nav-icon {
  transform: scale(1.15);
}

.nav-item.active {
  background: var(--nav-active-bg);
  color: var(--primary-500);
  font-weight: 600;
  box-shadow: 0 4px 12px var(--shadow-color), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.nav-item.active::before {
  height: 70%;
}

.nav-item.active::after {
  opacity: 1;
}

.nav-item.active .nav-icon {
  transform: scale(1.1);
}

/* 禁用状态的导航项 */
.nav-item.disabled {
  color: #b0b8c4;
  cursor: not-allowed;
  pointer-events: all; /* 允许鼠标事件以显示提示 */
  opacity: 0.5;
  position: relative;
}

.nav-item.disabled:hover {
  background: rgba(176, 184, 196, 0.08);
  transform: none;
  box-shadow: none;
  color: #b0b8c4;
}

.nav-item.disabled:active {
  transform: none;
}

.nav-item.disabled .nav-icon {
  opacity: 0.6;
  transform: none !important;
}

/* 权限提示 */
.nav-item.nav-item-tooltip:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 16px);
  top: 50%;
  transform: translateY(-50%);
  padding: 10px 16px;
  background: linear-gradient(135deg, rgba(220, 53, 69, 0.96) 0%, rgba(200, 45, 59, 0.96) 100%);
  color: white;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(220, 53, 69, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  z-index: 1000;
  animation: tooltipSlideIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item.nav-item-tooltip:hover::before {
  content: '';
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  border: 8px solid transparent;
  border-right-color: rgba(220, 53, 69, 0.96);
  z-index: 1000;
  animation: tooltipSlideIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes tooltipSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50%) translateX(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
}

/* 侧边栏滚动条样式 */
.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: rgba(74, 105, 255, 0.03);
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(74, 105, 255, 0.2);
  border-radius: 3px;
  transition: background 0.3s ease;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(74, 105, 255, 0.35);
}

/* 主内容区 */
.main-content {
  flex: 1;
  margin-left: 240px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.top-bar {
  background: var(--bg-surface);
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 8px var(--shadow-color);
  transition: all 0.3s ease;
}

/* 主题切换器 */
.theme-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px var(--shadow-color);
}

.theme-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 2px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.theme-toggle-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--nav-hover-bg);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.theme-toggle-btn:hover::before {
  opacity: 1;
}

.theme-toggle-btn:hover {
  transform: translateY(-2px) scale(1.05);
}

.theme-toggle-btn .theme-icon {
  font-size: 22px;
  position: relative;
  z-index: 1;
  transition: transform 0.3s ease;
}

.theme-toggle-btn:hover .theme-icon {
  transform: scale(1.1) rotate(10deg);
}

/* 激活状态 */
.theme-toggle-btn[data-theme="default"].active {
  background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-400) 100%);
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(74, 105, 255, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .theme-toggle-btn[data-theme="dark"].active {
  background: linear-gradient(135deg, #667EEA 0%, #818CF8 100%);
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

[data-theme="neumorphism"] .theme-toggle-btn[data-theme="neumorphism"].active {
  background: #E5E7EB;
  border-color: #6366F1;
  box-shadow: inset 4px 4px 8px rgba(163, 177, 198, 0.5), 
              inset -4px -4px 8px rgba(255, 255, 255, 0.8);
}

.theme-toggle-btn.active .theme-icon {
  animation: bounce 0.6s ease;
}

@keyframes bounce {
  0%, 100% { transform: scale(1) rotate(0deg); }
  25% { transform: scale(1.2) rotate(-10deg); }
  50% { transform: scale(0.9) rotate(10deg); }
  75% { transform: scale(1.1) rotate(-5deg); }
}

.user-info {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

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

.user-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary-500) 0%, #6b82ff 100%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(74, 105, 255, 0.25);
  border: 2px solid rgba(255, 255, 255, 0.9);
}

/* 移动端汉堡菜单按钮 */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 10;
  transition: all 0.3s ease;
}

.mobile-menu-btn span {
  width: 100%;
  height: 3px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}

.mobile-menu-btn:hover span {
  background: var(--primary-500);
}

/* 菜单打开时的按钮动画 */
.sidebar.open ~ .main-content .mobile-menu-btn span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.sidebar.open ~ .main-content .mobile-menu-btn span:nth-child(2) {
  opacity: 0;
}

.sidebar.open ~ .main-content .mobile-menu-btn span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

.page-content {
  flex: 1;
  padding: var(--space-lg);
  overflow-y: auto;
  overflow-x: visible; /* 允许水平方向溢出，便select下拉选项可见 */
  background: var(--bg-page);
  animation: pageContentFadeIn 0.4s ease-out;
  position: relative; /* 为z-index生效 */
}

@keyframes pageContentFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 页面标题 */
.page-title {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: var(--space-lg);
  color: var(--text-primary);
  position: relative;
  padding-bottom: 12px;
}

.page-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-500) 0%, #6b82ff 100%);
  border-radius: 2px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
}

/* 按钮样式 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-500) 0%, #5c7cff 100%);
  color: white;
  box-shadow: 0 2px 8px var(--shadow-color);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-700) 0%, var(--primary-500) 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px var(--shadow-color);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  background: transparent;
  color: var(--primary-500);
  border: 1.5px solid rgba(74, 105, 255, 0.3);
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: rgba(74, 105, 255, 0.08);
  border-color: var(--primary-500);
  box-shadow: 0 2px 8px rgba(74, 105, 255, 0.15);
}

.btn-sm {
  padding: var(--space-xs) var(--space-md);
  font-size: 13px;
}

.btn-icon {
  font-size: 16px;
}

/* 卡片样式 */
.stat-card {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: 0 2px 8px var(--shadow-color);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
}

/* 可点击的活动卡片样式 */
.stat-card[style*="cursor: pointer"] {
  cursor: pointer;
  user-select: none;
}

.stat-card[style*="cursor: pointer"]:active {
  transform: translateY(-2px) scale(0.98);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-500) 0%, var(--primary-300) 100%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.stat-card:hover {
  box-shadow: 0 8px 24px rgba(74, 105, 255, 0.15);
  transform: translateY(-4px);
  border-color: var(--primary-500);
}

.stat-card:hover::before {
  transform: scaleX(1);
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  position: relative;
  transition: all 0.3s ease;
}

.stat-card:hover .stat-icon {
  transform: scale(1.1) rotate(5deg);
}

.stat-icon.agency {
  background: linear-gradient(135deg, rgba(74, 105, 255, 0.15) 0%, rgba(74, 105, 255, 0.05) 100%);
  color: var(--primary-500);
  box-shadow: 0 4px 12px rgba(74, 105, 255, 0.2);
}

.stat-icon.doctor {
  background: linear-gradient(135deg, rgba(40, 167, 69, 0.15) 0%, rgba(40, 167, 69, 0.05) 100%);
  color: var(--success);
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
}

.stat-icon.city {
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.15) 0%, rgba(255, 193, 7, 0.05) 100%);
  color: var(--warning);
  box-shadow: 0 4px 12px rgba(255, 193, 7, 0.2);
}

.stat-icon.activity {
  background: linear-gradient(135deg, rgba(220, 53, 69, 0.15) 0%, rgba(220, 53, 69, 0.05) 100%);
  color: var(--error);
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.2);
}

.stat-info {
  flex: 1;
}

.stat-info h3 {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
}

.stat-info p {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 14px;
  margin: 0;
}

.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

.stat-trend.up {
  background: rgba(40, 167, 69, 0.1);
  color: var(--success);
}

.stat-trend.down {
  background: rgba(220, 53, 69, 0.1);
  color: var(--error);
}

/* 网格布局 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-xxl);
}

.charts-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  align-items: start;
}

/* 左侧地区分布卡片 */
.chart-card-left {
  grid-row: span 2;
}

/* 右侧分栏容器 */
.chart-card-right-group {
  display: grid;
  grid-template-rows: auto auto;
  gap: var(--space-lg);
}

.chart-card {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: 0 2px 8px var(--shadow-color);
  transition: all 0.3s ease;
  border: 1px solid var(--border);
}

.chart-card:hover {
  box-shadow: 0 8px 24px var(--shadow-color);
  transform: translateY(-2px);
}

.chart-card h3 {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: var(--space-md);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-card h3::before {
  content: '';
  width: 4px;
  height: 20px;
  background: linear-gradient(180deg, var(--primary-500) 0%, var(--primary-300) 100%);
  border-radius: 2px;
}

.chart-container {
  min-height: 300px;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow-y: auto;
}

.chart-bar-item {
  display: flex;
  align-items: center;
  margin: 10px 0;
  animation: slideInLeft 0.5s ease forwards;
  opacity: 0;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.chart-bar-label {
  width: 80px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  text-align: right;
  padding-right: 12px;
}

.chart-bar-track {
  flex: 1;
  background: rgba(74, 105, 255, 0.08);
  border-radius: 8px;
  height: 32px;
  margin: 0 12px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
}

.chart-bar-fill {
  height: 100%;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--primary-500) 0%, var(--primary-400) 100%);
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  box-shadow: 0 2px 8px rgba(74, 105, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  color: white;
  font-size: 12px;
  font-weight: 600;
}

.chart-bar-fill.success {
  background: linear-gradient(90deg, var(--success) 0%, #26d268 100%);
  box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.chart-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.2) 50%, transparent 100%);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.chart-bar-value {
  min-width: 40px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  background: rgba(74, 105, 255, 0.08);
  padding: 4px 12px;
  border-radius: 6px;
}

/* 加载动画 */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.chart-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: var(--text-secondary);
  gap: 12px;
}

.chart-loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(74, 105, 255, 0.2);
  border-top-color: var(--primary-500);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.chart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: var(--text-secondary);
  gap: 12px;
}

.chart-empty-icon {
  font-size: 48px;
  opacity: 0.5;
}

/* 筛选栏 */
.filter-bar {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
  position: relative; /* 为z-index生效 */
  z-index: 10; /* 确保筛选栏在上层 */
}

.filter-select,
.search-input {
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  font-family: inherit;
  font-size: 15px;
  transition: all var(--transition);
  min-width: 200px;
  position: relative; /* 为z-index生效 */
  z-index: 100; /* 确保下拉框在最上层 */
}

.filter-select:hover,
.search-input:hover {
  border-color: var(--primary-500);
}

.filter-select:focus,
.search-input:focus {
  outline: none;
  border-color: var(--primary-500);
  border-width: 1.5px;
  box-shadow: 0 0 0 3px rgba(74, 105, 255, 0.15);
}

.search-input {
  flex: 1;
  min-width: 250px;
}

/* 表格样式 */
.table-container {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  overflow: visible; /* 允许select下拉选项溢出 */
  box-shadow: var(--shadow-sm);
  position: relative; /* 为z-index生效 */
  z-index: 1; /* 低于筛选栏的z-index */
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  position: relative; /* 为z-index生效 */
  z-index: 1; /* 确保表格在下方 */
}

/* 表格行允许溢出 */
.data-table tbody tr {
  position: relative;
  z-index: 1; /* 确保表格行在下方 */
}

.data-table th {
  background: var(--bg-page);
  padding: 16px 24px;
  text-align: left;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 1; /* 确保表头在下方 */
}

.data-table td {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  position: relative; /* 为z-index生效 */
  overflow: visible; /* 允许select下拉选项溢出 */
  z-index: 1; /* 确保单元格在下方 */
}

.data-table tr:hover {
  background: var(--primary-100);
}

.data-table .actions {
  display: flex;
  gap: var(--space-sm);
}

/* 标签/徽章 */
.tag {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  background: var(--primary-100);
  color: var(--primary-700);
  margin: 2px;
}

.tag.success {
  background: rgba(40, 167, 69, 0.1);
  color: var(--success);
}

.tag.warning {
  background: rgba(255, 193, 7, 0.1);
  color: #B85700;
}

.tag.error {
  background: rgba(220, 53, 69, 0.1);
  color: var(--error);
}

/* 快速查询布局 */
.quick-search-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: var(--space-xl);
  height: calc(100vh - 200px);
}

.search-filters {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  overflow-y: auto;
}

.filter-section {
  margin-bottom: var(--space-lg);
}

.filter-section h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.filter-tag {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
}

.filter-tag:hover {
  border-color: var(--primary-500);
  color: var(--primary-500);
}

.filter-tag.active {
  background: var(--primary-500);
  color: white;
  border-color: var(--primary-500);
}

/* 擅长项目标签粉色样式 */
.filter-tags-pink .filter-tag {
  color: #ff69b4;
}

.filter-tags-pink .filter-tag:hover {
  border-color: #ff69b4;
  color: #ff1493;
}

.filter-tags-pink .filter-tag.active {
  background: #ff69b4;
  color: white;
  border-color: #ff69b4;
}

/* 筛选条件计数器 */
.filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--primary-100);
  color: var(--primary-500);
  font-size: 12px;
  font-weight: 600;
  border-radius: 10px;
  transition: all var(--transition);
}

.filter-count:not(:empty) {
  background: var(--primary-500);
  color: white;
}

.filter-count-pink {
  background: rgba(255, 105, 180, 0.1);
  color: #ff69b4;
}

.filter-count-pink:not(:empty) {
  background: #ff69b4;
  color: white;
}

.search-results {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border);
}

/* 结果视图 TABS */
.results-tabs {
  display: flex;
  gap: 8px;
  background: var(--bg-page);
  border-radius: var(--radius-sm);
  padding: 4px;
}

.results-tab {
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.results-tab:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary-500);
}

.results-tab.active {
  background: var(--bg-surface);
  color: var(--primary-500);
  box-shadow: var(--shadow-sm);
}

.results-tab span {
  font-size: 16px;
}

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

.results-count {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
}

/* 结果视图切换 */
.results-view {
  display: none;
  flex: 1;
  overflow: hidden;
}

.results-view.active {
  display: flex;
  flex-direction: column;
}

/* 分栏布局（查询结果视图） */
.results-split-view {
  display: flex;
  gap: var(--space-md);
  flex: 1;
  overflow: hidden;
}

.results-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-page);
  border-radius: var(--radius-sm);
  padding: var(--space-sm);
  overflow: hidden;
}

.results-column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-sm);
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  border-bottom: 2px solid var(--primary-500);
}

.results-column-header h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.column-count {
  background: var(--primary-500);
  color: white;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  min-width: 24px;
  text-align: center;
}

.results-container {
  flex: 1;
  overflow-y: auto;
}

/* 查询结果网格布局 - 默认每行2列 */
.results-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  padding: var(--space-sm);
}

/* 机构和专家专属视图 - 每行4列 */
.results-grid-4col {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  padding: var(--space-sm);
}

/* 左右分栏视图中的网格 - 每行2列 */
.results-column .results-grid-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  padding: var(--space-sm);
}

/* 平板设备上4列改为2列 */
@media (max-width: 1200px) {
  .results-grid-4col {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 手机端优化：卡片式布局 */
.result-item {
  padding: var(--space-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.result-item:hover {
  border-color: var(--primary-500);
  background: var(--primary-100);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

/* 选中的机构样式 */
.result-item.selected-agency {
  border: 2px solid var(--primary-500);
  background: linear-gradient(135deg, rgba(74, 105, 255, 0.08) 0%, rgba(74, 105, 255, 0.04) 100%);
  box-shadow: 0 0 0 3px rgba(74, 105, 255, 0.15);
}

.result-item.selected-agency:hover {
  background: linear-gradient(135deg, rgba(74, 105, 255, 0.12) 0%, rgba(74, 105, 255, 0.06) 100%);
  box-shadow: 0 0 0 3px rgba(74, 105, 255, 0.25);
}

/* 暗色主题下的选中样式 */
[data-theme="dark"] .result-item.selected-agency {
  border: 2px solid #667EEA;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(102, 126, 234, 0.1) 100%);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

[data-theme="dark"] .result-item.selected-agency:hover {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.3) 0%, rgba(102, 126, 234, 0.15) 100%);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.4);
}

/* 结果卡片标题 */
.result-item-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 结果卡片信息行 */
.result-item-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--text-secondary);
}

.result-info-row {
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.5;
}

.result-info-label {
  font-weight: 500;
  color: var(--text-primary);
  min-width: 60px;
}

.result-info-value {
  flex: 1;
  color: var(--text-secondary);
}

/* 标签样式 */
.result-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.result-tag {
  display: inline-block;
  padding: 2px 10px;
  background: var(--primary-100);
  color: var(--primary-500);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

/* 可点击的技能标签 */
.clickable-skill-tag {
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.clickable-skill-tag:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.clickable-skill-tag:active {
  transform: scale(0.98);
}

/* 暗色主题下的可点击标签 */
[data-theme="dark"] .clickable-skill-tag:hover {
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.5);
}

/* 详情按钮 */
.detail-btn {
  margin-top: var(--space-sm);
  padding: 6px 16px;
  background: var(--primary-500);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.detail-btn:hover {
  background: var(--primary-600);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.detail-btn:active {
  transform: translateY(0);
}

/* 数据管理页面 */
.data-management-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: var(--space-lg);
}

.data-card {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
}

.data-card h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.data-card p {
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
}

/* 导入/导出区域 */
.import-section {
  margin-top: var(--space-md);
}

.import-tabs {
  display: flex;
  margin-bottom: var(--space-md);
  background: var(--bg-page);
  border-radius: var(--radius-sm);
  padding: 4px;
}

.import-tab {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.import-tab.active {
  background: var(--bg-surface);
  color: var(--primary-500);
  box-shadow: var(--shadow-sm);
}

/* 模板下载区域 */
.template-download-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  background: linear-gradient(135deg, #f8f9ff 0%, #fff5f8 100%);
  border-radius: var(--radius-md);
  border: 1px solid #e3e8ff;
}

.template-info {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex: 1;
}

.template-icon {
  font-size: 32px;
  opacity: 0.8;
}

.template-text strong {
  display: block;
  color: var(--text-primary);
  font-size: 15px;
  margin-bottom: 4px;
}

.template-text p {
  color: var(--text-secondary);
  font-size: 13px;
  margin: 0;
}

.btn-outline {
  background: white;
  color: var(--primary-500);
  border: 2px solid var(--primary-500);
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-outline:hover {
  background: var(--primary-500);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-outline:active {
  transform: translateY(0);
}

.import-content {
  text-align: center;
}

.file-input {
  display: none;
}

.file-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xl);
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-page);
}

.file-label:hover {
  border-color: var(--primary-500);
  background: var(--primary-100);
}

.upload-icon {
  font-size: 32px;
  color: var(--text-secondary);
}

.upload-status {
  margin-top: var(--space-md);
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
  display: none;
}

.upload-status.success {
  background: rgba(40, 167, 69, 0.1);
  color: var(--success);
  display: block;
}

.upload-status.error {
  background: rgba(220, 53, 69, 0.1);
  color: var(--error);
  display: block;
}

.export-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.export-buttons .btn {
  width: 100%;
  justify-content: center;
}

/* 系统设置页面 */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: var(--space-lg);
}

.settings-section {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
}

.settings-section h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: var(--space-md);
  color: var(--text-primary);
}

.user-list {
  margin-top: var(--space-md);
}

.user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border);
}

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

.system-info p {
  margin-bottom: var(--space-xs);
  color: var(--text-secondary);
}

/* 模态框 */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  overflow: hidden; /* 阻止背景滚动 */
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto; /* 允许弹窗区域滚动 */
  overflow-x: hidden;
  padding: 20px; /* 为小屏幕添加内边距 */
}

.modal-content {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: modalSlideIn 0.3s ease-out;
  margin: auto; /* 居中显示 */
  position: relative;
}

/* 机构弹窗加宽 */
#agency-modal .modal-content {
  max-width: 800px; /* 增加宽度以适应更多内容 */
}

/* 医生(专家)弹窗加宽 */
#doctor-modal .modal-content {
  max-width: 800px; /* 增加宽度以适应更多内容 */
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0; /* 防止头部被压缩 */
  background: var(--bg-surface);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  position: sticky;
  top: 0;
  z-index: 1;
}

.modal-header h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.6;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

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

.modal-body {
  padding: var(--space-lg);
  overflow-y: auto; /* 允许内容滚动 */
  overflow-x: hidden;
  flex: 1; /* 占据剩余空间 */
  max-height: calc(90vh - 140px); /* 留出头部和底部的空间 */
}

.modal-footer {
  padding: var(--space-lg);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  flex-shrink: 0; /* 防止底部被压缩 */
  background: var(--bg-surface);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  position: sticky;
  bottom: 0;
}

/* 美化滚动条 */
.modal-body::-webkit-scrollbar {
  width: 8px;
}

.modal-body::-webkit-scrollbar-track {
  background: var(--bg-page);
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
  background: var(--primary-400);
  border-radius: 4px;
  transition: background 0.3s;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--primary-500);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .modal.active {
    padding: 10px;
  }
  
  .modal-content {
    width: 95%;
    max-height: 95vh;
  }
  
  #agency-modal .modal-content,
  #doctor-modal .modal-content {
    max-width: 95%;
  }
  
  .modal-header,
  .modal-body,
  .modal-footer {
    padding: var(--space-md);
  }
  
  .modal-body {
    max-height: calc(95vh - 120px);
  }
}

@media (max-width: 480px) {
  .modal.active {
    padding: 5px;
  }
  
  .modal-content {
    width: 98%;
    max-height: 98vh;
    border-radius: 8px;
  }
  
  .modal-header h2 {
    font-size: 18px;
  }
  
  .modal-body {
    max-height: calc(98vh - 110px);
  }
}

/* 防止body滚动时布局偏移 */
body.modal-open {
  overflow: hidden !important;
  padding-right: 0 !important;
}

/* 表单样式 */
.form-group {
  margin-bottom: var(--space-md);
}

.form-group label {
  display: block;
  margin-bottom: var(--space-xs);
  font-weight: 500;
  color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  font-family: inherit;
  font-size: 15px;
  transition: all var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-500);
  border-width: 1.5px;
  box-shadow: 0 0 0 3px rgba(74, 105, 255, 0.15);
}

/* 擅长项目标签样式 */
.specialty-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-page);
}

[data-theme="dark"] .specialty-tags-container {
  background: #0F172A;
  border-color: #334155;
}

[data-theme="neumorphism"] .specialty-tags-container {
  background: #E5E7EB;
  border: none;
  box-shadow: inset 3px 3px 6px rgba(163, 177, 198, 0.4), 
              inset -3px -3px 6px rgba(255, 255, 255, 0.7);
}

.specialty-tag {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  margin: 4px;
  border: 2px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  user-select: none;
}

.specialty-tag:hover {
  border-color: var(--primary-400);
  background: var(--primary-100);
  transform: translateY(-2px);
}

.specialty-tag input[type="checkbox"] {
  display: none;
}

.specialty-tag input[type="checkbox"]:checked + * {
  /* 隐藏对勾，使用父元素样式表示选中 */
}

.specialty-tag:has(input[type="checkbox"]:checked) {
  background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-400) 100%);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(74, 105, 255, 0.3);
  font-weight: 600;
}

/* 暗黑主题下的擅长标签 */
[data-theme="dark"] .specialty-tag {
  background: #0F172A;
  border-color: #334155;
  color: #CBD5E1;
}

[data-theme="dark"] .specialty-tag:hover {
  border-color: #667EEA;
  background: rgba(102, 126, 234, 0.1);
}

[data-theme="dark"] .specialty-tag:has(input[type="checkbox"]:checked) {
  background: linear-gradient(135deg, #667EEA 0%, #818CF8 100%);
  color: white;
  border-color: transparent;
}

/* 新拟态主题下的擅长标签 */
[data-theme="neumorphism"] .specialty-tag {
  background: #E5E7EB;
  border: none;
  box-shadow: 4px 4px 8px rgba(163, 177, 198, 0.6), 
              -4px -4px 8px rgba(255, 255, 255, 0.8);
}

[data-theme="neumorphism"] .specialty-tag:hover {
  box-shadow: 3px 3px 6px rgba(163, 177, 198, 0.7), 
              -3px -3px 6px rgba(255, 255, 255, 0.9);
}

[data-theme="neumorphism"] .specialty-tag:has(input[type="checkbox"]:checked) {
  background: #E5E7EB;
  color: #6366F1;
  box-shadow: inset 3px 3px 6px rgba(163, 177, 198, 0.5), 
              inset -3px -3px 6px rgba(255, 255, 255, 0.8);
  font-weight: 700;
}

/* 关联专家显示区域 */
.related-doctors-display {
  padding: 10px;
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: 4px;
  min-height: 40px;
  color: var(--text-secondary);
}

[data-theme="dark"] .related-doctors-display {
  background: #0F172A;
  border-color: #334155;
  color: #94A3B8;
}

[data-theme="neumorphism"] .related-doctors-display {
  background: #E5E7EB;
  border: none;
  box-shadow: inset 3px 3px 6px rgba(163, 177, 198, 0.4), 
              inset -3px -3px 6px rgba(255, 255, 255, 0.7);
  color: #6B7280;
}

/* 最近活动机构样式 */
.recent-activities-container {
  display: grid;
  gap: 12px;
  padding: 4px;
}

.activity-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  animation: slideInUp 0.4s ease forwards;
  opacity: 0;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.activity-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-400) 100%);
  transition: width 0.3s ease;
}

.activity-item:hover {
  background: var(--primary-100);
  border-color: var(--primary-400);
  transform: translateX(4px);
  box-shadow: 0 4px 12px var(--shadow-color);
}

.activity-item:hover::before {
  width: 6px;
}

.activity-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.activity-item-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.activity-item-badge {
  background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-400) 100%);
  color: white;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.activity-item-content {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-secondary);
}

.activity-item-time {
  display: flex;
  align-items: center;
  gap: 4px;
}

.loading-placeholder {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
  font-size: 14px;
}

/* 暗黑主题下的活动样式 */
[data-theme="dark"] .activity-item {
  background: #1E293B;
  border-color: #334155;
}

[data-theme="dark"] .activity-item:hover {
  background: rgba(102, 126, 234, 0.15);
  border-color: #667EEA;
}

[data-theme="dark"] .activity-item-title {
  color: #F1F5F9;
}

[data-theme="dark"] .activity-item-content {
  color: #94A3B8;
}

[data-theme="dark"] .activity-item-footer {
  color: #64748B;
}

/* 新拟态主题下的活动样式 */
[data-theme="neumorphism"] .activity-item {
  background: #E5E7EB;
  border: none;
  box-shadow: 6px 6px 12px rgba(163, 177, 198, 0.6), 
              -6px -6px 12px rgba(255, 255, 255, 0.8);
}

[data-theme="neumorphism"] .activity-item:hover {
  box-shadow: 4px 4px 8px rgba(163, 177, 198, 0.7), 
              -4px -4px 8px rgba(255, 255, 255, 0.9),
              inset 1px 1px 2px rgba(163, 177, 198, 0.2);
  transform: translateY(-2px);
}

[data-theme="neumorphism"] .activity-item::before {
  background: linear-gradient(135deg, #6366F1 0%, #818CF8 100%);
}

/* 查看详情弹窗样式优化 */
.detail-row {
  padding: 12px;
  border-radius: 6px;
  background: var(--bg-page);
  transition: background 0.2s ease;
  color: var(--text-primary);
}

.detail-row:hover {
  background: var(--primary-100);
}

[data-theme="dark"] .detail-row {
  background: #0F172A;
  color: #F1F5F9;
}

[data-theme="dark"] .detail-row:hover {
  background: rgba(102, 126, 234, 0.1);
}

[data-theme="dark"] .detail-row strong {
  color: #94A3B8 !important;
}

[data-theme="dark"] .detail-row span {
  color: #CBD5E1;
}

[data-theme="neumorphism"] .detail-row {
  background: #E5E7EB;
  box-shadow: inset 2px 2px 4px rgba(163, 177, 198, 0.3), 
              inset -2px -2px 4px rgba(255, 255, 255, 0.7);
}

[data-theme="neumorphism"] .detail-row:hover {
  box-shadow: inset 3px 3px 6px rgba(163, 177, 198, 0.4), 
              inset -3px -3px 6px rgba(255, 255, 255, 0.8);
}

/* 选项卡内容控制 */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* 主题切换提示 */
.theme-toast {
  position: fixed;
  top: 80px;
  right: 24px;
  background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-400) 100%);
  color: white;
  padding: 16px 24px;
  border-radius: 12px;
  box-shadow: 0 8px 24px var(--shadow-color), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
  z-index: 10000;
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toast.show {
  opacity: 1;
  transform: translateX(0);
}

.toast-icon {
  font-size: 20px;
  animation: sparkle 1s ease-in-out infinite;
}

@keyframes sparkle {
  0%, 100% { 
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
  50% { 
    transform: scale(1.2) rotate(180deg);
    opacity: 0.8;
  }
}



/* ============================================ */
/* 💎 新拟态主题特效 (Neumorphism) */
/* ============================================ */

/* 侧边栏新拟态 */
[data-theme="neumorphism"] .sidebar {
  background: #E5E7EB;
  border-right: none;
  box-shadow: 10px 0 30px rgba(163, 177, 198, 0.4);
}

[data-theme="neumorphism"] .sidebar-header {
  background: #E5E7EB;
  border-bottom: none;
  box-shadow: inset 0 -2px 4px rgba(163, 177, 198, 0.3);
}

[data-theme="neumorphism"] .sidebar-header h1 {
  background: linear-gradient(135deg, #6366F1 0%, #818CF8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
}

[data-theme="neumorphism"] .nav-item {
  background: #E5E7EB;
  box-shadow: 8px 8px 16px rgba(163, 177, 198, 0.6), 
              -8px -8px 16px rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  transition: all 0.3s ease;
}

[data-theme="neumorphism"] .nav-item:hover {
  box-shadow: 6px 6px 12px rgba(163, 177, 198, 0.7), 
              -6px -6px 12px rgba(255, 255, 255, 0.9);
  transform: translateY(-2px);
}

[data-theme="neumorphism"] .nav-item.active {
  box-shadow: inset 4px 4px 8px rgba(163, 177, 198, 0.5), 
              inset -4px -4px 8px rgba(255, 255, 255, 0.8);
  color: #6366F1;
  transform: translateY(0);
}

[data-theme="neumorphism"] .nav-item.active .nav-icon {
  transform: scale(1.1);
}

/* 顶部栏新拟态 */
[data-theme="neumorphism"] .top-bar {
  background: #E5E7EB;
  border-bottom: none;
  box-shadow: 0 4px 12px rgba(163, 177, 198, 0.4);
}

/* 统计卡片新拟态 */
[data-theme="neumorphism"] .stat-card {
  background: #E5E7EB;
  box-shadow: 12px 12px 24px rgba(163, 177, 198, 0.6), 
              -12px -12px 24px rgba(255, 255, 255, 0.8);
  border: none;
  border-radius: 20px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="neumorphism"] .stat-card:hover {
  box-shadow: 8px 8px 16px rgba(163, 177, 198, 0.7), 
              -8px -8px 16px rgba(255, 255, 255, 0.9),
              inset 2px 2px 4px rgba(163, 177, 198, 0.2);
  transform: translateY(-4px);
}

[data-theme="neumorphism"] .stat-icon {
  background: #E5E7EB;
  box-shadow: 6px 6px 12px rgba(163, 177, 198, 0.6), 
              -6px -6px 12px rgba(255, 255, 255, 0.8);
  border: none;
}

[data-theme="neumorphism"] .stat-card:hover .stat-icon {
  box-shadow: inset 3px 3px 6px rgba(163, 177, 198, 0.5), 
              inset -3px -3px 6px rgba(255, 255, 255, 0.8);
  transform: rotate(5deg) scale(1.05);
}

/* 图表卡片新拟态 */
[data-theme="neumorphism"] .chart-card {
  background: #E5E7EB;
  box-shadow: 12px 12px 24px rgba(163, 177, 198, 0.6), 
              -12px -12px 24px rgba(255, 255, 255, 0.8);
  border: none;
  border-radius: 20px;
}

[data-theme="neumorphism"] .chart-bar-fill {
  background: linear-gradient(90deg, #6366F1 0%, #818CF8 100%);
  box-shadow: inset 2px 2px 4px rgba(99, 102, 241, 0.3),
              0 2px 6px rgba(99, 102, 241, 0.4);
  border-radius: 8px;
}

/* 按钮新拟态 */
[data-theme="neumorphism"] .btn-primary {
  background: #E5E7EB;
  color: #6366F1;
  box-shadow: 8px 8px 16px rgba(163, 177, 198, 0.6), 
              -8px -8px 16px rgba(255, 255, 255, 0.8);
  border: none;
  font-weight: 700;
}

[data-theme="neumorphism"] .btn-primary:hover {
  box-shadow: 6px 6px 12px rgba(163, 177, 198, 0.7), 
              -6px -6px 12px rgba(255, 255, 255, 0.9);
  transform: translateY(-2px);
}

[data-theme="neumorphism"] .btn-primary:active {
  box-shadow: inset 4px 4px 8px rgba(163, 177, 198, 0.5), 
              inset -4px -4px 8px rgba(255, 255, 255, 0.8);
  transform: translateY(0);
}

[data-theme="neumorphism"] .btn-secondary {
  background: #E5E7EB;
  color: #6B7280;
  box-shadow: 6px 6px 12px rgba(163, 177, 198, 0.6), 
              -6px -6px 12px rgba(255, 255, 255, 0.8);
  border: none;
}

/* 输入框新拟态 */
[data-theme="neumorphism"] .form-group input,
[data-theme="neumorphism"] .form-group select,
[data-theme="neumorphism"] .form-group textarea,
[data-theme="neumorphism"] .search-input,
[data-theme="neumorphism"] .filter-select {
  background: #E5E7EB;
  box-shadow: inset 4px 4px 8px rgba(163, 177, 198, 0.5), 
              inset -4px -4px 8px rgba(255, 255, 255, 0.8);
  border: none;
  border-radius: 12px;
}

[data-theme="neumorphism"] .form-group input:focus,
[data-theme="neumorphism"] .form-group select:focus,
[data-theme="neumorphism"] .form-group textarea:focus,
[data-theme="neumorphism"] .search-input:focus,
[data-theme="neumorphism"] .filter-select:focus {
  box-shadow: inset 6px 6px 12px rgba(163, 177, 198, 0.6), 
              inset -6px -6px 12px rgba(255, 255, 255, 0.9),
              0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* 表格新拟态 */
[data-theme="neumorphism"] .data-table {
  background: #E5E7EB;
  box-shadow: 8px 8px 16px rgba(163, 177, 198, 0.4), 
              -8px -8px 16px rgba(255, 255, 255, 0.6);
  border-radius: 16px;
  overflow: hidden;
}

[data-theme="neumorphism"] .data-table th {
  background: #D1D5DB;
  box-shadow: 0 2px 4px rgba(163, 177, 198, 0.3);
}

[data-theme="neumorphism"] .data-table tr:hover {
  background: #DDE1E6;
}

/* 模态框新拟态 */
[data-theme="neumorphism"] .modal-content {
  background: #E5E7EB;
  box-shadow: 16px 16px 32px rgba(163, 177, 198, 0.6), 
              -16px -16px 32px rgba(255, 255, 255, 0.8);
  border: none;
  border-radius: 24px;
}

[data-theme="neumorphism"] .modal-header {
  border-bottom: 1px solid rgba(163, 177, 198, 0.2);
}

/* 标签新拟态 */
[data-theme="neumorphism"] .filter-tag {
  background: #E5E7EB;
  box-shadow: 4px 4px 8px rgba(163, 177, 198, 0.6), 
              -4px -4px 8px rgba(255, 255, 255, 0.8);
  border: none;
}

[data-theme="neumorphism"] .filter-tag.active {
  background: #E5E7EB;
  color: #6366F1;
  box-shadow: inset 3px 3px 6px rgba(163, 177, 198, 0.5), 
              inset -3px -3px 6px rgba(255, 255, 255, 0.8);
}

[data-theme="neumorphism"] .filter-tag:hover {
  box-shadow: 3px 3px 6px rgba(163, 177, 198, 0.7), 
              -3px -3px 6px rgba(255, 255, 255, 0.9);
}



/* 响应式设计 */
@media (max-width: 1200px) {
  .quick-search-layout {
    grid-template-columns: 250px 1fr;
  }
  
  .charts-section {
    grid-template-columns: 1fr;
  }
  
  .chart-card-left {
    grid-row: span 1;
  }
  
  .chart-card-right-group {
    grid-template-rows: auto auto;
  }
}

@media (max-width: 768px) {
  /* 显示移动端菜单按钮 */
  .mobile-menu-btn {
    display: flex;
  }
  
  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.2);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  /* 移动端遮罩层 */
  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity var(--transition);
  }
  
  .sidebar-overlay.active {
    display: block;
    opacity: 1;
  }
  
  .main-content {
    margin-left: 0;
  }
  
  /* 主题切换器移动端优化 */
  .top-bar {
    flex-wrap: wrap;
    gap: 12px;
  }
  
  .theme-switcher {
    gap: 4px;
    padding: 4px;
  }
  
  .theme-toggle-btn {
    width: 38px;
    height: 38px;
  }
  
  .theme-toggle-btn .theme-icon {
    font-size: 18px;
  }
  
  .theme-toast {
    top: 60px;
    right: 12px;
    left: 12px;
    padding: 12px 16px;
    font-size: 13px;
  }
  
  .quick-search-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .chart-bar-label {
    width: 60px;
    font-size: 13px;
  }
  
  .chart-bar-value {
    min-width: 35px;
    font-size: 13px;
  }
  
  .data-management-grid {
    grid-template-columns: 1fr;
  }
  
  .settings-grid {
    grid-template-columns: 1fr;
  }
  
  .filter-bar {
    flex-direction: column;
  }
  
  .filter-select,
  .search-input {
    min-width: 100%;
  }
  
  .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-md);
  }
  
  .page-title {
    font-size: 24px;
  }
  
  /* 快速查询结果移动端优化 */
  .results-split-view {
    flex-direction: column;
    gap: var(--space-md);
  }
  
  .results-column {
    min-height: 300px;
  }
  
  /* 移动端网格单列布局 */
  .results-grid,
  .results-grid-2col,
  .results-grid-4col {
    grid-template-columns: 1fr;
  }
  
  .result-item {
    padding: 16px;
    border-left: 3px solid var(--primary-500);
  }
  
  .result-item-title {
    font-size: 15px;
  }
  
  .result-item-info {
    font-size: 13px;
  }
  
  .result-info-row {
    flex-wrap: wrap;
  }
  
  .result-info-label {
    min-width: 50px;
    font-size: 12px;
  }
  
  .detail-btn {
    width: 100%;
    justify-content: center;
    margin-top: 8px;
  }
  
  /* 结果标签页移动端优化 */
  .results-tabs {
    flex-direction: row;
    overflow-x: auto;
  }
  
  .results-tab {
    flex-shrink: 0;
    padding: 6px 12px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .page-content {
    padding: var(--space-md);
  }
  
  .modal-content {
    width: 95%;
    margin: var(--space-sm);
  }
  
  .data-table {
    font-size: 14px;
  }
  
  .data-table th,
  .data-table td {
    padding: var(--space-sm);
  }
  
  .stat-card {
    padding: var(--space-md);
  }
}

/* 分页控件样式 */
.pagination-container {
  margin-top: var(--space-md);
}

.pagination-container button {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 14px;
}

.pagination-container button:hover:not(:disabled) {
  background: var(--primary-500);
  color: white;
  border-color: var(--primary-500);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(74, 105, 255, 0.3);
}

.pagination-container button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: #f5f5f5;
  color: #999;
  border-color: #e0e0e0;
}

.pagination-container button:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: none;
}

/* 订单详情样式 */
.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-page);
  border-radius: 6px;
  line-height: 1.6;
  transition: all 0.2s ease;
}

.detail-row:hover {
  background: #f0f4ff;
  transform: translateX(2px);
}

.detail-row span {
  flex-shrink: 0;
}

.detail-row strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* 状态标签 */
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.status-active {
  background: #e7f5ff;
  color: #1971c2;
}

.status-inactive {
  background: #fff5f5;
  color: #e03131;
}

/* 表格内按钮样式 */
.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
  margin: 0 2px;
}

.btn-danger {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
  color: white;
  border: none;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #ee5a6f 0%, #ff6b6b 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.btn-success {
  background: linear-gradient(135deg, #51cf66 0%, #40c057 100%);
  color: white;
  border: none;
}

.btn-success:hover {
  background: linear-gradient(135deg, #40c057 0%, #51cf66 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(81, 207, 102, 0.3);
}

/* ===========================================
   下拉菜单显示修复 - 机构管理和医生管理
   解决表格内select被裁剪的问题
   =========================================== */

/* 移除容器的overflow限制 */
.table-container {
  overflow: visible !important;
}

.module-content,
.content-main,
.page-content {
  overflow: visible !important;
}

/* 表格和单元格允许溢出 */
.data-table,
.data-table tbody,
.data-table tbody tr,
.data-table tbody tr td {
  position: relative;
  overflow: visible !important;
}

/* 全局select元素z-index提升 */
select {
  position: relative;
  z-index: 1;
}

select:focus,
select:active {
  z-index: 99999 !important;
  position: relative;
}

/* 表格内select特殊处理 */
.data-table select {
  position: relative;
  z-index: 10;
}

.data-table select:focus,
.data-table select:active {
  z-index: 99999 !important;
}

/* 表单内select */
.form-group select,
.form-row select,
.filter-select {
  position: relative;
  z-index: 10;
}

.form-group select:focus,
.form-group select:active,
.form-row select:focus,
.form-row select:active,
.filter-select:focus,
.filter-select:active {
  z-index: 99999 !important;
}

/* 模态框内select */
.modal-body select {
  position: relative;
  z-index: 10;
}

.modal-body select:focus,
.modal-body select:active {
  z-index: 99999 !important;
}

/* 确保模态框不会限制下拉选项 */
.modal-content {
  overflow: visible !important;
}

.modal-body {
  overflow-y: auto;
  overflow-x: visible !important;
}

/* ===========================================
   下拉菜单终极修复 - 机构/医生管理
   使用最高优先级确保selectbox显示
   =========================================== */

/* 1. 全局select元素 - 最高优先级 */
select,
input[type="select"],
.form-control.select {
  position: relative !important;
  z-index: 1 !important;
}

select:focus,
select:active,
select:hover,
input[type="select"]:focus,
input[type="select"]:active {
  z-index: 999999 !important;
  position: relative !important;
}

/* 2. 表格相关容器允许溢出 */
.table-container,
.data-table,
.data-table tbody,
.data-table tbody tr,
.data-table tbody tr td,
.data-table thead,
.data-table thead tr,
.data-table thead th {
  position: relative !important;
  overflow: visible !important;
}

/* 3. 页面容器允许溢出 */
.page-content,
.content-main,
.module-content,
.app,
.main-content {
  overflow: visible !important;
}

/* 4. 表单相关 */
.form-group,
.form-row,
.form-control,
.filter-group,
.search-filters {
  position: relative !important;
  overflow: visible !important;
}

/* 5. 表单内的select */
.form-group select,
.form-row select,
.form-control select {
  position: relative !important;
  z-index: 10 !important;
}

.form-group select:focus,
.form-group select:active,
.form-row select:focus,
.form-row select:active {
  z-index: 999999 !important;
}

/* 6. 过滤器select */
.filter-select,
.search-select,
.filter-group select {
  position: relative !important;
  z-index: 10 !important;
}

.filter-select:focus,
.filter-select:active,
.search-select:focus,
.search-select:active {
  z-index: 999999 !important;
}

/* 7. 表格内select */
.data-table select,
.data-table td select,
.data-table th select {
  position: relative !important;
  z-index: 10 !important;
}

.data-table select:focus,
.data-table select:active,
.data-table td select:focus,
.data-table td select:active {
  z-index: 999999 !important;
}

/* 8. 模态框内select */
.modal select,
.modal-content select,
.modal-body select {
  position: relative !important;
  z-index: 10 !important;
}

.modal select:focus,
.modal select:active,
.modal-content select:focus,
.modal-content select:active,
.modal-body select:focus,
.modal-body select:active {
  z-index: 999999 !important;
}

/* 9. 确保body和html不限制溢出 */
body,
html {
  overflow-x: visible !important;
}

/* 10. 所有可能的父容器 */
div[class*="container"],
div[class*="wrapper"],
div[class*="content"] {
  overflow: visible !important;
}

/* 11. select下拉选项样式增强 */
select option {
  background: var(--bg-surface) !important;
  color: var(--text-primary) !important;
  padding: 8px !important;
}

select option:hover {
  background: var(--primary-100) !important;
}