/* ===========================================================
   次元导航 · AI 导航页专属样式
   =========================================================== */

/* ---------- 顶部导航增强 ---------- */
.ai-header-nav { display: flex; align-items: center; gap: 3px; flex: none; }
.ai-header-link {
  padding: 7px 13px; border-radius: 9px; font-size: 13px; font-weight: 650;
  color: var(--text-2); text-decoration: none; transition: all .2s; white-space: nowrap;
}
.ai-header-link:hover { background: var(--primary-soft); color: var(--primary); }
.ai-header-link.active { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; box-shadow: 0 4px 12px rgba(99,102,241,.28); }

/* 确保 hidden 属性生效（display:flex 会覆盖浏览器默认 hidden） */
[hidden] { display: none !important; }

/* ---------- Hero ---------- */
.ai-hero {
  position: relative; overflow: hidden;
  background: linear-gradient(120deg, #eef2ff 0%, #fdf2f8 55%, #f0f9ff 100%);
  padding: 72px 24px 62px; text-align: center;
}
[data-theme="dark"] .ai-hero { background: linear-gradient(120deg, #1a1f38 0%, #2a1b33 55%, #14232e 100%); }
.ai-hero::before, .ai-hero::after {
  content: ''; position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; pointer-events: none;
}
.ai-hero::before { width: 420px; height: 420px; background: #c7d2fe; top: -160px; left: -80px; animation: aiOrb 18s ease-in-out infinite; }
.ai-hero::after { width: 360px; height: 360px; background: #fbcfe8; bottom: -150px; right: -60px; animation: aiOrb 22s ease-in-out infinite reverse; }
[data-theme="dark"] .ai-hero::before { background: #4338ca; opacity: .35; }
[data-theme="dark"] .ai-hero::after { background: #9d174d; opacity: .3; }
@keyframes aiOrb { 0%,100% { transform: translate(0,0); } 50% { transform: translate(30px,26px); } }
.ai-hero-inner { position: relative; z-index: 1; max-width: 900px; margin: 0 auto; }
.ai-hero-badge {
  display: inline-block; padding: 7px 16px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  color: var(--primary); background: rgba(255,255,255,.75); border: 1px solid rgba(99,102,241,.18);
  box-shadow: var(--shadow-sm); margin-bottom: 20px;
}
[data-theme="dark"] .ai-hero-badge { background: rgba(30,39,53,.7); }
.ai-hero h1 { font-size: clamp(30px, 4.6vw, 52px); line-height: 1.2; font-weight: 850; letter-spacing: -.5px; margin: 0 0 16px; color: var(--text); }
.ai-hero-gradient { background: linear-gradient(100deg, #6366f1, #ec4899, #0ea5e9); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; background-size: 200% auto; animation: aiGrad 6s linear infinite; }
@keyframes aiGrad { to { background-position: 200% center; } }
.ai-hero p { font-size: 15px; color: var(--text-2); line-height: 1.7; max-width: 640px; margin: 0 auto 30px; }
.ai-hero-stats { display: flex; justify-content: center; gap: clamp(24px, 6vw, 68px); flex-wrap: wrap; }
.ai-stat { display: flex; flex-direction: column; gap: 3px; }
.ai-stat strong { font-size: 26px; font-weight: 850; letter-spacing: -.5px; }
.ai-stat:nth-child(1) strong { color: #6366f1; }
.ai-stat:nth-child(2) strong { color: #ec4899; }
.ai-stat:nth-child(3) strong { color: #0ea5e9; }
.ai-stat:nth-child(4) strong { color: #14b8a6; }
.ai-stat span { font-size: 12.5px; color: var(--muted); font-weight: 600; }

/* ---------- 分类吸顶栏 ---------- */
.ai-catbar {
  position: sticky; top: var(--header-h); z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.ai-catbar-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 11px 20px;
  display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none;
}
.ai-catbar-inner::-webkit-scrollbar { display: none; }
.ai-cat-chip {
  flex: none; padding: 7px 13px; border-radius: 10px; font-size: 12.5px; font-weight: 650;
  color: var(--text-2); background: var(--surface); border: 1px solid var(--border);
  cursor: pointer; text-decoration: none; white-space: nowrap; transition: all .18s;
  display: inline-flex; align-items: center; gap: 5px;
}
.ai-cat-chip:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.ai-cat-chip .chip-num { font-size: 10.5px; color: var(--muted); background: var(--bg-soft); padding: 1px 6px; border-radius: 6px; }

/* ---------- 搜索提示 ---------- */
.ai-search-bar {
  max-width: var(--maxw); margin: 20px auto 0; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 13.5px; color: var(--text-2);
}
.ai-search-bar span strong { color: var(--primary); }
.ai-search-bar button {
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  padding: 6px 12px; border-radius: 8px; cursor: pointer; font-size: 12.5px; transition: all .2s;
}
.ai-search-bar button:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- 分区块 ---------- */
.ai-sections { max-width: var(--maxw); margin: 0 auto; padding: 34px 20px 70px; }
.ai-section { margin-bottom: 46px; scroll-margin-top: calc(var(--header-h) + 62px); }
.ai-section-head { display: flex; align-items: center; gap: 11px; margin-bottom: 16px; }
.ai-section-icon {
  width: 36px; height: 36px; flex: none; border-radius: 11px; display: grid; place-items: center;
  font-size: 18px; background: var(--primary-soft); box-shadow: var(--shadow-sm);
}
.ai-section-title { font-size: 20px; font-weight: 800; letter-spacing: -.3px; color: var(--text); margin: 0; }
.ai-section-count { font-size: 12px; color: var(--muted); font-weight: 600; }
.ai-section-line { flex: 1; height: 1px; background: linear-gradient(90deg, var(--border), transparent); }

.ai-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 11px; }

/* ---------- 站点卡片 ---------- */
.ai-card {
  position: relative; display: flex; align-items: center; gap: 11px;
  padding: 13px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s, border-color .2s;
  overflow: hidden;
}
.ai-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--card-c, var(--primary)), transparent); opacity: .85;
}
.ai-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--card-c, var(--primary)); }
.ai-card-link { position: absolute; inset: 0; z-index: 1; border-radius: 14px; }
.ai-card-logo {
  width: 42px; height: 42px; flex: none; border-radius: 11px; display: grid; place-items: center;
  font-size: 18px; font-weight: 800; color: #fff; background: var(--card-c, var(--primary));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3);
}
.ai-card-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 11px; padding: 4px; background: #fff; }
.ai-card-body { min-width: 0; flex: 1; }
.ai-card-name { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 750; color: var(--text); margin: 0 0 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-vpn { flex: none; font-size: 9.5px; font-weight: 800; color: #fff; background: #f59e0b; padding: 1px 5px; border-radius: 4px; letter-spacing: .3px; }
.ai-card-desc { font-size: 11.5px; line-height: 1.5; color: var(--muted); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ai-card-arrow { flex: none; color: var(--muted); opacity: .5; transition: transform .2s, opacity .2s; }
.ai-card:hover .ai-card-arrow { opacity: 1; transform: translate(2px, -2px); color: var(--card-c, var(--primary)); }

/* ---------- 无结果 ---------- */
.ai-empty { text-align: center; padding: 80px 20px; color: var(--text-2); }
.ai-empty-icon { font-size: 48px; margin-bottom: 14px; }
.ai-empty h3 { font-size: 20px; margin: 0 0 8px; color: var(--text); }
.ai-empty p { font-size: 13.5px; color: var(--muted); margin: 0; }

/* ---------- 页脚 ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 34px 20px; text-align: center; }
.footer-inner { max-width: var(--maxw); margin: 0 auto; }
.footer-brand { font-size: 15px; font-weight: 800; color: var(--primary); margin-bottom: 10px; }
.footer-note { font-size: 12px; color: var(--muted); line-height: 1.7; max-width: 620px; margin: 0 auto 14px; }
.footer-links a { font-size: 13px; color: var(--text-2); text-decoration: none; font-weight: 600; }
.footer-links a:hover { color: var(--primary); }

/* ---------- 返回顶部 ---------- */
.back-top {
  position: fixed; right: 22px; bottom: 24px; z-index: 60;
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); cursor: pointer;
  display: grid; place-items: center; box-shadow: var(--shadow-md);
  opacity: 0; pointer-events: none; transform: translateY(10px); transition: all .25s;
}
.back-top.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-top:hover { color: var(--primary); border-color: var(--primary); transform: translateY(-3px); }

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  .ai-hero { padding: 54px 18px 44px; }
  .ai-hero-stats { gap: 22px; }
  .ai-stat strong { font-size: 22px; }
  .ai-header-nav { gap: 0; }
  .ai-header-link { padding: 6px 8px; font-size: 11.5px; }
  .ai-grid { grid-template-columns: 1fr; }
  .ai-section-title { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .ai-hero::before, .ai-hero::after, .ai-hero-gradient { animation: none; }
}
