/**
 * DM商城管理后台 - 自定义样式
 */

/* ========== 全局变量 ========== */
:root {
  --sidebar-width: 250px;
  --sidebar-collapsed-width: 70px;
  --topbar-height: 56px;
  --primary-color: #0d6efd;
  --transition-speed: 0.3s;
}

/* ========== 登录页面 ========== */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container .card {
  backdrop-filter: blur(10px);
}

.brand-icon i {
  display: inline-block;
  width: 64px;
  height: 64px;
  line-height: 64px;
  border-radius: 16px;
  background: rgba(13, 110, 253, 0.1);
  color: var(--primary-color);
}

/* ========== 后台布局 ========== */
.dashboard-wrapper {
  min-height: 100vh;
}

/* ========== 侧边栏 ========== */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1000;
  transition: width var(--transition-speed) ease, transform var(--transition-speed) ease;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .sidebar-brand span,
.sidebar.collapsed .nav-link span,
.sidebar.collapsed .sidebar-footer small {
  display: none;
}

.sidebar.collapsed .nav-link i {
  margin-right: 0 !important;
  font-size: 1.2rem;
}

.sidebar .nav-link {
  border-radius: 8px;
  margin-bottom: 2px;
  padding: 10px 12px;
  transition: all 0.2s ease;
}

.sidebar .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.sidebar .nav-link.active {
  background-color: var(--primary-color);
  color: #fff !important;
}

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

.sidebar.collapsed + .main-content,
.main-content.expanded {
  margin-left: var(--sidebar-collapsed-width);
}

/* ========== 顶部栏 ========== */
.topbar {
  height: var(--topbar-height);
  z-index: 999;
  position: sticky;
  top: 0;
}

/* ========== 内容区域 ========== */
.content-area {
  min-height: calc(100vh - var(--topbar-height));
}

/* ========== 统计卡片 ========== */
.stat-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1) !important;
}

.stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0 !important;
  }

  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
  }
}

/* ========== 通用工具类 ========== */
.cursor-pointer {
  cursor: pointer;
}

/* ========== 表格优化 ========== */
.table th {
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ========== 淡入动画 ========== */
.fade-in {
  animation: fadeIn 0.3s ease;
}

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