/* 文芽作文 - 基础样式系统 */

:root {
  --paper: #faf8f4;
  --paper-2: #f3efe6;
  --card: #ffffff;
  --ink: #1c1f1d;
  --ink-soft: #5b635e;
  --ink-mute: #8b918c;
  --line: #e5e0d6;
  --brand: #2f6f4e;
  --brand-deep: #23563c;
  --brand-soft: #e8f1ea;
  --accent: #b8572a;
  --accent-soft: #f8ebe2;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(28, 31, 29, .04), 0 8px 24px -12px rgba(28, 31, 29, .12);
  --shadow-lg: 0 2px 4px rgba(28, 31, 29, .05), 0 24px 48px -24px rgba(28, 31, 29, .22);
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "SimSun", Georgia, serif;
  --sans: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  --max: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.35;
  margin: 0;
  letter-spacing: .01em;
}

p { margin: 0; }

button, input, select { font: inherit; color: inherit; }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- 顶部导航 ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 248, 244, .86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: .06em;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(145deg, var(--brand), var(--brand-deep));
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
  flex: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav a {
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 14.5px;
  color: var(--ink-soft);
  transition: background .18s, color .18s;
}

.nav a:hover { background: var(--paper-2); color: var(--ink); }

.nav a.active { background: var(--brand-soft); color: var(--brand-deep); font-weight: 600; }

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  cursor: pointer;
}

/* ---------- 通用区块 ---------- */

.section { padding: 64px 0; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

.section-head h2 { font-size: 27px; }

.section-head p {
  color: var(--ink-soft);
  font-size: 14.5px;
  margin-top: 6px;
}

.link-more {
  font-size: 14px;
  color: var(--brand);
  white-space: nowrap;
  border-bottom: 1px solid transparent;
  transition: border-color .18s;
}

.link-more:hover { border-color: var(--brand); }

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: transform .15s, box-shadow .18s, background .18s, border-color .18s;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 6px 18px -8px rgba(47, 111, 78, .7);
}

.btn-primary:hover { background: var(--brand-deep); }

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.btn-ghost:hover { background: var(--paper-2); border-color: #d8d1c3; }

/* ---------- 首页 Hero ---------- */

.hero {
  padding: 84px 0 72px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(900px 420px at 82% -10%, rgba(47, 111, 78, .09), transparent 70%),
    radial-gradient(700px 380px at 8% 8%, rgba(184, 87, 42, .06), transparent 65%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 56px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 13px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .04em;
}

.hero h1 {
  font-size: clamp(34px, 4.6vw, 52px);
  margin: 20px 0 18px;
  letter-spacing: .02em;
}

.hero h1 em {
  font-style: normal;
  color: var(--brand);
  position: relative;
  white-space: nowrap;
}

.hero h1 em::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  height: 8px;
  background: rgba(47, 111, 78, .14);
  border-radius: 4px;
  z-index: -1;
}

.hero-lead {
  font-size: 17px;
  color: var(--ink-soft);
  max-width: 44ch;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  gap: 36px;
  margin-top: 40px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.hero-stats div strong {
  display: block;
  font-family: var(--serif);
  font-size: 26px;
  color: var(--brand-deep);
  line-height: 1.2;
}

.hero-stats div span {
  font-size: 13px;
  color: var(--ink-mute);
}

/* Hero 右侧卡片 */

.hero-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 26px;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: -1px -1px auto;
  height: 3px;
  border-radius: 20px 20px 0 0;
  background: linear-gradient(90deg, var(--brand), #8fbb9c);
}

.hero-card h3 { font-size: 16px; }

.hero-card .muted {
  font-size: 13px;
  color: var(--ink-mute);
  margin-top: 4px;
}

.prompt-list {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  display: grid;
  gap: 10px;
}

.prompt-list li {
  display: flex;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  background: var(--paper);
  transition: border-color .18s, transform .18s;
}

.prompt-list li:hover { border-color: #cfe0d4; transform: translateX(2px); }

.prompt-list .idx {
  font-family: var(--serif);
  color: var(--brand);
  font-weight: 700;
  flex: none;
}

/* ---------- 卡片网格 ---------- */

.grid {
  display: grid;
  gap: 20px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: #dbd5c8;
}

.card-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 17px;
  margin-bottom: 16px;
}

.card h3 { font-size: 17px; margin-bottom: 8px; }

.card p { font-size: 14.5px; color: var(--ink-soft); }

/* ---------- 范文卡片 ---------- */

.essay-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform .2s, box-shadow .2s;
}

.essay-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.essay-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--ink-mute);
}

