/**
 * Admin模块自定义样式表
 * 用于GDzc项目 - 运营方管理平台Admin
 * 
 * 特性：支持二级菜单可收缩设计
 * 
 * 作者: GDzc开发团队
 * 版本: 1.0.0
 * 日期: 2026-06-27
 */

/* ==================== 全局样式重置与基础设置 ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 
               'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: #333;
  background-color: #f0f2f5;
  overflow-x: hidden;
}

/* ==================== 主布局容器 ==================== */
.admin-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ==================== 左侧菜单栏样式（支持二级菜单） ==================== */
.admin-sidebar {
  width: 260px;
  min-width: 260px;
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  color: #ecf0f1;
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.2);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1050;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Logo区域 */
.sidebar-header {
  padding: 20px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
}

.admin-logo {
  font-size: 28px;
  font-weight: bold;
  color: #fff;
  margin-bottom: 5px;
  letter-spacing: 3px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.logo-icon {
  display: inline-block;
  width: 45px;
  height: 45px;
  line-height: 45px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  font-size: 22px;
  margin-bottom: 10px;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.admin-subtitle {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* 菜单容器 */
.sidebar-menu {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 0;
}

/* 自定义滚动条样式 */
.sidebar-menu::-webkit-scrollbar {
  width: 4px;
}

.sidebar-menu::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
}

.sidebar-menu::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.sidebar-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ==================== 一级菜单项（父级菜单） ==================== */
.menu-parent {
  margin-bottom: 2px;
}

.menu-parent-header {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  transition: all 0.25s ease;
  border-left: 3px solid transparent;
  user-select: none;
  position: relative;
}

.menu-parent-header:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-left-color: rgba(102, 126, 234, 0.6);
}

.menu-parent.active > .menu-parent-header {
  background: rgba(102, 126, 234, 0.15);
  color: #fff;
  border-left-color: #667eea;
  font-weight: 500;
}

/* 父级菜单图标 */
.menu-parent-icon {
  width: 20px;
  height: 20px;
  margin-right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

/* 父级菜单文字 */
.menu-parent-text {
  flex: 1;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 展开/收起箭头 */
.menu-arrow {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
  font-size: 12px;
  opacity: 0.7;
}

.menu-parent.expanded .menu-arrow {
  transform: rotate(90deg);
}

/* 父级菜单徽章 */
.menu-parent-badge {
  background: #e74c3c;
  color: #fff;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 600;
  margin-right: 8px;
}

/* ==================== 二级子菜单（可收缩） ==================== */
.menu-children {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(0, 0, 0, 0.15);
}

.menu-parent.expanded .menu-children {
  max-height: 500px; /* 足够大的值以容纳所有子菜单 */
}

/* 二级菜单列表 */
.menu-child-list {
  list-style: none;
  padding: 8px 0;
  margin: 0;
}

/* 单个二级菜单项 */
.menu-child-item {
  position: relative;
}

.menu-child-link {
  display: flex;
  align-items: center;
  padding: 11px 20px 11px 52px; /* 左侧缩进，对齐父级图标位置 */
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  font-size: 13px;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
  position: relative;
}

.menu-child-link::before {
  content: '';
  position: absolute;
  left: 36px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  transition: all 0.2s ease;
}

.menu-child-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.9);
  border-left-color: rgba(102, 126, 234, 0.5);
}

.menu-child-link:hover::before {
  background: #667eea;
  box-shadow: 0 0 8px rgba(102, 126, 234, 0.6);
}

.menu-child-item.active .menu-child-link {
  background: rgba(102, 126, 234, 0.12);
  color: #fff;
  border-left-color: #667eea;
  font-weight: 500;
}

.menu-child-item.active .menu-child-link::before {
  background: #667eea;
  box-shadow: 0 0 8px rgba(102, 126, 234, 0.8);
}

/* 子菜单文字 */
.menu-child-text {
  flex: 1;
}

/* 子菜单徽章/状态 */
.menu-child-status {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 8px;
  font-weight: 500;
}

.status-new {
  background: #e74c3c;
  color: #fff;
}

.status-hot {
  background: #f39c12;
  color: #fff;
}

/* 侧边栏底部信息 */
.sidebar-footer {
  padding: 15px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  text-align: center;
  line-height: 1.6;
}

.sidebar-footer a {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
}

.sidebar-footer a:hover {
  color: #667eea;
}

/* ==================== 右侧内容区域 ==================== */
.admin-content {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 顶部导航栏 */
.admin-navbar {
  height: 64px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  position: sticky;
  top: 0;
  z-index: 1040;
}

/* 左侧区域 */
.navbar-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* 侧边栏折叠按钮 */
.sidebar-toggle {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
  color: #555;
}

.sidebar-toggle:hover {
  background: #f0f2f5;
  color: #333;
}

/* 面包屑导航 */
.navbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #666;
}

.breadcrumb-separator {
  color: #ccc;
}

.breadcrumb-current {
  color: #333;
  font-weight: 500;
}

/* 右侧区域 */
.navbar-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

/* 导航栏操作按钮 */
.navbar-action-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
  color: #666;
  font-size: 18px;
}

.navbar-action-btn:hover {
  background: #f0f2f5;
  color: #333;
}

/* 通知徽章 */
.notification-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  background: #e74c3c;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}

