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

/* ===== 变量 ===== */
:root {
  --c-blue: #3bb1ff;
  --c-red: #ff5252;
  --c-black: #000000;
  --c-white: #ffffff;
  --c-bg: #f5f5f5;
  --c-card-bg: #ffffff;
  --c-border: #000000;
  --c-text: #111111;
  --c-muted: #555555;
  --shadow: 4px 4px 0 var(--c-black);
  --shadow-lg: 6px 6px 0 var(--c-black);
  --border: 3px solid var(--c-black);
  --nav-w: 260px;
  --font-mono: 'Fira Code', 'Courier New', monospace;
  --font-sans: 'Fira Sans', system-ui, sans-serif;
}

/* ===== 重置 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--c-text);
  background: var(--c-bg);
  min-height: 100vh;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* ===== 布局骨架 ===== */
.site-layout {
  display: flex;
  min-height: 100vh;
}
.page-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-left: var(--nav-w);
  min-width: 0;
}

/* ===== 侧边导航 ===== */
.sidenav {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--nav-w);
  height: 100vh;
  background: var(--c-black);
  border-right: var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 100;
}
.sidenav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 16px;
  border-bottom: 2px solid #333;
}
.sidenav__logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
}
.sidenav__brand-name {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--c-blue);
  line-height: 1.3;
}
.sidenav__search {
  padding: 12px 16px;
  border-bottom: 2px solid #333;
}
.sidenav__search-input {
  width: 100%;
  background: #1a1a1a;
  border: 2px solid #444;
  color: var(--c-white);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 8px 10px;
  outline: none;
  transition: border-color 0.15s;
}
.sidenav__search-input::placeholder { color: #666; }
.sidenav__search-input:focus { border-color: var(--c-blue); }
.sidenav__links {
  display: flex;
  flex-direction: column;
  padding: 12px 0;
  flex: 1;
}
.nav-link {
  display: block;
  padding: 10px 16px;
  font-size: 0.82rem;
  font-family: var(--font-mono);
  font-weight: 500;
  color: #ccc;
  border-left: 3px solid transparent;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  min-height: 40px;
  display: flex;
  align-items: center;
}
.nav-link:hover {
  background: #1e1e1e;
  color: var(--c-blue);
  border-left-color: var(--c-blue);
}
.nav-link--active {
  background: #1a1a1a;
  color: var(--c-blue);
  border-left-color: var(--c-red);
  font-weight: 700;
}
.sidenav__footer-nav {
  padding: 12px 16px;
  border-top: 2px solid #333;
  font-size: 0.75rem;
  color: #888;
}
.sidenav__footer-nav dl dt { color: #555; margin-bottom: 4px; font-family: var(--font-mono); }
.sidenav__footer-nav dl dd { margin-bottom: 2px; }
.sidenav__footer-nav dl dd a { color: #888; }
.sidenav__footer-nav dl dd a:hover { color: var(--c-blue); }

/* ===== 面包屑 ===== */
.breadcrumb-bar {
  background: var(--c-white);
  border-bottom: var(--border);
  padding: 10px 24px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--c-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.breadcrumb-bar a { color: var(--c-blue); font-weight: 600; }
.breadcrumb-bar a:hover { text-decoration: underline; }

/* ===== 正文区域 + aside 并排 ===== */
main {
  flex: 1;
  min-width: 0;
}
.page-body {
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  grid-template-columns: 1fr 280px;
  grid-template-areas:
    "breadcrumb breadcrumb"
    "main aside"
    "footer footer";
}
.breadcrumb-bar { grid-area: breadcrumb; }
main { grid-area: main; }
.global-aside { grid-area: aside; }
.site-footer { grid-area: footer; }

/* ===== 容器 ===== */
.wrap {
  padding: 24px;
  max-width: 860px;
}

/* ===== 通用按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 10px 20px;
  border: var(--border);
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
  min-height: 44px;
  text-decoration: none;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow); }
.btn:active { transform: translate(0, 0); box-shadow: none; }
.btn--primary { background: var(--c-blue); color: var(--c-black); box-shadow: var(--shadow); }
.btn--outline { background: var(--c-white); color: var(--c-black); box-shadow: var(--shadow); }
.btn--red { background: var(--c-red); color: var(--c-white); box-shadow: var(--shadow); }

/* ===== Eyebrow / 眉题 ===== */
.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  background: var(--c-red);
  color: var(--c-white);
  padding: 2px 8px;
  margin-bottom: 6px;
  text-transform: uppercase;
}
.section-title {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 700;
  border-bottom: var(--border);
  padding-bottom: 8px;
  margin-bottom: 20px;
  margin-top: 4px;
}

/* ===== Hero（首页）===== */
.hero {
  background: var(--c-blue);
  border-bottom: var(--border);
  min-height: 45vh;
  display: flex;
  align-items: center;
}
.hero__inner {
  padding: 32px 24px;
  max-width: 760px;
  position: relative;
}
.hero__badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--c-black);
  color: var(--c-blue);
  padding: 4px 12px;
  margin-bottom: 16px;
  border: 2px solid var(--c-black);
}
.hero__h1 {
  font-family: var(--font-mono);
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 700;
  color: var(--c-black);
  line-height: 1.2;
  margin-bottom: 12px;
}
.hero__lead {
  font-size: 1rem;
  color: #1a1a1a;
  margin-bottom: 20px;
  max-width: 560px;
}
.hero__ctas { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.hero__deco {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.deco-badge {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 12px;
  border: 2px solid var(--c-black);
  background: var(--c-white);
}
.deco-badge--1 { background: var(--c-red); color: var(--c-white); }
.deco-badge--2 { background: var(--c-black); color: var(--c-white); }
.deco-badge--3 { background: var(--c-white); color: var(--c-black); }

/* ===== 频道入口网格 ===== */
.ch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 40px;
}
.ch-card { }
.ch-card__link {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--c-white);
  border: var(--border);
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.88rem;
  box-shadow: var(--shadow);
  transition: transform 0.12s, box-shadow 0.12s;
  min-height: 44px;
}
.ch-card__link:hover { transform: translate(-2px,-2px); box-shadow: var(--shadow-lg); }
.ch-card__icon { font-size: 1.2rem; }
.ch-card__name { flex: 1; }
.ch-card__arrow { color: var(--c-red); font-weight: 700; }

/* ===== 卡片网格 ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}
.card {
  background: var(--c-white);
  border: var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.card--feature {
  box-shadow: var(--shadow);
  transition: transform 0.12s, box-shadow 0.12s;
}
.card--feature:hover { transform: translate(-2px,-2px); box-shadow: var(--shadow-lg); }
.card-img-wrap { overflow: hidden; border-bottom: var(--border); }
.card-img { width: 100%; object-fit: cover; max-height: 180px; }
.card-img-wrap--sm .card-img { max-height: 120px; }
.card-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--c-red);
  color: var(--c-white);
  padding: 2px 8px;
  align-self: flex-start;
}
.card-title { font-size: 1rem; font-weight: 700; line-height: 1.4; }
.card-title a:hover { color: var(--c-blue); }
.card-desc { font-size: 0.88rem; color: var(--c-muted); line-height: 1.5; flex: 1; }
.card-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--c-muted);
  display: block;
}

/* ===== 首页正文区 ===== */
.home-content-section { margin-bottom: 40px; }
.home-content { background: var(--c-white); border: var(--border); padding: 24px; }

/* ===== 频道页文章列表 ===== */
.ch-article-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 40px; }
.ch-article-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--c-white);
  border: var(--border);
  padding: 16px;
  box-shadow: var(--shadow);
  transition: transform 0.12s, box-shadow 0.12s;
}
.ch-article-card:hover { transform: translate(-2px,-2px); box-shadow: var(--shadow-lg); }
.ch-article-card__num {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--c-red);
  min-width: 40px;
  line-height: 1;
  padding-top: 4px;
}
.ch-article-card__body { flex: 1; min-width: 0; }
.ch-article-card__title {
  display: block;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 6px;
  line-height: 1.4;
}
.ch-article-card__title:hover { color: var(--c-blue); }
.ch-article-card__desc { font-size: 0.88rem; color: var(--c-muted); margin-bottom: 6px; }

