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

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

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

body {
  font-family: 'Patrick Hand', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: #000;
  color: #fff;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

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

a:hover {
  opacity: 0.75;
}

ul, dl, dt, dd {
  list-style: none;
}

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

/* ===== 字体工具 ===== */
.kalam {
  font-family: 'Kalam', 'Patrick Hand', cursive;
}

/* ===== 整体布局：左侧导航 + 右侧主区 ===== */
.site-wrap {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}

/* ===== 左侧竖导航 ===== */
.sidenav {
  position: fixed;
  top: 0;
  left: 0;
  width: 220px;
  height: 100vh;
  background: #000;
  border-right: 1px solid #222;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 0;
  z-index: 100;
  overflow-y: auto;
}

.sidenav-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1rem 1.5rem;
  border-bottom: 1px solid #222;
  margin-bottom: 1rem;
}

.brand-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.brand-mark {
  font-family: 'Kalam', cursive;
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 2px solid #fff;
}

.sidenav-dl {
  flex: 1;
  padding: 0 0.75rem;
}

.nav-item {
  margin-bottom: 0.25rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.75rem;
  border-radius: 4px;
  font-size: 0.875rem;
  color: #ccc;
  transition: background 220ms ease, color 220ms ease;
  min-height: 40px;
}

.nav-link:hover,
.nav-link--active {
  background: #fff;
  color: #000;
  opacity: 1;
}

.nav-icon {
  font-size: 0.75rem;
  flex-shrink: 0;
  width: 16px;
  text-align: center;
}

.nav-text {
  font-size: 0.8125rem;
  line-height: 1.3;
}

.sidenav-cta {
  padding: 1rem 0.75rem 0;
  border-top: 1px solid #222;
  margin-top: 1rem;
}

/* ===== 通用CTA按钮 ===== */
.cta-btn {
  display: block;
  background: #fff;
  color: #000;
  text-align: center;
  padding: 0.65rem 1rem;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  transition: background 220ms ease, color 220ms ease;
  min-height: 40px;
  line-height: 1.4;
}

.cta-btn:hover {
  background: #e0e0e0;
  opacity: 1;
}

.cta-btn--hero {
  display: inline-block;
  margin-top: 1.25rem;
  padding: 0.75rem 2rem;
  font-size: 1rem;
}

/* ===== 主区域 ===== */
.site-main {
  margin-left: 220px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== Hero（首页专用） ===== */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 45vh;
  border-bottom: 1px solid #222;
}

.hero-media {
  position: relative;
  background: #111;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: #111;
  border-right: 1px solid #333;
}

.hero-placeholder-text {
  font-size: 3rem;
  font-weight: 700;
  color: #fff;
  opacity: 0.3;
  letter-spacing: 0.1em;
}

.hero-badge {
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  background: #fff;
  color: #000;
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  text-align: right;
  padding: 2rem 2.5rem;
  background: #000;
}

.hero-eyebrow {
  font-size: 0.875rem;
  color: #888;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
  font-weight: 700;
}

.hero-h1 {
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  color: #fff;
}

.hero-desc {
  font-size: 0.9375rem;
  color: #aaa;
  max-width: 320px;
  line-height: 1.6;
}

/* ===== 页面头部（非首页） ===== */
.page-header {
  padding: 2.5rem 2.5rem 2rem;
  border-bottom: 1px solid #222;
}

.page-header--about {
  background: #0a0a0a;
}

.page-header-inner {
  max-width: 800px;
}

