/* 全局样式 */
:root {
  --primary-color: #4f46e5;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --dark-color: #1f2937;
  --light-color: #f9fafb;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--light-color);
}

/* 加载动画 */
#loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.spinner-border {
  width: 3rem;
  height: 3rem;
}

/* 登录页面 */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-color) 0%, #7c3aed 100%);
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 2rem;
  background: white;
  border-radius: 1rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.login-title {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--dark-color);
  margin-bottom: 0.5rem;
}

.login-subtitle {
  color: #6b7280;
  margin-bottom: 2rem;
}

/* Dashboard */
.navbar {
  background: white !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.sidebar {
  min-height: calc(100vh - 56px);
  background: white;
  border-right: 1px solid #e5e7eb;
  padding: 1rem 0;
}

.sidebar-title {
  padding: 0 1.5rem 1rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dark-color);
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.menu-group {
  padding: 0 0.75rem;
}

.menu-group-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: none;
  background: transparent;
  color: #111827;
  padding: 0.7rem 0.75rem;
  border-radius: 0.75rem;
  font-weight: 700;
}

.menu-group.open .menu-group-toggle {
  background: #f8fafc;
}

.menu-group-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.menu-group-label::before {
  content: "";
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 0.22rem;
  border: 2px solid #94a3b8;
}

.menu-group-arrow {
  color: #94a3b8;
  font-size: 1rem;
  transition: transform 0.2s ease;
}

.menu-group.open .menu-group-arrow {
  transform: rotate(45deg);
}

.menu-sub-list {
  display: none;
  padding: 0.2rem 0 0.15rem 1rem;
}

.menu-group.open .menu-sub-list {
  display: block;
}

.menu-sub-link {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: #64748b;
  padding: 0.7rem 0.9rem;
  border-radius: 0.85rem;
  font-weight: 600;
  transition: all 0.2s;
}

.menu-sub-link::before {
  content: "";
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.75rem;
  border-radius: 50%;
  border: 2px solid currentColor;
  opacity: 0.65;
}

.menu-sub-link:hover,
.menu-sub-link.active {
  color: var(--primary-color);
  background: #eef2ff;
}

.menu-sub-link.active {
  box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.12);
}

.main-content {
  padding: 2rem;
  background: var(--light-color);
  min-height: calc(100vh - 56px);
}

.dashboard-panel {
  display: block;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.profile-item {
  padding: 1rem 1.1rem;
  border-radius: 0.9rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.profile-item span {
  display: block;
  color: #64748b;
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
}

.profile-item strong {
  color: #0f172a;
  font-size: 1rem;
}

.placeholder-card {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* 统计卡片 */
.stat-card {
  background: white;
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.stat-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.stat-value {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--dark-color);
}

.stat-label {
  color: #6b7280;
  font-size: 0.875rem;
}

/* 表格 */
.table-card {
  background: white;
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.table thead th {
  background: var(--light-color);
  color: #6b7280;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  border: none;
}

.table tbody tr {
  border-bottom: 1px solid #e5e7eb;
}

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

/* 徽章 */
.badge {
  padding: 0.375rem 0.75rem;
  font-weight: 500;
  border-radius: 0.375rem;
}

/* 按钮 */
.btn {
  padding: 0.625rem 1.25rem;
  font-weight: 500;
  border-radius: 0.5rem;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-primary:hover {
  background: #4338ca;
  border-color: #4338ca;
}

/* 响应式 */
@media (max-width: 768px) {
  .sidebar {
    min-height: auto;
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
  }

  .main-content {
    padding: 1rem;
  }

  .stat-card {
    margin-bottom: 1rem;
  }

  .menu-group {
    padding: 0 0.5rem;
  }
}

/* 图表容器 */
.chart-container {
  position: relative;
  height: 300px;
  margin-top: 1rem;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #6b7280;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}
