/* ============================================================
   星河导航 - 全套主题样式（2026-04-11）
   ============================================================ */

/* ===== CSS 变量 & 主题系统 ===== */
:root {
  --bg-primary: #f4f6fa;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-header: rgba(255,255,255,0.95);
  --bg-search: #ffffff;
  --text-primary: #1a1d27;
  --text-secondary: #5a6a85;
  --text-muted: #9aa3b5;
  --border: #e8ecf4;
  --border-light: #f0f3f9;
  --accent: #4f6ef7;
  --accent-hover: #3b5be8;
  --accent-light: #eef1ff;
  --red: #f05a5a;
  --orange: #ff8c42;
  --green: #2eca8b;
  --purple: #7c5cfc;
  --yellow: #ffc820;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.14);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --transition: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
  --bg-primary: #0f1117;
  --bg-secondary: #1a1d27;
  --bg-card: #1e2130;
  --bg-sidebar: #1a1d27;
  --bg-header: rgba(15,17,23,0.95);
  --bg-search: #1e2130;
  --text-primary: #e8ecf6;
  --text-secondary: #8a95b0;
  --text-muted: #545e7a;
  --border: #2a2f45;
  --border-light: #232738;
  --accent-light: #1a2050;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
}

/* ===== 全局重置 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; }

/* ===== 头部导航 ===== */
.xh-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: var(--bg-header);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  height: 60px;
  display: flex; align-items: center;
  box-shadow: var(--shadow-sm);
  transition: background 0.3s;
}
body.admin-bar .xh-header { top: 32px; }
@media (max-width: 782px) {
  body.admin-bar .xh-header { top: 46px; }
}
.xh-header-inner {
  width: 100%; max-width: 1440px; margin: 0 auto;
  padding: 0 24px;
  display: flex; align-items: center; gap: 24px;
}
.xh-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 20px; font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap; flex-shrink: 0;
  position: relative; z-index: 2;
}
.xh-logo-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #4f6ef7, #7c5cfc);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: white; flex-shrink: 0;
}
.xh-logo span { background: linear-gradient(135deg, #4f6ef7, #7c5cfc); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.xh-nav-menu {
  display: flex; align-items: center; gap: 2px;
  flex: 1; overflow-x: auto; scrollbar-width: none;
}
.xh-nav-menu::-webkit-scrollbar { display: none; }
.xh-nav-item {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 14px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500;
  color: var(--text-secondary); cursor: pointer;
  white-space: nowrap; transition: all var(--transition);
}
.xh-nav-item:hover, .xh-nav-item.active {
  color: var(--accent); background: var(--accent-light);
}
.xh-header-actions {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.xh-btn-icon {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--text-secondary);
  transition: all var(--transition);
}
.xh-btn-icon:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-light); }

/* 用户头像和登录按钮 */
.xh-user-avatar-small {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border);
  transition: all var(--transition);
}
.xh-user-avatar-small:hover {
  border-color: var(--accent);
  transform: scale(1.05);
}
.xh-user-avatar-small img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.xh-btn-login {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition);
}
.xh-btn-login:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* ===== 主布局 ===== */
.xh-page-wrapper {
  display: flex; min-height: 100vh; padding-top: 60px;
}
.xh-sidebar {
  width: 220px; flex-shrink: 0;
  position: fixed; left: 0; top: 60px; bottom: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  overflow-y: auto; z-index: 100;
  padding: 16px 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  transition: background 0.3s, border-color 0.3s;
}
.xh-sidebar-section { margin-bottom: 8px; }
.xh-sidebar-title {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 8px 12px 4px;
}
.xh-sidebar-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: var(--radius-sm);
  font-size: 14px; color: var(--text-secondary);
  cursor: pointer; transition: all var(--transition);
  position: relative;
}
.xh-sidebar-item:hover { color: var(--accent); background: var(--accent-light); }
.xh-sidebar-item.active { color: var(--accent); background: var(--accent-light); font-weight: 600; }
.xh-sidebar-item .si-icon { font-size: 16px; width: 20px; text-align: center; }
.xh-sidebar-item .si-count {
  margin-left: auto; font-size: 11px; font-weight: 700;
  background: var(--bg-primary); color: var(--text-muted);
  padding: 1px 6px; border-radius: 20px; border: 1px solid var(--border);
}
.xh-sidebar-item.active .si-count { background: var(--accent); color: white; border-color: var(--accent); }

/* ===== 主内容 ===== */
.xh-main-content {
  flex: 1; margin-left: 220px;
  padding: 24px; max-width: calc(1440px - 220px);
}

