:root {
  --bg: #f7f2ea;
  --bg-soft: #fffaf4;
  --paper: #ffffff;
  --text: #2f2a26;
  --muted: #8a7f75;
  --accent: #e8a87c;
  --accent-dark: #c67d52;
  --accent-soft: #fff0e3;
  --fairy: #e8a87c;
  --fairy-bg: #fff5eb;
  --science: #6ba3c7;
  --science-bg: #edf5fb;
  --line: rgba(198, 125, 82, 0.12);
  --shadow: 0 10px 30px rgba(47, 42, 38, 0.06);
  --shadow-lg: 0 16px 40px rgba(47, 42, 38, 0.1);
  --radius: 18px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: linear-gradient(180deg, #fffaf4 0%, var(--bg) 240px, var(--bg) 100%);
  color: var(--text);
  line-height: 1.7;
}
.wrap { max-width: 720px; margin: 0 auto; padding: 0 18px; }
.site-header {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(255, 250, 244, 0.88);
  border-bottom: 1px solid var(--line);
}
.header-inner { padding: 16px 18px 14px; text-align: center; }
.brand {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  color: var(--accent-dark); font-size: 1.28rem; font-weight: 800;
  text-decoration: none; letter-spacing: 0.04em;
}
.tagline {
  margin: 8px auto 0; color: var(--muted); font-size: 0.88rem; line-height: 1.55;
  max-width: 22em;
}
.tagline-sub {
  margin: 4px auto 0; color: #b0a69c; font-size: 0.78rem; line-height: 1.5;
  max-width: 24em;
}
.muted { color: var(--muted); margin: 4px 0 0; font-size: 0.86rem; }
.muted-sm { font-size: 0.75rem; color: #aaa; }
.footer-inner { padding: 28px 18px 32px; text-align: center; }
.footer-brand { margin: 0 0 6px; }
.site-footer { border-top: 1px solid var(--line); margin-top: 8px; background: var(--bg-soft); }

.featured { padding: 18px 18px 8px; }
.featured-label {
  margin: 0 0 10px; font-size: 0.82rem; font-weight: 700;
  color: var(--accent-dark); letter-spacing: 0.08em; text-align: center;
}
.featured-card {
  display: block; text-decoration: none; color: inherit;
  background: var(--paper); border-radius: calc(var(--radius) + 4px);
  overflow: hidden; box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
}
.featured-cover { aspect-ratio: 16/9; background: var(--fairy-bg); overflow: hidden; }
.featured-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.featured-body { padding: 16px 18px 18px; }
.featured-body h2 { margin: 8px 0 10px; font-size: 1.2rem; line-height: 1.45; }
.featured-body p { margin: 0; color: var(--muted); font-size: 0.92rem; line-height: 1.65; }
.featured-cta {
  display: inline-block; margin-top: 12px; font-size: 0.88rem;
  font-weight: 700; color: var(--accent-dark);
}

.follow { padding: 10px 18px 6px; }
.follow-card {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  background: linear-gradient(135deg, #fff8ef, #fffdf9);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 18px 18px; box-shadow: var(--shadow);
}
.follow-copy h2 { margin: 14px 0 6px; font-size: 1rem; color: var(--accent-dark); }
.follow-copy p { margin: 0; color: #888; font-size: 0.84rem; line-height: 1.5; }
.qrcode-box { text-align: center; }
.qrcode-img {
  width: 112px; height: 112px; object-fit: cover;
  border-radius: 14px; border: 4px solid #fff; box-shadow: var(--shadow);
}
.qrcode-placeholder {
  width: 112px; height: 112px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem; border-radius: 14px;
  background: #fff; border: 2px dashed #ecd9c8;
}
.qrcode-tip { margin: 10px 0 0; font-size: 0.82rem; line-height: 1.55; color: #666; }

.list-section { padding: 8px 18px 36px; }
.tabs {
  display: flex; gap: 8px; margin-bottom: 16px;
  overflow-x: auto; padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}
.tab {
  flex: 0 0 auto; border: 1px solid var(--line); background: var(--paper);
  color: var(--muted); border-radius: 999px; padding: 8px 16px;
  font-size: 0.88rem; font-weight: 600; cursor: pointer;
  transition: all 0.2s ease;
}
.tab.active {
  background: linear-gradient(135deg, #efb88f, var(--accent-dark));
  color: #fff; border-color: transparent; box-shadow: 0 6px 16px rgba(198, 125, 82, 0.25);
}
.story-list { display: grid; gap: 14px; }
.card {
  display: grid; grid-template-columns: 118px 1fr; gap: 0;
  background: var(--paper); border-radius: var(--radius);
  overflow: hidden; text-decoration: none; color: inherit;
  border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card:active { transform: scale(0.985); }
.card.hidden { display: none; }
.card-cover { position: relative; background: var(--fairy-bg); min-height: 118px; }
.card-cover img { width: 100%; height: 100%; min-height: 118px; object-fit: cover; display: block; }
.card-cover .badge { position: absolute; left: 8px; top: 8px; }
.card-body { padding: 12px 14px 14px 12px; }
.card-meta, .meta { color: var(--muted); font-size: 0.78rem; margin: 0 0 6px; }
.card h2 { margin: 0 0 6px; font-size: 1rem; line-height: 1.45; }
.card-digest {
  margin: 0; color: #666; font-size: 0.86rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em;
}
.badge-fairy { background: var(--fairy-bg); color: #b56d3e; }
.badge-science { background: var(--science-bg); color: #467da1; }
.badge-other { background: #f3f3f3; color: #777; }
.cover-placeholder {
  height: 100%; min-height: 118px; display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; background: linear-gradient(135deg, #fff5eb, #ffe8d6);
}
.cover-placeholder.lg { min-height: 180px; font-size: 3rem; }
.empty, .empty-filter { color: var(--muted); text-align: center; padding: 28px 0; }
.hidden { display: none !important; }

.page-article main { padding-bottom: calc(88px + var(--safe-bottom)); }
.article-wrap { padding: 16px 18px 24px; }
.article {
  background: var(--paper); border-radius: calc(var(--radius) + 2px);
  border: 1px solid var(--line); box-shadow: var(--shadow);
  overflow: hidden;
}
.article-head { padding: 22px 18px 0; }
.article h1 { margin: 10px 0 0; font-size: 1.34rem; line-height: 1.45; }
.article-body img { max-width: 100%; height: auto; border-radius: 10px; }
.article-body { padding: 8px 12px 0; overflow-wrap: anywhere; }
.article-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin: 16px 16px 0; padding-top: 18px; border-top: 1px solid var(--line);
}
.nav-btn {
  display: block; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: #fff; text-decoration: none; color: inherit;
  min-height: 58px; box-shadow: var(--shadow);
}
.nav-prev { text-align: left; }
.nav-next { text-align: right; }
.nav-empty { visibility: hidden; border: none; box-shadow: none; background: transparent; }
.nav-label { display: block; font-size: 0.78rem; color: var(--muted); margin-bottom: 5px; }
.nav-title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; font-size: 0.86rem; color: var(--accent-dark);
  font-weight: 600; line-height: 1.45;
}
.cta-panel {
  margin: 20px 16px 22px; padding: 18px; border-radius: 14px;
  background: linear-gradient(135deg, #fff8ef, #fffdf8);
  border: 1px solid #f0dfcf;
}
.cta-panel h2 { margin: 0 0 8px; font-size: 1rem; color: var(--accent-dark); }
.cta-panel p { margin: 0 0 10px; color: #666; font-size: 0.92rem; }
.text-link { color: var(--accent-dark); font-weight: 700; text-decoration: none; }

.fixed-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 10px 14px calc(10px + var(--safe-bottom));
  background: rgba(255, 251, 246, 0.92);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px rgba(47, 42, 38, 0.08);
}
.fixed-cta-inner {
  max-width: 720px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.fixed-cta-label { display: block; font-size: 0.76rem; color: var(--muted); }
.fixed-cta-name { font-size: 0.98rem; color: var(--accent-dark); }
.fixed-cta-btn {
  flex-shrink: 0; text-decoration: none; color: #fff; font-weight: 700; font-size: 0.86rem;
  background: linear-gradient(135deg, #efb88f, var(--accent-dark));
  padding: 10px 16px; border-radius: 999px;
  box-shadow: 0 8px 18px rgba(198, 125, 82, 0.28);
}

@media (max-width: 640px) {
  .card { grid-template-columns: 1fr; }
  .card-cover { min-height: 160px; }
  .card-cover img, .cover-placeholder { min-height: 160px; }
  .card-body { padding: 14px 16px 16px; }
}