.page-eyebrow {
  font-size: 0.8125rem;
  color: #888;
  letter-spacing: 0.12em;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.page-eyebrow a {
  color: #888;
  border-bottom: 1px solid #444;
}

.page-eyebrow a:hover {
  color: #fff;
  opacity: 1;
}

.page-h1 {
  font-size: clamp(1.5rem, 2.5vw, 2.25rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 0.75rem;
}

.page-lead {
  font-size: 0.9375rem;
  color: #aaa;
  line-height: 1.6;
  max-width: 600px;
}

.page-meta {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.75rem;
}

.page-date {
  font-size: 0.8125rem;
  color: #666;
}

/* ===== 主内容区 ===== */
.main-content {
  flex: 1;
  padding: 0;
}

.content-section {
  display: grid;
  grid-template-columns: auto 1fr 240px;
  grid-template-areas:
    "fig body aside";
  gap: 0;
  border-bottom: 1px solid #1a1a1a;
  min-height: 300px;
}

.content-section--article {
  grid-template-columns: 200px 1fr 240px;
}

.content-section--prose {
  grid-template-columns: auto 1fr 200px;
}

.content-section--about {
  grid-template-columns: auto 1fr 200px;
}

.content-figure {
  grid-area: fig;
  border-right: 1px solid #1a1a1a;
  padding: 1.5rem 1rem;
  min-width: 80px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: #050505;
}

.content-figure--article {
  min-width: 200px;
}

.content-figure--empty {
  min-width: 60px;
}

.content-figure-cap {
  font-size: 0.75rem;
  color: #555;
  writing-mode: vertical-lr;
  letter-spacing: 0.1em;
}

.content-figure-img,
.article-img {
  border-radius: 4px;
  width: 100%;
  max-height: 200px;
  object-fit: cover;
}

.content-figure figcaption {
  font-size: 0.75rem;
  color: #555;
  writing-mode: vertical-lr;
  letter-spacing: 0.1em;
}

.content-body {
  grid-area: body;
  padding: 2rem 2rem 2.5rem;
  font-size: 1rem;
  line-height: 1.75;
  color: #ddd;
  min-width: 0;
}

.article-body {
  max-width: 700px;
}

.prose-body {
  max-width: 700px;
}

.content-body h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin: 2rem 0 0.5rem;
  border-bottom: 1px solid #222;
  padding-bottom: 0.4rem;
}

.content-body h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  color: #eee;
  margin: 1.5rem 0 0.4rem;
}

.content-body p {
  margin-bottom: 1rem;
}

.content-body a {
  color: #fff;
  border-bottom: 1px solid #444;
}

.content-body a:hover {
  border-bottom-color: #fff;
  opacity: 1;
}

.content-body ul,
.content-body ol {
  padding-left: 1.25rem;
  margin-bottom: 1rem;
}

.content-body li {
  list-style: disc;
  margin-bottom: 0.4rem;
}

/* ===== 右侧aside ===== */
.content-aside {
  grid-area: aside;
  border-left: 1px solid #1a1a1a;
  padding: 1.75rem 1.25rem;
  background: #050505;
}

.aside-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.3rem;
  letter-spacing: 0.05em;
}

.aside-links {
  margin-top: 0.75rem;
}

.aside-links li {
  margin-bottom: 0.4rem;
}

.aside-links a {
  font-size: 0.8125rem;
  color: #888;
  display: block;
  padding: 0.35rem 0;
  border-bottom: 1px solid #111;
  transition: color 220ms;
  min-height: 32px;
  line-height: 1.4;
}

.aside-links a:hover {
  color: #fff;
  opacity: 1;
}

.aside-tags {
  margin-top: 1.25rem;
}

.aside-tags-label {
  font-size: 0.75rem;
  color: #555;
  margin-bottom: 0.5rem;
}

.tag-badge {
  display: inline-block;
  background: #111;
  color: #ccc;
  font-size: 0.75rem;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  margin: 0.2rem 0.2rem 0 0;
  border: 1px solid #333;
  transition: background 220ms, color 220ms;
}

.tag-badge:hover {
  background: #fff;
  color: #000;
  opacity: 1;
}

/* ===== 段落副标题 ===== */
.subtitle {
  font-size: 0.8125rem;
  color: #666;
  margin-top: 0.25rem;
  margin-bottom: 1rem;
  line-height: 1.4;
}

/* ===== Section 通用 ===== */
.section-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

/* ===== 分类总览（首页 table） ===== */
.section-cats {
  padding: 2.5rem 2.5rem 2rem;
  border-bottom: 1px solid #1a1a1a;
}