/* ===== 搜索英雄区 ===== */
.xh-search-hero {
  background: linear-gradient(135deg, #4f6ef7 0%, #7c5cfc 50%, #a855f7 100%);
  border-radius: var(--radius-lg); padding: 40px 32px;
  margin-bottom: 24px; position: relative; overflow: hidden;
}
.xh-search-hero::before {
  content: ''; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='20'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.xh-search-title { color: white; font-size: 28px; font-weight: 800; margin-bottom: 6px; position: relative; }
.xh-search-subtitle { color: rgba(255,255,255,0.7); font-size: 14px; margin-bottom: 24px; position: relative; }
.xh-search-box {
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-md);
  display: flex; align-items: center; overflow: hidden;
  position: relative;
}
.xh-engine-selector {
  padding: 0 16px; height: 52px; display: flex; align-items: center; gap: 8px;
  border-right: 1px solid rgba(255,255,255,0.2);
  cursor: pointer; color: white; font-size: 14px; font-weight: 600;
  min-width: 110px; white-space: nowrap; position: relative;
}
.xh-engine-selector .arrow { font-size: 10px; margin-left: auto; opacity: 0.7; }
.xh-engine-dropdown {
  display: none; position: absolute; top: 100%; left: 0;
  background: white; border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); overflow: hidden; width: 180px;
  z-index: 200; margin-top: 4px;
}
.xh-engine-dropdown.show { display: block; }
.xh-engine-option {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; font-size: 14px; color: #1a1d27;
  cursor: pointer; transition: background 0.15s;
}
.xh-engine-option:hover, .xh-engine-option.active { background: #eef1ff; color: #4f6ef7; }
.xh-engine-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.xh-search-input {
  flex: 1; height: 52px; padding: 0 16px;
  border: none; background: transparent; outline: none;
  font-size: 16px; color: white; font-family: inherit;
}
.xh-search-input::placeholder { color: rgba(255,255,255,0.5); }
.xh-search-btn {
  height: 52px; padding: 0 24px;
  background: white; border: none; cursor: pointer;
  color: var(--accent); font-size: 16px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
  transition: all var(--transition);
}
.xh-search-btn:hover { background: #f0f3ff; }
.xh-quick-engines {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; position: relative;
}
.xh-quick-engine-btn {
  padding: 5px 14px; border-radius: 20px;
  background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.25);
  color: white; font-size: 13px; cursor: pointer;
  transition: all var(--transition);
}
.xh-quick-engine-btn:hover, .xh-quick-engine-btn.active {
  background: rgba(255,255,255,0.3); border-color: rgba(255,255,255,0.5);
}

/* ===== 快捷工具栏 ===== */
.xh-quick-tools {
  display: flex; gap: 10px; margin-bottom: 24px; flex-wrap: wrap;
}
.xh-tool-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 20px;
  background: var(--bg-card); border: 1px solid var(--border);
  font-size: 13px; color: var(--text-secondary);
  cursor: pointer; transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}
.xh-tool-chip:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-light); transform: translateY(-1px); }