.tag {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--ink-soft);
  font-size: 12px;
}

.tag-brand { background: var(--brand-soft); color: var(--brand-deep); }

.tag-accent { background: var(--accent-soft); color: var(--accent); }

.essay-card h3 {
  font-size: 18px;
  line-height: 1.5;
}

.essay-card .excerpt {
  font-size: 14px;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.essay-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 13px;
  color: var(--ink-mute);
  margin-top: auto;
}

/* ---------- 筛选栏 ---------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 16px 0 28px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 32px;
}

.chip {
  padding: 6px 15px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 14px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all .16s;
}

.chip:hover { border-color: #cfc8ba; color: var(--ink); }

.chip.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 500;
}

.search-box {
  margin-left: auto;
  position: relative;
}

.search-box input {
  width: 240px;
  height: 38px;
  padding: 0 14px 0 36px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 14px;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}

.search-box input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(47, 111, 78, .1);
}

.search-box .icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-mute);
  pointer-events: none;
  display: block;
}

/* ---------- 页面头部 ---------- */

.page-head {
  padding: 56px 0 8px;
}

.page-head h1 { font-size: 34px; margin-bottom: 10px; }

.page-head p { color: var(--ink-soft); max-width: 60ch; }

/* ---------- 正文阅读 ---------- */

.reading {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 0 80px;
}

.reading h1 {
  font-size: 32px;
  margin-bottom: 14px;
}

.reading .meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 30px;
  font-size: 13.5px;
  color: var(--ink-mute);
}

.prose {
  font-family: var(--serif);
  font-size: 17.5px;
  line-height: 2;
  color: #2a2e2b;
}

.prose p { margin: 0 0 1.15em; text-indent: 2em; }

.prose h2 {
  font-size: 21px;
  margin: 1.8em 0 .8em;
  padding-left: 12px;
  border-left: 3px solid var(--brand);
}

.note {
  background: var(--brand-soft);
  border-left: 3px solid var(--brand);
  padding: 18px 20px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 14.5px;
  color: var(--brand-deep);
  margin: 28px 0;
}

.note strong { display: block; margin-bottom: 4px; }

/* ---------- 空状态 ---------- */

.empty {
  text-align: center;
  padding: 72px 20px;
  color: var(--ink-mute);
  font-size: 15px;
}

/* ---------- 页脚 ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--paper-2);
  padding: 44px 0 32px;
  margin-top: 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 32px;
}

.footer-grid h4 {
  font-size: 14px;
  font-family: var(--sans);
  font-weight: 600;
  margin-bottom: 12px;
}

.footer-grid p {
  font-size: 13.5px;
  color: var(--ink-soft);
  max-width: 34ch;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
  font-size: 13.5px;
  color: var(--ink-soft);
}

.footer-links a:hover { color: var(--brand); }

.copyright {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  font-size: 12.5px;
  color: var(--ink-mute);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* ---------- 响应式 ---------- */

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .search-box { margin-left: 0; width: 100%; }
  .search-box input { width: 100%; }
}

@media (max-width: 680px) {
  .wrap { padding: 0 18px; }
  .nav {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 10px 18px 16px;
    gap: 2px;
    display: none;
  }
  .nav.open { display: flex; }
  .nav-toggle { display: block; }
  .hero { padding: 56px 0 48px; }
  .section { padding: 48px 0; }
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; }
  .hero-stats { gap: 24px; }
  .prose { font-size: 16.5px; }
  .page-head h1 { font-size: 27px; }
  .reading h1 { font-size: 26px; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 10px; }
}
