/* ============================================================
   兴趣知识小站 · 全局样式
   设计语言：自然大地色系 / 极简 / 卡片式
   合规：纯静态展示，无任何交互式功能
   ============================================================ */

/* ---------- 设计变量 ---------- */
:root {
  --bg: #f7f3ec;
  --surface: #ffffff;
  --ink: #2f2a24;
  --ink-soft: #6f6559;
  --line: #e7ddcc;
  --brand: #4c6b43;       /* 森林绿 */
  --brand-deep: #3a5433;
  --accent: #c08a3e;      /* 琥珀 */
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 2px 10px rgba(60, 50, 30, .08);
  --shadow-lg: 0 10px 28px rgba(60, 50, 30, .14);
  --maxw: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
}

/* 频道主题色调（body 加 class 切换） */
body.tone-fishing { --brand: #2f6b6b; --brand-deep: #245252; --accent: #cf9f43; }
body.tone-outdoor { --brand: #4c6b43; --brand-deep: #3a5433; --accent: #c08a3e; }
body.tone-recipes { --brand: #b05c3b; --brand-deep: #8f4a30; --accent: #c9a13b; }

/* ---------- 基础 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-deep); }
ul { list-style: none; }
.main { min-height: 60vh; }

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247, 243, 236, .92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .2s ease;
}
.site-header.is-scrolled { box-shadow: 0 4px 14px rgba(60, 50, 30, .06); }
.header-inner {
  max-width: var(--maxw); margin: 0 auto;
  height: 60px; padding: 0 20px;
  display: flex; align-items: center; gap: 22px;
}
.logo {
  font-size: 1.12rem; font-weight: 700; color: var(--ink);
  letter-spacing: .4px; white-space: nowrap;
}
.logo em { font-style: normal; color: var(--brand); }
.logo small { display: block; font-size: .62rem; font-weight: 400; color: var(--ink-soft); letter-spacing: 2px; margin-top: -2px; }
.nav { display: flex; gap: 2px; }
.nav a {
  padding: 7px 13px; border-radius: var(--radius-sm);
  color: var(--ink-soft); font-size: .92rem; transition: all .15s ease;
}
.nav a:hover { color: var(--brand); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.nav a.active { color: var(--brand); background: var(--surface); font-weight: 600; box-shadow: inset 0 0 0 1px var(--line); }

.search { margin-left: auto; position: relative; width: 220px; }
.search input {
  width: 100%; height: 36px; padding: 0 14px 0 36px;
  border: 1px solid var(--line); border-radius: 18px;
  background: var(--surface); font: inherit; font-size: .85rem; color: var(--ink);
  outline: none; transition: border-color .15s ease, box-shadow .15s ease;
}
.search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(76, 107, 67, .12); }
.search .search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; opacity: .45; pointer-events: none;
}

/* ---------- 移动端底部导航 ---------- */
.mobile-tabbar {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: var(--surface); border-top: 1px solid var(--line);
}
.mobile-tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 9px 0 11px; color: var(--ink-soft); font-size: .68rem; transition: color .15s;
}
.mobile-tabbar a svg { width: 21px; height: 21px; }
.mobile-tabbar a.active { color: var(--brand); font-weight: 600; }

/* ---------- 首页 Hero ---------- */
.hero {
  max-width: var(--maxw); margin: 0 auto; padding: 56px 20px 28px;
  display: grid; grid-template-columns: 1.25fr .9fr; gap: 40px; align-items: center;
}
.hero h1 { font-size: 2.1rem; line-height: 1.3; letter-spacing: .5px; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero p { margin-top: 16px; color: var(--ink-soft); font-size: .98rem; max-width: 40em; }
.hero .hero-search { margin-top: 26px; position: relative; max-width: 420px; }
.hero .hero-search input {
  width: 100%; height: 46px; padding: 0 20px 0 46px; font-size: .95rem;
  border: 1px solid var(--line); border-radius: 24px; background: var(--surface);
  box-shadow: var(--shadow); font: inherit; outline: none;
}
.hero .hero-search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(76,107,67,.12); }
.hero .hero-search svg { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; opacity: .4; }
.hero-figure { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); }
.hero-figure img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- 区块 ---------- */
.section { max-width: var(--maxw); margin: 0 auto; padding: 30px 20px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 20px; }
.section-title { font-size: 1.3rem; font-weight: 700; position: relative; padding-left: 14px; }
.section-title::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 5px; height: 1.2em; border-radius: 3px; background: var(--brand);
}
.section-more { font-size: .85rem; color: var(--ink-soft); }
.section-more:hover { color: var(--brand); }