/* ===== 统计卡片 ===== */
.xh-stats-bar {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin-bottom: 24px;
}
.xh-stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 16px 20px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow-sm);
}
.xh-stat-icon {
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.xh-stat-num { font-size: 22px; font-weight: 800; color: var(--text-primary); line-height: 1; }
.xh-stat-label { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

/* ===== 分区标题 ===== */
.xh-section-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px; margin-top: 32px;
}
.xh-section-header:first-child { margin-top: 0; }
.xh-section-icon {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.xh-section-title { font-size: 17px; font-weight: 700; color: var(--text-primary); }
.xh-section-count { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.xh-section-more {
  margin-left: auto; font-size: 13px; color: var(--accent); cursor: pointer;
  display: flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 20px;
  transition: background 0.2s;
}
.xh-section-more:hover { background: var(--accent-light); }

/* ===== 网址卡片网格 ===== */
.xh-site-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px; margin-bottom: 8px;
}
.xh-site-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer; position: relative;
  transition: all var(--transition);
  overflow: hidden; box-shadow: var(--shadow-sm);
}
.xh-site-card::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--accent) 0%, transparent 100%);
  opacity: 0; transition: opacity 0.2s;
}
.xh-site-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.xh-site-card:hover::before { opacity: 0.04; }
.xh-site-favicon {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  background: var(--bg-primary); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; overflow: hidden; border: 1px solid var(--border-light);
  transition: transform 0.2s;
}
.xh-site-favicon img { width: 100%; height: 100%; object-fit: contain; }
.xh-site-card:hover .xh-site-favicon { transform: scale(1.1); }
.xh-site-info { flex: 1; min-width: 0; }
.xh-site-name {
  font-size: 14px; font-weight: 600; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 3px;
}
.xh-site-desc { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xh-site-badge {
  position: absolute; top: 8px; right: 8px;
  font-size: 10px; font-weight: 700; padding: 2px 6px;
  border-radius: 20px; letter-spacing: 0.03em;
}
.badge-hot { background: #fff0f0; color: var(--red); }
.badge-new { background: #f0fff6; color: var(--green); }
.badge-rec { background: var(--accent-light); color: var(--accent); }
.xh-site-go {
  position: absolute; right: 0; top: 0; bottom: 0;
  width: 32px; background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 12px; font-weight: 700;
  opacity: 0; transition: opacity 0.2s;
  writing-mode: vertical-rl;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.xh-site-card:hover .xh-site-go { opacity: 1; }

/* ===== 资源卡片 ===== */
.xh-resource-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px; margin-bottom: 8px;
}
.xh-resource-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 16px;
  display: flex; gap: 14px; cursor: pointer;
  transition: all var(--transition); box-shadow: var(--shadow-sm);
}
.xh-resource-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--accent); }
.xh-resource-icon {
  width: 52px; height: 52px; border-radius: var(--radius-sm);
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-size: 26px; background: var(--bg-primary); border: 1px solid var(--border-light);
}
.xh-resource-body { flex: 1; min-width: 0; }
.xh-resource-name { font-size: 15px; font-weight: 700; margin-bottom: 4px; color: var(--text-primary); }
.xh-resource-meta { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.xh-resource-version {
  font-size: 11px; padding: 2px 7px; border-radius: 20px;
  background: var(--accent-light); color: var(--accent); font-weight: 700;
}
.xh-resource-platform { font-size: 11px; color: var(--text-muted); }
.xh-resource-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
.xh-resource-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.xh-resource-tag {
  font-size: 11px; padding: 2px 8px; border-radius: 20px;
  background: var(--bg-primary); color: var(--text-muted); border: 1px solid var(--border);
}

/* ===== 热榜 ===== */
.xh-hot-tabs {
  display: flex; gap: 0; margin-bottom: 14px;
  background: var(--bg-primary); border-radius: var(--radius-sm);
  padding: 4px; border: 1px solid var(--border);
}
.xh-hot-tab {
  flex: 1; text-align: center; padding: 7px 10px;
  font-size: 13px; font-weight: 500; cursor: pointer;
  border-radius: 6px; color: var(--text-secondary);
  transition: all 0.2s; white-space: nowrap;
}
.xh-hot-tab.active { background: var(--bg-card); color: var(--accent); font-weight: 700; box-shadow: var(--shadow-sm); }
.xh-news-list { display: flex; flex-direction: column; gap: 1px; margin-bottom: 8px; }
.xh-news-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; background: var(--bg-card);
  border-radius: var(--radius-sm); cursor: pointer;
  transition: all var(--transition); border: 1px solid transparent;
}
.xh-news-item:hover { border-color: var(--border); transform: translateX(4px); }
.xh-news-rank {
  width: 24px; height: 24px; border-radius: 6px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; background: var(--bg-primary); color: var(--text-muted);
}
.xh-news-item:nth-child(1) .xh-news-rank { background: #ff6b6b; color: white; }
.xh-news-item:nth-child(2) .xh-news-rank { background: #ff9f43; color: white; }
.xh-news-item:nth-child(3) .xh-news-rank { background: #ffd32a; color: white; }
.xh-news-title { flex: 1; font-size: 14px; color: var(--text-primary); line-height: 1.5; min-width: 0; }
.xh-news-tag {
  font-size: 10px; padding: 1px 6px; border-radius: 4px;
  background: #fff0f0; color: var(--red); font-weight: 700; margin-right: 6px; vertical-align: middle;
}
.xh-news-time { font-size: 12px; color: var(--text-muted); flex-shrink: 0; }
.xh-news-source { font-size: 12px; color: var(--accent); flex-shrink: 0; }

/* ===== 排行榜 ===== */
.xh-rank-section {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 20px; margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.xh-rank-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.xh-rank-tabs { display: flex; gap: 6px; margin-left: auto; }
.xh-rank-tab {
  padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600;
  cursor: pointer; background: var(--bg-primary); color: var(--text-muted);
  border: 1px solid var(--border); transition: all 0.2s;
}
.xh-rank-tab.active { background: var(--accent); color: white; border-color: var(--accent); }
.xh-rank-list { display: flex; flex-direction: column; gap: 8px; }
.xh-rank-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--bg-primary); cursor: pointer;
  transition: all var(--transition);
}
.xh-rank-item:hover { background: var(--accent-light); }
.xh-rank-num {
  width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: var(--text-muted); background: var(--bg-card);
  border: 1px solid var(--border);
}
.xh-rank-item:nth-child(1) .xh-rank-num { background: linear-gradient(135deg,#ff6b6b,#ff9f43); color: white; border: none; }
.xh-rank-item:nth-child(2) .xh-rank-num { background: linear-gradient(135deg,#ff9f43,#ffd32a); color: white; border: none; }
.xh-rank-item:nth-child(3) .xh-rank-num { background: linear-gradient(135deg,#ffd32a,#ffeaa7); color: #8a5a00; border: none; }
.xh-rank-favicon {
  width: 28px; height: 28px; border-radius: 6px;
  background: var(--bg-card); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
}
.xh-rank-name { flex: 1; font-size: 14px; font-weight: 500; }
.xh-rank-views { font-size: 12px; color: var(--text-muted); flex-shrink: 0; }
.xh-rank-trend { font-size: 12px; flex-shrink: 0; }
.trend-up { color: var(--red); }
.trend-down { color: var(--green); }

/* ===== 书籍卡片 ===== */
.xh-book-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 14px; margin-bottom: 8px;
}
.xh-book-card { cursor: pointer; transition: all var(--transition); }
.xh-book-card:hover { transform: translateY(-4px); }
.xh-book-cover {
  width: 100%; aspect-ratio: 2/3; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 8px; border: 1px solid var(--border);
  box-shadow: 3px 3px 10px rgba(0,0,0,0.1);
  background: var(--bg-card); overflow: hidden; position: relative;
}
.xh-book-cover-inner {
  position: absolute; inset: 0; padding: 14px 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
}
.xh-book-title-on-cover { font-size: 13px; font-weight: 800; color: white; line-height: 1.3; margin-bottom: 8px; }
.xh-book-author-on-cover { font-size: 10px; color: rgba(255,255,255,0.7); }
.xh-book-name { font-size: 13px; font-weight: 600; color: var(--text-primary); line-height: 1.4; margin-bottom: 3px; }
.xh-book-author { font-size: 12px; color: var(--text-muted); }

/* ===== 标签筛选 ===== */
.xh-tag-filter { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.xh-tag-btn {
  padding: 5px 14px; border-radius: 20px; font-size: 13px;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-secondary); cursor: pointer; transition: all var(--transition);
}
.xh-tag-btn:hover, .xh-tag-btn.active { background: var(--accent); color: white; border-color: var(--accent); }

/* ===== 分隔线 ===== */
.xh-section-divider { border: none; border-top: 1px solid var(--border-light); margin: 28px 0; }

/* ===== 页脚 ===== */
.xh-footer {
  margin-left: 220px; background: var(--bg-card);
  border-top: 1px solid var(--border); padding: 32px 24px;
}
.xh-footer-inner { max-width: calc(1440px - 220px); margin: 0 auto; }
.xh-footer-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; margin-bottom: 24px;
}
.xh-footer-col-title { font-size: 14px; font-weight: 700; margin-bottom: 14px; }
.xh-footer-links { display: flex; flex-direction: column; gap: 8px; }
.xh-footer-link { font-size: 13px; color: var(--text-secondary); cursor: pointer; transition: color 0.2s; }
.xh-footer-link:hover { color: var(--accent); }
.xh-footer-bottom {
  border-top: 1px solid var(--border); padding-top: 20px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; color: var(--text-muted);
}

/* ===== 悬浮按钮 ===== */
.xh-fab-group {
  position: fixed; right: 24px; bottom: 24px;
  display: flex; flex-direction: column; gap: 10px; z-index: 999;
}
.xh-fab {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--bg-card); border: 1px solid var(--border);
  box-shadow: var(--shadow-md); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: var(--text-secondary);
  transition: all var(--transition);
}
.xh-fab:hover { transform: scale(1.1); color: var(--accent); border-color: var(--accent); }
.xh-fab.primary { background: var(--accent); color: white; border-color: var(--accent); }
.xh-fab.primary:hover { background: var(--accent-hover); }

/* ===== 汉堡菜单按钮（桌面隐藏） ===== */
.xh-btn-hamburger {
  display: none;
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg-secondary);
  cursor: pointer; align-items: center; justify-content: center;
  color: var(--text-secondary); transition: all var(--transition);
}
.xh-btn-hamburger:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-light); }

/* ===== 侧边栏关闭按钮（桌面隐藏） ===== */
.xh-sidebar-close {
  display: none;
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg-primary);
  cursor: pointer; align-items: center; justify-content: center;
  color: var(--text-muted); margin-bottom: 8px; margin-left: auto;
  transition: all var(--transition);
}
.xh-sidebar-close:hover { color: var(--red); border-color: var(--red); background: #fff0f0; }

/* ===== 侧边栏遮罩层（桌面隐藏） ===== */
.xh-sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 150;
  opacity: 0; transition: opacity 0.3s;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.xh-sidebar-overlay.active { display: block; opacity: 1; }

/* ===== 响应式 ===== */

/* ---- 平板及以下 (≤1024px) ---- */
@media (max-width: 1024px) {
  /* 侧边栏变抽屉 */
  .xh-sidebar {
    position: fixed; left: -280px; top: 60px; bottom: 0;
    width: 280px; z-index: 200;
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: none;
  }
  .xh-sidebar.open {
    left: 0;
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
  }
  .xh-sidebar-close { display: flex; }

  .xh-main-content { margin-left: 0; max-width: 100%; }
  .xh-footer { margin-left: 0; }
  .xh-footer-inner { max-width: 100%; }
  .xh-stats-bar { grid-template-columns: repeat(2, 1fr); }
  .xh-resource-list { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}

/* ---- 手机 (≤768px) ---- */
@media (max-width: 768px) {
  /* Header */
  .xh-nav-menu { display: none; }
  .xh-btn-hamburger { display: flex; }
  .xh-header-inner { padding: 0 16px; gap: 12px; }
  .xh-btn-submit { display: none; }

  /* 搜索英雄区 */
  .xh-search-hero { padding: 28px 20px; border-radius: var(--radius-md); }
  .xh-search-title { font-size: 22px; }
  .xh-search-subtitle { font-size: 13px; margin-bottom: 18px; }
  .xh-engine-selector { min-width: 90px; padding: 0 10px; font-size: 13px; }
  .xh-search-input { font-size: 16px; height: 46px; }
  .xh-search-btn { height: 46px; padding: 0 16px; font-size: 14px; }
  .xh-engine-selector { height: 46px; }
  .xh-quick-engine-btn { padding: 4px 10px; font-size: 12px; }

  /* 主内容 */
  .xh-main-content { padding: 16px; }

  /* 卡片网格 */
  .xh-site-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .xh-site-card { padding: 10px 12px; }
  .xh-site-favicon { width: 36px; height: 36px; font-size: 18px; }

  /* 资源列表 */
  .xh-resource-list { grid-template-columns: 1fr; }
  .xh-resource-card { padding: 14px; }

  /* 书籍 */
  .xh-book-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }

  /* 统计 */
  .xh-stats-bar { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .xh-stat-card { padding: 12px 14px; }
  .xh-stat-num { font-size: 18px; }
  .xh-stat-icon { width: 38px; height: 38px; font-size: 18px; }

  /* 页脚 */
  .xh-footer { padding: 24px 16px; }
  .xh-footer-grid { grid-template-columns: 1fr 1fr; gap: 20px; }

  /* 分区标题 */
  .xh-section-header { margin-top: 24px; margin-bottom: 12px; }

  /* 快捷工具 */
  .xh-quick-tools { gap: 8px; }
  .xh-tool-chip { padding: 6px 10px; font-size: 12px; }

  /* 热榜标签 */
  .xh-hot-tabs { overflow-x: auto; scrollbar-width: none; }
  .xh-hot-tabs::-webkit-scrollbar { display: none; }
  .xh-hot-tab { padding: 6px 8px; font-size: 12px; }

  /* 排行榜 */
  .xh-rank-section { padding: 16px; }
  .xh-rank-tabs { gap: 4px; }

  /* 新闻 */
  .xh-news-item { padding: 10px 12px; gap: 10px; }
  .xh-news-time { display: none; }

  /* FAB */
  .xh-fab-group { right: 16px; bottom: 16px; }
  .xh-fab { width: 40px; height: 40px; font-size: 16px; }

  /* 子页面 Hero */
  .xh-subpage-hero { padding: 36px 20px; }
  .xh-sph-title { font-size: 24px; }

  /* 工具页面 */
  .xh-tool-input-wrap { flex-direction: column; }
  .xh-tool-btn { width: 100%; }
}

/* ---- 小手机 (≤480px) ---- */
@media (max-width: 480px) {
  .xh-search-hero { padding: 22px 16px; }
  .xh-search-title { font-size: 19px; }
  .xh-search-box { border-radius: var(--radius-sm); }
  .xh-engine-selector { min-width: 72px; padding: 0 8px; gap: 4px; }
  .xh-engine-selector .arrow { display: none; }
  #xhCurrentEngineName { display: none; }

  .xh-site-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .xh-site-card { padding: 8px 10px; gap: 8px; }
  .xh-site-favicon { width: 32px; height: 32px; font-size: 16px; }
  .xh-site-name { font-size: 13px; }
  .xh-site-desc { font-size: 11px; }
  .xh-site-badge { font-size: 9px; padding: 1px 5px; top: 6px; right: 6px; }
  .xh-site-go { width: 26px; font-size: 10px; }

  .xh-book-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .xh-book-title-on-cover { font-size: 11px; }
  .xh-book-name { font-size: 12px; }
  .xh-book-author { font-size: 11px; }

  .xh-stat-num { font-size: 16px; }

  .xh-footer-grid { grid-template-columns: 1fr; gap: 16px; }
  .xh-footer-bottom { flex-direction: column; gap: 4px; text-align: center; }

  .xh-quick-engines { gap: 6px; }

  .xh-tool-chip { padding: 5px 8px; font-size: 11px; }

  .xh-tag-btn { padding: 4px 10px; font-size: 12px; }

  /* 防止 iOS 输入框缩放 */
  .xh-search-input,
  .xh-tool-input,
  input[type="text"],
  select,
  textarea { font-size: 16px !important; }
}

/* ===== 动画 ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.xh-animate-in { animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) both; }

/* ===== 子页面统一风格 ===== */

/* Hero 头部 - 蓝紫渐变 */
.xh-subpage-hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  padding: 48px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.xh-subpage-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}
.xh-sph-content {
  position: relative;
  z-index: 1;
}
.xh-sph-title {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.xh-sph-desc {
  font-size: 15px;
  color: rgba(255,255,255,0.85);
}

/* 卡片网格 - 竖向卡片（热门推荐/最新收录/子页面） */
.xh-site-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}
.xh-site-card--vertical {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-decoration: none !important;
  transition: all 0.25s ease;
  position: relative;
}
.xh-site-card--vertical:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(102, 126, 234, 0.15);
  border-color: #667eea;
}
.xh-site-card--vertical .xh-sc-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  overflow: hidden;
  flex-shrink: 0;
}
.xh-site-card--vertical .xh-sc-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
}
.xh-site-card--vertical .xh-sc-fallback {
  font-weight: 600;
}
.xh-site-card--vertical .xh-sc-info {
  text-align: center;
  flex: 1;
  min-width: 0;
  width: 100%;
}
.xh-site-card--vertical .xh-sc-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.xh-site-card--vertical .xh-sc-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.xh-site-card--vertical .xh-sc-arrow {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  color: #667eea;
  font-size: 14px;
  transition: all 0.2s;
}
.xh-site-card--vertical:hover .xh-sc-arrow {
  opacity: 1;
  right: 14px;
}

