/* 全局样式 */
:root {
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --secondary: #64748b;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --dark: #1e293b;
  --light: #f8fafc;
  --gray: #94a3b8;
  --border: #e2e8f0;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

a {
  text-decoration: none;
  color: inherit;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

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

.btn-text {
  display: inline-block;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.6);
}

.btn-outline {
  border: 1px solid var(--border);
  background: white;
  color: var(--dark);
}

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

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.6);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 4px 12px;
  font-size: 12px;
}

/* 顶部导航 */
.header {
  background: white;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

/* 顶部分类导航 - 已在上面定义 */

.header-content {
  display: flex;
  align-items: center;
  height: 56px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
  margin-right: 24px;
}

.logo-icon {
  font-size: 24px;
}

/* 顶部导航内的分类 */
.category-nav-header {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.nav-cat {
  padding: 8px 16px;
  font-size: 14px;
  color: var(--dark);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  border-radius: 4px;
}

.nav-cat:hover {
  color: var(--primary);
}

.nav-cat.active {
  color: var(--primary);
  font-weight: 600;
  background: transparent;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}
}

.category-nav-header .category-item {
  padding: 4px 12px;
  font-size: 13px;
  background: var(--light);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.category-nav-header .category-item:hover, 
.category-nav-header .category-item.active {
  background: var(--primary);
  color: white;
}

.nav {
  display: flex;
  gap: 24px;
}

.nav-link {
  color: var(--secondary);
  font-weight: 500;
  transition: color 0.2s;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.search-box {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.search-box input {
  border: none;
  padding: 8px 12px;
  width: 200px;
  outline: none;
}

.search-box button {
  border: none;
  background: var(--primary);
  color: white;
  padding: 8px 12px;
  cursor: pointer;
}

/* 分类导航 */
.category-nav {
  background: white;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.category-list {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.category-item {
  padding: 8px 16px;
  background: var(--light);
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.category-item:hover, .category-item.active {
  background: var(--primary);
  color: white;
}

/* Hero区域 */
.hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 60px 0;
  text-align: center;
}

.hero-content h1 {
  font-size: 36px;
  margin-bottom: 12px;
}

.hero-content p {
  font-size: 18px;
  opacity: 0.9;
  margin-bottom: 32px;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
}

.stat-item {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 32px;
  font-weight: 700;
}

.stat-label {
  font-size: 14px;
  opacity: 0.8;
}

/* 区域 */
.section {
  padding: 48px 0;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.section-header h2 {
  font-size: 24px;
}

.sort-tabs {
  display: flex;
  gap: 8px;
}

.sort-tab {
  padding: 6px 16px;
  border: 1px solid var(--border);
  background: white;
  border-radius: 16px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.sort-tab:hover, .sort-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* 资源卡片 */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  min-height: 200px;
  padding: 4px;
}

/* 加载提示 */
.loading-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  grid-column: 1 / -1;
}

/* 加载更多 */
.load-more-loader {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  color: var(--gray);
  font-size: 14px;
}

.load-more-end {
  grid-column: 1 / -1;
  text-align: center;
  padding: 24px;
  color: var(--gray);
  font-size: 14px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-text {
  margin-top: 12px;
  color: var(--gray);
  font-size: 14px;
}

/* 空状态 */
.empty-state {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

/* 资源卡片 */
.resource-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  cursor: pointer;
}

.resource-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
  border-color: rgba(59, 130, 246, 0.3);
}

.resource-cover {
  height: 140px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: white;
  position: relative;
}

.resource-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--warning);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.resource-vip-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--danger);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.resource-body {
  padding: 16px;
}

.resource-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.resource-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--gray);
  margin-bottom: 12px;
}

.resource-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.resource-points {
  font-size: 14px;
  font-weight: 600;
  color: var(--warning);
  margin-right: auto;
}

.resource-points.free {
  color: var(--success);
}

.resource-footer-buttons {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: var(--primary);
  color: white;
  border-radius: 4px;
  font-size: 13px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-download:hover {
  background: var(--primary-dark);
}

.btn-share {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: #10b981;
  color: white;
  border-radius: 4px;
  font-size: 13px;
  border: none;
  cursor: pointer;
  margin-left: 8px;
  transition: all 0.2s;
}

.btn-share:hover {
  background: #059669;
}

/* 优化复制和分享按钮样式 */
.btn-download, .btn-share {
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 500;
  font-size: 13px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-download {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.btn-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.6);
}

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

.btn-share {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.btn-share:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.6);
}

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

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

.btn-text {
  font-size: 12px;
}

/* 二维码弹窗 */
.qrcode-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.qrcode-modal-content {
  background: white;
  padding: 24px;
  border-radius: 12px;
  text-align: center;
  max-width: 320px;
  position: relative;
}

.qrcode-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 24px;
  cursor: pointer;
  color: #94a3b8;
}

.qrcode-modal-close:hover {
  color: #333;
}

.qrcode-img-box {
  padding: 16px;
  background: #f8fafc;
  border-radius: 8px;
  display: inline-block;
}

.btn-copy-link {
  margin-top: 16px;
  padding: 10px 24px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}

.btn-copy-link:hover {
  background: var(--primary-dark);
}

/* 分页 */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
}

