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

/* ==================== CSS 变量 ==================== */
:root {
  --paper: #fdfbf7;
  --paper-alt: #f5f5f5;
  --ink: #1a1a1a;
  --ink-light: #444;
  --ink-faint: #888;
  --border: #d8d4cc;
  --accent: #1a1a1a;
  --accent-line: #1a1a1a;
  --card-radius: 10px;
  --max-w: 1100px;
  --prose-max: 720px;
  --gap: 2rem;
  --font-main: 'Outfit', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
}

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

html {
  font-size: 17px;
  line-height: 1.7;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-main);
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  position: relative;
}

/* 纸张纹理 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Crect width='1' height='1' x='0' y='0' fill='%231a1a1a' opacity='0.03'/%3E%3Crect width='1' height='1' x='2' y='2' fill='%231a1a1a' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

body > * { position: relative; z-index: 1; }

a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
a:hover { opacity: 0.7; }

img { display: block; max-width: 100%; height: auto; }
ul, ol { list-style: none; }

/* ==================== 排版 ==================== */
h1, h2, h3, h4 {
  font-family: var(--font-main);
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink);
}

p { margin-bottom: 1.1em; font-size: 1rem; line-height: 1.75; }
p:last-child { margin-bottom: 0; }

/* ==================== 公告条 ==================== */
.header-announce {
  background: var(--ink);
  color: var(--paper);
  text-align: center;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  padding: 0.45rem 1rem;
}

/* ==================== 品牌行 ==================== */
.header-brand-row {
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
  padding: 1.1rem 0 1rem;
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-link {
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
  line-height: 1.2;
}

.brand-logo { width: 36px; height: 36px; object-fit: contain; }

/* ==================== 导航行 ==================== */
.header-nav-row {
  background: var(--paper-alt);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding-top: 0.2rem;
  padding-bottom: 0.2rem;
}

/* details 下拉菜单 */
.nav-dropdown {
  position: relative;
}

.nav-summary {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  background: var(--paper);
  user-select: none;
  list-style: none;
  min-height: 40px;
  transition: none;
}

.nav-summary::-webkit-details-marker { display: none; }
.nav-summary::after { content: '▾'; font-size: 0.7em; margin-left: 0.3rem; }
details[open] > .nav-summary::after { content: '▴'; }

.nav-dropdown > menu,
.nav-dropdown > ul {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  background: var(--paper);
  border: 1px solid var(--ink);
  min-width: 220px;
  z-index: 200;
  padding: 0.4rem 0;
}

.nav-dropdown > menu > li > a,
.nav-dropdown > ul > li > a {
  display: block;
  padding: 0.55rem 1.1rem;
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid var(--paper-alt);
  min-height: 40px;
  display: flex;
  align-items: center;
  transition: none;
}

.nav-dropdown > menu > li > a:hover,
.nav-dropdown > ul > li > a:hover {
  background: var(--paper-alt);
  opacity: 1;
}

/* 扁平链接行（桌面宽屏补充）*/
.nav-flat-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-left: auto;
}

.nav-flat-link {
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  min-height: 40px;
  display: flex;
  align-items: center;
  border-left: 1px solid var(--border);
  transition: none;
}

.nav-flat-link:hover { background: var(--paper-alt); opacity: 1; }

/* ==================== 主容器 ==================== */
main { min-height: 60vh; }

.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ==================== eyebrow small ==================== */
.eyebrow-small {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.35rem;
  font-family: var(--font-main);
}

.section-heading {
  font-size: 1.65rem;
  font-weight: 900;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--ink);
}