/* 用户信息下拉区 */
.user-dropdown {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.user-dropdown:hover {
  background: #f0f2f5;
}

.user-avatar-admin {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.user-info-text {
  display: flex;
  flex-direction: column;
}

.user-name-admin {
  font-size: 14px;
  font-weight: 500;
  color: #333;
  line-height: 1.2;
}

.user-role-admin {
  font-size: 11px;
  color: #999;
  line-height: 1.2;
}

.dropdown-arrow {
  font-size: 12px;
  color: #999;
  margin-left: 4px;
}

/* 主内容区 */
.main-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  background: #f0f2f5;
}

.content-container {
  max-width: 1600px;
  margin: 0 auto;
}

/* ==================== 卡片组件 ==================== */
.content-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
  padding: 24px;
  margin-bottom: 20px;
  transition: box-shadow 0.2s ease;
}

.content-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card-header-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f0f0f0;
}

.card-title-main {
  font-size: 17px;
  font-weight: 600;
  color: #2c3e50;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title-icon {
  color: #667eea;
}

/* 统计卡片网格 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background: #fff;
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  gap: 20px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.stat-icon-box {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}

.stat-icon-blue {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}

.stat-icon-green {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  color: #fff;
}

.stat-icon-orange {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: #fff;
}

.stat-icon-cyan {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  color: #fff;
}

.stat-info h3 {
  font-size: 26px;
  font-weight: 700;
  color: #2c3e50;
  margin: 0 0 4px 0;
  line-height: 1;
}

.stat-info p {
  font-size: 13px;
  color: #999;
  margin: 0;
}

/* 表格基础样式 */
.data-table-container {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid #eee;
}

.table-custom {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}

.table-custom thead th {
  background: #fafafa;
  padding: 14px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid #eee;
  white-space: nowrap;
}

.table-custom tbody td {
  padding: 14px 16px;
  font-size: 14px;
  color: #555;
  border-bottom: 1px solid #f5f5f5;
  vertical-align: middle;
}

.table-custom tbody tr:hover {
  background: #fafbfc;
}

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

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

.status-badge-success {
  background: #e8f8f0;
  color: #27ae60;
}

.status-badge-warning {
  background: #fef9e7;
  color: #f39c12;
}

.status-badge-danger {
  background: #fdedec;
  color: #e74c3c;
}

.status-badge-info {
  background: #ebf5fb;
  color: #3498db;
}

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

.btn-action-sm {
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 6px;
  border: 1px solid #ddd;
  background: #fff;
  color: #666;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-action-sm:hover {
  border-color: #667eea;
  color: #667eea;
  background: #f8f9ff;
}

.btn-action-primary {
  border-color: #667eea;
  color: #667eea;
}

.btn-action-primary:hover {
  background: #667eea;
  color: #fff;
}

.btn-action-danger {
  border-color: #e74c3c;
  color: #e74c3c;
}

.btn-action-danger:hover {
  background: #e74c3c;
  color: #fff;
}

/* 分页组件 */
.pagination-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  margin-top: 16px;
}

.pagination-info {
  font-size: 13px;
  color: #999;
}

.pagination-nav {
  display: flex;
  gap: 4px;
}

.page-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid #ddd;
  background: #fff;
  color: #666;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.page-btn:hover:not(:disabled) {
  border-color: #667eea;
  color: #667eea;
}

.page-btn.active {
  background: #667eea;
  color: #fff;
  border-color: #667eea;
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 搜索和筛选栏 */
.filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  padding: 16px;
  background: #fafbfc;
  border-radius: 8px;
}

.search-input-group {
  display: flex;
  gap: 10px;
  flex: 1;
  max-width: 480px;
}

.search-input {
  flex: 1;
  height: 38px;
  padding: 0 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-search {
  height: 38px;
  padding: 0 20px;
  background: #667eea;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-search:hover {
  background: #5a6fd6;
}

.filter-actions {
  display: flex;
  gap: 10px;
}

.btn-filter {
  height: 38px;
  padding: 0 16px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  color: #666;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-filter:hover {
  border-color: #667eea;
  color: #667eea;
}

.btn-add-new {
  height: 38px;
  padding: 0 18px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-add-new:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
}

/* 空数据状态 */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state-icon {
  font-size: 64px;
  color: #ddd;
  margin-bottom: 16px;
}

.empty-state-text {
  font-size: 15px;
  color: #999;
  margin-bottom: 20px;
}

.empty-state-action {
  display: inline-block;
  padding: 10px 24px;
  background: #667eea;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s;
}

.empty-state-action:hover {
  background: #5a6fd6;
}

/* 加载动画 */
.loading-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
}

.spinner-custom {
  width: 48px;
  height: 48px;
  border: 4px solid #f0f0f0;
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-text {
  margin-top: 16px;
  font-size: 14px;
  color: #999;
}

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

.fade-in-up {
  animation: fadeInUp 0.35s ease-out;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 1200px) {
  .admin-sidebar {
    transform: translateX(-100%);
    z-index: 1100;
  }

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

  .admin-content {
    margin-left: 0;
  }
  
  /* 移动端遮罩层 */
  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1099;
  }

  .sidebar-overlay.show {
    display: block;
  }
}

@media (max-width: 992px) {
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-input-group {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .main-content {
    padding: 16px;
  }

  .admin-navbar {
    padding: 0 16px;
  }

  .user-info-text {
    display: none;
  }

  .stat-card {
    padding: 18px;
  }

  .stat-icon-box {
    width: 48px;
    height: 48px;
    font-size: 22px;
  }

  .stat-info h3 {
    font-size: 22px;
  }
}
