/* ============================================
   123资源网 - 前端样式
   游戏与软件资源分享平台
   现代 · 简洁 · 响应式
   ============================================ */

/* ---- CSS 变量 ---- */
:root {
  --primary: #4F46E5;
  --primary-dark: #4338CA;
  --primary-light: #818CF8;
  --accent: #7C3AED;
  --accent-light: #A78BFA;
  --gradient: linear-gradient(135deg, #4F46E5 0%, #7C3AED 50%, #C026D3 100%);
  --gradient-subtle: linear-gradient(135deg, #EEF2FF 0%, #F5F3FF 100%);

  --bg: #F8FAFC;
  --bg-card: #FFFFFF;
  --bg-overlay: rgba(15, 23, 42, 0.6);
  --text: #1E293B;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;
  --border: #E2E8F0;
  --border-light: #F1F5F9;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 6px rgba(0,0,0,0.05), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.08), 0 4px 10px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 50px rgba(0,0,0,0.12);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);

  --max-width: 1200px;
  --header-height: 64px;
}

/* ---- Reset ---- */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font: inherit; border: none; background: none; }
input { font: inherit; border: none; outline: none; background: none; }
ul, ol { list-style: none; }

/* ---- 顶部导航 ---- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--transition);
}
.header.scrolled { box-shadow: var(--shadow); }

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 20px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  cursor: pointer;
  transition: opacity var(--transition);
}
.logo:hover { opacity: 0.85; }
.logo-icon {
  width: 40px; height: 40px;
  color: var(--primary);
  flex-shrink: 0;
}
.logo-icon svg { width: 100%; height: 100%; }
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-name { font-size: 18px; font-weight: 800; color: var(--text); letter-spacing: -0.3px; }
.logo-sub { font-size: 11px; color: var(--text-muted); }

/* PC导航 */
.nav { display: flex; gap: 4px; flex: 1; justify-content: center; }
.nav-link {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
  white-space: nowrap;
}
.nav-link:hover { color: var(--primary); background: var(--gradient-subtle); }
.nav-link.active { color: var(--primary); background: #EEF2FF; font-weight: 600; }

/* 右侧操作 */
.header-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

.search-bar {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
  gap: 6px;
  transition: all var(--transition);
  width: 180px;
}
.search-bar:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,0.1); width: 210px; }
.search-icon { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; }
.search-bar input { flex: 1; font-size: 12px; color: var(--text); min-width: 0; }
.search-bar input::placeholder { color: var(--text-muted); }
.search-clear {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 14px; color: var(--text-muted);
  transition: all var(--transition); flex-shrink: 0;
}
.search-clear:hover { background: var(--border); color: var(--text); }

