@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&family=JetBrains+Mono:wght@400&family=Playfair+Display:ital@1&display=swap');

/* ===== 变量 & 重置 ===== */
:root {
  --c-bg: #111111;
  --c-red: #E5281E;
  --c-fg: #F5F5F5;
  --c-mid: #1e1e1e;
  --c-border: #2a2a2a;
  --c-muted: #888888;
  --c-red-dark: #b81f17;
  --c-red-hover: #ff3329;
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  --radius: 0;
  --announce-h: 36px;
  --header-h: 60px;
  --anchor-h: 44px;
  --transition: 160ms ease;
}

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

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

body {
  background: var(--c-bg);
  color: var(--c-fg);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: var(--c-red);
  text-decoration: none;
  transition: color var(--transition), opacity var(--transition);
}

a:hover, a:focus {
  color: var(--c-red-hover);
  text-decoration: underline;
}

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

ul { list-style: none; }

hr {
  border: none;
  border-top: 2px solid var(--c-red);
  margin: 0.5rem 0 1.2rem;
}

/* ===== 公告条 ===== */
.site-announce {
  background: var(--c-red);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  height: var(--announce-h);
  line-height: var(--announce-h);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 1rem;
}

/* ===== 顶部Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--c-bg);
  border-bottom: 2px solid var(--c-border);
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  gap: 1rem;
}

.site-brand a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

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

.brand-text {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--c-fg);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.header-nav-right {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.top-nav-link {
  display: none;
  color: var(--c-fg);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  transition: color var(--transition), background var(--transition);
  text-decoration: none;
}

.top-nav-link:hover {
  color: var(--c-red);
  text-decoration: none;
}

@media (min-width: 900px) {
  .top-nav-link { display: inline-block; }
}

/* ===== 汉堡按钮 ===== */
.hamburger-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  min-width: 44px;
  min-height: 44px;
  flex-shrink: 0;
}

.hamburger-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--c-fg);
  transition: background var(--transition);
}

.hamburger-btn:hover span {
  background: var(--c-red);
}

/* ===== 全屏遮罩菜单 ===== */
.hamburger-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: var(--c-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

.hamburger-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

.hamburger-overlay[aria-hidden="false"] {
  opacity: 1;
  pointer-events: all;
}

.menu-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  background: none;
  border: none;
  color: var(--c-fg);
  font-size: 1.75rem;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition);
}

.menu-close:hover { color: var(--c-red); }

.overlay-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  max-width: 480px;
  padding: 0 2rem;
}

.overlay-nav .nav-link {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--c-fg);
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--c-border);
  text-decoration: none;
  transition: color var(--transition), background var(--transition);
  min-height: 52px;
  line-height: 1.4;
  display: flex;
  align-items: center;
  justify-content: center;
}

.overlay-nav .nav-link:hover,
.overlay-nav .nav-link.active {
  color: var(--c-red);
  background: rgba(229,40,30,0.06);
  text-decoration: none;
}

/* ===== 锚点导航条 ===== */
.anchor-bar {
  position: sticky;
  top: var(--header-h);
  z-index: 150;
  background: var(--c-mid);
  border-bottom: 2px solid var(--c-border);
  display: flex;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
  height: var(--anchor-h);
  padding: 0 0.75rem;
  gap: 0;
}

.anchor-bar::-webkit-scrollbar { display: none; }

.anchor-link {
  display: flex;
  align-items: center;
  height: var(--anchor-h);
  padding: 0 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--c-muted);
  white-space: nowrap;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color var(--transition), border-color var(--transition);
  min-height: 44px;
}

.anchor-link:hover,
.anchor-link.is-cur {
  color: var(--c-fg);
  border-bottom-color: var(--c-red);
  text-decoration: none;
}

/* ===== 布局包装 ===== */
.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ===== 面包屑 ===== */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--c-muted);
  margin-bottom: 1.5rem;
  padding-top: 1.5rem;
}