/* ===== 频道页头部 ===== */
.channel-hero-strip {
  background: var(--c-red);
  border: var(--border);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-lg);
}
.channel-hero-strip__badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--c-black);
  color: var(--c-white);
  display: inline-block;
  padding: 2px 10px;
  margin-bottom: 10px;
}
.channel-hero-strip__h1 {
  font-family: var(--font-mono);
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  font-weight: 700;
  color: var(--c-white);
  margin-bottom: 8px;
}
.channel-hero-strip__desc { color: rgba(255,255,255,0.9); font-size: 0.95rem; }
.channel-content {
  background: var(--c-white);
  border: var(--border);
  padding: 24px;
  margin-bottom: 32px;
}

/* ===== 文章页 ===== */
.article-hero-img-wrap {
  border: var(--border);
  border-bottom: none;
  overflow: hidden;
  margin-bottom: 0;
}
.article-hero-img { width: 100%; object-fit: cover; max-height: 320px; }
.article-header {
  background: var(--c-white);
  border: var(--border);
  padding: 24px;
  margin-bottom: 0;
}
.article-meta-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.article-channel-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--c-blue);
  color: var(--c-black);
  padding: 3px 10px;
  border: 2px solid var(--c-black);
}
.article-date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--c-muted);
}
.article-h1 {
  font-family: var(--font-mono);
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 10px;
}
.article-lead { font-size: 1rem; color: var(--c-muted); }
.article-body {
  background: var(--c-white);
  border: var(--border);
  border-top: none;
  padding: 24px;
  font-size: 1rem;
  line-height: 1.75;
}
.article-body h2,
.article-body h3 { font-family: var(--font-mono); font-weight: 700; margin: 24px 0 12px; }
.article-body h2 { font-size: 1.2rem; border-left: 4px solid var(--c-red); padding-left: 12px; }
.article-body h3 { font-size: 1.05rem; }
.article-body p { margin-bottom: 16px; }
.article-body ul, .article-body ol { padding-left: 20px; margin-bottom: 16px; }
.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }
.article-body li { margin-bottom: 6px; }
.article-body blockquote {
  border-left: 4px solid var(--c-blue);
  padding: 12px 16px;
  background: #f0f8ff;
  margin: 16px 0;
  font-style: italic;
}
.article-footer {
  background: var(--c-white);
  border: var(--border);
  border-top: 2px dashed var(--c-black);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.article-tags { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }

/* ===== 关于/隐私页 ===== */
.about-header,
.privacy-header {
  background: var(--c-blue);
  border: var(--border);
  padding: 28px 24px;
  margin-bottom: 0;
  box-shadow: var(--shadow-lg);
}
.about-header__icon,
.privacy-header__icon {
  font-size: 2rem;
  margin-bottom: 8px;
  display: block;
}
.about-header__h1,
.privacy-header__h1 {
  font-family: var(--font-mono);
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  font-weight: 700;
  color: var(--c-black);
  margin-bottom: 8px;
}
.about-header__desc { color: #1a1a1a; font-size: 0.95rem; }
.about-content,
.privacy-content {
  background: var(--c-white);
  border: var(--border);
  border-top: none;
  padding: 24px;
}
.about-links { margin-top: 32px; }
.about-nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.privacy-footer-links {
  display: flex;
  gap: 12px;
  padding: 16px 24px;
  background: var(--c-white);
  border: var(--border);
  border-top: 2px dashed var(--c-black);
  flex-wrap: wrap;
}

/* ===== 标签页 ===== */
.tag-hero {
  background: var(--c-black);
  border: var(--border);
  padding: 28px 24px;
  margin-bottom: 0;
  box-shadow: var(--shadow-lg);
}
.tag-hero__icon { font-size: 1.8rem; display: block; margin-bottom: 8px; }
.tag-hero__h1 {
  font-family: var(--font-mono);
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  font-weight: 700;
  color: var(--c-blue);
  margin-bottom: 8px;
}
.tag-hero__desc { color: #aaa; font-size: 0.95rem; }
.tag-content {
  background: var(--c-white);
  border: var(--border);
  border-top: none;
  padding: 24px;
  margin-bottom: 32px;
}
.tag-article-list { display: flex; flex-direction: column; gap: 8px; }
.tag-article-item {
  display: flex;
  align-items: baseline;
  gap: 12px;
  background: var(--c-white);
  border: var(--border);
  padding: 12px 16px;
  transition: transform 0.12s, box-shadow 0.12s;
}
.tag-article-item:hover { transform: translate(-2px,-2px); box-shadow: var(--shadow); }
.tag-article-item__num {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--c-red);
  min-width: 28px;
}
.tag-article-item__link { font-weight: 600; font-size: 0.95rem; flex: 1; }
.tag-article-item__link:hover { color: var(--c-blue); }
.tag-article-item__meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--c-muted);
  white-space: nowrap;
}