/* 积分徽章 */
.points-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 20px;
  background: linear-gradient(135deg, #FEF3C7, #FDE68A);
  border: 1px solid #FCD34D;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}
.points-badge:hover { transform: scale(1.05); box-shadow: 0 2px 10px rgba(251,191,36,0.3); }
.points-icon { width: 16px; height: 16px; color: #D97706; }
.points-num { font-size: 14px; font-weight: 700; color: #92400E; }

/* 移动端菜单按钮 */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.menu-toggle:hover { background: var(--border-light); }
.menu-toggle span {
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all var(--transition);
}
.menu-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

/* 移动端导航 */
.mobile-nav {
  display: none;
  background: #FFF;
  border-top: 1px solid var(--border);
  padding: 8px 20px 16px;
  flex-direction: column;
  gap: 2px;
}
.mobile-nav.open { display: flex; }
.mobile-nav .nav-link { padding: 10px 14px; font-size: 15px; }

/* ---- Hero ---- */
.hero {
  position: relative;
  background: var(--gradient);
  padding: 28px 20px 20px;
  text-align: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3Cpattern id='g' x='0' y='0' width='60' height='60' patternUnits='userSpaceOnUse'%3E%3Ccircle cx='30' cy='30' r='1.5' fill='rgba(255,255,255,0.08)'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='100%25' height='100%25' fill='url(%23g)'/%3E%3C/svg%3E");
  opacity: 0.5;
}

.hero-content { position: relative; z-index: 1; max-width: 700px; margin: 0 auto; }
.hero-title {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 900;
  color: #FFF;
  letter-spacing: -1px;
  margin-bottom: 8px;
}
.hero-desc {
  font-size: 16px;
  color: rgba(255,255,255,0.85);
  margin-bottom: 28px;
}

.hero-search {
  display: flex;
  max-width: 480px;
  margin: 0 auto 24px;
  background: #FFF;
  border-radius: 40px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.hero-search-icon { width: 18px; height: 18px; color: var(--text-muted); margin: 11px 0 11px 14px; flex-shrink: 0; }
.hero-search input {
  flex: 1;
  padding: 11px 10px;
  font-size: 14px;
  color: var(--text);
}
.hero-search input::placeholder { color: var(--text-muted); }
.hero-search button {
  padding: 11px 22px;
  background: var(--gradient);
  color: #FFF;
  font-weight: 600;
  font-size: 14px;
  transition: opacity var(--transition);
  white-space: nowrap;
}
.hero-search button:hover { opacity: 0.9; }

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
}
.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.stat-num {
  font-size: 28px;
  font-weight: 800;
  color: #FFF;
}
.stat-label { font-size: 13px; color: rgba(255,255,255,0.75); }

/* ---- Main ---- */
.main { max-width: var(--max-width); margin: 0 auto; padding: 32px 20px 60px; }
.section { margin-bottom: 40px; }

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
}
.section-title-icon { width: 22px; height: 22px; color: var(--primary); flex-shrink: 0; }
.section-title-icon svg { width: 100%; height: 100%; }
.section-count {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 2px 10px;
  background: var(--border-light);
  border-radius: 12px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.section-header .section-title { margin-bottom: 0; }

.section-actions { display: flex; align-items: center; gap: 8px; }
.section-tabs { display: flex; gap: 3px; background: var(--border-light); border-radius: 8px; padding: 2px; }
.st-btn {
  padding: 5px 14px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
}
.st-btn.active { background: #FFF; color: var(--primary); font-weight: 600; box-shadow: var(--shadow-sm); }
.st-btn:hover:not(.active) { color: var(--text); }

/* 分类下拉 */
.cat-dropdown { position: relative; }
.cat-dropdown-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--border-light);
  border-radius: 8px;
}
.cat-dropdown-btn:hover { background: var(--border); }
.cat-dropdown-arrow { width: 14px; height: 14px; flex-shrink: 0; transition: transform var(--transition); }
.cat-dropdown.open .cat-dropdown-arrow { transform: rotate(180deg); }

.cat-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 150px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  padding: 4px;
}
.cat-dropdown.open .cat-dropdown-menu { display: block; }

.cat-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.cat-dropdown-item:hover { background: var(--gradient-subtle); color: var(--primary); }
.cat-dropdown-item.active { background: #EEF2FF; color: var(--primary); font-weight: 600; }
.cat-dropdown-item .cat-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ---- 分类卡片网格 ---- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.cat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
}
.cat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}
.cat-card.active { border-color: var(--primary); background: #EEF2FF; box-shadow: var(--shadow); }

.cat-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.cat-info { min-width: 0; }
.cat-name { font-size: 14px; font-weight: 600; color: var(--text); }
.cat-count { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

/* ---- 资源卡片网格 ---- */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.res-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}
.res-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.res-card-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 16/10;
  background: var(--gradient-subtle);
  overflow: hidden;
}
.res-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.res-card:hover .res-card-cover img { transform: scale(1.05); }