.breadcrumb a { color: var(--c-muted); }
.breadcrumb a:hover { color: var(--c-red); }
.breadcrumb span { color: var(--c-muted); }

/* ===== 首页 Hero ===== */
.hero-section {
  min-height: 70vh;
  display: flex;
  align-items: center;
  padding: 4rem 0 3rem;
  background: var(--c-bg);
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--c-red);
}

.hero-article {
  width: 100%;
  text-align: center;
}

.hero-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.75rem;
}

.badge {
  display: inline-block;
  background: var(--c-red);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.3rem 0.8rem;
  text-transform: none;
}

.badge-alt {
  background: transparent;
  border: 2px solid var(--c-red);
  color: var(--c-red);
}

.hero-title {
  font-size: clamp(2rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--c-fg);
  margin-bottom: 1.25rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.hero-sub {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--c-muted);
  max-width: 620px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--c-red);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.75rem 2rem;
  min-height: 48px;
  text-decoration: none;
  transition: background var(--transition);
}

.btn-primary:hover {
  background: var(--c-red-hover);
  color: #fff;
  text-decoration: none;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--c-fg);
  font-size: 1rem;
  font-weight: 700;
  padding: 0.75rem 2rem;
  min-height: 48px;
  border: 2px solid var(--c-border);
  text-decoration: none;
  transition: border-color var(--transition), color var(--transition);
}

.btn-outline:hover {
  border-color: var(--c-red);
  color: var(--c-red);
  text-decoration: none;
}

.hero-content-area {
  max-width: 760px;
  margin: 0 auto;
  text-align: left;
  color: var(--c-muted);
  font-size: 0.95rem;
}

/* ===== 分类网格（首页）===== */
.cats-section,
.entries-section {
  padding: 3rem 0;
}

.cats-section h2,
.entries-section h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--c-fg);
  margin-bottom: 0.3rem;
}

.cats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1px;
  background: var(--c-border);
}

.cat-card {
  background: var(--c-mid);
  transition: background var(--transition);
}

.cat-card:hover {
  background: #222222;
}

.cat-card-inner {
  padding: 1.75rem 1.5rem;
  position: relative;
}

.cat-badge {
  display: inline-block;
  background: var(--c-red);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  margin-bottom: 0.75rem;
}

.cat-card h3 {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.cat-card h3 a {
  color: var(--c-fg);
  text-decoration: none;
}

.cat-card h3 a:hover { color: var(--c-red); }

.cat-card p {
  font-size: 0.875rem;
  color: var(--c-muted);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.cat-link {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--c-red);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
}

.cat-link:hover { color: var(--c-red-hover); }

/* ===== 条目网格（首页）===== */
.entries-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1px;
  background: var(--c-border);
}

.entry-card {
  background: var(--c-mid);
}

.entry-card:hover { background: #222; }

.entry-card-link {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.25rem 1.25rem;
  color: var(--c-fg);
  text-decoration: none;
  min-height: 100px;
}

.entry-card-link:hover { text-decoration: none; }

.entry-tag {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--c-red);
  letter-spacing: 0.05em;
}

.entry-card strong {
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-fg);
  display: block;
  line-height: 1.3;
}

.entry-desc {
  font-size: 0.82rem;
  color: var(--c-muted);
  display: block;
}

/* ===== 首页侧边 aside ===== */
.home-aside,
.cat-aside,
.entry-aside,
.about-aside,
.privacy-aside,
.default-aside {
  background: var(--c-mid);
  padding: 1.5rem;
  flex-shrink: 0;
}

.home-aside h3,
.cat-aside h3,
.entry-aside h3,
.about-aside h3,
.privacy-aside h3,
.default-aside h3 {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--c-fg);
  margin-bottom: 0.3rem;
  margin-top: 1.25rem;
}

.home-aside h3:first-child,
.cat-aside h3:first-child,
.entry-aside h3:first-child,
.about-aside h3:first-child,
.privacy-aside h3:first-child,
.default-aside h3:first-child {
  margin-top: 0;
}

