@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&display=swap');

/* ===== 基础重置与根变量 ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --paper: #fdfbf7;
  --paper-mid: #f5f5f5;
  --ink: #1a1a1a;
  --ink-soft: #444444;
  --ink-faint: #888888;
  --border: #d4d0c8;
  --border-strong: #1a1a1a;
  --accent-line: #1a1a1a;
  --gap: 1.5rem;
  --radius: 10px;
  --max-w: 1100px;
  --prose-max: 720px;
  --font-main: 'DM Sans', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --font-mono: 'Courier New', monospace;
}

html {
  font-size: 16px;
  scroll-behavior: auto;
}

body {
  font-family: var(--font-main);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

/* 纸张纹理叠加 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}
a:hover { text-decoration: none; }

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

/* ===== 页头 ===== */
.site-header {
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand-row {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.9rem 1.5rem 0.5rem;
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
}

.brand-logo {
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -0.02em;
  color: var(--ink);
  white-space: nowrap;
  flex-shrink: 0;
}

.brand-tagline {
  font-size: 0.8rem;
  color: var(--ink-faint);
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.main-nav {
  background: var(--paper-mid);
  border-top: 1px solid var(--border);
  padding: 0;
}

.main-nav > p {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.5rem 1.5rem;
  max-width: var(--max-w);
  margin: 0 auto;
}

.main-nav > p > a {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink);
  background: var(--paper);
  white-space: nowrap;
  min-height: 40px;
  transition: none;
}

.main-nav > p > a:hover,
.main-nav > p > a[aria-current="page"] {
  background: var(--ink);
  color: var(--paper);
}

/* ===== Hero 斜切色带 ===== */
.hero-slash {
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 40px;
  background: var(--paper);
  clip-path: polygon(0 100%, 100% 0, 100% 100%);
  z-index: 2;
}

/* ===== 面包屑 ===== */
.breadcrumb {
  font-size: 0.82rem;
  color: var(--ink-faint);
  margin-bottom: 1rem;
}
.breadcrumb a {
  color: var(--ink-faint);
  text-decoration: none;
}
.breadcrumb a:hover { text-decoration: underline; }

/* ===== 主体结构 ===== */
main {
  flex: 1;
  width: 100%;
}

.page-article {
  width: 100%;
}

/* ===== Hero 首页 ===== */
.hero-section {
  position: relative;
  min-height: 70vh;
  background: var(--paper-mid);
  border-bottom: 2px solid var(--ink);
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: 4rem 1.5rem 5rem;
}

.hero-content {
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 1;
}

.hero-h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  max-width: 20ch;
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--ink-soft);
  max-width: 50ch;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.section-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 1rem;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink);
  background: var(--paper);
  min-height: 40px;
}
.section-pill:hover {
  background: var(--ink);
  color: var(--paper);
}

.hero-media {
  position: absolute;
  right: 0;
  bottom: 0;
  top: 0;
  width: 42%;
  overflow: hidden;
  opacity: 0.18;
}
.hero-media .hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== 栏目 Hero ===== */
.section-hero {
  position: relative;
  background: var(--paper-mid);
  border-bottom: 2px solid var(--ink);
  padding: 3.5rem 1.5rem 4.5rem;
  overflow: hidden;
}
.section-hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.section-h1 {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 0.75rem;
}
.section-desc {
  font-size: 1rem;
  color: var(--ink-soft);
  max-width: 55ch;
}