/* ==================== HERO（首页） ==================== */
.hero-section {
  padding: 4rem 0 3.5rem;
  min-height: 70vh;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.hero-inner {
  width: 100%;
  position: relative;
}

/* 点阵底纹 */
.hero-dot-bg {
  position: absolute;
  inset: -2rem -1.5rem;
  background-image: radial-gradient(circle, var(--ink) 1px, transparent 1px);
  background-size: 20px 20px;
  opacity: 0.06;
  pointer-events: none;
}

.hero-text {
  text-align: right;
  max-width: 800px;
  margin-left: auto;
  position: relative;
  z-index: 1;
}

.hero-h1 {
  font-size: clamp(2rem, 5vw, 3.8rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1.2rem;
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--ink-light);
  margin-bottom: 2rem;
  line-height: 1.65;
  max-width: 560px;
  margin-left: auto;
}

.hero-cta-row {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.8rem;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  min-height: 44px;
  border: 2px solid var(--ink);
  transition: none;
}

.btn-primary:hover { background: var(--paper); color: var(--ink); opacity: 1; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.8rem;
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  min-height: 44px;
  border: 2px solid var(--ink);
  transition: none;
}

.btn-ghost:hover { background: var(--ink); color: var(--paper); opacity: 1; }

/* ==================== 首页布局（两列） ==================== */
.home-content-section {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: var(--gap);
  padding: 2.5rem 0 3rem;
  align-items: start;
}

/* ==================== 专题页布局 ==================== */
.topic-hero {
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
}

.topic-hero-inner, .topic-header-inner { width: 100%; }

.topic-h1, .tag-h1, .about-h1, .privacy-h1, .default-h1 {
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  margin-top: 0.5rem;
}

.topic-lead, .tag-lead {
  font-size: 1.05rem;
  color: var(--ink-light);
  max-width: var(--prose-max);
}

.topic-body-section,
.tag-body-section,
.about-body-section,
.privacy-body-section {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: var(--gap);
  padding: 2.5rem 0 3rem;
  align-items: start;
}

/* ==================== 문서형 섹션 ==================== */
.article-hero {
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
}

.article-hero-inner { width: 100%; }

.article-h1 {
  font-size: clamp(1.5rem, 3.5vw, 2.4rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  margin-top: 0.5rem;
}

.article-meta-row {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.article-date, .article-date-mod {
  font-size: 0.82rem;
  color: var(--ink-faint);
  font-weight: 500;
}

.article-hero-img-wrap { margin-top: 1.5rem; }
.article-hero-img { width: 100%; max-height: 400px; object-fit: cover; border: 1px solid var(--border); }

.article-body-section {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: var(--gap);
  padding: 2.5rem 0 3rem;
  align-items: start;
}

/* ==================== about / privacy ==================== */
.about-hero, .privacy-header {
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
}

.about-hero-inner, .privacy-header-inner { width: 100%; }

.privacy-date {
  font-size: 0.82rem;
  color: var(--ink-faint);
  display: block;
  margin-top: 0.5rem;
}

.default-section {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: var(--gap);
  padding: 2.5rem 0 3rem;
  align-items: start;
}

/* ==================== 面包屑 ==================== */
.breadcrumb {
  font-size: 0.82rem;
  color: var(--ink-faint);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.breadcrumb a { color: var(--ink-faint); text-underline-offset: 2px; }
.breadcrumb span { color: var(--ink-faint); }

/* ==================== 正文 prose ==================== */
.prose-content {
  max-width: var(--prose-max);
  margin-bottom: 2.5rem;
}

.prose-content h2 {
  font-size: 1.4rem;
  font-weight: 900;
  margin: 2rem 0 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

.prose-content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 1.5rem 0 0.5rem;
}

.prose-content ul, .prose-content ol {
  list-style: disc;
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.prose-content ol { list-style: decimal; }
.prose-content li { margin-bottom: 0.4rem; }

.prose-content blockquote {
  border-left: 3px solid var(--ink);
  padding-left: 1.2rem;
  margin: 1.5rem 0;
  color: var(--ink-light);
  font-style: italic;
}

.prose-content a { font-weight: 500; }
.prose-content strong { font-weight: 700; }

/* ==================== 卡片（通用） ==================== */
.topic-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.topic-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  padding: 1.4rem 1.2rem 0;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.topic-card::after {
  content: '';
  display: block;
  height: 4px;
  background: var(--ink);
  margin-top: 1.2rem;
  border-radius: 0 0 var(--card-radius) var(--card-radius);
}

.topic-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.topic-card-title a { text-decoration: none; }
.topic-card-title a:hover { text-decoration: underline; opacity: 1; }

.topic-card-desc {
  font-size: 0.88rem;
  color: var(--ink-light);
  line-height: 1.55;
  margin-bottom: 0.75rem;
  flex: 1;
}

.topic-card-link {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
}

/* ==================== 文章网格 ==================== */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.article-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  padding: 1.2rem 1.1rem 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

.article-card::after {
  content: '';
  display: block;
  height: 3px;
  background: var(--ink);
  margin-top: 1rem;
  border-radius: 0 0 var(--card-radius) var(--card-radius);
}

.article-card-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
}

.article-card-title a { text-decoration: none; }
.article-card-title a:hover { text-decoration: underline; opacity: 1; }

.article-card-desc {
  font-size: 0.86rem;
  color: var(--ink-light);
  line-height: 1.55;
  flex: 1;
  margin-bottom: 0.5rem;
}

.article-card-date {
  font-size: 0.78rem;
  color: var(--ink-faint);
  display: block;
  margin-bottom: 0;
}

/* ==================== 子页列表（ul>li>section） ==================== */
.children-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.child-article-card {
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  padding: 1.1rem 1.2rem 0;
  background: var(--paper);
  display: flex;
  flex-direction: column;
}

.child-article-card::after {
  content: '';
  display: block;
  height: 3px;
  background: var(--ink);
  margin-top: 1rem;
  border-radius: 0 0 var(--card-radius) var(--card-radius);
}

.child-card-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.child-card-title a { text-decoration: none; }
.child-card-title a:hover { text-decoration: underline; opacity: 1; }

.child-card-desc {
  font-size: 0.88rem;
  color: var(--ink-light);
  margin-bottom: 0.5rem;
  line-height: 1.55;
}

.child-card-date {
  font-size: 0.78rem;
  color: var(--ink-faint);
}

/* ==================== 侧边栏 ==================== */
aside .sidebar-block {
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  padding: 1.2rem;
  margin-bottom: 1.25rem;
  background: var(--paper-alt);
}

.sidebar-heading {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-link-list li {
  border-bottom: 1px solid var(--paper);
}

.sidebar-link-list li:last-child { border-bottom: none; }

.sidebar-link-list a {
  display: block;
  padding: 0.45rem 0;
  font-size: 0.88rem;
  text-decoration: none;
  font-weight: 500;
  min-height: 40px;
  display: flex;
  align-items: center;
  transition: none;
}

.sidebar-link-list a:hover { opacity: 1; text-decoration: underline; }

.sidebar-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-link {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--ink);
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  min-height: 32px;
  transition: none;
}

.tag-link:hover { background: var(--ink); color: var(--paper); opacity: 1; }

.sidebar-text {
  font-size: 0.86rem;
  color: var(--ink-light);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.sidebar-more {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* ==================== 首页子块 ==================== */
.home-topics-block, .home-recent-block, .children-list-block, .tag-articles-block {
  margin-top: 2.5rem;
}

/* ==================== 页脚 ==================== */
.site-footer {
  background: var(--paper-alt);
  border-top: 2px solid var(--ink);
  padding: 2.5rem 1.5rem 0;
  margin-top: 3rem;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.footer-brand-col { display: flex; flex-direction: column; gap: 0.5rem; }

.footer-brand-name {
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.footer-brand-desc {
  font-size: 0.84rem;
  color: var(--ink-light);
  line-height: 1.55;
  margin: 0;
}

.footer-nav-col {}

.footer-nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.footer-nav-list a {
  font-size: 0.86rem;
  text-decoration: none;
  font-weight: 500;
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 0.2rem 0;
  transition: none;
}

.footer-nav-list a:hover { text-decoration: underline; opacity: 1; }

.footer-bottom {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1.2rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--ink-faint);
}

.footer-note { font-style: italic; }

/* ==================== 动效 Scroll Reveal ==================== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
}

.reveal.visible {
  opacity: 1;
  transform: none;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal-fast {
  opacity: 0;
  transform: translateY(14px);
}

.reveal-fast.visible {
  opacity: 1;
  transform: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-fast {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ==================== 响应式 ==================== */
@media (max-width: 900px) {
  .home-content-section,
  .topic-body-section,
  .article-body-section,
  .tag-body-section,
  .about-body-section,
  .privacy-body-section,
  .default-section {
    grid-template-columns: 1fr;
  }

  .home-sidebar,
  .topic-sidebar,
  .article-sidebar,
  .tag-sidebar,
  .about-sidebar,
  .privacy-sidebar,
  .default-sidebar {
    order: -1;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .nav-flat-links {
    display: none;
  }
}

@media (max-width: 600px) {
  html { font-size: 16px; }

  .hero-section { min-height: auto; padding: 2.5rem 0 2rem; }
  .hero-h1 { font-size: 1.8rem; }
  .hero-text { text-align: left; }
  .hero-cta-row { justify-content: flex-start; }
  .hero-sub { margin-left: 0; }

  .topic-list { grid-template-columns: 1fr; }
  .article-grid { grid-template-columns: 1fr; }

  .nav-summary { font-size: 0.82rem; padding: 0.5rem 0.75rem; }

  .header-brand-row { padding: 0.8rem 0; }
  .brand-link { font-size: 0.95rem; }

  .footer-bottom { flex-direction: column; gap: 0.5rem; text-align: center; }

  .section-heading { font-size: 1.35rem; }
}
