/* ============================================
   云帆导航 - 清新渐变卡片风
   ============================================ */
:root {
  --primary: #4f6ef7;
  --primary-light: #7c8ffb;
  --primary-dark: #3a55d9;
  --gradient: linear-gradient(135deg, #4f6ef7 0%, #8a63f2 100%);
  --gradient-soft: linear-gradient(135deg, #eef1ff 0%, #f5efff 100%);
  --bg: #f5f7fb;
  --card-bg: #ffffff;
  --text: #2b2f3a;
  --text-sub: #7a8094;
  --border: #e8ecf4;
  --shadow: 0 4px 16px rgba(79, 110, 247, 0.08);
  --shadow-hover: 0 10px 28px rgba(79, 110, 247, 0.16);
  --radius: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; }

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

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
}
.logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.logo b { background: var(--gradient); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

.main-nav ul { display: flex; gap: 6px; }
.main-nav a {
  display: block;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 15px;
  color: var(--text-sub);
  transition: all 0.2s;
}
.main-nav a:hover, .main-nav a.active { color: var(--primary); background: var(--gradient-soft); font-weight: 600; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  padding: 0 9px;
}
.nav-toggle span { display: block; height: 2px; background: var(--text); border-radius: 2px; transition: all 0.25s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero 搜索区 ---------- */
.hero {
  background: var(--gradient);
  padding: 64px 0 88px;
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.hero::before, .hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}
.hero::before { width: 320px; height: 320px; top: -140px; right: -80px; }
.hero::after { width: 220px; height: 220px; bottom: -110px; left: -60px; }
.hero h1 { font-size: 34px; margin-bottom: 10px; position: relative; z-index: 1; }
.hero p { font-size: 15px; opacity: 0.88; margin-bottom: 30px; position: relative; z-index: 1; }

.search-box {
  position: relative;
  z-index: 1;
  max-width: 620px;
  margin: 0 auto;
  display: flex;
  background: #fff;
  border-radius: 999px;
  padding: 6px;
  box-shadow: 0 12px 32px rgba(31, 45, 120, 0.25);
}
.search-box input {
  flex: 1;
  border: none;
  outline: none;
  padding: 12px 22px;
  font-size: 16px;
  background: transparent;
  color: var(--text);
}
.search-box button {
  border: none;
  background: var(--gradient);
  color: #fff;
  font-size: 15px;
  padding: 12px 32px;
  border-radius: 999px;
  cursor: pointer;
  transition: opacity 0.2s;
}
.search-box button:hover { opacity: 0.88; }

.hot-words {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}
.hot-words a {
  font-size: 13px;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  transition: background 0.2s;
}
.hot-words a:hover { background: rgba(255, 255, 255, 0.3); }

/* ---------- 热门推荐 ---------- */
.section { padding: 44px 0 8px; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
}
.section-head h2 { font-size: 22px; }
.section-head h2::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 20px;
  border-radius: 3px;
  background: var(--gradient);
  margin-right: 10px;
  vertical-align: -3px;
}
.section-head .more { font-size: 14px; color: var(--text-sub); }
.section-head .more:hover { color: var(--primary); }

.hot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}
.hot-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  border: 1px solid transparent;
  transition: all 0.25s;
}
.hot-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: rgba(79, 110, 247, 0.35); }
.hot-rank {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  background: var(--gradient);
}
.hot-card:nth-child(2) .hot-rank { background: linear-gradient(135deg, #ff9a56, #ff6a88); }
.hot-card:nth-child(3) .hot-rank { background: linear-gradient(135deg, #f7b733, #fc4a1a); }
.hot-card h3 { font-size: 15px; }
.hot-card p { font-size: 12px; color: var(--text-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }

/* ---------- 分类网址区块 ---------- */
.cat-section { padding: 30px 0 8px; }
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.site-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 13px;
  align-items: flex-start;
  transition: all 0.25s;
  border: 1px solid transparent;
}
.site-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: rgba(79, 110, 247, 0.35); }
.site-icon {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--gradient-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  position: relative;
  overflow: hidden;
}
/* logo 图覆盖在首字母上方，加载失败隐藏后露出首字母 */
.site-fav {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
/* 热门卡片标题前的小 logo */
.hot-fav {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  vertical-align: -3px;
  margin-right: 6px;
  object-fit: cover;
}
.site-card h3 { font-size: 15px; margin-bottom: 3px; display: flex; align-items: center; gap: 6px; }
.site-card .tag {
  font-size: 10px;
  color: #ff5b7f;
  border: 1px solid #ffd2dc;
  background: #fff1f4;
  border-radius: 4px;
  padding: 0 5px;
  line-height: 16px;
  font-weight: 400;
}
.site-card p {
  font-size: 13px;
  color: var(--text-sub);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- 列表页布局 ---------- */
.page-banner {
  background: var(--gradient-soft);
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
}
.breadcrumb { font-size: 13px; color: var(--text-sub); margin-bottom: 4px; }
.breadcrumb a:hover { color: var(--primary); }
.page-banner h1 { font-size: 24px; }
.page-banner .sub { font-size: 14px; color: var(--text-sub); margin-top: 2px; }

.list-layout {
  display: flex;
  gap: 24px;
  padding: 28px 0 60px;
  align-items: flex-start;
}
.side-cats {
  width: 220px;
  flex-shrink: 0;
  position: sticky;
  top: 84px;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}
.side-cats .side-title { font-size: 13px; color: var(--text-sub); padding: 6px 12px 10px; letter-spacing: 1px; }
.side-cats a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 15px;
  color: var(--text-sub);
  margin-bottom: 2px;
  transition: all 0.2s;
}
.side-cats a:hover { background: var(--gradient-soft); color: var(--primary); }
.side-cats a.active { background: var(--gradient); color: #fff; font-weight: 600; }
.side-cats .count { margin-left: auto; font-size: 12px; opacity: 0.75; }

.list-main { flex: 1; min-width: 0; }
.result-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--text-sub);
}
.empty-tip {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 60px 20px;
  text-align: center;
  color: var(--text-sub);
  box-shadow: var(--shadow);
}
.empty-tip .icon { font-size: 44px; margin-bottom: 12px; }

/* ---------- 页脚 ---------- */
.site-footer {
  background: #1f2333;
  color: #9aa1b5;
  padding: 28px 0;
  text-align: center;
  font-size: 13px;
  margin-top: 40px;
}
.site-footer a { color: #c3c9db; }
.site-footer a:hover { color: #fff; }

/* ---------- 返回顶部 ---------- */
.back-top {
  position: fixed;
  right: 24px;
  bottom: 32px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--gradient);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  box-shadow: var(--shadow-hover);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  z-index: 90;
}
.back-top.show { opacity: 1; visibility: visible; }

/* ============================================
   响应式：平板 & 手机
   ============================================ */
@media (max-width: 900px) {
  .list-layout { flex-direction: column; }
  .side-cats {
    width: 100%;
    position: static;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 10px;
    gap: 4px;
    -webkit-overflow-scrolling: touch;
  }
  .side-cats .side-title { display: none; }
  .side-cats a { flex-shrink: 0; margin-bottom: 0; }
  .side-cats .count { display: none; }
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .main-nav {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  .main-nav.open { max-height: 420px; box-shadow: 0 16px 24px rgba(0,0,0,0.06); }
  .main-nav ul { flex-direction: column; gap: 0; padding: 10px 16px; }
  .main-nav a { padding: 12px; font-size: 16px; }

  .hero { padding: 44px 0 64px; }
  .hero h1 { font-size: 25px; }
  .hero p { font-size: 14px; margin-bottom: 22px; }
  .search-box { margin: 0 20px; }
  .search-box input { padding: 11px 16px; font-size: 15px; }
  .search-box button { padding: 11px 22px; }
  .hot-words { padding: 0 20px; }

  .section, .cat-section { padding: 30px 0 4px; }
  .section-head h2 { font-size: 19px; }
  .hot-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .hot-card { padding: 12px; gap: 10px; }
  .hot-card p { display: none; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .site-card { padding: 14px; gap: 10px; }
  .site-icon { width: 40px; height: 40px; font-size: 19px; }
  .site-card p { -webkit-line-clamp: 1; line-clamp: 1; font-size: 12px; }

  .page-banner { padding: 20px 0; }
  .page-banner h1 { font-size: 20px; }
  .list-layout { padding: 18px 0 40px; }
  .back-top { right: 16px; bottom: 24px; }
}

@media (max-width: 420px) {
  .hot-grid { grid-template-columns: 1fr; }
  .hot-card p { display: block; }
}