.section-cats .section-title {
  margin-bottom: 0.25rem;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 1.25rem;
}

.cat-table,
.tag-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.cat-table tr,
.tag-table tr {
  border-bottom: 1px solid #1a1a1a;
  transition: background 200ms;
}

.cat-table tr:hover,
.tag-table tr:hover {
  background: #0d0d0d;
}

.cat-cell,
.tag-table td {
  padding: 0.85rem 1rem;
  vertical-align: middle;
  color: #ccc;
}

.cat-cell--title,
.tag-entry-title {
  min-width: 180px;
  font-weight: 700;
}

.cat-link,
.tag-entry-link {
  color: #fff;
}

.cat-label {
  font-size: 1rem;
  font-weight: 700;
}

.cat-cell--desc,
.tag-entry-desc {
  color: #888;
  font-size: 0.875rem;
}

.cat-cell--count {
  color: #555;
  font-size: 0.8125rem;
  white-space: nowrap;
}

.tag-entry-date time {
  font-size: 0.8125rem;
  color: #555;
}

/* ===== 精选入口 grid（首页） ===== */
.section-entries {
  padding: 2.5rem 2.5rem 2rem;
  border-bottom: 1px solid #1a1a1a;
}

.section-entries .section-title {
  margin-bottom: 0.25rem;
}

.entries-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

/* ===== 玻璃拟态卡片 ===== */
.glass-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 1.25rem;
  transition: background 220ms ease, border-color 220ms ease, transform 220ms ease;
}

.glass-card:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.25);
  transform: translateY(-2px);
}

.entry-card-link,
.child-card-link,
.related-link {
  display: block;
}

.entry-card-label,
.child-card-title,
.related-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.4rem;
  line-height: 1.3;
}

.entry-card-desc,
.child-card-desc,
.related-desc {
  font-size: 0.8125rem;
  color: #888;
  line-height: 1.5;
}

.child-card-date {
  display: block;
  font-size: 0.75rem;
  color: #555;
  margin-top: 0.5rem;
}

/* ===== 子页列表（栏目页） ===== */
.section-children {
  padding: 2.5rem 2.5rem 2rem;
  border-bottom: 1px solid #1a1a1a;
}

.section-children .section-title {
  margin-bottom: 0.25rem;
}

.children-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

/* ===== 相关推荐（entry页） ===== */
.section-related {
  padding: 2.5rem 2.5rem 2rem;
  border-bottom: 1px solid #1a1a1a;
}

