/* =====================================================
   现代网站导航 · 前台样式
   设计基调：克制、留白、清晰层级、轻快
   ===================================================== */

/* ---------- 设计变量 ---------- */
:root {
  --primary: #2563eb;
  --primary-text: #ffffff;
  --primary-weak: rgba(37, 99, 235, 0.08);
  --primary-weak-2: rgba(37, 99, 235, 0.14);

  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --border: #e7e9ee;
  --border-strong: #d9dce3;

  --text: #17181c;
  --text-2: #5c6068;
  --text-3: #9a9fab;

  --ok: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(23, 24, 28, 0.04);
  --shadow-md: 0 10px 28px rgba(23, 24, 28, 0.09);
  --shadow-pop: 0 16px 40px rgba(23, 24, 28, 0.14);

  --container: 1180px;
  --header-h: 62px;

  --pin-line: var(--primary);
  --pin-main: var(--primary);
  --pin-bg: var(--primary-weak);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

html[data-theme="dark"] {
  --bg: #101114;
  --surface: #1a1c21;
  --surface-2: #20232a;
  --border: #2a2e37;
  --border-strong: #383d49;
  --text: #ecedef;
  --text-2: #a4a8b3;
  --text-3: #6b7180;
  --primary-weak: rgba(37, 99, 235, 0.16);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.4);
  --shadow-pop: 0 16px 40px rgba(0, 0, 0, 0.55);
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 22px; height: var(--header-h); }

.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 60%, #7c3aed));
  color: #fff; font-weight: 700; font-size: 17px;
  box-shadow: var(--shadow-sm);
}
.brand-mark.small { width: 28px; height: 28px; font-size: 14px; border-radius: 8px; }
.brand-logo { width: 34px; height: 34px; border-radius: 9px; object-fit: cover; }
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: 0.2px; }

.main-nav { display: flex; align-items: center; gap: 4px; flex: none; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a {
  padding: 7px 13px; border-radius: 8px;
  font-size: 14.5px; color: var(--text-2); white-space: nowrap;
  transition: color .15s, background-color .15s;
}
.main-nav a:hover { color: var(--text); background: var(--surface-2); }
.main-nav a.active { color: var(--primary); background: var(--primary-weak); font-weight: 600; }
/* 导航内的提交按钮不受链接样式覆盖 */
.main-nav a.btn { padding: 9px 16px; margin-left: 6px; }
.main-nav a.btn:hover, .main-nav a.btn.active { color: #fff; background: var(--primary); }

/* ---------- 顶部导航内搜索框（左侧主搜索位） ---------- */
.header-search {
  display: flex; align-items: center; gap: 8px;
  flex: 1; max-width: 520px; min-width: 150px; margin: 0 10px 0 16px;
  height: 36px; padding: 0 14px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.header-search:focus-within {
  border-color: var(--primary); background: var(--surface);
  box-shadow: 0 0 0 4px var(--primary-weak-2);
}
.header-search svg { color: var(--text-3); flex: none; }
.header-search input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font-size: 13.5px; color: var(--text); font-family: inherit;
}
.header-search input::placeholder { color: var(--text-3); }

/* 顶部公告条 */
.announcement-bar {
  background: var(--primary-weak);
  border-bottom: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border));
}
.announcement-inner {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 20px; font-size: 13.5px;
}
.announcement-inner svg { flex: none; color: var(--primary); }
.announcement-label { flex: none; font-weight: 700; color: var(--primary); letter-spacing: 1px; }
.announcement-text {
  flex: 1; min-width: 0; color: var(--text-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
@media (max-width: 640px) {
  .announcement-inner { padding: 7px 16px; font-size: 12.5px; gap: 7px; }
  .announcement-label { display: none; }
}

.header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: border-color .15s, color .15s;
}
.icon-btn:hover { border-color: var(--border-strong); color: var(--text); }
.ico-moon { display: none; }
html[data-theme="dark"] .ico-sun { display: none; }
html[data-theme="dark"] .ico-moon { display: block; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 9px; border: 1px solid transparent; cursor: pointer;
  font-size: 14.5px; font-weight: 600; padding: 9px 18px; line-height: 1.4;
  transition: transform .12s, box-shadow .15s, background-color .15s, border-color .15s;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--primary); color: var(--primary-text);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}
