/* ============================================================
   星河导航 - StarNav. 网址导航系统
   创意视觉风格：暗夜宇宙 + 玻璃态 + 渐变色彩
   ============================================================ */

/* ---------- CSS 变量 ---------- */
:root {
  /* 主色调（默认浅色主题） */
  --bg-primary: #f0f2f5;
  --bg-secondary: #ffffff;
  --bg-card: rgba(0, 0, 0, 0.03);
  --bg-card-hover: rgba(0, 0, 0, 0.06);
  --bg-glass: rgba(255, 255, 255, 0.8);
  --bg-glass-border: rgba(0, 0, 0, 0.1);

  /* 渐变 */
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-accent: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 100%);
  --gradient-warm: linear-gradient(135deg, #f7971e 0%, #ffd200 100%);
  --gradient-cyber: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gradient-forest: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  --gradient-hero: linear-gradient(135deg, #e8ecf1 0%, #f0f2f5 50%, #e0e5ec 100%);

  /* 文字 */
  --text-primary: #1a2332;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --text-accent: #667eea;

  /* 阴影 */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 30px rgba(102, 126, 234, 0.1);
  --shadow-glow-strong: 0 0 60px rgba(102, 126, 234, 0.2);

  /* 布局 */
  --max-width: 1280px;
  --header-height: 70px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  /* 动画 */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

  /* 毛玻璃 */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(0, 0, 0, 0.08);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial,
    sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

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

ul, ol {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
}

/* ---------- 星空背景 ---------- */
.stars-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 50%;
  animation: twinkle var(--duration) ease-in-out infinite alternate;
}

@keyframes twinkle {
  0% { opacity: 0.2; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1.2); }
}

/* 流星 */
.shooting-star {
  position: absolute;
  width: 150px;
  height: 2px;
  background: linear-gradient(to right, transparent, rgba(255,255,255,0.8), transparent);
  animation: shoot 4s linear infinite;
  opacity: 0;
  transform: rotate(-35deg);
}

.shooting-star:nth-child(1) { top: 10%; left: 20%; animation-delay: 0s; }
.shooting-star:nth-child(2) { top: 30%; left: 60%; animation-delay: 2s; width: 100px; }
.shooting-star:nth-child(3) { top: 50%; left: 30%; animation-delay: 5s; width: 120px; }
.shooting-star:nth-child(4) { top: 15%; left: 80%; animation-delay: 8s; width: 80px; }

@keyframes shoot {
  0% { transform: translateX(0) rotate(-35deg); opacity: 0; }
  5% { opacity: 1; }
  15% { opacity: 1; }
  20% { opacity: 0; }
  100% { transform: translateX(-600px) rotate(-35deg); opacity: 0; }
}

/* ---------- 流星雨 ---------- */
.meteor-shower {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.meteor {
  position: absolute;
  width: 2px;
  height: 2px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  box-shadow: 0 0 6px 2px rgba(0, 0, 0, 0.05);
  animation: meteorFall var(--fall-duration, 3s) linear infinite;
  animation-delay: var(--fall-delay, 0s);
  opacity: 0;
}

.meteor::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 80px;
  height: 1px;
  background: linear-gradient(to left, rgba(0,0,0,0.08), transparent);
  transform: translateY(-50%);
}

@keyframes meteorFall {
  0% { transform: translate(0, 0) rotate(-35deg); opacity: 0; }
  5% { opacity: 1; }
  15% { opacity: 1; }
  20% { opacity: 0; }
  100% { transform: translate(-500px, 500px) rotate(-35deg); opacity: 0; }
}

/* ---------- Header ---------- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  transition: var(--transition-normal);
}

.header.scrolled {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.logo span {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-nav a {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.header-nav a:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

/* ---------- 主题切换 ---------- */
.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: var(--transition-fast);
  margin-left: 8px;
}

.theme-toggle:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

/* ---------- Hero 区域 ---------- */
.hero {
  position: relative;
  z-index: 1;
  padding: 140px 24px 80px;
  text-align: center;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 50px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  font-size: 0.85rem;
  color: var(--text-accent);
  margin-bottom: 24px;
  animation: fadeInDown 0.6s ease-out;
}

.hero-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #38ef7d;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 20px;
  letter-spacing: -1.5px;
  animation: fadeInUp 0.6s ease-out 0.1s both;
}

.hero-title-gradient {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 40px;
  line-height: 1.8;
  animation: fadeInUp 0.6s ease-out 0.2s both;
}

