/* ============================================================
   夜航船 · 悬疑故事集  —  泛黄书页质感
   whfun.top/story  ·  纯静态 · 无框架
   ============================================================ */

:root {
  --paper:      #f2e8d5;   /* 纸面 */
  --paper-deep: #e9dcc1;   /* 泛黄更深 */
  --card:       #f8f0df;   /* 卡片纸面 */
  --ink:        #3a3226;   /* 墨色 */
  --ink-soft:   #7a6b53;   /* 淡墨 */
  --ink-faint:  #a6977c;   /* 浅墨 */
  --seal:       #8c2f2f;   /* 印章红 */
  --seal-deep:  #6e2222;
  --line:       #d6c6a4;   /* 纸边线 */
  --shadow:     rgba(90, 70, 40, 0.18);
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", "STSong", serif;
  --kai:   "Kaiti SC", "STKaiti", "KaiTi", "楷体", serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--serif);
  color: var(--ink);
  line-height: 1.8;
  background-color: #efe3c8;
  /* 纸张：泛黄晕染 + 细腻纹理 */
  background-image:
    radial-gradient(ellipse 90% 60% at 15% 8%,  rgba(130, 96, 54, 0.10), transparent 55%),
    radial-gradient(ellipse 80% 55% at 85% 92%, rgba(130, 96, 54, 0.13), transparent 60%),
    radial-gradient(ellipse 50% 40% at 60% 25%, rgba(255, 250, 236, 0.55), transparent 65%),
    repeating-linear-gradient(45deg, rgba(60, 45, 20, 0.014) 0 2px, transparent 2px 5px);
  background-attachment: fixed;
  min-height: 100vh;
}

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- 头部 ---------- */
.site-head {
  border-bottom: 2px solid var(--line);
  background: linear-gradient(180deg, rgba(248, 240, 223, 0.85), rgba(242, 232, 213, 0.55));
  backdrop-filter: blur(2px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.head-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 12px;
  padding-bottom: 12px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: baseline; gap: 8px; text-decoration: none; color: var(--ink); }
.brand-mark {
  font-family: var(--kai);
  font-size: 24px;
  font-weight: 700;
  color: var(--card);
  background: var(--seal);
  width: 34px; height: 34px;
  border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  transform: rotate(-4deg);
  box-shadow: 0 1px 3px var(--shadow);
}
.brand-name { font-family: var(--kai); font-size: 20px; font-weight: 700; letter-spacing: 2px; }
.brand-sub { font-size: 12px; color: var(--ink-soft); letter-spacing: 2px; }
.head-nav { display: flex; gap: 18px; }
.head-nav a {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 14px;
  letter-spacing: 1px;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
}
.head-nav a:hover { color: var(--seal); }
.head-nav a.active { color: var(--seal); border-bottom-color: var(--seal); }

/* ---------- 首页 hero ---------- */
.hero { text-align: center; padding: 56px 0 34px; }
.hero-title {
  font-family: var(--kai);
  font-size: 46px;
  letter-spacing: 10px;
  color: var(--ink);
  text-shadow: 0 1px 0 rgba(255, 252, 240, 0.6);
}
.hero-sub { margin-top: 12px; color: var(--ink-soft); font-size: 15px; letter-spacing: 2px; }

/* ---------- 区块 ---------- */
.section-title {
  font-family: var(--kai);
  font-size: 22px;
  color: var(--ink);
  letter-spacing: 4px;
  margin: 34px 0 16px;
  padding-left: 12px;
  border-left: 4px solid var(--seal);
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- 精选 ---------- */
.featured-list { display: flex; flex-direction: column; gap: 14px; }

/* ---------- 题材网格 ---------- */
.genre-grid { display: flex; flex-wrap: wrap; gap: 14px; }
.genre-card {
  flex: 1 1 200px;
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px 18px 16px;
  text-decoration: none;
  color: var(--ink);
  position: relative;
  box-shadow: 0 2px 6px var(--shadow);
  transition: transform .18s, box-shadow .18s;
}
.genre-card:hover { transform: translateY(-2px); box-shadow: 0 6px 14px var(--shadow); }
.genre-card .g-name { font-family: var(--kai); font-size: 20px; font-weight: 700; letter-spacing: 2px; }
.genre-card .g-count { font-size: 12px; color: var(--seal); margin-top: 4px; letter-spacing: 1px; }
.genre-card .g-desc { font-size: 13px; color: var(--ink-soft); margin-top: 8px; line-height: 1.7; }

/* ---------- 故事列表 ---------- */
.story-list { display: flex; flex-direction: column; gap: 14px; }
.story-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px 20px;
  text-decoration: none;
  color: var(--ink);
  box-shadow: 0 2px 6px var(--shadow);
  transition: transform .18s, box-shadow .18s;
  position: relative;
}
.story-card:hover { transform: translateY(-2px); box-shadow: 0 6px 14px var(--shadow); }
.story-card::before {
  content: "";
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 3px;
  background: var(--seal);
  border-radius: 2px;
  opacity: 0.75;
}
.sc-top { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.sc-no { font-size: 12px; color: var(--seal); letter-spacing: 1px; font-weight: 700; }
.sc-cat { font-size: 12px; color: var(--ink-soft); letter-spacing: 1px; }
.sc-title { font-family: var(--kai); font-size: 20px; font-weight: 700; margin-top: 4px; letter-spacing: 1px; }
.sc-summary { font-size: 14px; color: var(--ink-soft); margin-top: 6px; line-height: 1.8; }
.sc-tags { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 标签 ---------- */
.card-tag {
  display: inline-block;
  font-size: 12px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 10px;
  text-decoration: none;
  transition: color .2s, border-color .2s;
}
.card-tag:hover { color: var(--seal); border-color: var(--seal); }

/* ---------- 详情页 · 书页 ---------- */
.story-sheet {
  background:
    linear-gradient(180deg, rgba(255, 252, 242, 0.55), transparent 120px),
    var(--card);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 3px 10px var(--shadow), inset 0 0 0 3px rgba(214, 198, 164, 0.35);
  margin: 28px 0 40px;
  padding: 42px 40px 36px;
  position: relative;
}
/* 书页顶部装订线装饰 */
.story-sheet::before {
  content: "";
  position: absolute;
  left: 24px; right: 24px; top: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--seal) 50%, transparent);
  opacity: 0.55;
}

.story-kicker { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.seal {
  display: inline-block;
  font-family: var(--kai);
  font-size: 13px;
  font-weight: 700;
  color: var(--seal);
  border: 2px solid var(--seal);
  border-radius: 5px;
  padding: 1px 10px;
  transform: rotate(-2deg);
  letter-spacing: 2px;
  box-shadow: 0 0 0 1px var(--card);
}
.story-no { font-size: 13px; color: var(--ink-faint); letter-spacing: 1px; }

.story-title {
  font-family: var(--kai);
  font-size: 34px;
  line-height: 1.5;
  letter-spacing: 3px;
  margin-bottom: 12px;
}
.story-tags { display: flex; gap: 8px; flex-wrap: wrap; padding-bottom: 20px; border-bottom: 1px dashed var(--line); }

.story-body { padding: 22px 0 6px; }
.story-body p {
  font-size: 16.5px;
  line-height: 2.05;
  text-indent: 2em;
  margin-bottom: 1em;
  color: var(--ink);
}
.story-body p:first-of-type::first-letter {
  font-family: var(--kai);
  font-size: 2.1em;
  color: var(--seal);
  float: left;
  line-height: 1;
  padding: 2px 6px 0 0;
}

/* ---------- 揭晓真相 ---------- */
.story-actions { text-align: center; padding: 12px 0 6px; }
.btn-reveal {
  font-family: var(--kai);
  font-size: 17px;
  letter-spacing: 4px;
  color: var(--card);
  background: linear-gradient(180deg, var(--seal), var(--seal-deep));
  border: none;
  border-radius: 6px;
  padding: 10px 34px;
  cursor: pointer;
  box-shadow: 0 2px 6px var(--shadow);
  transition: transform .15s, box-shadow .15s;
}
.btn-reveal:hover { transform: translateY(-1px); box-shadow: 0 4px 10px var(--shadow); }
.btn-reveal:active { transform: translateY(0); }

.story-reveal { margin-top: 22px; }
.reveal-inner {
  background: linear-gradient(180deg, rgba(140, 47, 47, 0.06), rgba(140, 47, 47, 0.02));
  border: 1px dashed var(--seal);
  border-radius: 6px;
  padding: 20px 24px;
}
.reveal-title {
  font-family: var(--kai);
  font-size: 18px;
  color: var(--seal);
  letter-spacing: 4px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.reveal-title::before { content: "◆"; font-size: 12px; }
.reveal-text p { font-size: 15.5px; line-height: 2; color: var(--ink); text-indent: 2em; margin-bottom: 0.6em; }

/* ---------- 详情页上下篇 ---------- */
.story-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
  flex-wrap: wrap;
}
.foot-link { font-size: 14px; color: var(--ink-soft); text-decoration: none; letter-spacing: 1px; }
.foot-link:hover { color: var(--seal); }
.foot-link.back {
  color: var(--seal);
  border: 1px solid var(--seal);
  border-radius: 6px;
  padding: 5px 16px;
}
.foot-link.back:hover { background: var(--seal); color: var(--card); }

/* ---------- 题材页 tab ---------- */
.genre-tabs { display: flex; gap: 10px; flex-wrap: wrap; margin: 26px 0 20px; }
.genre-tab {
  font-family: var(--kai);
  font-size: 15px;
  letter-spacing: 1px;
  color: var(--ink-soft);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 18px;
  cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
}
.genre-tab:hover { color: var(--seal); border-color: var(--seal); }
.genre-tab.active { color: var(--card); background: var(--seal); border-color: var(--seal); }

/* ---------- 搜索 ---------- */
.search-box { margin: 30px 0 22px; }
.search-box input {
  width: 100%;
  font-family: var(--serif);
  font-size: 16px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 18px;
  outline: none;
  box-shadow: 0 2px 6px var(--shadow);
}
.search-box input:focus { border-color: var(--seal); box-shadow: 0 0 0 3px rgba(140, 47, 47, 0.12); }

/* ---------- 空态 / 更新时间 ---------- */
.empty-tip { text-align: center; color: var(--ink-faint); padding: 40px 0; font-size: 15px; letter-spacing: 2px; }
.updated { font-size: 12px; color: var(--ink-faint); }

/* ---------- 页脚 ---------- */
.site-foot { border-top: 2px solid var(--line); margin-top: 30px; padding: 22px 0 30px; text-align: center; }
.site-foot p { color: var(--ink-soft); font-size: 14px; letter-spacing: 2px; }
.site-foot .copy { margin-top: 6px; font-size: 12px; color: var(--ink-faint); }
.site-foot .fiction-note { margin-top: 10px; font-size: 12px; color: var(--ink-soft); letter-spacing: 1px; }

/* ---------- 移动端 ---------- */
@media (max-width: 640px) {
  .wrap { padding: 0 14px; }
  .hero-title { font-size: 34px; letter-spacing: 6px; }
  .hero { padding: 40px 0 24px; }
  .story-sheet { padding: 30px 20px 26px; margin: 18px 0 30px; }
  .story-title { font-size: 26px; }
  .story-body p { font-size: 16px; }
  .head-inner { padding-top: 10px; padding-bottom: 10px; }
  .brand-sub { display: none; }
  .story-foot { justify-content: center; }
}
