/* ==========================================================================
   导航站 前台样式 —— 清爽分类卡片式（浅色）
   ========================================================================== */

:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eaf1ff;
  --text: #1f2937;
  --text-2: #6b7280;
  --text-3: #9aa3af;
  --border: #e8ecf1;
  --border-2: #dfe4ea;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, .06);
  --shadow: 0 4px 14px rgba(16, 24, 40, .08);
  --shadow-lg: 0 10px 28px rgba(16, 24, 40, .12);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

a { color: var(--text); text-decoration: none; }
a:hover { color: var(--primary); }
img { max-width: 100%; vertical-align: middle; border: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }

.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px; }

/* ---------------------------------------------------------------- 顶部导航 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 60px;
}
.logo { display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
.logo img { width: 32px; height: 32px; border-radius: 8px; }
.logo-text {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: .5px;
  color: var(--text);
  white-space: nowrap;
}
.logo-text span { color: var(--primary); }

.topbar-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.topbar-nav a {
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--text-2);
  transition: all .18s;
  white-space: nowrap;
}
.topbar-nav a:hover { background: var(--primary-soft); color: var(--primary); }
.topbar-nav a.on { background: var(--primary); color: #fff; }
.topbar-nav a.btn-apply {
  background: var(--primary);
  color: #fff;
  font-weight: 500;
}
.topbar-nav a.btn-apply:hover { background: var(--primary-dark); color: #fff; }

.btn-menu {
  display: none;
  margin-left: auto;
  width: 38px;
  height: 34px;
  border: 1px solid var(--border-2);
  background: #fff;
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0;
}
.btn-menu i {
  display: block;
  width: 16px;
  height: 2px;
  margin: 3px auto;
  background: var(--text-2);
  border-radius: 2px;
}

/* ------------------------------------------------------------------ 搜索区 */
.hero { background: linear-gradient(180deg, #fafbfe 0%, var(--bg) 100%); padding: 34px 0 30px; }
.hero-title { text-align: center; font-size: 26px; font-weight: 700; letter-spacing: .5px; }
.hero-sub { text-align: center; color: var(--text-3); font-size: 13px; margin-top: 6px; }

/* 内页紧凑版搜索区 */
.hero-sm { padding: 16px 0 14px; }
.hero-sm .hero-title,
.hero-sm .hero-sub { display: none; }
.hero-sm .searchbox { margin-top: 0; }
.hero-sm .hot-words { display: none; }
.hero-sm .search-tabs { margin-bottom: 8px; }

.searchbox { max-width: 660px; margin: 20px auto 0; }
.search-tabs { display: flex; justify-content: center; gap: 8px; margin-bottom: 12px; }
.search-tabs button {
  border: 1px solid var(--border-2);
  background: #fff;
  color: var(--text-2);
  padding: 5px 16px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  transition: all .18s;
}
.search-tabs button.on {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.search-form {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid var(--border-2);
  border-radius: 999px;
  padding: 5px 5px 5px 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, border-color .2s;
}
.search-form:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.search-form input {
  flex: 1;
  border: 0;
  outline: 0;
  font-size: 15px;
  height: 40px;
  background: transparent;
  color: var(--text);
  min-width: 0;
}
.search-form input::placeholder { color: var(--text-3); }
.search-form button {
  flex-shrink: 0;
  height: 40px;
  padding: 0 26px;
  border: 0;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  transition: background .18s;
}
.search-form button:hover { background: var(--primary-dark); }

.hot-words {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-2);
}
.hot-words a {
  padding: 3px 11px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-2);
}
.hot-words a:hover { color: var(--primary); border-color: var(--primary); }

/* -------------------------------------------------------------- 分类导航条 */
.catbar {
  position: sticky;
  top: 60px;
  z-index: 50;
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.catbar-inner {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 0;
  scrollbar-width: none;
}
.catbar-inner::-webkit-scrollbar { display: none; }
.catbar-inner a {
  flex: 0 0 auto;
  padding: 6px 15px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--text-2);
  white-space: nowrap;
  transition: all .18s;
}
.catbar-inner a:hover { background: var(--primary-soft); color: var(--primary); }
.catbar-inner a.on { background: var(--primary); color: #fff; font-weight: 500; }

/* ------------------------------------------------------------------- 布局 */
.main-wrap { display: flex; gap: 20px; padding: 22px 0 40px; align-items: flex-start; }
.main { flex: 1; min-width: 0; }
.side { width: 290px; flex-shrink: 0; }

/* ------------------------------------------------------------- 分类区块 */
.block {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
  overflow: hidden;
}
.block-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.block-head .bar {
  width: 4px;
  height: 17px;
  border-radius: 3px;
  background: var(--primary);
  flex-shrink: 0;
}
.block-head h2 { font-size: 17px; }
.block-head .count { font-size: 12px; color: var(--text-3); font-weight: 400; }
.block-head .more { margin-left: auto; font-size: 13px; color: var(--text-3); }
.block-head .more:hover { color: var(--primary); }

.subcat { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 18px 0; }
.subcat a {
  font-size: 13px;
  color: var(--text-2);
  background: var(--bg);
  border-radius: 999px;
  padding: 3px 12px;
}
.subcat a:hover { background: var(--primary-soft); color: var(--primary); }

.sites {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 14px 18px 18px;
}
.site-card {
  display: flex;
  gap: 11px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  transition: transform .18s, box-shadow .18s, border-color .18s;
  min-width: 0;
}
.site-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: rgba(37, 99, 235, .35);
}
.site-logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  flex-shrink: 0;
  object-fit: cover;
  background: var(--bg);
  border: 1px solid var(--border);
}
.site-logo-fallback {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #4f8bf9, #2563eb);
}
.site-body { min-width: 0; flex: 1; }
.site-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 5px;
}
.site-name .tag-top {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 500;
  color: #e8590c;
  background: #fff3e6;
  border-radius: 4px;
  padding: 0 4px;
  line-height: 16px;
}
.site-desc {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 4px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 36px;
}

