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

/* ── 基础变量 ── */
:root {
  --c-black: #000000;
  --c-white: #ffffff;
  --c-gray-100: #f5f5f5;
  --c-gray-200: #e8e8e8;
  --c-gray-300: #d0d0d0;
  --c-gray-500: #7a7a7a;
  --c-gray-700: #3a3a3a;
  --c-accent: #1a1a1a;
  --c-glass-bg: rgba(255,255,255,0.72);
  --c-glass-border: rgba(0,0,0,0.10);
  --r-card: 4px;
  --r-btn: 4px;
  --shadow-card: 0 2px 12px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.05);
  --shadow-glass: 0 4px 24px rgba(0,0,0,0.10);
  --font-main: 'Nunito Sans', 'Varela Round', system-ui, -apple-system, sans-serif;
  --grid-gap: 1rem;
  --bottom-bar-h: 56px;
  --max-w: 1200px;
  --content-max: 780px;
}

/* ── 重置 ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.7;
  color: var(--c-black);
  background: var(--c-white);
  padding-bottom: var(--bottom-bar-h);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-black); text-decoration: underline; text-underline-offset: 2px; }
a:hover { opacity: 0.7; }
ul { list-style: none; }
h1,h2,h3,h4 { font-family: var(--font-main); font-weight: 700; line-height: 1.25; }
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
h2 { font-size: clamp(1.2rem, 3vw, 1.7rem); margin-bottom: 0.5rem; }
h3 { font-size: clamp(1rem, 2.5vw, 1.2rem); }
p { margin-bottom: 1rem; }
hr {
  border: none;
  border-top: 2px solid var(--c-black);
  margin: 0.75rem 0 1rem;
}

/* ── 外层包裹 ── */
.site-wrap { min-height: 100vh; display: flex; flex-direction: column; }

/* ── 汉堡全屏遮罩 ── */
.hamburger-overlay {
  position: fixed;
  inset: 0;
  background: var(--c-black);
  color: var(--c-white);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.hamburger-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}
.overlay-close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: var(--c-white);
  font-size: 1.8rem;
  cursor: pointer;
  padding: 0.5rem;
  line-height: 1;
  min-height: 44px;
  min-width: 44px;
}
.overlay-nav ul { display: flex; flex-direction: column; gap: 1.5rem; text-align: center; }
.overlay-nav ul li a {
  font-size: clamp(1.2rem, 5vw, 2rem);
  font-weight: 600;
  color: var(--c-white);
  text-decoration: none;
  letter-spacing: 0.02em;
  padding: 0.5rem 1rem;
  display: block;
  min-height: 44px;
  line-height: 44px;
}
.overlay-nav ul li a:hover { opacity: 0.6; }

/* ── 底部固定导航条 ── */
.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-bar-h);
  background: var(--c-black);
  color: var(--c-white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  z-index: 100;
  border-top: 2px solid var(--c-white);
}
.bar-brand {
  font-family: 'Varela Round', var(--font-main);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--c-white);
  text-decoration: none;
  letter-spacing: 0.03em;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.hamburger-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 0.6rem;
  min-height: 44px;
  min-width: 44px;
  justify-content: center;
  align-items: flex-end;
}
.hamburger-btn span {
  display: block;
  height: 2px;
  background: var(--c-white);
  border-radius: 2px;
  transition: width 0.2s;
}
.hamburger-btn span:nth-child(1) { width: 22px; }
.hamburger-btn span:nth-child(2) { width: 16px; }
.hamburger-btn span:nth-child(3) { width: 22px; }
.hamburger-btn:hover span { width: 22px; }