.aside-links li {
  border-bottom: 1px solid var(--c-border);
}

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

.aside-links a {
  display: block;
  padding: 0.55rem 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--c-fg);
  text-decoration: none;
  min-height: 40px;
  display: flex;
  align-items: center;
  transition: color var(--transition);
}

.aside-links a:hover { color: var(--c-red); }

.aside-tip {
  margin-top: 1rem;
  background: rgba(229,40,30,0.08);
  border-left: 3px solid var(--c-red);
  padding: 0.75rem 1rem;
}

.aside-tip strong {
  display: block;
  font-size: 0.85rem;
  color: var(--c-red);
  margin-bottom: 0.3rem;
}

.aside-tip p {
  font-size: 0.82rem;
  color: var(--c-muted);
  line-height: 1.5;
}

.aside-cat-link {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0.4rem 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--c-fg);
  text-decoration: none;
  border-bottom: 1px solid var(--c-border);
  transition: color var(--transition);
}

.aside-cat-link:last-of-type { border-bottom: none; }
.aside-cat-link:hover,
.aside-cat-link.cur { color: var(--c-red); }

/* ===== 栏目页 ===== */
.cat-hero {
  padding: 3rem 0 2rem;
  border-bottom: 2px solid var(--c-border);
}

.cat-hero-inner {
  max-width: 760px;
}

.cat-title {
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--c-fg);
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.cat-intro {
  font-size: 1rem;
  color: var(--c-muted);
  max-width: 640px;
  line-height: 1.65;
}

.cat-content-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding: 2.5rem 0 3rem;
}

@media (min-width: 900px) {
  .cat-content-section {
    grid-template-columns: 1fr 260px;
  }
}

.cat-content-article {
  min-width: 0;
}

.cat-prose {
  font-size: 1rem;
  line-height: 1.75;
  color: #d0d0d0;
  margin-bottom: 2.5rem;
}

.cat-prose p { margin-bottom: 1rem; }

.children-block h2 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 0.3rem;
}

.children-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--c-border);
  margin-top: 0;
}

.child-card {
  background: var(--c-mid);
  transition: background var(--transition);
}

.child-card:hover { background: #222; }

.child-card-body {
  padding: 1.5rem;
}

.child-title {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.child-title a {
  color: var(--c-fg);
  text-decoration: none;
}

.child-title a:hover { color: var(--c-red); }

.entry-date {
  display: block;
  font-size: 0.78rem;
  color: var(--c-muted);
  margin-bottom: 0.5rem;
  font-family: var(--font-mono);
}

.child-desc {
  font-size: 0.875rem;
  color: var(--c-muted);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.child-more {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--c-red);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
}

.child-more:hover { color: var(--c-red-hover); }

.empty-tip {
  color: var(--c-muted);
  padding: 1.5rem 0;
  font-size: 0.95rem;
}

/* ===== 条目页 ===== */
.entry-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding: 0 0 3rem;
}

@media (min-width: 900px) {
  .entry-section {
    grid-template-columns: 1fr 260px;
  }
}

.entry-article {
  min-width: 0;
}

.entry-hero-wrap {
  margin-bottom: 1.5rem;
}

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

.entry-title {
  font-size: clamp(1.5rem, 3.5vw, 2.5rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--c-fg);
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
  padding-top: 1rem;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.article-date {
  font-size: 0.78rem;
  color: var(--c-muted);
  font-family: var(--font-mono);
}

.entry-cat-tag {
  display: inline-block;
  background: var(--c-red);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  min-height: 24px;
  line-height: 24px;
  text-decoration: none;
  transition: background var(--transition);
}

.entry-cat-tag:hover {
  background: var(--c-red-hover);
  color: #fff;
  text-decoration: none;
}

.entry-prose {
  font-size: 1rem;
  line-height: 1.8;
  color: #d0d0d0;
  margin-bottom: 2rem;
}

.entry-prose p { margin-bottom: 1.1rem; }
.entry-prose h2, .entry-prose h3 { color: var(--c-fg); margin: 1.5rem 0 0.5rem; }
.entry-prose ul, .entry-prose ol { padding-left: 1.5rem; margin-bottom: 1rem; list-style: disc; }
.entry-prose li { margin-bottom: 0.4rem; }

.entry-back {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.related-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--c-border);
}

.related-section h3 {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 0.3rem;
}

.related-card {
  background: var(--c-mid);
  margin-bottom: 1px;
}

.related-card:hover { background: #222; }

.related-card a {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1rem 1.25rem;
  color: var(--c-fg);
  text-decoration: none;
  min-height: 60px;
  justify-content: center;
}

.related-card strong {
  font-size: 0.95rem;
  font-weight: 700;
}

.related-card span {
  font-size: 0.8rem;
  color: var(--c-muted);
}

/* ===== 关于/隐私页 ===== */
.about-section,
.privacy-section,
.default-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding: 0 0 3rem;
}

@media (min-width: 900px) {
  .about-section,
  .privacy-section,
  .default-section {
    grid-template-columns: 1fr 260px;
  }
}

.about-article,
.privacy-article,
.default-article {
  min-width: 0;
}

.page-h1 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--c-fg);
  margin-bottom: 0.75rem;
  padding-top: 1rem;
  letter-spacing: -0.01em;
}

