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

/* ── 变量 ── */
:root {
  --c-white: #ffffff;
  --c-surface: #f5f5f5;
  --c-ink: #1f1f1f;
  --c-ink-muted: #555555;
  --c-ink-faint: #999999;
  --c-border: #e0e0e0;
  --c-accent: #1f1f1f;
  --c-accent-hover: #3a3a3a;
  --radius: 0px;
  --gap: 16px;
  --font: 'IBM Plex Sans', 'Helvetica Neue', Arial, 'Noto Sans CJK SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --max-w: 1200px;
  --header-h: 100px;
  --transition: 0.22s ease;
}

/* ── 重置 ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--c-surface);
  color: var(--c-ink);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { list-style: none; }

/* ── 页头 ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--c-white);
  border-bottom: 1.5px solid var(--c-border);
}

.header-brand {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 14px 24px 10px;
  display: flex;
  align-items: center;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand-text {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--c-ink);
}

.brand-logo {
  height: 36px;
  width: auto;
}

.header-nav {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
}

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--c-ink-muted);
  text-decoration: none;
  border-right: 1px solid var(--c-border);
  min-height: 44px;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}

.nav-link:first-child { border-left: 1px solid var(--c-border); }
.nav-link:hover { background: var(--c-white); color: var(--c-ink); text-decoration: none; }
.nav-link--active { background: var(--c-white); color: var(--c-ink); font-weight: 600; }

/* ── 主体 ── */
main { flex: 1; }

.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 32px 24px 48px;
}

/* ── Hero ── */
.hero-section {
  background: var(--c-white);
  border: 1.5px solid var(--c-border);
  padding: 40px 40px 36px;
  margin-bottom: 24px;
  min-height: 30vh;
  display: flex;
  align-items: center;
}

.hero-content {
  display: flex;
  align-items: flex-start;
  gap: 32px;
  width: 100%;
}

.hero-h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  max-width: 680px;
  flex: 1;
}

.hero-desc {
  font-size: 1rem;
  color: var(--c-ink-muted);
  margin-top: 16px;
  max-width: 560px;
  line-height: 1.7;
}

.hero-media {
  flex-shrink: 0;
  width: 120px;
}

.hero-img {
  width: 100%;
  height: auto;
  border: 1.5px solid var(--c-border);
}

/* ── 正文区段 ── */
.content-section {
  margin-bottom: 24px;
}

.page-content {
  background: var(--c-white);
  border: 1.5px solid var(--c-border);
  padding: 32px 40px;
}

/* ── 标题装饰 ── */
.section-heading {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-ink);
  margin-bottom: 8px;
}

.section-heading + hr {
  border: none;
  border-top: 2px solid var(--c-ink);
  margin-bottom: 20px;
}

/* ── Bento 网格 ── */
.bento-section { margin-bottom: 24px; }

.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 200px;
  gap: var(--gap);
}

.bento-card {
  background: var(--c-white);
  border: 1.5px solid var(--c-border);
  overflow: hidden;
  transition: transform var(--transition), border-color var(--transition);
}

.bento-card:hover {
  transform: scale(1.02);
  border-color: var(--c-ink);
  text-decoration: none;
}

.bento-card--span2x2 { grid-column: span 2; grid-row: span 2; }
.bento-card--span2x1 { grid-column: span 2; grid-row: span 1; }
.bento-card--span1x1 { grid-column: span 1; grid-row: span 1; }

.card-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.card-media {
  flex-shrink: 0;
  overflow: hidden;
  height: 50%;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition);
}

.bento-card:hover .card-img { transform: scale(1.04); }

.card-body {
  flex: 1;
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}

.card-eyebrow {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-ink-faint);
}

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-desc {
  font-size: 0.8rem;
  color: var(--c-ink-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-date {
  font-size: 0.75rem;
  color: var(--c-ink-faint);
  margin-top: auto;
}

/* ── 子页列表 ── */
.children-section,
.children-block { margin-bottom: 24px; }

.children-list {
  list-style: decimal;
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1.5px solid var(--c-border);
  background: var(--c-white);
}

.children-list li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--c-border);
  font-size: 0.9rem;
  counter-increment: list-count;
}

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

.children-list li::before {
  content: counter(list-count, decimal-leading-zero);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--c-ink-faint);
  min-width: 24px;
  flex-shrink: 0;
}

.children-list { counter-reset: list-count; }

.children-list a {
  font-weight: 500;
  transition: color var(--transition);
  text-decoration: none;
}

.children-list a:hover { color: var(--c-ink-faint); text-decoration: underline; }

.children-list small {
  color: var(--c-ink-faint);
  font-size: 0.78rem;
  margin-left: auto;
  flex-shrink: 0;
}

/* ── 文章页 ── */
.article-section { }

.article-main {
  background: var(--c-white);
  border: 1.5px solid var(--c-border);
  padding: 36px 40px 48px;
}

.article-h1 {
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}

.article-meta {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.meta-date {
  font-size: 0.8rem;
  color: var(--c-ink-faint);
  font-weight: 500;
  letter-spacing: 0.03em;
}

.article-hero {
  margin-bottom: 28px;
  border: 1.5px solid var(--c-border);
  overflow: hidden;
}

.article-hero-img {
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: cover;
}

.article-body {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--c-ink);
}