.btn-primary:hover { box-shadow: 0 4px 14px rgba(37, 99, 235, 0.32); }
.btn-outline { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.burger { display: none; }

/* ---------- 广告位 ---------- */
.ad-area { padding: 18px 0 0; }
.ad-slot {
  margin: 0 auto; max-width: var(--container);
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--surface-2); overflow: hidden; position: relative;
  padding: 16px 16px 14px; text-align: center;
}
.ad-slot::after {
  content: "AD"; position: absolute; right: 8px; top: 6px;
  font-size: 10px; letter-spacing: 1px; color: var(--text-3); opacity: .7;
}
/* 图片广告：方形头像 + 下方标题（电脑 12 个/行，手机 4 个/行） */
.ad-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px 10px;
}
.ad-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  min-width: 0; text-decoration: none;
}
.ad-item-img {
  width: 100%; aspect-ratio: 1 / 1;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14%; overflow: hidden; transition: border-color .18s, box-shadow .18s;
}
.ad-item-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ad-item-name {
  max-width: 100%; font-size: 13px; line-height: 1.3; color: var(--text-2);
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; transition: color .18s;
}
a.ad-item:hover .ad-item-img { border-color: var(--primary); box-shadow: 0 4px 12px rgba(37, 99, 235, 0.14); }
a.ad-item:hover .ad-item-name { color: var(--primary); }
/* 文字广告：紧凑文字链接（电脑 9 个/行，手机 4 个/行） */
.ad-text-row {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 10px;
}
.ad-text {
  display: block; font-size: 14px; font-weight: 500; color: var(--text-2);
  padding: 8px 6px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  transition: color .18s, border-color .18s;
}
.ad-text:hover { color: var(--primary); border-color: var(--primary); }
/* HTML 自定义广告 */
.ad-html { margin-top: 12px; }
.ad-html:first-child { margin-top: 0; }
.ad-html img { max-height: 90px; margin: 0 auto; border-radius: 6px; }
.ad-grid + .ad-text-row, .ad-grid + .ad-html, .ad-html + .ad-text-row { margin-top: 14px; }
.section .ad-slot { margin-top: 22px; }

/* ---------- 搜索区 ---------- */
.hero-search { padding: 44px 0 34px; text-align: center; }
.hero-search.compact { padding: 28px 0 6px; }
.search-box {
  display: flex; align-items: center; gap: 4px;
  max-width: 620px; margin: 0 auto;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 14px; padding: 6px 6px 6px 16px;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s;
}
.search-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-weak-2); }
.search-box svg { color: var(--text-3); flex-shrink: 0; }
.search-box input {
  flex: 1; border: 0; outline: 0; background: transparent;
  font-size: 15.5px; color: var(--text); padding: 10px 8px; min-width: 0;
  font-family: inherit;
}
.search-box input::placeholder { color: var(--text-3); }
.search-box button {
  border: 0; border-radius: 10px; padding: 10px 22px;
  background: var(--primary); color: var(--primary-text);
  font-size: 14.5px; font-weight: 600; cursor: pointer;
  transition: opacity .15s;
}
.search-box button:hover { opacity: .9; }

/* ---------- 通用区块 ---------- */
.section { padding: 18px 0; }
.section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.section-title { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 700; margin: 0; letter-spacing: .2px; }
.title-accent { width: 4px; height: 18px; border-radius: 2px; background: var(--primary); display: inline-block; }
.count-badge {
  font-size: 12.5px; color: var(--text-3); background: var(--surface);
  border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px;
}
.more-link { margin-left: auto; font-size: 13.5px; color: var(--text-3); transition: color .15s; }
.more-link:hover { color: var(--primary); }
.cat-desc { margin: -6px 0 14px; color: var(--text-3); font-size: 13.5px; }

