/* ============================================================
   云笙 · 个人作品网站 — 素雅纸感主题（含暗色模式）
   ============================================================ */

:root {
  --bg: #f7f3ec;
  --bg-soft: #efe9df;
  --card: #fffdf9;
  --text: #2b2620;
  --muted: #8a7f70;
  --line: #e3dccc;
  --accent: #9a3b2e;
  --accent-soft: #f3e4e0;
  --gold: #b5882f;
  --cat-杂谈: #9a3b2e;
  --cat-随笔: #3e6b5a;
  --cat-诗歌: #7a5a9e;
  --cat-短文: #b5882f;
  --shadow: 0 10px 30px rgba(60, 45, 30, .08);
  --radius: 14px;
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", Georgia, "Times New Roman", serif;
}

html[data-theme="dark"] {
  --bg: #171512;
  --bg-soft: #201d18;
  --card: #211e19;
  --text: #e8e1d5;
  --muted: #9a9081;
  --line: #37322a;
  --accent: #d0695a;
  --accent-soft: #33241f;
  --gold: #cfa050;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-serif);
  line-height: 1.9;
  transition: background .3s, color .3s;
}

.container { max-width: 880px; margin: 0 auto; padding: 0 24px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav-wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { font-size: 1.3rem; font-weight: 700; letter-spacing: .35em; color: var(--text); text-decoration: none; }
.nav { display: flex; gap: 26px; align-items: center; }
.nav-link {
  color: var(--muted); text-decoration: none; font-size: .95rem; letter-spacing: .1em;
  padding-bottom: 2px; border-bottom: 2px solid transparent; transition: .2s;
}
.nav-link:hover, .nav-link.active { color: var(--accent); border-bottom-color: var(--accent); }
.theme-btn {
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 1rem;
  transition: .2s; flex-shrink: 0;
}
.theme-btn:hover { border-color: var(--accent); }
.hamburger {
  display: none; flex-direction: column; gap: 5px; background: none; border: none;
  cursor: pointer; padding: 8px;
}
.hamburger span { width: 22px; height: 2px; background: var(--text); transition: .25s; display: block; }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { padding: 96px 0 72px; text-align: center; position: relative; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 60% 50% at 50% 0%, var(--accent-soft), transparent 70%);
  opacity: .7;
}
.hero-inner { position: relative; }
.hero-eyebrow {
  display: inline-block; font-size: .8rem; letter-spacing: .4em; color: var(--gold);
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 18px 4px 22px; margin-bottom: 28px;
  background: var(--card);
}
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); font-weight: 700; letter-spacing: .12em; line-height: 1.5; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .sub { margin: 22px auto 0; max-width: 560px; color: var(--muted); font-size: 1.02rem; }
.hero-seal {
  margin-top: 36px; display: inline-flex; align-items: center; gap: 10px;
  color: var(--muted); font-size: .85rem; letter-spacing: .2em;
}
.hero-seal::before, .hero-seal::after { content: ""; width: 48px; height: 1px; background: var(--line); }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 8px 0 64px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 12px; text-align: center; box-shadow: var(--shadow);
  transition: transform .2s;
}
.stat:hover { transform: translateY(-3px); }
.stat b { display: block; font-size: 2rem; color: var(--accent); font-weight: 700; }
.stat span { font-size: .85rem; color: var(--muted); letter-spacing: .2em; }

/* ---------- Section ---------- */
section, .page-section { margin-bottom: 64px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 22px; gap: 12px; flex-wrap: wrap; }
.section-head h1, .section-head h2 { font-size: 1.4rem; letter-spacing: .15em; }
.section-head h1::before, .section-head h2::before { content: "❖ "; color: var(--gold); font-size: .9em; }
.section-head a { color: var(--muted); font-size: .85rem; text-decoration: none; letter-spacing: .1em; }
.section-head a:hover { color: var(--accent); }
.section-head .count { color: var(--muted); font-size: .9rem; }
.section-head .count strong { color: var(--accent); }
.lead { color: var(--muted); margin-bottom: 24px; font-size: .95rem; }

/* ---------- Article list ---------- */
.article-list { list-style: none; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.article-list li + li { border-top: 1px solid var(--line); }
.article-list a {
  display: flex; align-items: center; gap: 18px; padding: 16px 24px;
  color: var(--text); text-decoration: none; transition: background .15s;
}
.article-list a:hover { background: var(--bg-soft); }
.article-list a:hover .title { color: var(--accent); }
.num { color: var(--gold); font-size: .85rem; font-variant-numeric: tabular-nums; width: 2em; flex-shrink: 0; }
.title { flex: 1; font-size: 1.03rem; transition: color .15s; }
.cat {
  font-size: .75rem; letter-spacing: .15em; padding: 2px 12px; border-radius: 999px;
  border: 1px solid; flex-shrink: 0;
}
.cat-杂谈 { color: var(--cat-杂谈); border-color: color-mix(in srgb, var(--cat-杂谈) 45%, transparent); }
.cat-随笔 { color: var(--cat-随笔); border-color: color-mix(in srgb, var(--cat-随笔) 45%, transparent); }
.cat-诗歌 { color: var(--cat-诗歌); border-color: color-mix(in srgb, var(--cat-诗歌) 45%, transparent); }
.cat-短文 { color: var(--cat-短文); border-color: color-mix(in srgb, var(--cat-短文) 45%, transparent); }
.article-list li.hidden { display: none; }
.article-list .no-results { padding: 40px; text-align: center; color: var(--muted); }

/* ---------- Quote ---------- */
.quote-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 44px 40px; text-align: center; box-shadow: var(--shadow); position: relative;
}
.quote-card::before {
  content: "“"; position: absolute; top: 6px; left: 26px; font-size: 4rem;
  color: var(--accent); opacity: .25; font-family: Georgia, serif;
}
.quote-label { font-size: .75rem; letter-spacing: .4em; color: var(--gold); margin-bottom: 16px; }
.quote-text { font-size: 1.25rem; line-height: 2; }
.quote-src { margin-top: 16px; color: var(--muted); font-size: .9rem; }
.quote-src a { color: var(--accent); text-decoration: none; }