/* ===== 文章 Hero ===== */
.story-header-section {
  background: var(--paper-mid);
  border-bottom: 2px solid var(--ink);
  padding: 2.5rem 1.5rem 3rem;
}
.story-header-section .story-meta {
  max-width: var(--max-w);
  margin: 0 auto;
}
.story-h1 {
  font-size: clamp(1.5rem, 3.5vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0.5rem auto 0.75rem;
  max-width: var(--max-w);
  padding: 0 1.5rem;
}
.story-desc {
  font-size: 1rem;
  color: var(--ink-soft);
  max-width: var(--prose-max);
  margin: 0 auto 1rem;
  padding: 0 1.5rem;
}
.meta-dates {
  font-size: 0.82rem;
  color: var(--ink-faint);
  margin-top: 0.25rem;
}
.meta-date { font-style: normal; }
.story-hero-wrap {
  max-width: var(--max-w);
  margin: 1.5rem auto 0;
  padding: 0 1.5rem;
}
.story-hero-img {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ===== 标签 Hero ===== */
.tag-header-section {
  background: var(--paper-mid);
  border-bottom: 2px solid var(--ink);
  padding: 2.5rem 1.5rem 3.5rem;
  position: relative;
  overflow: hidden;
}
.tag-h1 {
  font-size: clamp(1.5rem, 3.5vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  max-width: var(--max-w);
}
.tag-desc {
  font-size: 1rem;
  color: var(--ink-soft);
  max-width: 55ch;
}

/* ===== 关于 / 隐私 / 默认 Hero ===== */
.about-header-section,
.privacy-header-section,
.default-header-section {
  background: var(--paper-mid);
  border-bottom: 2px solid var(--ink);
  padding: 2.5rem 1.5rem 3.5rem;
  position: relative;
  overflow: hidden;
}
.about-h1, .privacy-h1, .default-h1 {
  font-size: clamp(1.5rem, 3.5vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  max-width: var(--max-w);
  margin: 0.5rem 0 0;
}

/* ===== 内容区双栏：侧边 + 正文 ===== */
.content-section {
  display: flex;
  align-items: flex-start;
  gap: 0;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  width: 100%;
}

/* 侧边栏在左 */
.page-aside {
  flex-shrink: 0;
  width: 210px;
  margin-right: 2.5rem;
  position: sticky;
  top: 110px;
  align-self: flex-start;
}

.aside-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

.aside-link {
  display: block;
  font-size: 0.88rem;
  padding: 0.3rem 0;
  text-decoration: none;
  color: var(--ink-soft);
  border-bottom: 1px solid transparent;
  line-height: 1.4;
}
.aside-link:hover {
  color: var(--ink);
  text-decoration: underline;
}
.aside-back {
  font-weight: 500;
}

.content-main {
  flex: 1;
  min-width: 0;
}

.page-date {
  display: block;
  font-size: 0.82rem;
  color: var(--ink-faint);
  margin-bottom: 1.25rem;
  font-style: normal;
}

/* ===== 正文排版 ===== */
.prose {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--ink);
  max-width: var(--prose-max);
}

.prose h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 2rem 0 0.25rem;
  letter-spacing: -0.015em;
}
.prose h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 1.5rem 0 0.25rem;
}
.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0.5rem 0 1rem;
}
.prose p { margin-bottom: 1rem; }
.prose ul, .prose ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}
.prose li { margin-bottom: 0.4rem; }
.prose a { color: var(--ink); }
.prose blockquote {
  border-left: 3px solid var(--ink);
  padding-left: 1rem;
  margin: 1.25rem 0;
  color: var(--ink-soft);
  font-style: italic;
}
.prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--paper-mid);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.1em 0.35em;
}
.prose pre {
  background: var(--paper-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  overflow-x: auto;
  margin-bottom: 1rem;
}
.prose pre code {
  background: none;
  border: none;
  padding: 0;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.prose th, .prose td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  text-align: left;
}
.prose th { background: var(--paper-mid); font-weight: 700; }

/* ===== section-heading 共用 ===== */
.section-heading {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-bottom: 0.25rem;
}

/* ===== 首页卡片区 ===== */
.cards-section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}
.cards-section > hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0.25rem 0 1.5rem;
}

.home-card {
  display: flex;
  gap: 1.25rem;
  padding: 1.25rem 0;
  border-bottom: 2px solid var(--ink);
}
.home-card:last-child { border-bottom: 1px solid var(--border); }

.home-card .card-thumb {
  flex-shrink: 0;
  width: 160px;
  height: 110px;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--paper-mid);
}
.home-card .card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== 栏目子页列表 ===== */
.index-section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}
.index-section > hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0.25rem 0 1.5rem;
}

.child-card {
  display: flex;
  gap: 1.25rem;
  padding: 1.25rem 0;
  border-bottom: 2px solid var(--ink);
}
.child-card:last-child { border-bottom: 1px solid var(--border); }

.child-card .card-thumb {
  flex-shrink: 0;
  width: 140px;
  height: 95px;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--paper-mid);
}
.child-card .card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== 共用卡片元素 ===== */
.card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.card-date {
  font-size: 0.78rem;
  color: var(--ink-faint);
  font-style: normal;
}
.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.card-title a {
  text-decoration: none;
  color: var(--ink);
}
.card-title a:hover { text-decoration: underline; }
.card-desc {
  font-size: 0.88rem;
  color: var(--ink-soft);
  line-height: 1.5;
  flex: 1;
}
.card-link {
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 1.5px solid var(--ink);
  align-self: flex-start;
  padding-bottom: 1px;
}
.card-link:hover { opacity: 0.6; }