/* ── 主内容区共用 ── */
.home-main,
.inner-main {
  flex: 1;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (min-width: 900px) {
  .home-main,
  .inner-main {
    grid-template-columns: 1fr 280px;
    padding: 2.5rem 2rem 4rem;
    align-items: start;
  }
}

/* ── 正文容器结构契约：main > div > section ── */
.home-article,
.inner-article {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  min-width: 0;
}

/* ── Hero（首页） ── */
.hero-section {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 40vh;
  background: var(--c-black);
  color: var(--c-white);
  border-radius: var(--r-card);
  padding: 2.5rem 2rem;
  position: relative;
  overflow: hidden;
  align-items: center;
}
@media (min-width: 640px) {
  .hero-section {
    grid-template-columns: 1fr auto;
    min-height: 45vh;
    padding: 3rem 2.5rem;
  }
}
.hero-inner { display: flex; flex-direction: column; gap: 1rem; z-index: 1; }
.hero-badge {
  display: inline-block;
  background: var(--c-white);
  color: var(--c-black);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.75rem;
  border-radius: 2px;
  width: fit-content;
  text-transform: uppercase;
}
.hero-section h1 { color: var(--c-white); margin-bottom: 0.5rem; }
.hero-sub { font-size: 1rem; line-height: 1.7; opacity: 0.85; max-width: 520px; }
.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.5rem; }
.btn-primary {
  background: var(--c-white);
  color: var(--c-black);
  padding: 0.65rem 1.5rem;
  border-radius: var(--r-btn);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  transition: opacity 0.15s;
}
.btn-outline {
  background: transparent;
  color: var(--c-white);
  border: 2px solid var(--c-white);
  padding: 0.65rem 1.5rem;
  border-radius: var(--r-btn);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  transition: opacity 0.15s;
}
.btn-primary:hover, .btn-outline:hover { opacity: 0.75; }
.hero-deco {
  position: absolute;
  right: -20px;
  top: -20px;
  width: 200px;
  height: 200px;
  z-index: 0;
  pointer-events: none;
}
@media (min-width: 640px) {
  .hero-deco { right: 1rem; top: 1rem; }
}
.deco-block {
  position: absolute;
  border-radius: 2px;
  opacity: 0.12;
  background: var(--c-white);
}
.deco-block.b1 { width: 80px; height: 80px; top: 0; right: 0; }
.deco-block.b2 { width: 48px; height: 48px; top: 90px; right: 50px; }
.deco-block.b3 { width: 32px; height: 100px; top: 20px; right: 100px; }

/* ── 页面头部（内页） ── */
.page-header-section { padding: 1.5rem 0 0.5rem; border-bottom: 2px solid var(--c-black); }
.page-badge {
  display: inline-block;
  background: var(--c-black);
  color: var(--c-white);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 0.2rem 0.6rem;
  border-radius: 2px;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}
.page-intro { font-size: 1rem; color: var(--c-gray-700); margin-top: 0.5rem; }
.entry-meta {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--c-gray-500);
  margin-top: 0.5rem;
}
.entry-meta time { display: inline-flex; align-items: center; gap: 0.25rem; }
.entry-hero { margin-top: 1.25rem; }
.entry-hero-img { width: 100%; border-radius: var(--r-card); max-height: 360px; object-fit: cover; }

/* ── 正文区 ── */
.page-content-area {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--c-black);
  max-width: var(--content-max);
}
.page-content-area h2 { margin-top: 2rem; margin-bottom: 0.4rem; }
.page-content-area h3 { margin-top: 1.5rem; margin-bottom: 0.4rem; }
.page-content-area ul, .page-content-area ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.page-content-area li { margin-bottom: 0.4rem; }
.page-content-area a { color: var(--c-black); font-weight: 600; }
.page-content-area code {
  background: var(--c-gray-100);
  padding: 0.1em 0.4em;
  border-radius: 2px;
  font-size: 0.9em;
}
.page-content-area pre {
  background: var(--c-black);
  color: var(--c-white);
  padding: 1rem 1.25rem;
  border-radius: var(--r-card);
  overflow-x: auto;
  margin-bottom: 1rem;
}
.page-content-area blockquote {
  border-left: 4px solid var(--c-black);
  padding-left: 1rem;
  color: var(--c-gray-700);
  margin: 1rem 0;
}

/* ── 玻璃拟态卡片 ── */
.glass-card {
  background: var(--c-glass-bg);
  border: 1px solid var(--c-glass-border);
  border-radius: var(--r-card);
  padding: 1.25rem 1rem;
  box-shadow: var(--shadow-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  position: relative;
  overflow: hidden;
}
.glass-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0.05) 100%);
  pointer-events: none;
}
.glass-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.14);
}
.glass-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0; }
.glass-card h3 a { text-decoration: none; color: var(--c-black); }
.glass-card h3 a:hover { text-decoration: underline; }
.card-eyebrow {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-gray-500);
}
.card-desc { font-size: 0.88rem; color: var(--c-gray-700); line-height: 1.5; margin-bottom: 0; flex: 1; }
.card-meta { font-size: 0.78rem; color: var(--c-gray-500); }
.card-date { font-size: 0.78rem; color: var(--c-gray-500); }
.card-link {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--c-black);
  text-decoration: none;
  margin-top: 0.25rem;
  display: inline-block;
}
.card-link:hover { text-decoration: underline; }

