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

/* ===== 基础重置与变量 ===== */
:root {
  --black: #000000;
  --white: #ffffff;
  --gray-100: #f5f5f5;
  --gray-200: #e8e8e8;
  --gray-300: #cccccc;
  --gray-500: #888888;
  --gray-700: #444444;
  --accent: #000000;
  --font-main: 'Nunito Sans', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-brand: 'Varela Round', 'Nunito Sans', sans-serif;
  --max-w: 1200px;
  --nav-h: auto;
  --gap: 2rem;
  --radius: 4px;
  --trans: 220ms ease;
}

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

html {
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background: var(--white);
  color: var(--black);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a {
  color: var(--black);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity var(--trans);
}

a:hover {
  opacity: 0.6;
}

ul, ol, menu {
  list-style: none;
}

/* ===== 工具类 ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ===== 导航：details > summary + menu > li > a ===== */
.site-nav {
  background: var(--black);
  color: var(--white);
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--black);
}

.site-nav[open] summary .nav-toggle::after {
  content: '收起';
}

.site-nav summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  cursor: pointer;
  list-style: none;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-nav summary::-webkit-details-marker {
  display: none;
}

.brand-name {
  font-family: var(--font-brand);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.04em;
}

.brand-link {
  font-family: var(--font-brand);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
  text-decoration: none;
  letter-spacing: 0.04em;
}

.brand-link:hover {
  opacity: 0.7;
}

.nav-toggle {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--gray-300);
  text-transform: uppercase;
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
}

.site-nav__menu {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0;
  border-top: 1px solid #222;
  padding: 0.5rem 2rem 1rem;
}

.site-nav__menu li a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0.4rem 0.75rem;
  color: var(--white);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius);
  transition: background var(--trans), opacity var(--trans);
  line-height: 1.4;
}

.site-nav__menu li a:hover {
  background: rgba(255,255,255,0.08);
  opacity: 1;
}

.site-nav__menu li a.active {
  background: var(--white);
  color: var(--black);
}

/* ===== Hero（首页专用）===== */
.hero {
  background: var(--white);
  border-bottom: 2px solid var(--black);
  min-height: 45vh;
  display: flex;
  align-items: flex-end;
  padding: 3rem 2rem;
}

.hero__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
  text-align: right;
}

.hero__eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gray-500);
  margin-bottom: 1rem;
}

.hero__title {
  font-family: var(--font-brand);
  font-size: clamp(2rem, 6vw, 4.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
  color: var(--black);
}

.hero__sub {
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  color: var(--gray-700);
  max-width: 600px;
  margin-left: auto;
  line-height: 1.6;
}

/* ===== 页面页头（非首页）===== */
.page-header {
  background: var(--black);
  color: var(--white);
  padding: 2.5rem 2rem;
  border-bottom: none;
}

.page-header__inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

.page-header__crumb {
  font-size: 0.8rem;
  color: var(--gray-300);
  margin-bottom: 0.75rem;
}

.page-header__crumb a {
  color: var(--gray-300);
  text-decoration: none;
}

.page-header__crumb a:hover {
  color: var(--white);
  opacity: 1;
}

.page-header__title {
  font-family: var(--font-brand);
  font-size: clamp(1.5rem, 4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 0.75rem;
  color: var(--white);
}

.page-header__desc {
  font-size: 0.95rem;
  color: var(--gray-300);
  max-width: 700px;
  line-height: 1.6;
}

/* ===== 内容布局（侧边 aside 在左）===== */
.content-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0;
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
  flex: 1;
  align-items: start;
  padding: 0 2rem;
}

/* ===== 侧边栏 aside ===== */
.site-aside {
  position: sticky;
  top: 80px;
  padding: 2rem 1.5rem 2rem 0;
  border-right: 1px solid var(--gray-200);
  min-height: 300px;
}

.aside-inner {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.aside-inner h3 {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
  margin-top: 0.25rem;
}

.aside-links {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.aside-links li a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0.35rem 0;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-200);
  transition: color var(--trans);
  line-height: 1.4;
}

.aside-links li a:hover {
  color: var(--black);
  opacity: 1;
}

.aside-links li:last-child a {
  border-bottom: none;
}

.aside-divider {
  height: 1px;
  background: var(--gray-200);
  margin: 1rem 0;
}

/* ===== 眉题（small 同级紧邻 h2/h3）===== */
.eyebrow {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gray-500);
  margin-bottom: 0.25rem;
}