/* ===== 标签胶囊 ===== */
.tag-pill {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--c-white);
  border: 2px solid var(--c-black);
  padding: 4px 12px;
  box-shadow: 3px 3px 0 var(--c-black);
  transition: transform 0.1s, box-shadow 0.1s;
  min-height: 32px;
}
.tag-pill:hover { transform: translate(-1px,-1px); box-shadow: 4px 4px 0 var(--c-black); background: var(--c-blue); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }

/* ===== aside ===== */
.global-aside {
  border-left: var(--border);
  background: var(--c-white);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}
.aside-block { }
.aside-title {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  border-bottom: 2px solid var(--c-black);
  padding-bottom: 6px;
  margin-bottom: 12px;
  margin-top: 4px;
}
.aside-list { display: flex; flex-direction: column; gap: 6px; }
.aside-list li a {
  display: block;
  font-size: 0.88rem;
  padding: 6px 8px;
  border-left: 3px solid transparent;
  transition: border-color 0.12s, background 0.12s;
}
.aside-list li a:hover { border-left-color: var(--c-blue); background: #f0f8ff; color: var(--c-blue); }

/* ===== 页脚 ===== */
.site-footer {
  background: var(--c-black);
  border-top: var(--border);
  color: var(--c-white);
}
.footer-cta {
  background: var(--c-red);
  border-bottom: var(--border);
  padding: 28px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-cta__text {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-white);
}
.footer-cols {
  padding: 28px 24px;
  border-bottom: 2px solid #222;
}
.footer-cols nav {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}
.footer-dl { flex: 1; min-width: 140px; }
.footer-dl__title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--c-blue);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
  display: block;
}
.footer-dl dd { margin-bottom: 6px; }
.footer-dl dd a {
  font-size: 0.85rem;
  color: #aaa;
  transition: color 0.12s;
}
.footer-dl dd a:hover { color: var(--c-white); }
.footer-bar {
  padding: 14px 24px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #666;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.footer-bar a { color: #888; }
.footer-bar a:hover { color: var(--c-blue); }

/* ===== Prose（正文排版）===== */
.prose { font-size: 1rem; line-height: 1.75; }
.prose h2 { font-family: var(--font-mono); font-size: 1.2rem; font-weight: 700; margin: 24px 0 12px; border-left: 4px solid var(--c-red); padding-left: 12px; }
.prose h3 { font-family: var(--font-mono); font-size: 1.05rem; font-weight: 700; margin: 20px 0 10px; }
.prose p { margin-bottom: 16px; }
.prose ul { list-style: disc; padding-left: 20px; margin-bottom: 16px; }
.prose ol { list-style: decimal; padding-left: 20px; margin-bottom: 16px; }
.prose li { margin-bottom: 6px; }
.prose a { color: var(--c-blue); text-decoration: underline; }

/* ===== empty tip ===== */
.empty-tip { color: var(--c-muted); font-size: 0.9rem; padding: 24px 0; }

/* ===== Reveal 动效 ===== */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.4s ease, transform 0.4s ease;
  }
  .reveal.visible {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}