/* ---------- 频道入口卡 ---------- */
.channel-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.channel-card {
  display: flex; flex-direction: column; gap: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease;
}
.channel-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.channel-card .cc-icon {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--brand) 12%, var(--surface));
}
.channel-card .cc-icon svg { width: 28px; height: 28px; stroke: var(--brand); }
.channel-card h3 { font-size: 1.08rem; }
.channel-card p { font-size: .86rem; color: var(--ink-soft); }
.channel-card .cc-more { margin-top: auto; font-size: .84rem; color: var(--brand); font-weight: 600; }

/* ---------- 内容卡片 / 瀑布流 ---------- */
.masonry { columns: 3; column-gap: 18px; }
.card {
  display: block; break-inside: avoid; margin-bottom: 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); color: var(--ink);
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); color: var(--ink); }
.card-cover { position: relative; aspect-ratio: 16 / 10; overflow: hidden; }
.card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card:hover .card-cover img { transform: scale(1.04); }
.card-tag {
  position: absolute; left: 12px; top: 12px;
  background: rgba(255,255,255,.92); color: var(--brand);
  font-size: .72rem; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  box-shadow: var(--shadow);
}
.card-body { padding: 14px 16px 16px; }
.card-title { font-size: .98rem; font-weight: 600; line-height: 1.45; }
.card-excerpt {
  font-size: .84rem; color: var(--ink-soft); margin-top: 6px; line-height: 1.65;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta { margin-top: 12px; font-size: .74rem; color: var(--ink-soft); display: flex; gap: 12px; align-items: center; }
.card-meta time { }
.chip {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .7rem;
  background: color-mix(in srgb, var(--brand) 10%, var(--surface)); color: var(--brand-deep);
}
.is-hidden { display: none !important; }

/* 栏目空态提示 */
.empty-tip { text-align: center; color: var(--ink-soft); font-size: .9rem; padding: 40px 0; display: none; }
.empty-tip.show { display: block; }
.banner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 20px;
}
.banner-note {
  border: 1px dashed var(--line); border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  color: var(--ink-soft); font-size: .88rem; padding: 14px 18px;
}

/* ---------- 频道页头部 ---------- */
.page-head {
  max-width: var(--maxw); margin: 0 auto; padding: 44px 20px 10px;
}
.page-head .crumb { font-size: .8rem; color: var(--ink-soft); margin-bottom: 10px; }
.page-head .crumb a { color: var(--ink-soft); }
.page-head .crumb a:hover { color: var(--brand); }
.page-head h1 { font-size: 1.9rem; line-height: 1.3; }
.page-head p { margin-top: 10px; color: var(--ink-soft); font-size: .95rem; max-width: 46em; }

/* ---------- 文章页 ---------- */
.article { max-width: 720px; margin: 0 auto; padding: 40px 20px 70px; }
.article-head { margin-bottom: 26px; }
.article-head h1 { font-size: 1.72rem; line-height: 1.4; }
.article-meta {
  margin-top: 14px; font-size: .82rem; color: var(--ink-soft);
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
}
.article-cover { border-radius: var(--radius); overflow: hidden; margin-bottom: 28px; box-shadow: var(--shadow); }
.article-cover img { width: 100%; aspect-ratio: 21 / 9; object-fit: cover; }
.article-body { font-size: 1rem; line-height: 2; color: var(--ink); }
.article-body h2 { font-size: 1.24rem; margin: 36px 0 14px; padding-left: 13px; border-left: 4px solid var(--brand); line-height: 1.5; }
.article-body h3 { font-size: 1.05rem; margin: 26px 0 10px; color: var(--brand-deep); }
.article-body p { margin: 14px 0; }
.article-body ul, .article-body ol { margin: 14px 0; padding-left: 1.4em; }
.article-body li { margin: 8px 0; }
.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }
.article-body strong { color: var(--ink); }
.article-body figure { margin: 24px 0; }
.article-body figure img { border-radius: var(--radius); box-shadow: var(--shadow); }
.article-body figcaption { font-size: .8rem; color: var(--ink-soft); text-align: center; margin-top: 10px; }
.article-body blockquote {
  margin: 20px 0; padding: 12px 18px;
  border-left: 4px solid var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--surface));
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--ink-soft); font-size: .94rem;
}
.article-body .note {
  margin: 20px 0; padding: 12px 16px; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--brand) 8%, var(--surface));
  color: var(--ink-soft); font-size: .9rem;
}
.article-body .note strong { color: var(--brand-deep); }
.article-back { margin-top: 46px; font-size: .88rem; }