/* ===== main 内容区 ===== */
main {
  padding: 2.5rem 0 2.5rem 2rem;
  min-width: 0;
}

/* 正文容器结构：main > div.wrap > section > article */
.wrap {
  max-width: 820px;
}

section {
  margin-bottom: 3rem;
}

section:last-child {
  margin-bottom: 0;
}

/* ===== 章节标题 ===== */
.section-title {
  font-family: var(--font-brand);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  color: var(--black);
}

/* ===== 首页话题卡片 ===== */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--gap);
}

.topic-card {
  background: var(--black);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--trans), opacity var(--trans);
}

.topic-card:hover {
  transform: translateY(-3px);
  opacity: 0.9;
}

.topic-card__link {
  display: block;
  text-decoration: none;
  color: var(--white);
  height: 100%;
}

.topic-card__inner {
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 160px;
}

.topic-card__arrow {
  font-size: 1.25rem;
  font-weight: 300;
  color: var(--gray-300);
}

.topic-card__title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--white);
}

.topic-card__desc {
  font-size: 0.85rem;
  color: var(--gray-300);
  line-height: 1.5;
  flex: 1;
}

/* ===== 表格列表 ===== */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

tbody tr {
  border-bottom: 1px solid var(--gray-200);
  transition: background var(--trans);
}

tbody tr:last-child {
  border-bottom: none;
}

tbody tr:hover {
  background: var(--gray-100);
}

td {
  padding: 0.875rem 1rem;
  vertical-align: top;
  line-height: 1.5;
}

.tbl-date {
  white-space: nowrap;
  font-size: 0.8rem;
  color: var(--gray-500);
  min-width: 90px;
}

.tbl-title {
  font-weight: 600;
  min-width: 140px;
}

.tbl-title a {
  text-decoration: none;
  font-weight: 600;
}

.tbl-title a:hover {
  text-decoration: underline;
  opacity: 1;
}

.tbl-desc {
  color: var(--gray-700);
  font-size: 0.875rem;
}

/* ===== 文章页 ===== */
.article-meta {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--black);
}

.article-crumb {
  font-size: 0.8rem;
  color: var(--gray-500);
  margin-bottom: 0.75rem;
}

.article-crumb a {
  color: var(--gray-500);
  text-decoration: none;
}

.article-crumb a:hover {
  color: var(--black);
  opacity: 1;
}

.article-title {
  font-family: var(--font-brand);
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1rem;
  color: var(--black);
}

.article-dates {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.article-date {
  font-size: 0.8rem;
  color: var(--gray-500);
}

.article-content {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--black);
}

/* ===== 正文排版 ===== */
.prose,
.article-content,
.home-content-body,
.topic-intro-body,
.tag-content-body,
.about-body .prose,
.privacy-body .prose {
  font-size: 1rem;
  line-height: 1.75;
}

.prose h2, .article-content h2,
.prose h3, .article-content h3 {
  font-family: var(--font-brand);
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  line-height: 1.25;
}

.prose h2, .article-content h2 {
  font-size: 1.35rem;
  border-bottom: 1px solid var(--gray-200);
  padding-bottom: 0.4rem;
}

.prose h3, .article-content h3 {
  font-size: 1.1rem;
}

.prose p, .article-content p {
  margin-bottom: 1.25rem;
}

.prose ul, .article-content ul,
.prose ol, .article-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }

.prose li, .article-content li {
  margin-bottom: 0.4rem;
}

.prose a, .article-content a {
  color: var(--black);
  font-weight: 600;
}

/* ===== 页脚：footer > section×n ===== */
.site-footer {
  background: var(--black);
  color: var(--white);
  margin-top: auto;
}

.footer-cta {
  padding: 3rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  border-bottom: 1px solid #222;
  flex-wrap: wrap;
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
}

.footer-cta__text {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--white);
}

.footer-cta__btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.6rem 1.5rem;
  background: var(--white);
  color: var(--black);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: var(--radius);
  transition: background var(--trans), color var(--trans);
  white-space: nowrap;
}

.footer-cta__btn:hover {
  background: var(--gray-200);
  color: var(--black);
  opacity: 1;
}

.footer-meta {
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--gray-500);
}

.footer-nav {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-nav a {
  color: var(--gray-300);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  min-height: 40px;
  display: flex;
  align-items: center;
  transition: color var(--trans);
}

.footer-nav a:hover {
  color: var(--white);
  opacity: 1;
}

/* ===== 首页特定 ===== */
.page-home main {
  padding: 2.5rem 2rem;
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
  flex: 1;
}

.page-home .wrap {
  max-width: 100%;
}

.page-home .site-aside {
  display: none;
}

/* ===== 日期 time 样式 ===== */
time {
  font-size: 0.8rem;
  color: var(--gray-500);
}

/* ===== 动效：scroll reveal ===== */
@media (prefers-reduced-motion: no-preference) {
  .topic-card,
  .table-wrap,
  .article-body,
  .prose {
    animation: fadeUp 0.4s ease both;
  }

  .topic-card:nth-child(2) { animation-delay: 0.05s; }
  .topic-card:nth-child(3) { animation-delay: 0.1s; }
  .topic-card:nth-child(4) { animation-delay: 0.15s; }

  @keyframes fadeUp {
    from {
      opacity: 0;
      transform: translateY(16px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .content-layout {
    grid-template-columns: 1fr;
    padding: 0 1rem;
  }

  .site-aside {
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--gray-200);
    padding: 1.5rem 0;
    min-height: auto;
  }

  main {
    padding: 1.5rem 0;
  }

  .hero {
    min-height: 35vh;
    padding: 2rem 1rem;
  }

  .footer-cta {
    flex-direction: column;
    align-items: flex-start;
    padding: 2rem 1rem;
  }

  .footer-meta {
    padding: 1rem;
  }
}

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

  .site-nav summary {
    padding: 0.875rem 1rem;
  }

  .site-nav__menu {
    grid-template-columns: 1fr;
    padding: 0.5rem 1rem 1rem;
  }

  .site-nav__menu li a {
    min-height: 44px;
    font-size: 0.95rem;
  }

  .hero {
    min-height: 30vh;
    padding: 1.5rem 1rem;
    align-items: flex-start;
  }

  .hero__title {
    font-size: 1.75rem;
  }

  .hero__inner {
    text-align: left;
  }

  .hero__sub {
    margin-left: 0;
  }

  .page-header {
    padding: 1.5rem 1rem;
  }

  .page-header__title {
    font-size: 1.5rem;
  }

  .topic-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .topic-card__inner {
    min-height: 120px;
    padding: 1.25rem 1rem;
  }

  .section-title {
    font-size: 1.2rem;
  }

  .page-home main {
    padding: 1.5rem 1rem;
  }

  .tbl-desc {
    display: none;
  }

  td {
    padding: 0.75rem 0.75rem;
  }

  .article-title {
    font-size: 1.4rem;
  }

  .footer-nav {
    gap: 1rem;
  }

  .footer-nav a {
    font-size: 0.8rem;
  }
}

/* ===== about / privacy 页专用 ===== */
.about-body,
.privacy-body {
  max-width: 680px;
}

.page-about .article-body,
.page-privacy .article-body {
  max-width: 680px;
}