/* ===== 标签列表 ===== */
.tag-list-section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}
.tag-list-section > hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0.25rem 0 1.5rem;
}

.tag-item {
  padding: 1.25rem 0;
  border-bottom: 2px solid var(--ink);
}
.tag-item:last-child { border-bottom: 1px solid var(--border); }
.tag-item-inner { max-width: var(--prose-max); }
.tag-item-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}
.tag-item-title a {
  text-decoration: none;
  color: var(--ink);
}
.tag-item-title a:hover { text-decoration: underline; }
.tag-item-desc {
  font-size: 0.88rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

/* ===== 关于页联系表单 ===== */
.about-contact {
  margin-top: 2.5rem;
  max-width: var(--prose-max);
}
.about-contact h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.about-contact > hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0 0 1rem;
}
.about-contact p {
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin-bottom: 1.25rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  margin-bottom: -0.4rem;
}
.form-input, .form-textarea {
  font-family: var(--font-main);
  font-size: 0.95rem;
  padding: 0.55rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  width: 100%;
  outline: none;
}
.form-input:focus, .form-textarea:focus {
  border-color: var(--ink);
}
.form-textarea { resize: vertical; line-height: 1.6; }
.form-btn {
  font-family: var(--font-main);
  font-size: 0.92rem;
  font-weight: 700;
  padding: 0.7rem 1.5rem;
  background: var(--ink);
  color: var(--paper);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  align-self: flex-start;
  min-height: 44px;
  letter-spacing: 0.02em;
}
.form-btn:hover { opacity: 0.8; }

/* ===== 页脚 ===== */
.site-footer {
  border-top: 2px solid var(--ink);
  background: var(--paper-mid);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  justify-content: center;
  font-size: 0.88rem;
}
.footer-links a {
  text-decoration: none;
  color: var(--ink-soft);
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}
.footer-links a:hover { text-decoration: underline; color: var(--ink); }

.footer-copy {
  font-size: 0.78rem;
  color: var(--ink-faint);
  text-align: center;
}

/* ===== hr 共用 ===== */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0.5rem 0 1.25rem;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .brand-row {
    padding: 0.75rem 1rem 0.4rem;
    flex-wrap: wrap;
    gap: 0.3rem;
  }
  .brand-tagline { display: none; }

  .main-nav > p {
    padding: 0.45rem 1rem;
    gap: 0.35rem;
  }
  .main-nav > p > a {
    font-size: 0.78rem;
    padding: 0.38rem 0.65rem;
  }

  .hero-section {
    min-height: 70vh;
    padding: 3rem 1rem 4rem;
  }
  .hero-media { display: none; }
  .hero-h1 { font-size: 1.8rem; }
  .hero-sub { font-size: 0.95rem; }

  .section-hero { padding: 2rem 1rem 3rem; }
  .story-header-section { padding: 2rem 1rem 2.5rem; }
  .story-h1 { padding: 0 1rem; }
  .story-desc { padding: 0 1rem; }
  .story-hero-wrap { padding: 0 1rem; }
  .about-header-section,
  .privacy-header-section,
  .default-header-section,
  .tag-header-section { padding: 2rem 1rem 3rem; }

  .content-section {
    flex-direction: column;
    padding: 1.5rem 1rem;
    gap: 1.5rem;
  }
  .page-aside {
    width: 100%;
    margin-right: 0;
    position: static;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
  }

  .cards-section,
  .index-section,
  .tag-list-section { padding: 0 1rem 2rem; }

  .home-card { flex-direction: column; }
  .home-card .card-thumb {
    width: 100%;
    height: 180px;
  }
  .child-card { flex-direction: column; }
  .child-card .card-thumb {
    width: 100%;
    height: 160px;
  }

  .site-footer { padding: 1.25rem 1rem; }
  .footer-links { gap: 0.3rem 1rem; }
}

@media (max-width: 480px) {
  html { font-size: 15px; }
  .hero-h1 { font-size: 1.5rem; }
  .section-h1, .story-h1, .tag-h1,
  .about-h1, .privacy-h1, .default-h1 { font-size: 1.4rem; }
  .main-nav > p > a { min-height: 44px; }
  .footer-links a { min-height: 44px; }
}

/* ===== 动效 / 轮播（prefers-reduced-motion 关闭） ===== */
@media (prefers-reduced-motion: no-preference) {
  .cards-section .home-card,
  .index-section .child-card,
  .tag-list-section .tag-item {
    border-bottom-width: 2px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