/* 上一篇/下一篇 */
.article-pager {
  max-width: 720px; margin: 0 auto; padding: 0 20px 30px;
  display: flex; justify-content: space-between; gap: 16px;
}
.article-pager a {
  flex: 1; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: 12px 16px; font-size: .86rem; color: var(--ink);
  box-shadow: var(--shadow); transition: all .15s ease;
}
.article-pager a:hover { border-color: var(--brand); color: var(--brand); }
.article-pager a small { display: block; font-size: .72rem; color: var(--ink-soft); margin-bottom: 3px; }
.article-pager .next { text-align: right; }

/* ---------- 关于 / 免责声明 ---------- */
.prose {
  max-width: 720px; margin: 0 auto; padding: 40px 20px 70px; font-size: .98rem; line-height: 2;
}
.prose h1 { font-size: 1.72rem; margin-bottom: 18px; }
.prose h2 { font-size: 1.2rem; margin: 32px 0 12px; padding-left: 13px; border-left: 4px solid var(--brand); }
.prose p { margin: 12px 0; }
.prose ul, .prose ol { margin: 12px 0; padding-left: 1.4em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin: 6px 0; }
.prose blockquote { margin: 18px 0; padding: 12px 18px; border-left: 4px solid var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--ink-soft); }
.prose .highlight { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); border-radius: var(--radius-sm); padding: 14px 16px; }
.prose table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: .9rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; }
.prose th { background: color-mix(in srgb, var(--brand) 8%, var(--surface)); font-weight: 600; }

/* ---------- 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--line); margin-top: 40px;
  background: var(--surface); padding: 30px 20px 26px;
}
.footer-inner { max-width: var(--maxw); margin: 0 auto; text-align: center; color: var(--ink-soft); font-size: .82rem; line-height: 2.1; }
.footer-inner .footer-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 18px; margin-bottom: 8px; }
.footer-inner a { color: var(--ink-soft); }
.footer-inner a:hover { color: var(--brand); }
.footer-inner .icp a { color: var(--ink-soft); }
.footer-inner .icp a:hover { color: var(--brand); }
.footer-inner .icp { letter-spacing: .3px; }

/* ---------- 滚动浮现 ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- 灯箱 ---------- */
.lightbox {
  display: none; position: fixed; inset: 0; z-index: 100;
  background: rgba(20, 16, 10, .88); padding: 6vh 4vw;
  justify-content: center; align-items: center; flex-direction: column;
}
.lightbox.show { display: flex; }
.lightbox img { max-width: 100%; max-height: 82vh; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); }
.lightbox .lb-caption { margin-top: 14px; color: rgba(255,255,255,.8); font-size: .85rem; text-align: center; max-width: 70vw; }
.lightbox .lb-close {
  position: absolute; top: 18px; right: 22px; background: none; border: none;
  color: #fff; font-size: 2rem; cursor: pointer; line-height: 1; opacity: .85;
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .masonry { columns: 2; }
  .hero { grid-template-columns: 1fr; padding-top: 40px; }
  .hero-figure { max-width: 560px; }
  .channel-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .header-inner { height: 56px; }
  .nav, .search { display: none; }
  .mobile-tabbar { display: flex; }
  .main { padding-bottom: 58px; }
  .site-footer { padding-bottom: 78px; }
  .hero h1 { font-size: 1.6rem; }
  .article-head h1 { font-size: 1.4rem; }
  .masonry { columns: 1; }
  .section { padding: 22px 16px; }
  .page-head { padding-top: 30px; }
}