/* 排行榜卡片 */
.xh-rank-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.xh-rank-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none !important;
  transition: all 0.2s;
}
.xh-rank-card:hover {
  border-color: #667eea;
  background: linear-gradient(90deg, var(--bg-card) 0%, rgba(102,126,234,0.03) 100%);
}
.xh-rank-card .xh-rc-rank {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}
.xh-rank-card .xh-rc-rank.top {
  background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(255, 170, 0, 0.3);
}
.xh-rank-card .xh-rc-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #fff;
  overflow: hidden;
  flex-shrink: 0;
}
.xh-rank-card .xh-rc-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
}
.xh-rank-card .xh-rc-info {
  flex: 1;
  min-width: 0;
}
.xh-rank-card .xh-rc-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.xh-rank-card .xh-rc-clicks {
  font-size: 12px;
  color: var(--text-muted);
}
.xh-rank-card .xh-rc-arrow {
  opacity: 0;
  color: #667eea;
  transition: opacity 0.2s;
}
.xh-rank-card:hover .xh-rc-arrow {
  opacity: 1;
}

/* 工具页面 */
.xh-tool-panel {
  max-width: 600px;
  margin: 0 auto;
}
.xh-tool-input-wrap {
  display: flex;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}
.xh-tool-input {
  flex: 1;
  padding: 14px 18px;
  border: none;
  background: transparent;
  font-size: 15px;
  color: var(--text-primary);
  outline: none;
}
.xh-tool-input::placeholder {
  color: var(--text-muted);
}
.xh-tool-btn {
  padding: 14px 32px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.xh-tool-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.35);
}
.xh-tool-result {
  margin-top: 24px;
}
.xh-loading {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}
.xh-spin {
  display: inline-block;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.xh-result-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}