.article-body h2 { font-size: 1.3rem; font-weight: 700; margin: 2em 0 0.5em; }
.article-body h2 + hr { border: none; border-top: 2px solid var(--c-ink); margin-bottom: 1em; }
.article-body h3 { font-size: 1.1rem; font-weight: 600; margin: 1.6em 0 0.5em; }
.article-body p { margin-bottom: 1.2em; }
.article-body ul, .article-body ol { padding-left: 1.5em; margin-bottom: 1.2em; list-style: revert; }
.article-body li { margin-bottom: 0.4em; }
.article-body table { width: 100%; border-collapse: collapse; margin-bottom: 1.5em; font-size: 0.9rem; }
.article-body th, .article-body td { padding: 10px 14px; border: 1px solid var(--c-border); text-align: left; }
.article-body th { background: var(--c-surface); font-weight: 600; }
.article-body blockquote { border-left: 3px solid var(--c-ink); padding-left: 1em; margin: 1.5em 0; color: var(--c-ink-muted); }
.article-body code { font-family: 'IBM Plex Mono', monospace; background: var(--c-surface); padding: 0.1em 0.4em; font-size: 0.88em; }
.article-body pre { background: var(--c-surface); padding: 1em; overflow-x: auto; margin-bottom: 1.5em; }
.article-body pre code { background: none; padding: 0; }
.article-body a { text-decoration: underline; color: var(--c-ink); }
.article-body a:hover { color: var(--c-ink-muted); }
.article-body img { max-width: 100%; border: 1.5px solid var(--c-border); margin: 1em 0; }

.related-nav { margin-top: 36px; }

/* ── 面包屑 ── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--c-ink-faint);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.breadcrumb a { color: var(--c-ink-faint); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--c-ink-faint); }

/* ── About 页 ── */
.about-article {
  background: var(--c-white);
  border: 1.5px solid var(--c-border);
  padding: 36px 40px 48px;
}

.about-h1 {
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  font-weight: 700;
  margin-bottom: 16px;
}

.about-hero { margin-bottom: 28px; border: 1.5px solid var(--c-border); overflow: hidden; }
.about-hero-img { width: 100%; height: auto; max-height: 360px; object-fit: cover; }

.about-body {
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 36px;
}

.about-body h2 { font-size: 1.3rem; font-weight: 700; margin: 2em 0 0.5em; }
.about-body h2 + hr { border: none; border-top: 2px solid var(--c-ink); margin-bottom: 1em; }
.about-body h3 { font-size: 1.1rem; font-weight: 600; margin: 1.5em 0 0.4em; }
.about-body p { margin-bottom: 1.2em; }

.about-links { margin-top: 32px; }

/* ── Privacy 页 ── */
.privacy-article {
  background: var(--c-white);
  border: 1.5px solid var(--c-border);
  padding: 36px 40px 48px;
}

.privacy-h1 {
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 700;
  margin-bottom: 16px;
}

.privacy-body {
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 32px;
}

.privacy-body h2 { font-size: 1.15rem; font-weight: 700; margin: 2em 0 0.5em; }
.privacy-body h2 + hr { border: none; border-top: 2px solid var(--c-ink); margin-bottom: 1em; }
.privacy-body p { margin-bottom: 1.2em; }

.privacy-nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.privacy-nav a {
  font-size: 0.875rem;
  font-weight: 500;
  border: 1.5px solid var(--c-ink);
  padding: 8px 18px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}

.privacy-nav a:hover { background: var(--c-ink); color: var(--c-white); text-decoration: none; }

/* ── 页脚 ── */
.site-footer {
  background: var(--c-white);
  border-top: 1.5px solid var(--c-border);
  margin-top: auto;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 40px 24px 32px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.footer-col dt {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-ink);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1.5px solid var(--c-border);
}

.footer-col dd {
  margin-bottom: 8px;
}

.footer-col dd a {
  font-size: 0.875rem;
  color: var(--c-ink-muted);
  text-decoration: none;
  display: inline-block;
  min-height: 28px;
  line-height: 1.6;
  transition: color var(--transition);
}

.footer-col dd a:hover { color: var(--c-ink); text-decoration: underline; }

.footer-bar {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 14px 24px;
  border-top: 1px solid var(--c-border);
  font-size: 0.78rem;
  color: var(--c-ink-faint);
}

/* ── Scroll Reveal ── */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ── 移动断点 ── */
@media (max-width: 900px) {
  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .bento-card--span2x2 { grid-column: span 2; grid-row: span 2; }
  .bento-card--span2x1 { grid-column: span 2; }
  .bento-card--span1x1 { grid-column: span 1; }
  .footer-inner { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .wrap { padding: 20px 16px 36px; }
  .header-brand { padding: 12px 16px 8px; }
  .header-nav { padding: 0 16px; overflow-x: auto; flex-wrap: nowrap; }
  .nav-link { padding: 10px 12px; font-size: 0.82rem; min-height: 44px; }

  .hero-section { padding: 28px 20px 24px; min-height: 0; }
  .hero-content { flex-direction: column; gap: 16px; }
  .hero-media { width: 80px; }
  .hero-h1 { font-size: 1.4rem; }

  .page-content { padding: 20px 18px; }
  .article-main { padding: 24px 18px 36px; }
  .about-article { padding: 24px 18px 36px; }
  .privacy-article { padding: 24px 18px 36px; }

  .bento-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 220px;
  }
  .bento-card--span2x2,
  .bento-card--span2x1,
  .bento-card--span1x1 {
    grid-column: span 1;
    grid-row: span 1;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 28px 16px 24px;
  }

  .footer-col dd a { min-height: 40px; display: flex; align-items: center; }
}

/* ── prefers-reduced-motion ── */
@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .bento-card { transition: none; }
  .bento-card:hover { transform: none; }
  .card-img { transition: none; }
  * { transition-duration: 0.01ms !important; }
}