/* ---------- 搜索栏 ---------- */
.search-wrapper {
  max-width: 640px;
  margin: 0 auto 60px;
  width: 100%;
  animation: fadeInUp 0.6s ease-out 0.3s both;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 60px;
  padding: 4px;
  transition: var(--transition-normal);
  backdrop-filter: blur(10px);
}

.search-box:focus-within {
  border-color: rgba(102, 126, 234, 0.5);
  box-shadow: 0 0 40px rgba(102, 126, 234, 0.1);
  background: rgba(255, 255, 255, 0.08);
}

.search-icon {
  padding: 0 16px 0 20px;
  color: var(--text-muted);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 1rem;
  padding: 14px 0;
  font-family: inherit;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-btn {
  padding: 10px 28px;
  border-radius: 50px;
  border: none;
  background: var(--gradient-primary);
  color: white;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  margin: 4px;
  flex-shrink: 0;
  font-family: inherit;
}

.search-btn:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
}

.search-btn:active {
  transform: scale(0.98);
}

/* 搜索建议下拉 */
.search-suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 8px;
  display: none;
  z-index: 100;
  max-height: 360px;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.search-suggestions.active {
  display: block;
  animation: fadeIn 0.2s ease-out;
}

.suggestion-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}

.suggestion-item:hover {
  background: var(--bg-card);
}

.suggestion-item .suggestion-icon {
  font-size: 1.2rem;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.suggestion-item .suggestion-name {
  font-size: 0.95rem;
  color: var(--text-primary);
}

.suggestion-item .suggestion-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.suggestion-item .suggestion-url {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--text-accent);
}

/* 热门搜索标签 */
.hot-tags {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
  font-size: 0.85rem;
  animation: fadeInUp 0.6s ease-out 0.4s both;
}

.hot-tags-label {
  color: var(--text-muted);
  margin-right: 4px;
}

.hot-tag {
  padding: 4px 14px;
  border-radius: 50px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
  font-size: 0.82rem;
}

.hot-tag:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: rgba(102, 126, 234, 0.3);
}

/* ---------- 统计信息 ---------- */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 40px;
  animation: fadeInUp 0.6s ease-out 0.5s both;
}

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

.stat-number {
  font-size: 1.8rem;
  font-weight: 800;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ---------- 分类导航 ---------- */
.categories-section {
  position: relative;
  z-index: 1;
  padding: 60px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.section-title span {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 1rem;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}

.category-card {
  position: relative;
  padding: 20px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  text-align: center;
  cursor: pointer;
  transition: var(--transition-normal);
  overflow: hidden;
}

.category-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--card-gradient, var(--gradient-primary));
  opacity: 0;
  transition: var(--transition-normal);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.category-card:hover {
  transform: translateY(-4px);
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow-glow);
}

.category-card:hover::before {
  opacity: 1;
}

.category-icon {
  font-size: 2rem;
  margin-bottom: 10px;
  display: block;
}

.category-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.category-count {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ---------- 推荐站点 ---------- */
.featured-section {
  position: relative;
  z-index: 1;
  padding: 60px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.site-card {
  position: relative;
  padding: 24px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  transition: var(--transition-normal);
  overflow: hidden;
  cursor: pointer;
}

.site-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--card-hover-gradient, linear-gradient(135deg, transparent 60%, rgba(102, 126, 234, 0.05)));
  opacity: 0;
  transition: var(--transition-normal);
  pointer-events: none;
}

.site-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow-glow);
}

.site-card:hover::after {
  opacity: 1;
}

.site-card-top {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.site-logo {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  overflow: hidden;
}

.site-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.site-info {
  flex: 1;
  min-width: 0;
}

.site-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.site-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

.site-category-tag {
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 50px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
}

.site-visit-btn {
  padding: 6px 16px;
  border-radius: 50px;
  border: none;
  background: var(--gradient-primary);
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  font-family: inherit;
}

.site-visit-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 16px rgba(102, 126, 234, 0.4);
}