.res-card-cover .cover-placeholder {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.cover-placeholder svg { width: 48px; height: 48px; }

.res-card-badge {
  position: absolute;
  top: 10px; left: 10px;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #FFF;
}

.res-card-body { padding: 14px 16px 12px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.res-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  /* 搜索关键词高亮 */
}
.res-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 12px;
  color: var(--text-muted);
}
.res-card-meta span { display: flex; align-items: center; gap: 4px; }
.res-card-meta svg { width: 13px; height: 13px; flex-shrink: 0; }

.res-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-top: 1px solid var(--border-light);
  font-size: 12px;
  color: var(--text-muted);
}
.res-card-dl {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--primary);
  font-weight: 600;
}
.res-card-dl svg { width: 14px; height: 14px; }

/* 搜索关键词高亮 */
mark {
  background: #FEF08A;
  color: var(--text);
  padding: 1px 2px;
  border-radius: 2px;
}

/* ---- 空状态 ---- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}
.empty-icon { width: 64px; height: 64px; margin: 0 auto 16px; color: var(--text-muted); }
.empty-icon svg { width: 100%; height: 100%; }
.empty-text { font-size: 16px; font-weight: 600; color: var(--text-secondary); margin-bottom: 4px; }
.empty-hint { font-size: 13px; color: var(--text-muted); }

/* ---- 分页 ---- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 32px;
  flex-wrap: wrap;
}
.pg-btn {
  min-width: 36px; height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
  padding: 0 8px;
}
.pg-btn:hover:not(.disabled):not(.active) { border-color: var(--primary); color: var(--primary); }
.pg-btn.active { background: var(--primary); color: #FFF; border-color: var(--primary); font-weight: 600; }
.pg-btn.disabled { opacity: 0.4; cursor: not-allowed; }
.pg-jump {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}
.pg-jump input {
  width: 48px; height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 13px;
  background: var(--bg-card);
}

/* ---- 页脚 ---- */
.footer {
  background: #1E293B;
  color: #CBD5E1;
  padding: 48px 20px 24px;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto 32px;
  display: flex;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}