.xh-result-card .xh-rc-header {
  padding: 16px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
}
.xh-result-card .xh-rc-body {
  padding: 16px 20px;
}
.xh-result-card .xh-rc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}
.xh-result-card .xh-rc-row:last-child {
  border-bottom: none;
}
.xh-result-card .xh-rc-row span {
  color: var(--text-muted);
  font-size: 14px;
}
.xh-result-card .xh-rc-row b {
  font-size: 16px;
  font-weight: 700;
}
.xh-result-success, .xh-result-error {
  text-align: center;
  padding: 40px 30px;
}
.xh-result-success .xh-rc-icon, .xh-result-error .xh-rc-icon {
  font-size: 48px;
  margin-bottom: 12px;
}
.xh-result-success .xh-rc-title, .xh-result-error .xh-rc-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}
.xh-result-success .xh-rc-title {
  color: #43e97b;
}
.xh-result-error .xh-rc-title {
  color: #e74c3c;
}
.xh-result-success .xh-rc-value, .xh-result-error .xh-rc-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.xh-result-success .xh-rc-target, .xh-result-error .xh-rc-target {
  color: var(--text-muted);
  font-size: 13px;
}

@media (max-width: 768px) {
  .xh-subpage-hero {
    padding: 28px 16px;
  }
  .xh-sph-title {
    font-size: 22px;
  }
  .xh-site-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .xh-site-card,
  .xh-site-card--vertical {
    padding: 12px 10px;
  }
  .xh-site-card .xh-sc-icon,
  .xh-site-card--vertical .xh-sc-icon {
    width: 38px;
    height: 38px;
  }
  .xh-rank-card {
    padding: 10px 12px;
  }
  .xh-rank-card .xh-rc-rank {
    width: 26px;
    height: 26px;
    font-size: 11px;
  }
  .xh-tool-input-wrap {
    flex-direction: column;
  }
  .xh-tool-btn {
    width: 100%;
  }
}