/* ---------- About + platforms ---------- */
.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; }
.about-card, .platform-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px; box-shadow: var(--shadow);
}
.about-card p { color: var(--muted); font-size: .98rem; }
.about-card p + p { margin-top: 12px; }
.about-quote {
  margin-top: 20px; padding-left: 16px; border-left: 3px solid var(--gold);
  color: var(--text); font-size: .95rem; line-height: 2;
}
.about-quote cite { display: block; margin-top: 8px; color: var(--muted); font-style: normal; font-size: .85rem; }
.platform-card h3 { font-size: 1.05rem; letter-spacing: .15em; margin-bottom: 18px; }
.platform-links { display: flex; flex-wrap: wrap; gap: 10px; }
.platform-links a {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 16px;
  color: var(--text); text-decoration: none; font-size: .88rem; transition: .2s; background: var(--bg);
}
.platform-links a:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.platform-links .dot { width: 8px; height: 8px; border-radius: 50%; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0; text-align: center; color: var(--muted); font-size: .85rem; letter-spacing: .15em; }

/* ---------- Literature page: search & filter ---------- */
.search-box {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 18px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.search-box input {
  flex: 1; border: none; outline: none; background: none; color: var(--text);
  font-family: inherit; font-size: .98rem;
}
.search-box input::placeholder { color: var(--muted); }
.search-icon { color: var(--muted); }
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.filter-tag {
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
  border-radius: 999px; padding: 6px 16px; font-size: .88rem; cursor: pointer;
  font-family: inherit; letter-spacing: .1em; transition: .2s;
}
.filter-tag .tag-count { margin-left: 6px; font-size: .75rem; color: var(--gold); }
.filter-tag:hover { border-color: var(--accent); color: var(--accent); }
.filter-tag.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.filter-tag.active .tag-count { color: rgba(255,255,255,.8); }

/* ---------- Article detail ---------- */
.article-main { padding: 56px 0 64px; }
.text-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(28px, 6vw, 64px); box-shadow: var(--shadow);
}
.text-card h1 { font-size: clamp(1.7rem, 4.5vw, 2.3rem); letter-spacing: .08em; text-align: center; }
.meta { text-align: center; margin: 14px 0 36px; }
.article-body { font-size: 1.05rem; line-height: 2.15; color: var(--text); }
.article-body p { margin: 1rem 0; }
.article-body strong { color: var(--accent); }
.article-body .article-section {
  text-align: center; font-weight: 600; color: var(--muted);
  letter-spacing: .3em; margin: 2.2rem 0 .8rem;
}
.article-body hr {
  border: none; width: 60px; height: 1px; background: var(--muted);
  opacity: .4; margin: 2.4rem auto;
}
.article-body.poem { text-align: center; font-size: 1.15rem; line-height: 2.4; }
.article-body.poem p { margin: .3rem 0; }

.article-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 40px; }
.article-nav a {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 20px; text-decoration: none; color: var(--text); transition: .2s;
}
.article-nav a:hover { border-color: var(--accent); transform: translateY(-2px); }
.article-nav .next-article { text-align: right; }
.article-nav .nav-label { font-size: .78rem; color: var(--muted); letter-spacing: .15em; }
.article-nav .nav-title { font-size: .98rem; color: var(--accent); }
.back-link { text-align: center; margin-top: 32px; }
.back-link a { color: var(--muted); text-decoration: none; font-size: .92rem; letter-spacing: .1em; }
.back-link a:hover { color: var(--accent); }

.reading-progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0;
  background: linear-gradient(90deg, var(--gold), var(--accent)); z-index: 30;
}

/* ---------- Photography ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.photo-tile {
  aspect-ratio: 4 / 3; border-radius: var(--radius); border: 1px dashed var(--line);
  background: var(--card); display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 8px; color: var(--muted); box-shadow: var(--shadow);
}
.photo-tile .icon { font-size: 1.8rem; opacity: .6; }
.photo-tile span { font-size: .85rem; letter-spacing: .15em; }
.photo-note {
  margin-top: 32px; text-align: center; color: var(--muted); font-size: .95rem;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 28px;
  background: var(--card); box-shadow: var(--shadow);
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; }
  .hero { padding: 64px 0 48px; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
  .hamburger { display: flex; }
  .nav {
    position: fixed; top: 64px; right: 0; left: 0;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--card); border-bottom: 1px solid var(--line);
    padding: 8px 24px 16px; display: none;
  }
  .nav.open { display: flex; }
  .nav .nav-link { width: 100%; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .nav .nav-link:last-of-type { border-bottom: none; }
  .nav .theme-btn { margin-top: 12px; }
  .article-nav { grid-template-columns: 1fr; }
  .article-list a { gap: 12px; padding: 14px 16px; }
}