.block-empty { padding: 24px; text-align: center; color: var(--text-3); font-size: 13px; }

/* ------------------------------------------------------------- 侧栏模块 */
.widget {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
  overflow: hidden;
}
.widget-head {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
}
.widget-head .bar { width: 4px; height: 15px; border-radius: 3px; background: var(--primary); margin-right: 8px; }
.widget-body { padding: 10px 16px 14px; }

.rank-list li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.rank-list li:last-child { border-bottom: 0; }
.rank-no {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  background: var(--bg);
  color: var(--text-3);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 600;
}
.rank-list li:nth-child(1) .rank-no { background: #e03131; color: #fff; }
.rank-list li:nth-child(2) .rank-no { background: #f76707; color: #fff; }
.rank-list li:nth-child(3) .rank-no { background: #f59f00; color: #fff; }
.rank-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.rank-hits { font-size: 12px; color: var(--text-3); flex-shrink: 0; }

.notice { font-size: 13px; color: var(--text-2); line-height: 1.8; }

.ad-box { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-sm); margin-bottom: 16px; overflow: hidden; }
.ad-box img { display: block; width: 100%; }
.ad-text { padding: 10px 14px; font-size: 13px; line-height: 1.9; }
.ad-text a { color: var(--text-2); }
.ad-text a:hover { color: var(--primary); }

/* ----------------------------------------------------------------- 分页 */
.pager { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; padding: 18px 0 4px; }
.pager a, .pager span {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-2);
}
.pager a:hover { border-color: var(--primary); color: var(--primary); }
.pager .current, .pager span.current {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ------------------------------------------------------------ 面包屑/标题 */
.crumb { font-size: 13px; color: var(--text-3); padding: 16px 0 10px; }
.crumb a { color: var(--text-2); }
.page-title { font-size: 20px; font-weight: 600; padding: 4px 0 14px; }
.page-title small { font-size: 13px; color: var(--text-3); font-weight: 400; margin-left: 8px; }

/* ---------------------------------------------------------------- 详情页 */
.detail-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 26px; }
.detail-head { display: flex; gap: 18px; align-items: flex-start; }
.detail-head img { width: 68px; height: 68px; border-radius: 14px; background: var(--bg); }
.detail-head h1 { font-size: 21px; }
.detail-meta { color: var(--text-3); font-size: 13px; margin-top: 6px; }
.detail-desc { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); line-height: 1.9; color: var(--text-2); }
.detail-actions { margin-top: 22px; display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  display: inline-block;
  padding: 9px 22px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  transition: background .18s;
}
.btn:hover { background: var(--primary-dark); color: #fff; }
.btn-ghost { background: #fff; color: var(--text-2); border: 1px solid var(--border-2); }
.btn-ghost:hover { background: var(--bg); color: var(--primary); }

/* ---------------------------------------------------------------- 表单 */
.form-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 26px; }
.form-tip {
  background: var(--primary-soft);
  border-left: 3px solid var(--primary);
  color: var(--text-2);
  font-size: 13px;
  padding: 12px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 20px;
  line-height: 1.8;
}
.form-item { margin-bottom: 16px; }
.form-item label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.form-item label i { color: #e03131; font-style: normal; margin-right: 3px; }
.form-item input[type=text], .form-item input[type=url], .form-item input[type=email],
.form-item select, .form-item textarea {
  width: 100%;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  outline: 0;
  transition: border-color .18s, box-shadow .18s;
  font-family: inherit;
}
.form-item input:focus, .form-item select:focus, .form-item textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}
.form-item textarea { resize: vertical; min-height: 88px; }
.form-inline { display: flex; gap: 10px; }
.form-inline input { flex: 1; }
.form-inline img { height: 40px; border-radius: var(--radius-sm); cursor: pointer; border: 1px solid var(--border-2); }
.form-submit { margin-top: 6px; }
.form-submit button {
  border: 0;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  padding: 11px 34px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .18s;
}
.form-submit button:hover { background: var(--primary-dark); }

/* ---------------------------------------------------------------- 单页 */
.article { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 28px; }
.article h1 { font-size: 21px; margin-bottom: 16px; }
.article .content { line-height: 2; color: var(--text-2); font-size: 14px; }
.article .content p { margin: 0 0 12px; }
.article .content img { max-width: 100%; }

/* ---------------------------------------------------------------- 底部 */
.footer { background: #fff; border-top: 1px solid var(--border); margin-top: 20px; padding: 30px 0 22px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 16px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.footer-links a { font-size: 13px; color: var(--text-2); }
.footer-links a:hover { color: var(--primary); }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 16px 0; font-size: 13px; }
.footer-nav a { color: var(--text-2); }
.footer-copy { color: var(--text-3); font-size: 12px; line-height: 1.9; }
.footer-copy a { color: var(--text-3); }

/* ---------------------------------------------------------------- 其他 */
.empty { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 60px 20px; text-align: center; color: var(--text-3); }
.empty-icon { font-size: 42px; margin-bottom: 10px; opacity: .35; }

.to-top {
  position: fixed;
  right: 22px;
  bottom: 26px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--border-2);
  box-shadow: var(--shadow);
  color: var(--text-2);
  font-size: 18px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 80;
}
.to-top.show { display: flex; }
.to-top:hover { color: var(--primary); border-color: var(--primary); }

