/* =============================================================
   导航站群 · 前台主题样式
   设计：清爽蓝青渐变 + 白卡片，丝滑过渡，PC 三栏 / 移动端抽屉
   ============================================================= */
:root {
  --bg: #f3f6fb;
  --card: #ffffff;
  --ink: #17233d;
  --ink-2: #4b5878;
  --ink-3: #8a94ad;
  --line: #e8edf5;
  --brand: #2f6bff;
  --brand-2: #4f8bff;
  --cyan: #22b8cf;
  --grad: linear-gradient(135deg, #2f6bff 0%, #22b8cf 100%);
  --radius: 16px;
  --shadow: 0 1px 2px rgba(23, 35, 61, .04), 0 8px 24px rgba(23, 35, 61, .06);
  --shadow-hover: 0 4px 8px rgba(23, 35, 61, .06), 0 16px 40px rgba(23, 35, 61, .12);
  --ease: cubic-bezier(.4, 0, .2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; }

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

/* ---------- 顶栏 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 20px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; color: var(--ink); white-space: nowrap; }
.brand .logo-badge {
  width: 38px; height: 38px; border-radius: 11px; background: var(--grad);
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 18px;
  box-shadow: 0 4px 12px rgba(47, 107, 255, .35);
}
.brand .site-title { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

.nav-links { display: flex; gap: 4px; margin-left: 8px; }
.nav-links a { padding: 8px 16px; border-radius: 10px; font-size: 15px; color: var(--ink-2); transition: all .2s var(--ease); font-weight: 500; }
.nav-links a:hover, .nav-links a.active { color: var(--brand); background: rgba(47, 107, 255, .08); }

.search-box { flex: 1; max-width: 420px; margin-left: auto; display: flex; align-items: center; background: #f1f4fa; border: 1px solid transparent; border-radius: 12px; padding: 0 14px; height: 42px; transition: .2s; }
.search-box:focus-within { background: #fff; border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(47, 107, 255, .12); }
.search-box input { flex: 1; border: none; outline: none; background: transparent; font-size: 14px; color: var(--ink); }
.search-box .search-ico { color: var(--ink-3); font-size: 15px; }

.menu-toggle { display: none; margin-left: auto; width: 42px; height: 42px; border: 1px solid var(--line); background: #fff; border-radius: 11px; font-size: 18px; color: var(--ink-2); cursor: pointer; }

/* ---------- 布局 ---------- */
.layout { display: grid; grid-template-columns: 210px 1fr 300px; gap: 22px; padding: 24px 0; align-items: start; }

/* ---------- 侧边分类 ---------- */
.left-col { min-width: 0; }
.side-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; position: sticky; top: 88px; }
.side-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.side-title .t-ico { color: var(--brand); }
.cat-list { display: flex; flex-direction: column; gap: 2px; max-height: calc(100vh - 200px); overflow-y: auto; }
.cat-list a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; font-size: 14px; color: var(--ink-2); transition: .18s; }
.cat-list a i { width: 18px; text-align: center; color: var(--ink-3); font-size: 14px; }
.cat-list a:hover, .cat-list a.active { background: rgba(47, 107, 255, .08); color: var(--brand); }
.cat-list a:hover i, .cat-list a.active i { color: var(--brand); }