/* ===== 子页面通用样式 ===== */
.xh-page-header { text-align:center; padding:32px 0 24px; }
.xh-ph-title { font-size:24px; font-weight:700; color:var(--text-primary); margin-bottom:6px; }
.xh-ph-desc { font-size:14px; color:var(--text-muted); }

/* 热门/最新 - 卡片网格复用 .xh-site-grid */
.xh-link-card { display:flex; flex-direction:column; align-items:center; gap:8px; padding:18px 12px;
  background:var(--bg-card); border:1px solid var(--border-color); border-radius:var(--radius-lg);
  transition:all .25s ease; text-decoration:none !important; text-align:center; }
.xh-link-card:hover { transform:translateY(-3px); box-shadow:0 8px 20px rgba(0,0,0,.08); border-color:var(--accent); }
.xh-link-card img { width:40px;height:40px;border-radius:10px;object-fit:contain;}
.xh-lc-icon { width:44px;height:44px;display:flex;align-items:center;justify-content:center;font-size:22px;
  background:var(--bg-secondary);border-radius:12px;color:var(--accent);flex-shrink:0;overflow:hidden;}
.xh-lc-title { font-size:13px; font-weight:600; color:var(--text-primary); line-height:1.3; }
.xh-lc-desc { font-size:11.5px; color:var(--text-muted); line-height:1.4; display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
.xh-lc-date { font-size:11px; color:var(--text-muted); opacity:.7; }

/* 排行榜 */
.xh-rank-list { display:flex; flex-direction:column; gap:2px; background:var(--bg-card); border:1px solid var(--border-color); border-radius:var(--radius-lg); overflow:hidden; }
.xh-rank-item { display:flex; align-items:center; gap:12px; padding:14px 18px; text-decoration:none !important;
  transition:background .15s; }
.xh-rank-item:hover { background:var(--bg-secondary); }
.xh-rank-num { width:26px;height:26px;display:flex;align-items:center;justify-content:center;
  font-size:12px;font-weight:700;border-radius:6px;background:var(--bg-secondary);color:var(--text-muted);flex-shrink:0;}
.xh-rank-num.top { background:linear-gradient(135deg,#ffd700,#ffaa00);color:#fff; }
.xh-rank-icon { width:30px;height:30px;border-radius:8px;overflow:hidden;flex-shrink:0;
  display:flex;align-items:center;justify-content:center;background:var(--bg-secondary);}
.xh-rank-icon img{width:100%;height:100%;object-fit:contain;border-radius:6px;}
.xh-rank-name { font-size:14px; font-weight:500; color:var(--text-primary); flex:1; white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.xh-rank-clicks { font-size:12px; color:var(--text-muted); flex-shrink:0;}

/* 工具页面 */
.xh-tool-box { max-width:560px;margin:0 auto;padding:28px 24px;background:var(--bg-card);
  border:1px solid var(--border-color);border-radius:16px;display:flex;gap:10px;align-items:center;}
.xh-tb-input { flex:1; padding:12px 16px;border:1px solid var(--border-color);border-radius:10px;
  font-size:14px;outline:none;transition:border-color .2s;background:transparent;color:var(--text-primary);}
.xh-tb-input:focus { border-color:var(--accent);box-shadow:0 0 0 3px rgba(79,110,247,.15); }
.xh-tb-btn { padding:12px 28px; background:var(--accent);color:#fff;border:none;border-radius:10px;
  font-size:14px;font-weight:600;cursor:pointer;transition:all .2s;white-space:nowrap;}
.xh-tb-btn:hover { background:var(--accent-hover); transform:translateY(-1px); }

#weightResult table { width:100%; border-collapse:collapse; font-size:14px; }
#weightResult td { padding:10px 14px; border-bottom:1px solid var(--border-color); }
#weightResult td:first-child { color:var(--text-muted); width:100px; }

/* ===== 注册按钮 ===== */
.xh-btn-register {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), #f97316);
  border: none;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  display: inline-block;
}
.xh-btn-register:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}
.xh-btn-submit {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  border: none;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  display: inline-block;
}
.xh-btn-submit:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* ===== 全局登录/注册弹窗 ===== */
.auth-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}
.auth-modal-overlay.show {
  display: flex;
}
.auth-modal-content {
  background: var(--bg-card);
  border-radius: 16px;
  width: 380px;
  max-width: 92vw;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  animation: authModalIn 0.25s ease;
  overflow: hidden;
}
@keyframes authModalIn {
  from { opacity: 0; transform: translateY(-16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.auth-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 12px;
}
.auth-modal-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}
.auth-modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg-secondary);
  border-radius: 8px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.auth-modal-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}