/* ---------- 置顶卡片 ---------- */
.pin-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
.pin-card {
  position: relative; display: block;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s;
}
.pin-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--pin-main) 45%, var(--border)); }
.pin-topline { display: block; height: 3px; width: 100%; background: var(--pin-line); }
.pin-card[style*="--pin-line"] .pin-topline { opacity: .95; }
.pin-body { padding: 14px 16px 15px; background: linear-gradient(var(--surface), var(--pin-bg, var(--surface))); }
.pin-head { display: flex; align-items: center; gap: 11px; }
.pin-title-wrap { flex: 1; min-width: 0; }
.pin-name { display: block; font-weight: 700; font-size: 15px; color: var(--pin-main); }
.pin-domain { display: block; font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pin-tag {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 7px;
  background: var(--pin-bg, var(--primary-weak)); color: var(--pin-main);
  font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}
.pin-desc {
  margin: 10px 0 0; font-size: 13px; color: var(--text-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ---------- 站点卡片 ---------- */
.site-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.site-card {
  display: block; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 15px 16px; box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s;
}
.site-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.site-card.is-featured { border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); }
/* 栏目置顶站点卡片：左侧色条 + 名称高亮 + "顶"角标（红 / 红橙渐变） */
.site-card.cat-pinned { position: relative; }
.site-card.cat-pinned::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  border-radius: var(--radius) 0 0 var(--radius);
}
.site-card.cat-pinned.red::before { background: #ef4444; }
.site-card.cat-pinned.gradient::before { background: linear-gradient(180deg, #ef4444, #f97316); }
.site-card.cat-pinned.red .site-name { color: #ef4444; }
.site-card.cat-pinned.gradient .site-name {
  background: linear-gradient(90deg, #ef4444, #f97316);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.cat-pin-tag {
  position: absolute; right: 10px; top: 10px; z-index: 1;
  font-size: 11px; font-weight: 600; line-height: 1; padding: 3px 6px;
  border-radius: 6px; color: #fff; pointer-events: none;
}
.site-card.cat-pinned.red .cat-pin-tag { background: #ef4444; }
.site-card.cat-pinned.gradient .cat-pin-tag { background: linear-gradient(135deg, #ef4444, #f97316); }
html[data-theme="dark"] .site-card.cat-pinned.red .site-name { color: #f87171; }
html[data-theme="dark"] .site-card.cat-pinned.red::before { background: #f87171; }
html[data-theme="dark"] .site-card.cat-pinned.gradient .site-name { background: linear-gradient(90deg, #f87171, #fb923c); -webkit-background-clip: text; background-clip: text; }
html[data-theme="dark"] .site-card.cat-pinned.gradient::before { background: linear-gradient(180deg, #f87171, #fb923c); }
html[data-theme="dark"] .site-card.cat-pinned.red .cat-pin-tag { background: #ef4444; }
html[data-theme="dark"] .site-card.cat-pinned.gradient .cat-pin-tag { background: linear-gradient(135deg, #ef4444, #f97316); }
.site-card-head { display: flex; align-items: center; gap: 10px; }
.site-title-wrap { flex: 1; min-width: 0; }
.site-name { display: block; font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-card.is-featured .site-name { color: var(--primary); }
.site-domain { display: block; font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.featured-dot { color: #f59e0b; font-size: 13px; flex-shrink: 0; }
.site-desc {
  margin: 9px 0 0; font-size: 12.8px; color: var(--text-3); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* 站点头像 */
.site-ava-img { border-radius: 9px; object-fit: cover; flex-shrink: 0; background: var(--surface-2); }
.site-ava-letter {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  border-radius: 9px; background: linear-gradient(135deg, var(--primary-weak-2), var(--primary-weak));
  color: var(--primary); font-weight: 700; font-size: 16px;
}
.pin-head .site-ava-letter { font-size: 18px; }
.empty-hint { grid-column: 1 / -1; color: var(--text-3); font-size: 13.5px; margin: 6px 2px; }

/* ---------- 友情链接 ---------- */
.friend-section { padding-bottom: 8px; }
.friend-links { display: flex; flex-wrap: wrap; gap: 8px 6px; }
.friend-links a {
  font-size: 13.5px; color: var(--text-2); background: var(--surface);
  border: 1px solid var(--border); border-radius: 999px; padding: 5px 14px;
  transition: color .15s, border-color .15s;
}
.friend-links a:hover { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); }

/* ---------- 联系我们横带 ---------- */
.contact-band {
  text-align: center; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 34px 24px; margin-bottom: 10px;
}
.contact-band h2 { margin: 0 0 8px; font-size: 19px; }
.contact-band p { margin: 0 0 16px; color: var(--text-3); font-size: 14px; }

/* ---------- 面包屑 / 页头 ---------- */
.breadcrumb { display: flex; align-items: center; gap: 8px; padding: 20px 0 4px; font-size: 13px; color: var(--text-3); flex-wrap: wrap; }
.breadcrumb a:hover { color: var(--primary); }
.page-head { padding: 14px 0 20px; }
.page-head.center { text-align: center; }
.page-head h1 { margin: 0 0 6px; font-size: 24px; letter-spacing: .2px; }
.page-head .page-desc { margin: 0 0 10px; color: var(--text-2); font-size: 14px; }
.result-meta { color: var(--text-2); font-size: 14px; margin: 4px 0 16px; }
.result-meta strong { color: var(--text); }

/* ---------- 详情页 ---------- */
.detail-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px 28px; box-shadow: var(--shadow-sm);
}
.detail-head { display: flex; align-items: center; gap: 18px; }
.detail-head .site-ava-letter { width: 64px !important; height: 64px !important; font-size: 26px !important; }
.detail-info { flex: 1; min-width: 0; }
.detail-info h1 { margin: 0 0 2px; font-size: 22px; }
.detail-info .site-domain { display: inline-block; margin: 0 0 8px; }
.cat-chip {
  display: inline-block; font-size: 12.5px; color: var(--primary);
  background: var(--primary-weak); border-radius: 999px; padding: 3px 12px;
}
.detail-desc { margin: 18px 0 0; color: var(--text-2); font-size: 14.5px; }
.detail-desc.muted { color: var(--text-3); }
.detail-meta { display: flex; gap: 20px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); color: var(--text-3); font-size: 13px; flex-wrap: wrap; }

/* ---------- 表单（提交页） ---------- */
.submit-wrap { max-width: 640px; margin: 0 auto 40px; }
.rules-card {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm); padding: 18px 20px; margin-bottom: 26px;
}
.rules-card h2 { margin: 0 0 8px; font-size: 15.5px; }
.rules-body { font-size: 14px; color: var(--text-2); }
.submit-form {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px 28px; box-shadow: var(--shadow-sm);
}
.form-row { margin-bottom: 18px; }
.form-row label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 7px; }
.form-row label em { color: var(--danger); font-style: normal; }
.form-row label .opt { font-weight: 400; color: var(--text-3); font-size: 12.5px; margin-left: 4px; }
.form-row input, .form-row select {
  width: 100%; padding: 11px 13px; font-size: 14.5px; font-family: inherit;
  color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border-strong); border-radius: 9px; outline: 0;
  transition: border-color .15s, box-shadow .15s;
}
.form-row input:focus, .form-row select:focus {
  border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-weak-2); background: var(--surface);
}
.hint { margin: 6px 0 0; font-size: 12.5px; color: var(--text-3); }
.field-error { margin: 6px 0 0; font-size: 12.5px; color: var(--danger); display: none; }
.field-error.show { display: block; }
.form-actions { display: flex; gap: 12px; margin-top: 24px; }
.form-actions .btn { flex: 0 0 auto; min-width: 120px; }
#submitBtn[disabled], #checkBtn[disabled] { opacity: .55; cursor: not-allowed; }
.form-msg {
  margin-top: 18px; padding: 13px 16px; border-radius: 9px; font-size: 14px;
  border: 1px solid transparent; line-height: 1.6; word-break: break-all;
}
.form-msg.ok { background: rgba(22, 163, 74, 0.08); border-color: rgba(22, 163, 74, 0.3); color: var(--ok); }
.form-msg.err { background: rgba(220, 38, 38, 0.07); border-color: rgba(220, 38, 38, 0.28); color: var(--danger); }
.form-msg.info { background: var(--primary-weak); border-color: var(--primary-weak-2); color: var(--primary); }
.hp-field { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }

/* ---------- 联系页 ---------- */
.contact-page { max-width: 760px; }
.contact-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px 32px; box-shadow: var(--shadow-sm);
  font-size: 15px; line-height: 1.9; margin-bottom: 40px;
}
.contact-card p { margin: 0 0 8px; }
.contact-card strong { color: var(--text); }

/* ---------- 空状态 / 404 ---------- */
.empty-state { text-align: center; padding: 70px 20px 90px; color: var(--text-3); }
.empty-state p { margin: 0 0 18px; font-size: 15px; }
.empty-state.nf { padding: 90px 20px 110px; }
.nf-code { font-size: 64px; font-weight: 800; letter-spacing: 4px; color: var(--border-strong); margin: 0 0 10px !important; }

/* ---------- 分页 ---------- */
.pagination { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 30px 0 10px; }
.pagination a, .pagination .ellipsis {
  min-width: 36px; height: 36px; padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 9px;
  background: var(--surface); color: var(--text-2); font-size: 13.5px;
  transition: border-color .15s, color .15s;
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination a.active { background: var(--primary); border-color: var(--primary); color: var(--primary-text); font-weight: 600; }
.pagination .ellipsis { border: 0; background: transparent; }

/* ---------- 页脚 ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); margin-top: 30px; }
.footer-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 26px 0 20px; gap: 20px; flex-wrap: wrap;
}
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-name { font-weight: 700; font-size: 15px; }
.footer-sub { font-size: 12.5px; color: var(--text-3); }
.footer-links { display: flex; gap: 22px; font-size: 13.5px; }
.footer-links a { color: var(--text-2); transition: color .15s; }
.footer-links a:hover { color: var(--primary); }
.footer-bottom {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 0 22px; border-top: 1px solid var(--border);
  font-size: 12.5px; color: var(--text-3);
}
.footer-bottom a:hover { color: var(--text-2); }

/* ---------- 主区域 ---------- */
.site-main { min-height: 55vh; }

/* ---------- 动画偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}

/* =====================================================
   移动端适配（重新设计布局，而非缩小 PC 版）
   ===================================================== */
@media (max-width: 1080px) {
  .pin-grid, .site-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
  .container { padding: 0 16px; }

  /* 导航：汉堡菜单 */
  .burger { display: inline-flex; }
  .main-nav {
    display: none; position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 10px 16px 14px; box-shadow: var(--shadow-md);
    overflow: visible;
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px 14px; font-size: 15px; border-radius: 10px; }

  /* 顶栏：搜索框保留在导航内，站名隐藏留空间 */
  .brand-name { display: none; }
  .header-search { margin: 0 8px; min-width: 110px; }
  .header-actions { margin-left: 0; }
  .main-nav a.btn { margin: 6px 0 2px; padding: 11px 14px; font-size: 14px; justify-content: center; text-align: center; border-radius: 10px; }

  /* 搜索 */
  .hero-search { padding: 30px 0 24px; }
  .search-box { padding: 5px 5px 5px 13px; }
  .search-box button { padding: 9px 16px; }

  /* 网格：两列 */
  .pin-grid, .site-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .pin-card { padding: 0; }
  .pin-body { padding: 11px 12px 12px; }
  .pin-head { gap: 9px; }
  .site-card { padding: 12px 13px; }
  .site-card-head { gap: 9px; }

  .section { padding: 14px 0; }
  .section-title { font-size: 17px; }

  /* 详情页 */
  .detail-card { padding: 20px 18px; }
  .detail-head { flex-wrap: wrap; gap: 14px; }
  .btn-visit { width: 100%; }
  .detail-meta { gap: 12px 20px; }

  /* 提交表单 */
  .submit-form { padding: 20px 18px; }
  .form-actions { flex-direction: column; }
  .form-actions .btn { width: 100%; }

  /* 广告：图片 4 个/行，文字 4 个/行 */
  .ad-slot { padding: 12px 12px 11px; }
  .ad-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 10px; }
  .ad-item { gap: 5px; }
  .ad-item-name { font-size: 12px; }
  .ad-text-row { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .ad-text { font-size: 13px; padding: 7px 4px; }
  .ad-html img { max-height: 64px; }
  .ad-grid + .ad-text-row, .ad-grid + .ad-html, .ad-html + .ad-text-row { margin-top: 11px; }

  /* 页脚 */
  .footer-top { flex-direction: column; align-items: flex-start; }
  .footer-bottom { flex-direction: column; gap: 6px; }
  .footer-links { flex-wrap: wrap; gap: 14px; }
}
@media (max-width: 420px) {
  body { font-size: 14.5px; }
  .brand-name { font-size: 15.5px; }
  .pin-name { font-size: 14px; }
  .site-name { font-size: 13.8px; }
  .site-desc { font-size: 12.2px; -webkit-line-clamp: 1; }
  .pin-desc { -webkit-line-clamp: 1; }
  .contact-band { padding: 26px 16px; }
}

/* 深色模式下的细节微调 */
html[data-theme="dark"] .site-header { background: color-mix(in srgb, var(--surface) 92%, transparent); }
html[data-theme="dark"] .pin-body { background: linear-gradient(var(--surface), color-mix(in srgb, var(--pin-bg, var(--surface)) 70%, var(--surface))); }