.page-btn {
  padding: 8px 14px;
  border: 1px solid var(--border);
  background: white;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.page-btn:hover, .page-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* 页脚 */
.footer {
  background: var(--dark);
  color: white;
  padding: 48px 0 20px;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-bottom: 32px;
}

.footer-section h4 {
  margin-bottom: 16px;
  font-size: 16px;
}

.footer-section p {
  color: var(--gray);
  font-size: 14px;
  line-height: 1.8;
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #334155;
  color: var(--gray);
  font-size: 14px;
}

/* 弹窗 */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  padding: 32px;
  border-radius: 12px;
  width: 400px;
  max-width: 90%;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 24px;
  cursor: pointer;
  color: var(--gray);
}

.modal-content h2 {
  margin-bottom: 24px;
  text-align: center;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
}

.form-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
}

.modal-footer-text {
  text-align: center;
  margin-top: 16px;
  font-size: 14px;
  color: var(--gray);
}

.modal-footer-text a {
  color: var(--primary);
}

/* Toast通知 */
.toast {
  display: none;
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  z-index: 2000;
  animation: slideIn 0.3s ease;
}

.toast.active {
  display: block;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast-content {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
}

.toast-icon {
  font-size: 32px;
}

.toast-body h4 {
  font-size: 14px;
  margin-bottom: 4px;
}

.toast-body p {
  font-size: 13px;
  color: var(--gray);
}

.toast-close {
  border: none;
  background: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--gray);
}

/* 用户信息 */
.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.user-name {
  font-weight: 500;
}

.user-vip {
  font-size: 12px;
  padding: 2px 8px;
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  color: white;
  border-radius: 10px;
}

/* 用户下拉菜单 */
.user-dropdown {
  position: relative;
  cursor: pointer;
}

.dropdown-arrow {
  font-size: 10px;
  color: var(--gray);
  margin-left: 4px;
  transition: transform 0.2s;
}

.user-dropdown:hover .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  min-width: 160px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s;
  z-index: 1000;
}

.user-dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: block;
  padding: 12px 16px;
  color: var(--dark);
  font-size: 14px;
  transition: background 0.2s;
}