.prose {
  font-size: 1rem;
  line-height: 1.8;
  color: #d0d0d0;
}

.prose p { margin-bottom: 1.1rem; }
.prose h2 { color: var(--c-fg); font-size: 1.25rem; margin: 1.75rem 0 0.5rem; font-weight: 800; }
.prose h3 { color: var(--c-fg); font-size: 1.05rem; margin: 1.25rem 0 0.4rem; font-weight: 700; }
.prose ul, .prose ol { padding-left: 1.5rem; margin-bottom: 1rem; list-style: disc; }
.prose li { margin-bottom: 0.4rem; }
.prose a { color: var(--c-red); }
.prose a:hover { color: var(--c-red-hover); }

/* ===== 页脚 ===== */
.site-footer {
  background: #0a0a0a;
  border-top: 2px solid var(--c-border);
  padding: 2rem 1.25rem 1.5rem;
  text-align: center;
}

.footer-dl {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 0;
  margin-bottom: 1rem;
}

.footer-dl dt,
.footer-dl dd {
  margin: 0;
}

.footer-dl dt a,
.footer-dl dd a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--c-muted);
  text-decoration: none;
  transition: color var(--transition);
}

.footer-dl dt a { color: var(--c-red); }

.footer-dl dt a:hover,
.footer-dl dd a:hover {
  color: var(--c-fg);
  text-decoration: none;
}

.footer-copy {
  font-size: 0.82rem;
  color: var(--c-muted);
  margin-bottom: 0.4rem;
}

.footer-copy a {
  color: var(--c-muted);
  text-decoration: none;
}

.footer-copy a:hover { color: var(--c-red); }

.footer-note {
  display: block;
  font-size: 0.75rem;
  color: #555;
}

/* ===== 移动端适配 ===== */
@media (max-width: 599px) {
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
  }

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

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

  .cat-content-section,
  .entry-section,
  .about-section,
  .privacy-section,
  .default-section {
    grid-template-columns: 1fr;
  }

  .cat-aside,
  .entry-aside,
  .about-aside,
  .privacy-aside,
  .default-aside {
    order: -1;
  }

  .anchor-bar {
    padding: 0 0.5rem;
  }

  .anchor-link {
    padding: 0 0.6rem;
    font-size: 0.78rem;
  }
}

@media (min-width: 600px) and (max-width: 899px) {
  .cats-grid {
    grid-template-columns: 1fr 1fr;
  }

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

/* ===== 无障碍跳过链接 ===== */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--c-red);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 9999;
  font-size: 0.875rem;
  transition: top 0.1s;
}

.skip-link:focus { top: 0; }

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