/* ---------- 主内容 ---------- */
.main-col { min-width: 0; }
.hero { background: var(--grad); border-radius: 20px; padding: 28px 28px; color: #fff; margin-bottom: 22px; position: relative; overflow: hidden; box-shadow: 0 10px 30px rgba(47, 107, 255, .25); }
.hero::after { content: ''; position: absolute; right: -40px; top: -40px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,.12); }
.hero::before { content: ''; position: absolute; right: 60px; bottom: -60px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255,255,255,.1); }
.hero h1 { font-size: 22px; margin-bottom: 6px; position: relative; z-index: 1; }
.hero p { font-size: 14px; opacity: .9; position: relative; z-index: 1; }
.hero-search { margin-top: 16px; display: flex; align-items: center; background: #fff; border-radius: 14px; padding: 4px 4px 4px 16px; position: relative; z-index: 1; box-shadow: 0 6px 20px rgba(0,0,0,.15); }
.hero-search input { flex: 1; border: none; outline: none; font-size: 15px; color: var(--ink); padding: 8px 0; background: transparent; }
.hero-search button { border: none; background: var(--grad); color: #fff; padding: 10px 22px; border-radius: 11px; font-size: 14px; cursor: pointer; transition: .2s; }
.hero-search button:hover { opacity: .92; }

.category-block { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; }
.cat-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.cat-head .cat-ico { width: 34px; height: 34px; border-radius: 9px; background: rgba(47, 107, 255, .1); color: var(--brand); display: flex; align-items: center; justify-content: center; font-size: 16px; }
.cat-head h2 { font-size: 17px; font-weight: 600; }
.cat-head .cat-count { font-size: 12px; color: var(--ink-3); background: #f1f4fa; padding: 2px 10px; border-radius: 20px; }
.cat-more { margin-left: auto; font-size: 13px; color: var(--brand); }

.sub-group { margin-bottom: 10px; }
.sub-group:last-child { margin-bottom: 0; }
.sub-title { font-size: 13px; font-weight: 600; color: var(--ink-3); margin-bottom: 8px; padding-left: 8px; border-left: 3px solid var(--cyan); }

.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.site-item { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line); transition: all .18s var(--ease); background: #fff; }
.site-item:hover { border-color: var(--brand-2); box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.site-item .favicon { width: 24px; height: 24px; border-radius: 6px; flex-shrink: 0; background: #eef2f9; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.site-item .favicon img { width: 100%; height: 100%; object-fit: cover; }
.site-item .favicon i { color: var(--brand); font-size: 13px; }
.site-item .s-name { font-size: 14px; font-weight: 500; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 右侧栏 ---------- */
.right-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.hot-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; position: sticky; top: 88px; }
.hot-head { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; padding-bottom: 12px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.hot-head .fire { color: #ff6b35; }
.hot-item { display: flex; align-items: flex-start; gap: 10px; padding: 9px 8px; border-radius: 10px; transition: .15s; }
.hot-item:hover { background: #f6f8fc; }
.hot-rank { width: 20px; height: 20px; border-radius: 6px; background: #f1f4fa; color: var(--ink-3); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.hot-item:nth-child(1) .hot-rank, .hot-item:nth-child(2) .hot-rank, .hot-item:nth-child(3) .hot-rank { background: var(--grad); color: #fff; }
.hot-title { font-size: 14px; color: var(--ink); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- 底部 ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0; margin-top: 24px; background: #fff; }
.friend-links { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-bottom: 18px; justify-content: center; }
.friend-links a { font-size: 13px; color: var(--ink-3); transition: color .15s var(--ease); }
.friend-links a:hover { color: var(--brand); }
.copyright { text-align: center; font-size: 13px; color: var(--ink-3); }

/* ---------- 移动端抽屉 ---------- */
.drawer-mask { position: fixed; inset: 0; background: rgba(23,35,61,.4); z-index: 200; opacity: 0; visibility: hidden; transition: .25s var(--ease); }
.drawer-mask.show { opacity: 1; visibility: visible; }
.drawer { position: fixed; left: -280px; top: 0; bottom: 0; width: 264px; background: #fff; z-index: 201; transition: transform .28s cubic-bezier(.4,0,.2,1); padding: 20px; overflow-y: auto; box-shadow: 4px 0 40px rgba(0,0,0,.14); }
.drawer.show { transform: translateX(280px); }

/* ---------- 分页 ---------- */
.pager { display: flex; gap: 8px; justify-content: center; margin: 20px 0; }
.pager a, .pager span { min-width: 36px; height: 36px; padding: 0 8px; display: flex; align-items: center; justify-content: center; border-radius: 10px; border: 1px solid var(--line); font-size: 14px; color: var(--ink-2); background: #fff; transition: .15s; }
.pager a:hover { border-color: var(--brand-2); color: var(--brand); }
.pager .current { background: var(--grad); color: #fff; border-color: transparent; }

/* ---------- 文章详情 ---------- */
.article-page { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px; }
.article-page h1 { font-size: 24px; margin-bottom: 12px; }
.article-meta { font-size: 13px; color: var(--ink-3); margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.article-body { font-size: 15px; color: var(--ink); line-height: 1.9; }
.article-body img { max-width: 100%; border-radius: 12px; margin: 12px 0; }
.article-body p { margin-bottom: 14px; }

/* ---------- 空状态 ---------- */
.empty { text-align: center; color: var(--ink-3); padding: 40px 20px; font-size: 14px; }

/* ---------- 广告位 ---------- */
/* 搜索框下方 · 文字广告模块 */
.text-ad-module {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  margin-bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.text-ad-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 10px;
  background: #f6f8fc;
  border: 1px solid var(--line);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  transition: all .18s var(--ease);
}
.text-ad-item:hover {
  border-color: var(--brand-2);
  color: var(--brand);
  background: #fff;
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.text-ad-item i { color: var(--cyan); font-size: 14px; }

/* 搜索框下方 · 图片广告（仅图片） */
.search-image-ads {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.search-image-ads a {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #fff;
  transition: transform .18s var(--ease);
}
.search-image-ads a:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.search-image-ads a img { max-width: 100%; height: auto; display: block; margin: 0 auto; }

.side-ads { display: flex; flex-direction: column; gap: 16px; }
.side-ads a { display: block; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: #fff; transition: transform .18s var(--ease); }
.side-ads a:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.side-ads a img { max-width: 100%; height: auto; display: block; margin: 0 auto; }

.top-banner { margin-bottom: 24px; }
.top-banner a { display: block; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: #fff; transition: transform .18s var(--ease); }
.top-banner a:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.top-banner a img { max-width: 100%; height: auto; display: block; margin: 0 auto; }

.footer-banner { margin: 28px 0; }
.footer-banner a { display: block; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: #fff; transition: transform .18s var(--ease); }
.footer-banner a:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.footer-banner a img { max-width: 100%; height: auto; display: block; margin: 0 auto; }

.bottom-ads { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-top: 20px; }
.bottom-ads a { display: block; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: #fff; transition: transform .18s var(--ease); }
.bottom-ads a:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.bottom-ads a img { max-width: 100%; height: auto; display: block; margin: 0 auto; }

/* 右侧栏广告与热点卡片之间的间距 */
.right-col .side-ads + .hot-card, .right-col .hot-card + .side-ads { margin-top: 0; }

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
  .layout { grid-template-columns: 180px 1fr; }
  .right-col { display: none; }
}
@media (max-width: 860px) {
  .nav-links { display: none; }
  .menu-toggle { display: block; }
  .search-box { display: none; }
  .layout { grid-template-columns: 1fr; }
  .left-col { display: none; }
  .hero { padding: 22px; }
  .hero h1 { font-size: 19px; }
  .site-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
  .container { padding: 0 14px; }
}