.dropdown-item:hover {
  background: var(--light);
  color: var(--primary);
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* 响应式 - 手机端适配 */
@media (max-width: 768px) {
  .header-content {
    flex-wrap: wrap;
    height: auto;
    padding: 8px 0;
    gap: 8px;
  }

  .logo {
    font-size: 16px;
  }

  .logo-icon {
    font-size: 20px;
  }

  .category-nav-header {
    order: 3;
    width: 100%;
    padding: 4px 0 !important;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .category-nav-header .category-item {
    font-size: 12px;
    padding: 4px 10px;
    flex-shrink: 0;
  }

  .search-box {
    flex: 1;
    min-width: 0;
  }

  .search-box input {
    width: 100%;
    min-width: 0;
    font-size: 13px;
  }

  .search-box button {
    padding: 6px 10px;
  }

  .header-actions {
    gap: 8px;
  }

  .header-actions .btn {
    padding: 6px 12px;
    font-size: 12px;
  }

  .hero {
    padding: 32px 0;
  }

  .hero-content h1 {
    font-size: 22px;
  }

  .hero-content p {
    font-size: 14px;
  }

  .section {
    padding: 16px 0;
    background: #f8fafc;
  }

  .section-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .section-header h2 {
    font-size: 18px;
  }

  .sort-tabs {
    width: 100%;
    overflow-x: auto;
  }

  .sort-tab {
    padding: 4px 12px;
    font-size: 12px;
    white-space: nowrap;
  }

  .resource-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 8px;
  }

  .resource-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.08);
    overflow: hidden;
  }

  .resource-cover {
    height: 80px;
    font-size: 32px;
  }

  .resource-body {
    padding: 10px;
  }

  .resource-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
  }

  .resource-meta {
    font-size: 11px;
    flex-direction: row;
    gap: 8px;
    flex-wrap: wrap;
  }

  .resource-footer {
    flex-direction: row;
    gap: 6px;
    margin-top: 8px;
  }

  .btn-download, .btn-share {
    padding: 8px 12px;
    font-size: 12px;
    border-radius: 16px;
  }

  .resource-badge,
  .resource-vip-badge {
    font-size: 10px;
    padding: 2px 6px;
  }

  .btn-download,
  .btn-share {
    font-size: 11px;
    padding: 6px 10px;
  }

  .pagination {
    flex-wrap: wrap;
    gap: 4px;
  }

  .page-btn {
    padding: 6px 10px;
    font-size: 12px;
  }

  .footer {
    padding: 24px 0 16px;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .footer-section h4 {
    font-size: 14px;
  }

  .footer-section p {
    font-size: 12px;
  }

  /* 弹窗手机端 */
  .modal-content {
    padding: 20px;
    width: 95%;
  }

  .modal-content h2 {
    font-size: 18px;
  }

  .form-group {
    margin-bottom: 12px;
  }

  .form-group input {
    padding: 8px 10px;
    font-size: 14px;
  }

  /* 用户下拉菜单 */
  .dropdown-menu {
    right: -8px;
    min-width: 140px;
  }

  .dropdown-item {
    padding: 10px 12px;
    font-size: 13px;
  }
}

/* 更小屏幕 */
@media (max-width: 480px) {
  .container {
    padding: 0 12px;
  }

  .hero-content h1 {
    font-size: 18px;
  }

  .resource-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .resource-cover {
    height: 80px;
    font-size: 28px;
  }

  .resource-body {
    padding: 8px;
  }

  .resource-title {
    font-size: 12px;
  }

  .resource-points {
    font-size: 12px;
  }
}

/* 用户中心页面 */
.user-page {
  padding: 32px 0;
}

.user-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 40px;
  border-radius: 12px;
  margin-bottom: 32px;
}

.user-header h1 {
  font-size: 28px;
  margin-bottom: 16px;
}

.user-stats {
  display: flex;
  gap: 32px;
}

.user-stat {
  text-align: center;
}

.user-stat-value {
  font-size: 24px;
  font-weight: 700;
}

.user-stat-label {
  font-size: 14px;
  opacity: 0.8;
}

.user-tabs {
  display: flex;
  gap: 4px;
  background: white;
  padding: 4px;
  border-radius: 8px;
  margin-bottom: 24px;
}

.user-tab {
  padding: 12px 24px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

.user-tab:hover, .user-tab.active {
  background: var(--primary);
  color: white;
}

/* 详情页 */
.detail-page {
  padding: 32px 0;
}

.detail-header {
  background: white;
  padding: 32px;
  border-radius: 12px;
  margin-bottom: 24px;
}

.detail-title {
  font-size: 28px;
  margin-bottom: 16px;
}

.detail-meta {
  display: flex;
  gap: 24px;
  color: var(--gray);
  font-size: 14px;
  margin-bottom: 24px;
}

.detail-actions {
  display: flex;
  gap: 16px;
}

.detail-actions .btn {
  padding: 12px 24px;
  border-radius: 25px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.detail-description {
  background: white;
  padding: 32px;
  border-radius: 12px;
}

/* 管理后台 */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 240px;
  background: #1e293b !important;
  color: white !important;
  padding: 20px 0 !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  height: 100vh !important;
  z-index: 9999 !important;
  overflow-y: auto;
}

.admin-logo {
  padding: 0 20px 20px;
  border-bottom: 1px solid #334155;
  margin-bottom: 20px;
  font-size: 18px;
  font-weight: 600;
}

.admin-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.admin-menu-item {
  padding: 12px 20px;
  cursor: pointer;
  transition: background 0.2s;
}

.admin-menu-item:hover, .admin-menu-item.active {
  background: rgba(255, 255, 255, 0.15);
}

.admin-menu-item a {
  color: white;
  text-decoration: none;
  display: block;
}

.admin-main {
  flex: 1;
  margin-left: 240px;
  padding: 24px;
  background: var(--light);
  position: relative;
  z-index: 1;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.admin-card {
  background: white;
  padding: 24px;
  border-radius: 8px;
  margin-bottom: 24px;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.admin-stat-card {
  background: white;
  padding: 24px;
  border-radius: 8px;
  text-align: center;
}

.admin-stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
}

.admin-stat-label {
  color: var(--gray);
  margin-top: 8px;
}

/* 表格 */
.table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  overflow: hidden;
}

.table th, .table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.table th {
  background: var(--light);
  font-weight: 600;
}

.table tr:hover {
  background: var(--light);
}

/* 表单 */
.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.form-group-full {
  margin-bottom: 16px;
}

textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  min-height: 100px;
  resize: vertical;
}

