/* ==========================================
   艺只鹅 - 管理后台 PC端样式
   ========================================== */

:root {
  --ad-green: #8B5CF6;
  --ad-green-light: #C4B5FD;
  --ad-green-dark: #7C3AED;
  --ad-accent: #F59E0B;
  --ad-bg: #F5F3FF;
  --ad-card: #FFFFFF;
  --ad-border: #EDE9FE;
  --ad-text: #111111;
  --ad-text-2: #333333;
  --ad-text-3: #666666;
  --ad-sidebar-w: 240px;
  --ad-header-h: 56px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--ad-bg);
  color: var(--ad-text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ===== 布局 ===== */
.admin-layout { display: flex; min-height: 100vh; }

/* ===== 侧边栏 ===== */
.admin-sidebar {
  width: var(--ad-sidebar-w); background: linear-gradient(180deg, #1E1B2E 0%, #2D2640 100%); color: #fff;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
  display: flex; flex-direction: column;
  transition: transform 0.3s;
}
.admin-sidebar-logo {
  height: var(--ad-header-h); display: flex; align-items: center; gap: 10px;
  padding: 0 20px; border-bottom: 1px solid rgba(255,255,255,0.08); flex-shrink: 0;
}
.admin-sidebar-logo-icon {
  width: 32px; height: 32px; background: linear-gradient(135deg, #8B5CF6, #7C3AED);
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
}
.admin-sidebar-logo span { font-size: 16px; font-weight: 700; }
.admin-sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.admin-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px; margin: 2px 8px; border-radius: 8px;
  color: rgba(255,255,255,0.6); font-size: 14px; text-decoration: none;
  transition: all 0.2s; cursor: pointer;
}
.admin-nav-item:hover { color: #fff; background: rgba(255,255,255,0.06); }
.admin-nav-item.active { color: #fff; background: rgba(139,92,246,0.2); }
.admin-nav-item.active .admin-nav-icon { color: #A78BFA; }
.admin-nav-icon { width: 20px; height: 20px; flex-shrink: 0; }
.admin-nav-icon svg { width: 100%; height: 100%; }
.admin-sidebar-footer {
  padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 12px; color: rgba(255,255,255,0.3);
}

/* ===== 主内容区 ===== */
.admin-main { flex: 1; margin-left: var(--ad-sidebar-w); min-height: 100vh; }

/* ===== 顶部栏 ===== */
.admin-header {
  height: var(--ad-header-h); background: var(--ad-card);
  border-bottom: 1px solid var(--ad-border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; position: sticky; top: 0; z-index: 50;
}
.admin-header-title { font-size: 18px; font-weight: 700; color: #111111; }
.admin-header-actions { display: flex; align-items: center; gap: 12px; }

/* ===== 内容区 ===== */
.admin-body { padding: 24px; }

/* ===== 统计卡片 ===== */
.admin-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.admin-stat-card {
  background: var(--ad-card); border-radius: 12px; padding: 20px;
  border: 1px solid var(--ad-border); transition: box-shadow 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.admin-stat-card:hover { box-shadow: 0 4px 16px rgba(139,92,246,0.08); }
.admin-stat-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; margin-bottom: 12px;
}
.admin-stat-value { font-size: 28px; font-weight: 800; margin-bottom: 2px; color: #111111; }
.admin-stat-label { font-size: 13px; color: #666666; }

/* ===== 卡片 ===== */
.admin-card {
  background: var(--ad-card); border-radius: 12px;
  border: 1px solid var(--ad-border); margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.admin-card-header {
  padding: 16px 20px; border-bottom: 1px solid var(--ad-border);
  display: flex; align-items: center; justify-content: space-between;
}
.admin-card-title { font-size: 15px; font-weight: 700; color: #111111; }
.admin-card-body { padding: 20px; }

/* ===== 表格 ===== */
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
  text-align: left; padding: 10px 16px; font-size: 12px; font-weight: 700;
  color: #333333; text-transform: uppercase; letter-spacing: 0.5px;
  background: #FAFAFA; border-bottom: 1px solid var(--ad-border);
}
.admin-table td {
  padding: 12px 16px; font-size: 14px; border-bottom: 1px solid var(--ad-border);
  vertical-align: middle; color: #111111;
}
.admin-table tr:hover td { background: #F9FAFB; }
.admin-table tr:last-child td { border-bottom: none; }

/* ===== 按钮 ===== */
.ad-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 500;
  border: none; cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.ad-btn:active { transform: scale(0.97); }
.ad-btn-primary { background: var(--ad-green); color: #fff; }
.ad-btn-primary:hover { background: var(--ad-green-dark); }
.ad-btn-default { background: #fff; color: var(--ad-text-2); border: 1px solid var(--ad-border); }
.ad-btn-default:hover { background: #F9FAFB; }
.ad-btn-danger { background: #FEF2F2; color: #EF4444; }
.ad-btn-danger:hover { background: #FEE2E2; }
.ad-btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 6px; }
.ad-btn-icon { padding: 6px; border-radius: 6px; }

/* ===== 输入框 ===== */
.ad-input {
  width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--ad-border);
  border-radius: 8px; font-size: 14px; color: var(--ad-text); outline: none;
  transition: border-color 0.2s; background: #fff;
}
.ad-input:focus { border-color: var(--ad-green); box-shadow: 0 0 0 3px rgba(107,203,119,0.1); }
.ad-textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--ad-border);
  border-radius: 8px; font-size: 14px; color: var(--ad-text); outline: none;
  resize: vertical; min-height: 80px; font-family: inherit;
}
.ad-textarea:focus { border-color: var(--ad-green); box-shadow: 0 0 0 3px rgba(107,203,119,0.1); }
.ad-select {
  height: 38px; padding: 0 32px 0 12px; border: 1px solid var(--ad-border);
  border-radius: 8px; font-size: 14px; color: var(--ad-text); outline: none;
  background: #fff; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%239CA3AF' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.ad-select:focus { border-color: var(--ad-green); }
.ad-label { display: block; font-size: 13px; font-weight: 600; color: #111111; margin-bottom: 4px; }

/* ===== 搜索栏 ===== */
.ad-search {
  display: flex; align-items: center; height: 38px; padding: 0 12px;
  background: #F9FAFB; border: 1px solid var(--ad-border); border-radius: 8px; gap: 8px;
}
.ad-search input { flex: 1; border: none; background: transparent; outline: none; font-size: 14px; }
.ad-search-icon { width: 16px; height: 16px; color: var(--ad-text-3); flex-shrink: 0; }

/* ===== 标签 ===== */
.ad-tag {
  display: inline-flex; align-items: center; padding: 3px 10px;
  border-radius: 6px; font-size: 12px; font-weight: 500;
}
.ad-tag-success { background: #ECFDF5; color: #059669; }
.ad-tag-warning { background: #FFFBEB; color: #D97706; }
.ad-tag-info { background: #EFF6FF; color: #2563EB; }
.ad-tag-danger { background: #FEF2F2; color: #DC2626; }
.ad-tag-gray { background: #F3F4F6; color: #6B7280; }
.ad-tag-purple { background: #F5F3FF; color: #7C3AED; }

/* ===== 进度条 ===== */
.ad-progress { height: 6px; background: #F3F4F6; border-radius: 3px; overflow: hidden; }
.ad-progress-bar { height: 100%; border-radius: 3px; transition: width 0.3s; }

/* ===== 网格 ===== */
.ad-grid { display: grid; gap: 16px; }
.ad-grid-2 { grid-template-columns: repeat(2, 1fr); }
.ad-grid-3 { grid-template-columns: repeat(3, 1fr); }

/* ===== Toast (复用) ===== */
.ad-toast {
  position: fixed; top: 24px; right: 24px; z-index: 9999;
  padding: 12px 20px; border-radius: 8px; font-size: 14px;
  color: #fff; transform: translateX(120%); transition: transform 0.3s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.ad-toast.show { transform: translateX(0); }
.ad-toast-success { background: #059669; }
.ad-toast-error { background: #DC2626; }
.ad-toast-warning { background: #D97706; }
.ad-toast-info { background: #2563EB; }

/* ===== Modal ===== */
.ad-modal-overlay {
  position: fixed; inset: 0; z-index: 9998;
  background: rgba(0,0,0,0); display: flex; align-items: center; justify-content: center;
  transition: background 0.2s; opacity: 0; pointer-events: none;
}
.ad-modal-overlay.show { background: rgba(0,0,0,0.4); opacity: 1; pointer-events: auto; }
.ad-modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 480px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  transform: scale(0.95); transition: transform 0.2s;
}
.ad-modal-overlay.show .ad-modal { transform: scale(1); }
.ad-modal-header {
  padding: 20px 24px 0; font-size: 16px; font-weight: 600;
  display: flex; align-items: center; justify-content: space-between;
}
.ad-modal-close { background: none; border: none; cursor: pointer; color: var(--ad-text-3); padding: 4px; }
.ad-modal-close:hover { color: var(--ad-text); }
.ad-modal-body { padding: 16px 24px 24px; }
.ad-modal-footer { padding: 0 24px 20px; display: flex; gap: 10px; justify-content: flex-end; }

/* ===== 开关 ===== */
.ad-switch { position: relative; width: 44px; height: 24px; cursor: pointer; display: inline-block; }
.ad-switch input { display: none; }
.ad-switch-track {
  position: absolute; inset: 0; background: #D1D5DB; border-radius: 12px; transition: background 0.3s;
}
.ad-switch input:checked + .ad-switch-track { background: var(--ad-green); }
.ad-switch-thumb {
  position: absolute; top: 2px; left: 2px; width: 20px; height: 20px;
  background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.3s;
}
.ad-switch input:checked ~ .ad-switch-thumb { transform: translateX(20px); }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .admin-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .ad-grid-2, .ad-grid-3 { grid-template-columns: 1fr; }
  .admin-table { font-size: 13px; }
  .admin-table th, .admin-table td { padding: 8px 10px; }
  .admin-body { padding: 16px; }
  .mobile-menu-btn { display: flex !important; }
}
@media (min-width: 769px) {
  .mobile-menu-btn { display: none !important; }
}
