/* ============ 基础与变量 ============ */
:root {
  --primary: #3b6fe0;
  --primary-dark: #2a56c4;
  --accent: #f97316;
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1f2937;
  --text-2: #6b7280;
  --border: #e5e9f2;
  --green: #0e9f6e;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(17, 24, 39, .06), 0 6px 18px rgba(17, 24, 39, .05);
  --shadow-hover: 0 4px 10px rgba(17, 24, 39, .08), 0 14px 32px rgba(59, 111, 224, .14);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { max-width: 1160px; margin: 0 auto; padding: 0 20px; }

/* ============ 顶部导航 ============ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 20px; height: 62px; }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 19px; white-space: nowrap; }
.logo-icon { border-radius: 8px; }
.logo-name { background: linear-gradient(90deg, #3b6fe0, #7c3aed); -webkit-background-clip: text; background-clip: text; color: transparent; }
.main-nav { display: flex; align-items: center; gap: 14px; flex: 0 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.main-nav::-webkit-scrollbar { display: none; }
.nav-link { font-size: 15px; color: var(--text-2); padding: 4px 2px; white-space: nowrap; transition: color .15s; }
.nav-link:hover { color: var(--primary); }
.nav-sep { width: 1px; height: 14px; background: var(--border); flex: 0 0 auto; }
.header-search { margin-left: auto; display: flex; flex: 0 1 280px; }
.header-search input {
  flex: 1; min-width: 0; height: 36px; padding: 0 12px;
  border: 1.5px solid var(--border); border-right: none; border-radius: 18px 0 0 18px;
  font-size: 14px; outline: none; background: #fafbfe;
}
.header-search input:focus { border-color: var(--primary); }
.header-search button {
  height: 36px; padding: 0 14px; border: none; cursor: pointer;
  background: var(--primary); color: #fff; border-radius: 0 18px 18px 0; font-size: 14px;
}
.header-search button:hover { background: var(--primary-dark); }

/* ============ 首页 Hero ============ */
.hero {
  background: linear-gradient(135deg, #3b6fe0 0%, #5b4fe8 55%, #7c3aed 100%);
  color: #fff; text-align: center; padding: 56px 0 48px;
}
.hero h1 { font-size: 34px; letter-spacing: 1px; }
.hero-sub { margin-top: 10px; font-size: 15px; opacity: .92; max-width: 640px; margin-left: auto; margin-right: auto; }
.hero-search { max-width: 560px; margin: 26px auto 0; display: flex; }
.hero-search input {
  flex: 1; height: 48px; padding: 0 18px; border: none; border-radius: 24px 0 0 24px;
  font-size: 15px; outline: none;
}
.hero-search button {
  height: 48px; padding: 0 26px; border: none; border-radius: 0 24px 24px 0;
  background: var(--accent); color: #fff; font-size: 16px; font-weight: 600; cursor: pointer;
}
.hero-search button:hover { background: #e2630b; }
.hot-words { margin-top: 18px; font-size: 13px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; }
.hot-label { opacity: .85; }
.hot-words a {
  background: rgba(255, 255, 255, .16); padding: 3px 12px; border-radius: 14px;
  color: #fff; transition: background .15s;
}
.hot-words a:hover { background: rgba(255, 255, 255, .3); }
.hero-stats { margin-top: 26px; display: flex; gap: 26px; justify-content: center; flex-wrap: wrap; font-size: 13px; opacity: .95; }
.hero-stats b { color: #ffd166; }

/* ============ 公告栏 ============ */
.announce {
  background: #fff7ed; border-bottom: 1px solid #fed7aa; color: #9a3412; font-size: 14px;
}
.announce .container { display: flex; gap: 8px; align-items: center; padding-top: 10px; padding-bottom: 10px; }
.announce b { flex: 0 0 auto; }

/* ============ 区块 ============ */
.main-content { padding: 34px 20px 50px; }
.section { margin-bottom: 42px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 18px; }
.section-head h2 { font-size: 22px; }
.section-more { color: var(--text-2); font-size: 14px; }
.section-more:hover { color: var(--primary); }

/* ============ 资源卡片 ============ */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 18px; }
.card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid transparent;
  display: flex; flex-direction: column; transition: transform .18s, box-shadow .18s, border-color .18s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: #c7d6f7; }
.card-cover { position: relative; height: 132px; }
.cover-img { width: 100%; height: 100%; object-fit: cover; }
.cover-ph {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 46px;
  background: linear-gradient(135deg, #e8effd 0%, #eef2fb 100%);
}
.hot-badge {
  position: absolute; top: 10px; right: 10px;
  background: linear-gradient(90deg, #f97316, #ef4444); color: #fff;
  font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 10px;
}
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-title {
  font-size: 16px; line-height: 1.45; font-weight: 600;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-summary {
  font-size: 13px; color: var(--text-2);
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); }
.card-date { margin-left: auto; }
.card-pans { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 4px; }

.cat-chip { display: inline-block; background: #eef3ff; color: var(--primary); border: 1px solid #d4e0fa; font-size: 12px; padding: 1px 9px; border-radius: 10px; white-space: nowrap; }
.pan-badge { display: inline-block; color: #fff; font-size: 12px; padding: 2px 9px; border-radius: 10px; white-space: nowrap; }

/* ============ 分类入口 ============ */
.cat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.cat-tile {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; text-align: center; box-shadow: var(--shadow); transition: transform .18s, border-color .18s;
}
.cat-tile:hover { transform: translateY(-3px); border-color: #c7d6f7; }
.cat-tile-emoji { font-size: 34px; }
.cat-tile-name { margin-top: 8px; font-size: 16px; font-weight: 600; }
.cat-tile-desc { margin-top: 4px; font-size: 12px; color: var(--text-2); }

/* ============ 面包屑 ============ */
.breadcrumb { display: flex; gap: 8px; font-size: 13px; color: var(--text-2); margin-bottom: 18px; flex-wrap: wrap; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .current { color: var(--text); }

/* ============ 分类页 ============ */
.cat-head { margin-bottom: 24px; }
.cat-head h1 { font-size: 26px; }
.cat-desc { margin-top: 8px; color: var(--text-2); font-size: 14px; }
.cat-count { margin-top: 6px; font-size: 13px; color: var(--primary); }

/* ============ 详情页 ============ */
.detail { max-width: 860px; }
.detail-title { font-size: 25px; line-height: 1.4; }
.detail-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; font-size: 13px; color: var(--text-2); }
.detail-meta .chip { background: #f1f5f9; border: 1px solid var(--border); border-radius: 10px; padding: 1px 9px; font-size: 12px; }
.detail-date { margin-left: auto; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tag { background: #eef7f2; color: #166534; border: 1px solid #c9e8d8; font-size: 12px; padding: 2px 10px; border-radius: 10px; }
.detail-desc { margin-top: 22px; font-size: 15px; color: #374151; line-height: 1.85; }
.detail-desc p { margin-bottom: 12px; }

/* ============ 下载面板 ============ */
.download-panel {
  margin-top: 30px; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.panel-head h2 { font-size: 20px; }
.panel-count { font-size: 13px; color: var(--text-2); }
.howto {
  margin: 16px 0; background: #f8faff; border: 1px dashed #c7d6f7; border-radius: 10px; padding: 14px 16px;
}
.howto-title { font-size: 14px; font-weight: 600; color: var(--primary-dark); margin-bottom: 6px; }
.howto ol { padding-left: 20px; font-size: 13.5px; color: #374151; }
.howto li { margin: 3px 0; }
.pan-list { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.pan-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; background: #fcfdff;
  transition: border-color .15s, background .15s;
}
.pan-row:hover { border-color: #b9cdf7; background: #f8faff; }
.pan-row-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.pan-note { color: var(--text-2); font-size: 12.5px; }
.code-chip { background: #fef3c7; border: 1px dashed #f59e0b; color: #92400e; font-size: 13px; padding: 2px 10px; border-radius: 8px; }
.code-chip b { letter-spacing: 1px; }
.pan-row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 8px; padding: 8px 16px; font-size: 14px; cursor: pointer; border: none;
  transition: background .15s, color .15s, border-color .15s; font-family: inherit; line-height: 1.2;
}
.btn-primary { background: var(--primary); color: #fff; font-weight: 500; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: #fff; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-ghost:hover { background: #eef3ff; }
.panel-tip { margin-top: 16px; font-size: 13.5px; color: #92400e; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 8px; padding: 10px 14px; line-height: 1.7; }
.panel-disclaimer { margin-top: 12px; font-size: 12.5px; color: var(--text-2); line-height: 1.7; }

.related { margin-top: 40px; }
.related h2 { font-size: 20px; margin-bottom: 16px; }

.prev-next { margin-top: 30px; display: flex; gap: 12px; justify-content: space-between; }
.prev-next a {
  flex: 1; background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 16px; font-size: 14px; box-shadow: var(--shadow); overflow: hidden;
  white-space: nowrap; text-overflow: ellipsis; transition: border-color .15s, color .15s;
}
.prev-next a:hover { border-color: #b9cdf7; color: var(--primary); }
.prev-next .pn-label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 2px; }
.prev-next a.next { text-align: right; }

/* ============ 搜索页 ============ */
.search-page { max-width: 820px; }
.search-page h1 { font-size: 26px; }
.search-form { display: flex; margin-top: 18px; }
.search-form input {
  flex: 1; height: 46px; padding: 0 16px; border: 1.5px solid var(--border); border-radius: 12px 0 0 12px;
  font-size: 15px; outline: none;
}
.search-form input:focus { border-color: var(--primary); }
.search-form button {
  height: 46px; padding: 0 26px; border: none; background: var(--primary); color: #fff;
  border-radius: 0 12px 12px 0; font-size: 15px; cursor: pointer;
}
.search-form button:hover { background: var(--primary-dark); }
.search-tags { margin-top: 14px; font-size: 13px; color: var(--text-2); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.search-tags a { background: #eef3ff; color: var(--primary-dark); padding: 2px 12px; border-radius: 12px; }
.search-tags a:hover { background: #dbe7ff; }
.search-info { margin: 20px 0 12px; font-size: 14px; color: var(--text-2); }
.search-results { display: flex; flex-direction: column; gap: 12px; }
.result-item {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; display: flex; justify-content: space-between; gap: 14px; align-items: center;
  box-shadow: var(--shadow); transition: border-color .15s;
}
.result-item:hover { border-color: #b9cdf7; }
.result-main { flex: 1; min-width: 0; }
.result-title { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.result-title:hover { color: var(--primary); }
.result-summary { font-size: 13px; color: var(--text-2); margin-top: 4px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.result-meta { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--text-2); flex-wrap: wrap; }
.result-go { flex: 0 0 auto; }

/* ============ 关于/文章 ============ */
.prose { max-width: 760px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 30px 34px; box-shadow: var(--shadow); }
.prose h1 { font-size: 25px; margin-bottom: 16px; }
.prose h2 { font-size: 19px; margin: 24px 0 10px; }
.prose p { font-size: 15px; margin-bottom: 12px; color: #374151; }

/* ============ 404 ============ */
.notfound { text-align: center; padding: 70px 0; }
.nf-code { font-size: 84px; font-weight: 800; background: linear-gradient(135deg, #3b6fe0, #7c3aed); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1.1; }
.notfound h1 { font-size: 24px; margin-top: 10px; }
.notfound p { color: var(--text-2); margin: 10px 0 24px; }

/* ============ 页脚 ============ */
.site-footer { background: #141a2a; color: #9aa5bd; margin-top: 30px; }
.footer-inner { display: flex; gap: 36px; flex-wrap: wrap; padding: 40px 20px 30px; }
.footer-brand { flex: 2; min-width: 240px; }
.footer-logo { color: #fff; font-size: 17px; font-weight: 700; }
.footer-desc { margin-top: 10px; font-size: 13px; line-height: 1.8; max-width: 420px; }
.footer-links { flex: 1; min-width: 140px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.footer-links a:hover { color: #fff; }
.footer-note { flex: 2; min-width: 220px; font-size: 13px; line-height: 1.9; }
.footer-note a { color: #9aa5bd; }
.footer-note a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #232c42; padding: 16px 0; font-size: 12.5px; line-height: 1.9; }
.footer-bottom .container { padding-top: 0; padding-bottom: 0; }

/* ============ 提示气泡与回到顶部 ============ */
#toast {
  position: fixed; left: 50%; bottom: 44px; transform: translateX(-50%) translateY(20px);
  background: rgba(17, 24, 39, .92); color: #fff; padding: 10px 22px; border-radius: 22px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 999;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#back-top {
  position: fixed; right: 22px; bottom: 22px; width: 42px; height: 42px; border-radius: 50%;
  background: var(--primary); color: #fff; border: none; cursor: pointer; font-size: 18px;
  box-shadow: 0 4px 14px rgba(59, 111, 224, .4); opacity: 0; visibility: hidden;
  transition: opacity .2s, visibility .2s; z-index: 90;
}
#back-top.show { opacity: 1; visibility: visible; }
#back-top:hover { background: var(--primary-dark); }

/* ============ 响应式 ============ */
@media (max-width: 900px) {
  .header-search { flex-basis: 170px; }
  .hero h1 { font-size: 27px; }
  .detail-title { font-size: 22px; }
}
@media (max-width: 680px) {
  .header-search { display: none; }
  .hero { padding: 40px 0 36px; }
  .hero h1 { font-size: 24px; }
  .hero-sub { font-size: 13.5px; }
  .hero-search input { height: 46px; font-size: 14px; }
  .hero-search button { height: 46px; padding: 0 18px; font-size: 15px; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .card-cover { height: 96px; }
  .cover-ph { font-size: 34px; }
  .card-title { font-size: 14.5px; }
  .card-body { padding: 10px 12px 12px; gap: 6px; }
  .card-summary { display: none; }
  .pan-row { flex-direction: column; align-items: stretch; }
  .pan-row-actions { justify-content: flex-end; }
  .detail-meta .detail-date { margin-left: 0; }
  .prose { padding: 22px 18px; }
  .prev-next { flex-direction: column; }
  .result-item { flex-direction: column; align-items: stretch; }
  .result-go .btn { width: 100%; }
  .footer-inner { padding: 30px 20px 22px; }
  .announce .container { display: block; }
  .announce b { display: none; }
}
/* ============ 下载引导中转页 ============ */
.go-card { max-width: 720px; margin: 0 auto; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 30px 34px; box-shadow: var(--shadow); }
.go-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.go-title { font-size: 19px; line-height: 1.5; }
.go-link-hint { font-size: 14px; color: var(--text-2); margin-bottom: 6px; }
.go-link-hint b { color: var(--accent); font-size: 16px; }
.go-code { margin: 14px 0 0; }
.go-code b { letter-spacing: 2px; font-size: 19px; }
.go-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0 4px; }
.go-open { font-size: 16px; padding: 12px 28px; }
.go-guide { margin-top: 22px; background: #f8faff; border: 1px dashed #c7d6f7; border-radius: 10px; padding: 16px 20px; }
.go-guide h2 { font-size: 16px; margin-bottom: 8px; }
.go-guide ol { padding-left: 22px; font-size: 14px; color: #374151; }
.go-guide li { margin: 4px 0; }
.go-tip { margin-top: 10px; font-size: 13px; color: #92400e; line-height: 1.7; }
.go-back { margin-top: 18px; font-size: 13.5px; color: var(--text-2); }
.go-back a { color: var(--primary); }
.go-card .panel-disclaimer { margin-top: 12px; }

/* ============ 私域导流悬浮挂件 ============ */
.floating-dock { position: fixed; left: 50%; transform: translateX(-50%); bottom: 16px; z-index: 80; max-width: 600px; width: calc(100% - 32px); }
.fd-inner { background: var(--card); border: 1px solid #ffd7b0; box-shadow: 0 8px 30px rgba(17, 24, 39, .18); border-radius: 14px; padding: 12px 40px 12px 14px; position: relative; }
.fd-toggle { position: absolute; top: 8px; right: 8px; border: none; background: #f1f5f9; color: var(--text-2); border-radius: 8px; width: 24px; height: 24px; cursor: pointer; font-size: 12px; line-height: 1; font-family: inherit; }
.fd-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fd-icon { font-size: 26px; flex: 0 0 auto; }
.fd-qr { width: 56px; height: 56px; border-radius: 8px; border: 1px solid var(--border); flex: 0 0 auto; }
.fd-text { flex: 1; min-width: 150px; }
.fd-title { font-size: 14.5px; font-weight: 600; }
.fd-desc { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.fd-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fd-wechat { font-size: 13px; color: #374151; background: #fff7ed; border: 1px dashed #f59e0b; padding: 4px 12px; border-radius: 8px; }
.fd-copy { border: none; background: var(--accent); color: #fff; border-radius: 8px; padding: 8px 16px; font-size: 13.5px; cursor: pointer; font-family: inherit; }
.fd-copy:hover { background: #e2630b; }
.floating-dock.collapsed { left: auto; right: 16px; transform: none; width: auto; max-width: none; }
.floating-dock.collapsed .fd-inner { padding: 0; border: none; background: transparent; box-shadow: none; }
.floating-dock.collapsed .fd-row { display: none; }
.floating-dock.collapsed .fd-toggle { position: static; width: auto; height: auto; padding: 9px 16px; font-size: 13px; border-radius: 20px; background: var(--primary); color: #fff; box-shadow: 0 4px 14px rgba(59, 111, 224, .4); }

@media (max-width: 680px) {
  .go-card { padding: 20px 16px; }
  .go-title { font-size: 17px; }
  .fd-actions { width: 100%; justify-content: space-between; }
  body.has-dock #back-top { bottom: 150px; }
}

/* ============ 网盘行二维码 ============ */
.pan-qr { display: flex; flex-direction: column; align-items: center; gap: 3px; flex: 0 0 auto; }
.pan-qr img { width: 80px; height: 80px; border-radius: 8px; border: 1px solid var(--border); padding: 4px; background: #fff; image-rendering: pixelated; }
.pan-qr span { font-size: 11px; color: var(--text-2); }
.pan-row.qr-only .pan-row-actions { display: none; }
@media (max-width: 680px) {
  .pan-qr { order: 3; width: 100%; }
  .pan-qr img { width: 140px; height: 140px; }
}