.section-related .section-title {
  margin-bottom: 0.25rem;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

/* ===== 标签页 ===== */
.section-tag-entries {
  padding: 2.5rem 2.5rem 2rem;
}

.section-tag-entries .section-title {
  margin-bottom: 0.25rem;
}

/* ===== about统计 ===== */
.section-about-stats {
  padding: 2.5rem 2.5rem 2rem;
}

.section-about-stats .section-title {
  margin-bottom: 0.25rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.25rem;
}

.stat-card {
  text-align: center;
  padding: 2rem 1rem;
}

.stat-num {
  font-size: 2.5rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.875rem;
  color: #888;
}

/* ===== 页脚 ===== */
.site-footer {
  background: #000;
  border-top: 1px solid #222;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  margin-top: auto;
}

.site-footer > section {
  padding: 2rem 2rem;
  border-right: 1px solid #1a1a1a;
}

.site-footer > section:last-child {
  border-right: none;
}

.footer-brand-name {
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.footer-brand-desc {
  font-size: 0.8125rem;
  color: #666;
  line-height: 1.5;
}

.footer-dl-title {
  font-size: 0.75rem;
  color: #555;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}

.footer-dl dd {
  margin-bottom: 0.35rem;
}

.footer-dl dd a {
  font-size: 0.8125rem;
  color: #888;
  display: inline-block;
  padding: 0.2rem 0;
  min-height: 28px;
  line-height: 1.4;
  transition: color 200ms;
}

.footer-dl dd a:hover {
  color: #fff;
  opacity: 1;
}

.footer-legal {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.5rem;
}

.footer-copy {
  font-size: 0.8125rem;
  color: #555;
}

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

.footer-links a {
  font-size: 0.8125rem;
  color: #888;
  min-height: 28px;
  display: inline-block;
  line-height: 1.4;
  padding: 0.2rem 0;
  transition: color 200ms;
}

.footer-links a:hover {
  color: #fff;
  opacity: 1;
}

/* ===== 滚动揭示动效 ===== */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 300ms ease, transform 300ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .glass-card {
    transition: none;
  }
  .nav-link, .cta-btn, .tag-badge, .aside-links a {
    transition: none;
  }
}

/* ===== 移动端（≤768px） ===== */
@media (max-width: 768px) {
  .site-wrap {
    grid-template-columns: 1fr;
  }

  .sidenav {
    position: static;
    width: 100%;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 0.75rem;
    border-right: none;
    border-bottom: 1px solid #222;
    overflow-x: auto;
    overflow-y: visible;
  }

  .sidenav-brand {
    padding: 0 1rem 0 0;
    border-bottom: none;
    border-right: 1px solid #333;
    margin-bottom: 0;
    margin-right: 0.75rem;
  }

  .sidenav-dl {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 0;
    gap: 0.25rem;
    flex: 1;
  }

  .nav-item {
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .nav-link {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    min-height: 40px;
  }

  .nav-text {
    white-space: nowrap;
    font-size: 0.75rem;
  }

  .nav-icon {
    display: none;
  }

  .sidenav-cta {
    border-top: none;
    margin-top: 0;
    padding: 0 0 0 0.75rem;
  }

  .site-main {
    margin-left: 0;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-media {
    min-height: 200px;
  }

  .hero-copy {
    text-align: left;
    align-items: flex-start;
    padding: 1.5rem;
  }

  .hero-desc {
    max-width: 100%;
  }

  .content-section {
    grid-template-columns: 1fr;
    grid-template-areas:
      "fig"
      "body"
      "aside";
  }

  .content-section--article,
  .content-section--prose,
  .content-section--about {
    grid-template-columns: 1fr;
  }

  .content-figure {
    border-right: none;
    border-bottom: 1px solid #1a1a1a;
    flex-direction: row;
    align-items: center;
    min-width: auto;
    padding: 1rem 1.5rem;
  }

  .content-figure figcaption,
  .content-figure-cap {
    writing-mode: horizontal-tb;
    font-size: 0.8125rem;
  }

  .content-aside {
    border-left: none;
    border-top: 1px solid #1a1a1a;
    order: 3;
    padding: 1.25rem 1.5rem;
  }

  .content-body {
    padding: 1.5rem;
    order: 2;
  }

  .page-header {
    padding: 1.5rem;
  }

  .site-footer {
    grid-template-columns: 1fr;
  }

  .site-footer > section {
    border-right: none;
    border-bottom: 1px solid #1a1a1a;
    padding: 1.5rem;
  }

  .site-footer > section:last-child {
    border-bottom: none;
  }

  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
  }

  .entries-grid,
  .children-grid,
  .related-grid {
    grid-template-columns: 1fr 1fr;
  }

  .section-cats,
  .section-entries,
  .section-children,
  .section-related,
  .section-about-stats,
  .section-tag-entries {
    padding: 1.5rem;
  }

  .page-meta {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
}

@media (max-width: 480px) {
  .entries-grid,
  .children-grid,
  .related-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .hero-h1 {
    font-size: 1.375rem;
  }

  .cat-cell--desc {
    display: none;
  }
}

/* ===== 带侧边栏的主内容布局 ===== */
.main-content--with-aside {
  display: block;
}

.main-content--article {
  display: block;
}

.main-content--tag {
  display: block;
}

/* ===== 空提示 ===== */
.empty-tip {
  color: #666;
  font-size: 0.9rem;
  padding: 1rem 0;
}