/* ---------- 全部站点列表 ---------- */
.all-sites-section {
  position: relative;
  z-index: 1;
  padding: 60px 24px 100px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.sites-filter-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 10px 24px;
  border-radius: 50px;
  border: 1px solid var(--glass-border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  font-family: inherit;
  letter-spacing: 0.3px;
}

.filter-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.filter-btn.active {
  background: var(--gradient-primary);
  border-color: transparent;
  color: white;
}

.sites-table {
  display: grid;
  gap: 1px;
  background: var(--glass-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.site-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  background: var(--bg-secondary);
  transition: var(--transition-fast);
  cursor: pointer;
  cursor: pointer;
}

.site-row:hover {
  background: var(--bg-card);
}

.site-row-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.site-row-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--glass-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.site-row-name {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-row-url {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-row-category {
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: 50px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  white-space: nowrap;
}

.site-row-action {
  padding: 6px 14px;
  border-radius: 6px;
  border: none;
  background: var(--gradient-primary);
  color: white;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  font-family: inherit;
  white-space: nowrap;
}

.site-row-action:hover {
  opacity: 0.9;
  transform: scale(1.03);
}

/* ---------- Footer ---------- */
.footer {
  position: relative;
  z-index: 1;
  padding: 40px 24px;
  border-top: 1px solid var(--glass-border);
  background: var(--bg-secondary);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-copyright {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  font-size: 0.82rem;
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.footer-links a:hover {
  color: var(--text-accent);
}

/* ---------- Scroll animations ---------- */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- 动画关键帧 ---------- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 滚动条美化 ---------- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

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

/* ---------- 回到顶部 ---------- */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 999;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gradient-primary);
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-normal);
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
  font-family: inherit;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 30px rgba(102, 126, 234, 0.6);
}

/* ---------- 加载动画 ---------- */
.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-primary);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.page-loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-spinner {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid var(--glass-border);
  border-top-color: #667eea;
  animation: spin 0.8s linear infinite;
}

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

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
  :root {
    --header-height: 60px;
  }

  .hero {
    padding: 100px 16px 60px;
    min-height: auto;
  }

  .hero-title {
    font-size: 2rem;
  }

  .header-nav a {
    font-size: 0.82rem;
    padding: 6px 10px;
  }

  .search-wrapper {
    margin-bottom: 40px;
  }

  .search-box {
    border-radius: 40px;
  }

  .search-btn {
    padding: 8px 18px;
    font-size: 0.85rem;
  }

  .search-input {
    padding: 10px 0;
    font-size: 0.9rem;
  }

  .categories-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
  }

  .category-card {
    padding: 14px 10px;
  }

  .category-icon {
    font-size: 1.5rem;
  }

  .featured-grid {
    grid-template-columns: 1fr;
  }

  .stats-bar {
    gap: 20px;
    flex-wrap: wrap;
  }

  .site-row {
    grid-template-columns: 1fr auto;
    padding: 12px 14px;
  }

  .site-row-category {
    display: none;
  }

  .sites-filter-bar {
    gap: 8px;
  }

  .filter-btn {
    font-size: 0.85rem;
    padding: 8px 16px;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.6rem;
  }

  .categories-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .stat-number {
    font-size: 1.4rem;
  }

  .search-btn-text {
    display: none;
  }
}

/* ---------- Dark Theme (手动切换) ---------- */
body.dark-theme {
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --bg-glass: rgba(255, 255, 255, 0.06);
  --bg-glass-border: rgba(255, 255, 255, 0.1);

  --text-primary: #f0f2f5;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --text-accent: #818cf8;

  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);

  --gradient-hero: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
}

body.dark-theme .header {
  background: rgba(10, 14, 26, 0.8);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

body.dark-theme .header.scrolled {
  background: rgba(10, 14, 26, 0.95);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

body.dark-theme .search-box {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

body.dark-theme .search-box:focus-within {
  border-color: rgba(102, 126, 234, 0.5);
  box-shadow: 0 0 40px rgba(102, 126, 234, 0.15);
  background: rgba(255, 255, 255, 0.08);
}

body.dark-theme .site-row {
  background: #111827;
}

body.dark-theme .site-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

body.dark-theme .sites-table {
  background: rgba(255, 255, 255, 0.08);
}

body.dark-theme .footer {
  background: #111827;
  border-top-color: rgba(255, 255, 255, 0.08);
}

body.dark-theme .search-suggestions {
  background: rgba(17, 24, 39, 0.95);
}

body.dark-theme .category-card {
  background: rgba(255, 255, 255, 0.04);
}

body.dark-theme .hot-tag {
  background: rgba(255, 255, 255, 0.06);
}

body.dark-theme::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
}

/* 深色主题下星星变亮 */
body.dark-theme .star {
  background: #fff;
}

body.dark-theme .meteor {
  background: #fff;
  box-shadow: 0 0 6px 2px rgba(255, 255, 255, 0.3);
}
body.dark-theme .meteor::after {
  background: linear-gradient(to left, rgba(255,255,255,0.6), transparent);
}