.auth-tabs {
  display: flex;
  padding: 0 24px;
  gap: 4px;
}
.auth-tab {
  flex: 1;
  padding: 10px 0;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.auth-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.auth-tab:hover:not(.active) {
  color: var(--text-secondary);
}
.auth-form {
  padding: 20px 24px 24px;
}
.auth-form .form-group {
  margin-bottom: 16px;
}
.auth-form .form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.auth-form .form-group input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s;
  box-sizing: border-box;
}
.auth-form .form-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12);
  background: var(--bg-card);
}
.auth-submit-btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #f97316);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 4px;
}
.auth-submit-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.3);
}

/* ===== Toast 提示 ===== */
.auth-toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-12px);
  padding: 10px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  z-index: 10001;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
}
.auth-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.auth-toast-success {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}
.auth-toast-error {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}
.auth-toast-info {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

/* 暗色模式适配 */
[data-theme="dark"] .auth-modal-content {
  background: #1e293b;
}
[data-theme="dark"] .auth-modal-close {
  background: rgba(71, 85, 105, 0.5);
  color: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.2);
}
[data-theme="dark"] .auth-modal-close:hover {
  background: rgba(71, 85, 105, 0.8);
  color: #ffffff;
  border-color: rgba(148, 163, 184, 0.4);
}
[data-theme="dark"] .auth-form .form-group input {
  background: #0f172a;
  border-color: #334155;
  color: #e2e8f0;
}
[data-theme="dark"] .auth-form .form-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}
[data-theme="dark"] .auth-toast-success {
  background: #064e3b;
  color: #6ee7b7;
  border-color: #065f46;
}
[data-theme="dark"] .auth-toast-error {
  background: #450a0a;
  color: #fca5a5;
  border-color: #7f1d1d;
}
[data-theme="dark"] .auth-toast-info {
  background: #1e3a5f;
  color: #93c5fd;
  border-color: #1e40af;
}