select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  background: white;
}

/* 充值卡片 */
.recharge-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.recharge-card {
  background: white;
  padding: 24px;
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  border: 2px solid var(--border);
  transition: all 0.2s;
}

.recharge-card:hover, .recharge-card.selected {
  border-color: var(--primary);
}

.recharge-amount {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
}

.recharge-points {
  color: var(--gray);
  margin-top: 8px;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray);
}

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

/* 加载中 */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--gray);
}

/* 富文本内容 */
.rich-content {
  line-height: 1.8;
  color: #333;
}

.rich-content p {
  margin-bottom: 12px;
}

.rich-content img {
  max-width: 100%;
  border-radius: 8px;
  margin: 12px 0;
}

.rich-content h1, .rich-content h2, .rich-content h3 {
  margin: 16px 0 8px;
  color: var(--dark);
}

.rich-content ul, .rich-content ol {
  padding-left: 24px;
  margin-bottom: 12px;
}

.rich-content blockquote {
  border-left: 4px solid var(--primary);
  padding-left: 16px;
  margin: 12px 0;
  color: var(--gray);
}

.rich-content code {
  background: var(--light);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
}

.rich-content pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 12px 0;
}

.rich-content pre code {
  background: none;
  padding: 0;
}

/* VIP开通页面 */
.vip-card {
  background: white;
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  border: 2px solid var(--border);
  transition: all 0.3s;
  cursor: pointer;
}

.vip-card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 30px rgba(59, 130, 246, 0.2);
}

.vip-card.popular {
  border-color: var(--primary);
  position: relative;
}

.vip-card.popular::before {
  content: '推荐';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: white;
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 12px;
}

.vip-price {
  font-size: 48px;
  font-weight: 700;
  color: var(--primary);
}

.vip-price span {
  font-size: 18px;
}

.vip-title {
  font-size: 20px;
  font-weight: 600;
  margin: 16px 0 8px;
}

.vip-desc {
  color: var(--gray);
  font-size: 14px;
  margin-bottom: 16px;
}

.vip-features {
  text-align: left;
  padding: 0;
  list-style: none;
  margin-bottom: 24px;
}

.vip-features li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.vip-features li:last-child {
  border-bottom: none;
}

.vip-features li::before {
  content: '✓ ';
  color: var(--success);
  font-weight: bold;
  margin-right: 8px;
}

.qrcode-section {
  background: white;
  border-radius: 16px;
  padding: 40px;
  text-align: center;
  margin-top: 32px;
}

.qrcode-section h3 {
  margin-bottom: 24px;
}

.qrcode-placeholder {
  width: 200px;
  height: 200px;
  background: var(--light);
  border-radius: 8px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray);
  border: 2px dashed var(--border);
}

.qrcode-note {
  color: var(--gray);
  font-size: 14px;
  margin-top: 16px;
}

/* VIP卡片 */
.vip-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 32px;
}

.vip-card {
  background: white;
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
  border: 2px solid var(--border);
  transition: all 0.3s;
}

.vip-card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.15);
}

.vip-card.popular {
  border-color: var(--primary);
  position: relative;
}

.vip-card.popular::before {
  content: '推荐';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: white;
  padding: 4px 16px;
  border-radius: 12px;
  font-size: 12px;
}