/* ── Grid 布局 ── */
.grid-layout {
  display: grid;
  gap: var(--grid-gap);
}
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* ── 面包屑 ── */
.breadcrumb {
  font-size: 0.82rem;
  color: var(--c-gray-500);
  margin-bottom: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
}
.breadcrumb a { color: var(--c-gray-500); text-decoration: underline; text-underline-offset: 2px; }
.breadcrumb span[aria-hidden] { opacity: 0.5; }

/* ── 相关列表 ── */
.related-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.related-list li a {
  display: block;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--c-gray-200);
  border-radius: var(--r-card);
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.15s;
}
.related-list li a:hover { background: var(--c-gray-100); }
.empty-tip { color: var(--c-gray-500); font-size: 0.9rem; padding: 1rem 0; }

/* ── 侧边栏 ── */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0;
}
.sidebar-block {
  background: var(--c-gray-100);
  border: 1px solid var(--c-gray-200);
  border-radius: var(--r-card);
  padding: 1rem;
}
.sidebar-block h3 { font-size: 0.92rem; font-weight: 700; margin-bottom: 0.25rem; }
.sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.5rem;
}
.sidebar-links li a {
  font-size: 0.88rem;
  text-decoration: none;
  color: var(--c-gray-700);
  padding: 0.3rem 0;
  display: block;
  min-height: 36px;
  display: flex;
  align-items: center;
}
.sidebar-links li a:hover { color: var(--c-black); text-decoration: underline; }
.sidebar-links.about-info li {
  font-size: 0.85rem;
  color: var(--c-gray-700);
  padding: 0.25rem 0;
}
.sidebar-links.about-info li span { font-weight: 600; color: var(--c-black); }
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.tag-item {
  display: inline-block;
  background: var(--c-black);
  color: var(--c-white);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 2px;
  text-decoration: none;
  min-height: 28px;
  line-height: 1.5;
  transition: opacity 0.15s;
}
.tag-item:hover { opacity: 0.7; }

/* ── 页脚 ── */
.site-footer {
  background: var(--c-black);
  color: var(--c-white);
  padding: 2rem 1.25rem 1.25rem;
  margin-top: auto;
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 640px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
.footer-brand { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-brand-text {
  font-family: 'Varela Round', var(--font-main);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--c-white);
}
.footer-brand p { font-size: 0.84rem; color: rgba(255,255,255,0.65); line-height: 1.6; margin-bottom: 0; }
.footer-nav dl { display: flex; flex-direction: column; gap: 0.4rem; }
.footer-nav dt a,
.footer-nav dd a {
  color: rgba(255,255,255,0.85);
  font-size: 0.85rem;
  text-decoration: none;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0;
}
.footer-nav dt a { font-weight: 600; color: var(--c-white); }
.footer-nav dd { padding-left: 0.75rem; }
.footer-nav dd a { font-size: 0.8rem; color: rgba(255,255,255,0.6); }
.footer-nav dt a:hover, .footer-nav dd a:hover { opacity: 0.75; text-decoration: underline; }
.footer-bottom {
  max-width: var(--max-w);
  margin: 1.5rem auto 0;
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: 1rem;
  text-align: center;
}
.footer-bottom p { font-size: 0.78rem; color: rgba(255,255,255,0.45); margin-bottom: 0; }

/* ── 首页特殊 ── */
.page-home .hero-section h1 { color: var(--c-white); }
.page-home .cats-section,
.page-home .entries-section { padding-top: 0.5rem; }

/* ── 关于页 ── */
.about-info li { list-style: none; }

/* ── 移动端补丁 ── */
@media (max-width: 640px) {
  .home-main,
  .inner-main {
    padding: 1rem 0.875rem 2.5rem;
    gap: 1.5rem;
  }
  .hero-section { min-height: 38vh; padding: 2rem 1.25rem; }
  .hero-deco { display: none; }
  .glass-card { padding: 1rem 0.875rem; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .entry-meta { flex-direction: column; gap: 0.4rem; }
}

/* ── prefers-reduced-motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .glass-card:hover { transform: none; }
}