.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-logo { width: 44px; height: 44px; color: var(--primary-light); }
.footer-logo svg { width: 100%; height: 100%; }
.footer-name { font-size: 18px; font-weight: 700; color: #F1F5F9; margin-bottom: 2px; }
.footer-desc { font-size: 13px; color: #94A3B8; }
.footer-links { display: flex; gap: 48px; flex-wrap: wrap; }
.footer-col h4 { font-size: 14px; font-weight: 600; color: #E2E8F0; margin-bottom: 12px; }
.footer-col a, .footer-col p { display: block; font-size: 13px; color: #94A3B8; padding: 4px 0; transition: color var(--transition); }
.footer-col a:hover { color: #E2E8F0; }
.footer-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-top: 20px;
  border-top: 1px solid #334155;
  text-align: center;
  font-size: 12px;
  color: #64748B;
  line-height: 1.8;
}

/* ---- 模态弹窗基础 ---- */
.modal-overlay {
  position: fixed; inset: 0;
  z-index: 200;
  background: var(--bg-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
  backdrop-filter: blur(4px);
}
.modal-overlay.show { opacity: 1; visibility: visible; }

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 620px;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.modal-overlay.show .modal { transform: translateY(0) scale(1); }
.modal-sm { max-width: 400px; }

.modal-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 32px; height: 32px;
  display: flex;
  align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(0,0,0,0.05);
  font-size: 20px;
  color: var(--text-muted);
  z-index: 10;
  transition: all var(--transition);
}
.modal-close:hover { background: rgba(0,0,0,0.1); color: var(--text); }

/* ---- 资源详情弹窗（重设计版） ---- */
.modal-detail { max-width: 580px; }
.modal-cover {
  width: 100%;
  height: 240px;
  background: var(--gradient-subtle);
  position: relative;
  overflow: hidden;
}
.modal-cover img { width: 100%; height: 100%; object-fit: cover; }
.modal-cover.no-cover { height: 80px; }
.modal-cover-placeholder {
  display: none;
  position: absolute; inset: 0;
  align-items: center; justify-content: center;
  color: var(--text-muted);
}
.modal-cover.no-cover .modal-cover-placeholder { display: flex; }
.modal-cover-placeholder svg { width: 36px; height: 36px; }

/* 封面上的分类标签 */
.modal-cover-badge {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 10px 16px;
  background: linear-gradient(transparent, rgba(0,0,0,0.55));
  display: flex; align-items: flex-end;
}
.modal-cover-badge .modal-cat-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  color: #FFF;
}

.modal-body { padding: 20px 24px 24px; }
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 6px; line-height: 1.35; }
.modal-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 16px; }

/* 信息网格（四宫格） */
.modal-info-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.info-item {
  text-align: center;
  padding: 10px 6px;
  background: var(--gradient-subtle);
  border-radius: var(--radius-sm);
}
.info-item .info-label {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
}
.info-item .info-value {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* QQ群卡片 */
.qq-group-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #F0F9FF 0%, #EEF2FF 100%);
  border: 1.5px solid #93C5FD;
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}
.qq-group-card::before {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 6px;
  background: linear-gradient(180deg, #3B82F6, #4F46E5);
}
.qq-group-icon {
  width: 34px; height: 34px;
  flex-shrink: 0;
  color: #3B82F6;
}
.qq-group-icon svg { width: 100%; height: 100%; }
.qq-group-info { flex: 1; min-width: 0; }
.qq-group-title { font-size: 13px; font-weight: 700; color: #1E40AF; margin-bottom: 1px; }
.qq-group-number {
  font-size: 18px;
  font-weight: 900;
  color: #1D4ED8;
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
  margin-bottom: 1px;
}
.qq-group-hint { font-size: 10px; color: #6B7280; }

.btn-qq {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 7px;
  background: linear-gradient(135deg, #3B82F6, #2563EB);
  color: #FFF;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(59,130,246,0.3);
  transition: all var(--transition);
}
.btn-qq:hover { transform: scale(1.03); box-shadow: 0 4px 14px rgba(59,130,246,0.4); }
.btn-qq svg { width: 14px; height: 14px; }

/* 下载区 */
.modal-section-title { font-size: 13px; font-weight: 600; margin-bottom: 8px; color: var(--text); }
.modal-download { margin-bottom: 0; }
.download-link-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12px;
  word-break: break-all;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

/* ---- 通用按钮 ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 18px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition);
}
.btn-primary { background: var(--gradient); color: #FFF; }
.btn-primary:hover { opacity: 0.9; box-shadow: 0 4px 15px rgba(79,70,229,0.35); }
.btn-outline {
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: #EEF2FF; }
.btn-lg { padding: 8px 20px; font-size: 13px; max-width: 220px; }
.btn-block { width: 100%; }

.download-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.download-actions .btn { flex: 0 1 auto; min-width: 0; max-width: 220px; }
.copy-tip { margin-top: 8px; font-size: 12px; color: #059669; font-weight: 500; min-height: 18px; }

/* 按钮统一单行 */
.btn, .btn-qq, .st-btn { white-space: nowrap; }

/* ---- 签到弹窗（全新设计） ---- */

/* 弹窗容器 */
.checkin-modal {
  overflow: hidden;
  border-radius: var(--radius-xl);
  transform: translateY(30px) scale(0.92);
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
#checkinOverlay.show .checkin-modal {
  transform: translateY(0) scale(1);
}

/* 暖色渐变横幅 */
.checkin-banner {
  background: linear-gradient(160deg, #F59E0B 0%, #F97316 45%, #EF4444 100%);
  padding: 36px 24px 28px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
/* 横幅背景纹理 */
.checkin-banner::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.15) 0%, transparent 50%),
              radial-gradient(circle at 70% 80%, rgba(255,255,255,0.08) 0%, transparent 40%);
}

/* 关闭按钮 */
.checkin-close-btn {
  position: absolute;
  top: 12px; right: 12px;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.85);
  transition: all var(--transition);
  z-index: 2;
}
.checkin-close-btn svg { width: 16px; height: 16px; }
.checkin-close-btn:hover { background: rgba(255,255,255,0.35); color: #FFF; }

/* 日历图标 */
.checkin-badge {
  width: 52px; height: 52px;
  margin: 0 auto 12px;
  color: #FFF;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.12));
  animation: badge-float 3s ease-in-out infinite;
}
@keyframes badge-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.checkin-badge svg { width: 100%; height: 100%; }

/* 标题 */
.checkin-title {
  font-size: 21px;
  font-weight: 800;
  color: #FFF;
  margin-bottom: 4px;
  letter-spacing: -0.2px;
}
.checkin-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.8);
  font-weight: 500;
}

/* 主体 */
.checkin-body { padding: 20px 24px 24px; }

/* 连续签到进度 */
.streak-section { margin-bottom: 20px; }
.streak-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.streak-header-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.streak-header-count {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  background: #EEF2FF;
  padding: 2px 10px;
  border-radius: 10px;
}

/* 连签轨道 + 连接线 */
.streak-track {
  position: relative;
  display: flex;
  justify-content: center;
}
.streak-line {
  position: absolute;
  top: 19px;
  left: calc(50% - 128px);
  width: 256px;
  height: 2px;
  background: var(--border);
  z-index: 0;
}
.streak-bar {
  display: flex;
  justify-content: center;
  gap: 14px;
  position: relative;
  z-index: 1;
}

/* 连签圆点 */
.streak-dot {
  width: 38px; height: 38px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  border-radius: 50%;
  border: 2px solid var(--border);
  font-size: 13px; font-weight: 700;
  color: var(--text-muted);
  background: #FFF;
  transition: all 0.35s cubic-bezier(0.34,1.56,0.64,1);
  position: relative;
}
.streak-dot::after {
  content: attr(data-day);
  position: absolute;
  bottom: -18px;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}

/* 已完成 */
.streak-dot.done {
  background: linear-gradient(135deg, #F59E0B, #F97316);
  border-color: #F59E0B;
  color: #FFF;
  box-shadow: 0 2px 8px rgba(245,158,11,0.3);
}
.streak-dot.done::after { color: #F59E0B; font-weight: 600; }

/* 今日（待签到） */
.streak-dot.today {
  border-color: #F59E0B;
  color: #F59E0B;
  background: #FFF7ED;
  box-shadow: 0 0 0 4px rgba(245,158,11,0.15);
  animation: today-pulse 2s ease-in-out infinite;
}
.streak-dot.today::after { color: #F59E0B; font-weight: 700; }

@keyframes today-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(245,158,11,0.15); }
  50% { box-shadow: 0 0 0 10px rgba(245,158,11,0.05); }
}

/* 签到成功时连点依次亮起 */
.streak-dot.pop-in {
  animation: dot-pop 0.45s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes dot-pop {
  0% { transform: scale(0.6); opacity: 0; }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

/* 积分双卡片 */
.checkin-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.checkin-card {
  text-align: center;
  padding: 16px 8px 14px;
  background: var(--gradient-subtle);
  border-radius: var(--radius);
  transition: transform var(--transition);
}
.checkin-card:hover { transform: translateY(-1px); }
.checkin-card-icon {
  width: 22px; height: 22px;
  margin: 0 auto 6px;
  color: var(--primary);
}
.checkin-card-icon svg { width: 100%; height: 100%; }
.checkin-card-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 3px;
}
.checkin-card-value {
  display: block;
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  transition: all 0.3s ease;
}

/* 今日可得卡片（金色高亮） */
.checkin-card-highlight {
  background: linear-gradient(135deg, #FFFBEB, #FEF3C7);
  border: 1px solid #FDE68A;
}
.checkin-card-highlight .checkin-card-icon { color: #F59E0B; }
.checkin-card-highlight .checkin-card-value { color: #D97706; }

/* 数值脉冲 */
.pulse-once {
  animation: val-pulse 0.5s ease-out;
}
@keyframes val-pulse {
  0% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* 签到状态文字 */
.checkin-status {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #F59E0B;
  margin-bottom: 6px;
  min-height: 20px;
  transition: all 0.3s ease;
}
.checkin-done {
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: #059669;
  margin-bottom: 14px;
  min-height: 20px;
  transition: all 0.3s ease;
}

/* 签到按钮 */
.btn-checkin {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px;
  border-radius: 12px;
  background: linear-gradient(135deg, #F59E0B, #F97316);
  color: #FFF;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
  border: none;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 4px 16px rgba(245,158,11,0.35);
  position: relative;
  overflow: hidden;
}
/* 按钮光泽 */
.btn-checkin::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}
.btn-checkin:hover::after { left: 120%; }

.btn-checkin-icon { width: 18px; height: 18px; flex-shrink: 0; }
.btn-checkin:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 24px rgba(245,158,11,0.45);
}
.btn-checkin:active { transform: translateY(0) scale(0.98); }
.btn-checkin:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn-checkin:disabled::after { display: none; }

/* 签到成功后按钮变为绿色 */
.btn-checkin.checked {
  background: linear-gradient(135deg, #059669, #10B981);
  box-shadow: 0 4px 16px rgba(5,150,105,0.35);
}

/* ===== 彩纸粒子 ===== */
.confetti-container {
  position: absolute; inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 10;
}
.confetti-piece {
  position: absolute;
  width: 8px; height: 8px;
  border-radius: 2px;
  animation: confetti-fall 1.2s ease-out forwards;
}
@keyframes confetti-fall {
  0% { transform: translateY(-20px) rotate(0deg) scale(1); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translateY(280px) rotate(720deg) scale(0.3); opacity: 0; }
}

/* ===== 移动端适配 ===== */
@media (max-width: 768px) {
  .checkin-banner { padding: 28px 20px 22px; }
  .checkin-badge { width: 44px; height: 44px; }
  .checkin-title { font-size: 19px; }
  .checkin-body { padding: 16px 18px 20px; }
  .streak-bar { gap: 8px; }
  .streak-dot { width: 32px; height: 32px; font-size: 11px; }
  .streak-dot::after { bottom: -16px; font-size: 9px; }
  .streak-line { top: 16px; left: calc(50% - 100px); width: 200px; }
  .checkin-card-value { font-size: 20px; }
}

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: 30px; left: 50%; transform: translateX(-50%) translateY(100px);
  z-index: 300;
  background: #1E293B;
  color: #FFF;
  padding: 12px 28px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
  pointer-events: none;
  white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ---- 微信遮罩 ---- */
.wx-mask {
  position: fixed; inset: 0;
  z-index: 9999;
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
}
.wx-mask.show { display: flex; }
.wx-mask-bg {
  position: absolute; inset: 0;
  background: rgba(15,23,42,0.92);
}
.wx-mask-particles { position: absolute; inset: 0; overflow: hidden; }
.wx-particle {
  position: absolute;
  border-radius: 50%;
  animation: floatUp 5s ease-in-out infinite;
  opacity: 0.5;
}
@keyframes floatUp {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.3; }
  50% { transform: translateY(-30px) scale(1.3); opacity: 0.7; }
}

.wx-mask-card {
  position: relative;
  background: #1E293B;
  border: 1px solid #334155;
  border-radius: var(--radius-xl);
  padding: 40px 32px;
  text-align: center;
  max-width: 400px;
  color: #E2E8F0;
}
.wx-mask-icon { width: 70px; height: 70px; margin: 0 auto 20px; color: var(--primary-light); }
.wx-mask-icon svg { width: 100%; height: 100%; }
.wx-mask-title { font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.wx-mask-desc { font-size: 14px; color: #94A3B8; line-height: 1.6; margin-bottom: 20px; }
.wx-mask-steps { margin-bottom: 16px; }
.wx-step {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 0;
  font-size: 14px;
}
.wx-step-num {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--gradient);
  color: #FFF;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.wx-mask-tip { font-size: 12px; color: #64748B; margin-top: 8px; }

/* ============================================
   响应式设计
   ============================================ */

/* 平板 (≤1024px) */
@media (max-width: 1024px) {
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .resource-grid { grid-template-columns: repeat(3, 1fr); }
  .nav { display: none; }
  .search-bar { width: 140px; }
  .search-bar:focus-within { width: 160px; }
  .menu-toggle { display: flex; }
}

/* 手机 (≤768px) */
@media (max-width: 768px) {
  .header-inner { gap: 10px; padding: 0 14px; }
  .logo-icon { width: 30px; height: 30px; }
  .logo-name { font-size: 14px; }
  .logo-sub { font-size: 10px; display: none; }
  .search-bar { width: auto; flex: 1; max-width: 120px; padding: 4px 8px; border-radius: 16px; }
  .search-bar input { font-size: 11px; }
  .search-bar:focus-within { width: auto; max-width: 130px; }
  .search-icon { width: 14px; height: 14px; }
  .search-clear { width: 16px; height: 16px; font-size: 12px; }
  .points-badge { padding: 3px 7px; }
  .points-num { font-size: 11px; }
  .points-icon { width: 12px; height: 12px; }

  .hero { padding: 14px 14px 12px; }
  .hero-title { font-size: 22px; margin-bottom: 4px; }
  .hero-desc { font-size: 12px; margin-bottom: 14px; }
  .hero-search { max-width: 100%; border-radius: 40px; }
  .hero-search-icon { width: 16px; height: 16px; margin: 10px 0 10px 12px; }
  .hero-search input { padding: 10px 8px; font-size: 13px; }
  .hero-search button { padding: 10px 16px; font-size: 13px; white-space: nowrap; }
  .hero-stats { gap: 16px; }
  .stat-num { font-size: 18px; }
  .stat-label { font-size: 11px; }

  .main { padding: 20px 14px 36px; }
  .section { margin-bottom: 28px; }

  .category-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .cat-card { padding: 12px 14px; gap: 10px; }
  .cat-icon { width: 32px; height: 32px; font-size: 16px; }
  .cat-name { font-size: 13px; }

  .resource-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .res-card-body { padding: 10px 12px 8px; }
  .res-card-title { font-size: 13px; }
  .res-card-meta { font-size: 11px; }
  .res-card-footer { padding: 8px 12px; }

  .section-header { flex-direction: column; align-items: flex-start; }
  .section-title { font-size: 17px; margin-bottom: 14px; }
  .section-title-icon { width: 18px; height: 18px; }

  .modal { max-width: 100%; max-height: 90vh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .modal-cover { height: 180px; }
  .modal-body { padding: 16px 18px 20px; }
  .modal-info-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .info-item { padding: 7px 3px; }
  .info-item .info-value { font-size: 11px; }
  .qq-group-card { padding: 10px; gap: 8px; flex-wrap: wrap; }
  .qq-group-icon { width: 28px; height: 28px; }
  .qq-group-number { font-size: 16px; }
  .btn-qq { padding: 5px 10px; font-size: 11px; }
  .download-actions { flex-direction: column; align-items: center; }
  .download-actions .btn { width: 100%; max-width: 240px; }

  .footer-inner { flex-direction: column; gap: 28px; }
  .footer-links { gap: 28px; }

  .pagination { gap: 4px; }
  .pg-btn { min-width: 32px; height: 32px; font-size: 13px; }
}

/* 小手机 (≤480px) */
@media (max-width: 480px) {
  .hero { padding: 10px 12px 8px; }
  .hero-title { font-size: 20px; }
  .hero-desc { font-size: 11px; margin-bottom: 10px; }
  .hero-search input { font-size: 12px; padding: 8px 6px; }
  .hero-search button { padding: 8px 12px; font-size: 12px; }
  .hero-search-icon { margin: 8px 0 8px 10px; width: 14px; height: 14px; }
  .hero-stats { gap: 12px; }
  .stat-num { font-size: 16px; }
  .stat-label { font-size: 10px; }
  .resource-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .res-card-cover { aspect-ratio: 4/3; }
}

/* ===== 资源详情子页面 ===== */
.detail-page { display: flex; flex-direction: column; min-height: 100vh; background: var(--bg); animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.detail-topbar { position: sticky; top: 0; z-index: 50; background: var(--card); border-bottom: 1px solid var(--border); padding: 0 20px; backdrop-filter: blur(10px); }
.detail-back { display: inline-flex; align-items: center; gap: 6px; background: none; border: none; color: var(--text-secondary); font-size: 14px; padding: 12px 0; cursor: pointer; transition: color 0.2s; }
.detail-back svg { width: 18px; height: 18px; }
.detail-back:hover { color: var(--primary); }

.detail-container { flex: 1; max-width: 860px; width: 100%; margin: 0 auto; padding: 0; }

.detail-cover { position: relative; width: 100%; aspect-ratio: 16/6; max-height: 360px; background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4c1d95 100%); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.detail-cover.no-cover { background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4c1d95 100%); }
.detail-cover-ph { display: none; position: absolute; color: rgba(255,255,255,0.2); width: 64px; height: 64px; }
.detail-cover.no-cover .detail-cover-ph { display: block; }
.detail-cover-ph svg { width: 100%; height: 100%; }
.detail-cover-badge { position: absolute; top: 16px; left: 16px; background: rgba(0,0,0,0.55); backdrop-filter: blur(4px); color: #fff; font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 99px; }
.detail-cover-badge .detail-cat-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
}

.detail-body { padding: 28px 24px 40px; }
.detail-title { font-size: 24px; font-weight: 700; color: var(--text); margin: 0 0 8px; line-height: 1.3; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }
.detail-meta span { display: inline-flex; align-items: center; gap: 4px; }
.detail-meta .meta-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--border); }

.detail-info-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 24px; }

.detail-download { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; margin-top: 24px; }
.detail-section-title { font-size: 15px; font-weight: 600; color: var(--text); margin: 0 0 12px; }

/* 手机端详情页 */
@media (max-width: 768px) {
  .detail-topbar { padding: 0 14px; }
  .detail-cover { aspect-ratio: 16/7; max-height: 220px; }
  .detail-cover-badge { top: 10px; left: 10px; font-size: 11px; padding: 3px 10px; }
  .detail-body { padding: 20px 16px 32px; }
  .detail-title { font-size: 20px; }
  .detail-info-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .detail-download { padding: 12px; }
  .detail-download .download-actions { flex-direction: row; gap: 8px; justify-content: center; }
  .detail-download .download-actions .btn { width: auto; max-width: none; padding: 6px 12px; font-size: 12px; flex: 1 1 auto; white-space: nowrap; line-height: 1.2; }
  .detail-download .download-link-box { padding: 8px 10px; font-size: 12px; }
}

@media (max-width: 480px) {
  .detail-cover { aspect-ratio: 16/8; max-height: 180px; }
  .detail-body { padding: 16px 12px 28px; }
  .detail-title { font-size: 18px; }
  .detail-download .download-actions { flex-direction: row; gap: 6px; justify-content: center; }
  .detail-download .download-actions .btn { width: auto; max-width: none; padding: 5px 8px; font-size: 11px; flex: 1 1 auto; white-space: nowrap; line-height: 1.2; }
}

/* ---- 滚动条美化 ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