.alert {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 14px;
  display: none;
}
.alert.show { display: block; }
.alert-error { background: #fff0f0; color: #c92a2a; border: 1px solid #ffd7d7; }
.alert-ok { background: #ebfbee; color: #2b8a3e; border: 1px solid #c3f0ca; }

/* ---------------------------------------------------------------- 响应式 */
@media (max-width: 1100px) {
  .sites { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .main-wrap { flex-direction: column; }
  .side { width: 100%; }
  .sites { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  .topbar-inner { height: 54px; }
  .logo-text { font-size: 17px; }
  .topbar-nav {
    display: none;
    position: absolute;
    top: 54px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 8px;
  }
  .topbar-nav.open { display: flex; }
  .topbar-nav a { border-radius: var(--radius-sm); padding: 10px 14px; text-align: left; }
  .btn-menu { display: block; }
  .catbar { top: 54px; }
  .hero { padding: 22px 0 20px; }
  .hero-title { font-size: 20px; }
  .search-form { padding-left: 16px; }
  .search-form input { font-size: 14px; height: 38px; }
  .search-form button { height: 38px; padding: 0 18px; font-size: 14px; }
  .sites { grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 12px; }
  .block-head { padding: 12px 14px; }
  .subcat { padding: 10px 14px 0; }
  .site-desc { -webkit-line-clamp: 1; min-height: 18px; }
  .detail-card, .form-card, .article { padding: 18px; }
  .detail-head img { width: 54px; height: 54px; }
  .to-top { right: 12px; bottom: 16px; }
}
@media (max-width: 420px) {
  .sites { grid-template-columns: 1fr; }
  .hero-title { font-size: 18px; }
}