/* ===== 移动端 ===== */
@media (max-width: 900px) {
  :root { --nav-w: 0px; }
  .site-layout { flex-direction: column; }
  .sidenav {
    position: static;
    width: 100%;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    overflow: visible;
    border-right: none;
    border-bottom: var(--border);
  }
  .sidenav__brand { padding: 12px 16px; border-bottom: none; border-right: 2px solid #333; }
  .sidenav__search { padding: 8px 12px; border-bottom: none; border-right: 2px solid #333; flex: 1; }
  .sidenav__links {
    flex-direction: row;
    flex-wrap: wrap;
    padding: 6px 8px;
    width: 100%;
    border-top: 2px solid #333;
    gap: 4px;
  }
  .nav-link {
    border-left: none;
    border-bottom: 2px solid transparent;
    padding: 8px 10px;
    font-size: 0.75rem;
    min-height: 40px;
  }
  .nav-link--active { border-bottom-color: var(--c-red); }
  .sidenav__footer-nav { display: none; }
  .page-body {
    margin-left: 0;
    display: block;
  }
  .global-aside {
    border-left: none;
    border-top: var(--border);
    padding: 16px;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px;
  }
  .aside-block { flex: 1; min-width: 200px; }
  .footer-cols nav { flex-direction: column; gap: 20px; }
  .footer-cta { flex-direction: column; align-items: flex-start; }
  .ch-grid { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  .wrap { padding: 16px; }
}

@media (max-width: 480px) {
  .hero { min-height: 45vh; }
  .hero__h1 { font-size: 1.35rem; }
  .article-h1,
  .channel-hero-strip__h1,
  .about-header__h1,
  .privacy-header__h1,
  .tag-hero__h1 { font-size: 1.2rem; }
  .tag-article-item { flex-wrap: wrap; }
  .tag-article-item__meta { width: 100%; }
  .footer-bar { font-size: 0.72rem; }
}