.vip-price {
  font-size: 40px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.vip-price span {
  font-size: 16px;
  vertical-align: top;
}

.vip-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.vip-desc {
  color: var(--gray);
  font-size: 14px;
  margin-bottom: 20px;
}

.vip-features {
  list-style: none;
  text-align: left;
}

.vip-features li {
  padding: 8px 0;
  font-size: 14px;
  color: var(--dark);
  border-bottom: 1px solid var(--border);
}

.vip-features li:last-child {
  border-bottom: none;
}

.vip-features li::before {
  content: '✓';
  color: var(--success);
  margin-right: 8px;
}

/* ============ 滚动通知栏 ============ */
.notice-bar {
  display: flex;
  align-items: center;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 10px 16px;
  margin-bottom: 20px;
  overflow: hidden;
}

.notice-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
  margin-right: 12px;
  padding-right: 12px;
  border-right: 1px solid #bfdbfe;
  flex-shrink: 0;
}

.notice-scroll-wrap {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.notice-scroll {
  display: flex;
  gap: 48px;
  white-space: nowrap;
  animation: scrollNotice 20s linear infinite;
}

.notice-scroll:hover {
  animation-play-state: paused;
}

.notice-item {
  font-size: 13px;
  color: var(--dark);
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.2s;
}

.notice-item:hover {
  color: var(--primary);
  text-decoration: underline;
}

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

/* ============ 移动端适配 ============ */
@media screen and (max-width: 768px) {
  /* 导航栏 */
  .header-content {
    flex-wrap: wrap;
    height: auto;
    padding: 8px 0;
  }
  
  .logo {
    font-size: 16px;
    margin-right: 12px;
  }
  
  .logo-icon {
    font-size: 20px;
  }
  
  .category-nav-header {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding: 8px 0;
    gap: 6px;
    -webkit-overflow-scrolling: touch;
  }
  
  .nav-cat {
    padding: 6px 12px;
    font-size: 13px;
    flex-shrink: 0;
  }
  
  .header-actions {
    margin-left: auto;
    gap: 8px;
  }
  
  .search-box {
    display: none;
  }
  
  /* Hero区域 */
  .hero {
    padding: 40px 0;
  }
  
  .hero h1 {
    font-size: 24px;
  }
  
  .hero p {
    font-size: 14px;
  }
  
  /* 资源卡片 */
  .resource-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .resource-card {
    margin-bottom: 0;
  }
  
  /* 分页 */
  .pagination {
    flex-wrap: wrap;
  }
  
  .page-btn {
    min-width: 36px;
    height: 36px;
  }
  
  /* 排序标签 */
  .sort-tabs {
    flex-wrap: wrap;
  }
  
  /* 用户中心 */
  .user-header h1 {
    font-size: 20px;
  }
  
  .user-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
  
  .user-tabs {
    flex-wrap: wrap;
  }
  
  .user-tab {
    flex: 1;
    min-width: 80px;
    text-align: center;
  }
  
  /* VIP卡片 */
  .vip-cards {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .vip-card {
    padding: 20px;
  }
  
  .vip-price {
    font-size: 32px;
  }
  
  /* 弹窗 */
  .modal-content {
    width: 95%;
    max-width: 400px;
    padding: 16px;
  }
  
  /* 页脚 */
  .footer-content {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  
  /* 详情页 */
  .detail-header h1 {
    font-size: 20px;
  }
  
  .detail-meta {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .detail-actions {
    flex-direction: column;
    gap: 12px;
  }
  
  .detail-actions .btn {
    width: 100%;
  }
}

/* 小屏幕手机 */
@media screen and (max-width: 480px) {
  .container {
    padding: 0 12px;
  }
  
  .hero h1 {
    font-size: 20px;
  }
  
  .section-header h2 {
    font-size: 18px;
  }
  
  .user-stats {
    grid-template-columns: 1fr;
  }
  
  .vip-card {
    padding: 16px;
  }
  
  .vip-price {
    font-size: 28px;
  }
  
  .vip-features li {
    font-size: 13px;
  }
  
  /* 隐藏管理后台入口 */
  .dropdown-menu a[href="admin.html"] {
    display: none;
  }
}

/* 分享弹窗样式 */
.share-modal-content {
  text-align: center;
  padding: 24px !important;
}

.share-modal-content h3 {
  margin-bottom: 20px;
  color: var(--dark);
  font-size: 18px;
}

#shareCardContainer {
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
}

.share-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.share-actions .btn {
  min-width: 120px;
}
