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

/* ===== CSS 变量 ===== */
:root {
  --blue: #3bb1ff;
  --red: #ff5252;
  --black: #000;
  --white: #fff;
  --yellow: #ffe566;
  --bg: #f5f5f5;
  --shadow: 5px 5px 0 var(--black);
  --shadow-sm: 3px 3px 0 var(--black);
  --border: 3px solid var(--black);
  --radius: 0px;
  --font-body: 'Quicksand', system-ui, sans-serif;
  --font-display: 'Caveat', cursive;
  --content-max: 1100px;
  --prose-max: 720px;
}

/* ===== 重置 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 17px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-weight: 500;
  line-height: 1.65;
  background: var(--bg);
  color: var(--black);
  min-height: 100vh;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: inherit; }
ul, ol { padding-left: 1.4em; }

/* ===== 通用工具 ===== */
.wrap {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 1rem;
}

/* ===== 按钮 ===== */
.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  padding: 0.55em 1.3em;
  background: var(--yellow);
  color: var(--black);
  border: var(--border);
  box-shadow: var(--shadow);
  transition: transform 0.1s, box-shadow 0.1s;
  text-decoration: none;
}
.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--black);
  text-decoration: none;
}
.btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--black); }
.btn-hero {
  background: var(--red);
  color: var(--white);
  font-size: 1.25rem;
  padding: 0.7em 2em;
}
.btn-sm { font-size: 0.9rem; padding: 0.35em 0.9em; box-shadow: var(--shadow-sm); }

/* ===== 顶部导航 ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--black);
  border-bottom: var(--border);
}
.header-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
}
.brand-logo {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: 0.02em;
  text-decoration: none;
}
.brand-logo:hover { color: var(--yellow); text-decoration: none; }

.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: var(--blue);
  border: var(--border);
  padding: 0.5rem 0.7rem;
  box-shadow: var(--shadow-sm);
  min-height: 44px;
  min-width: 44px;
  justify-content: center;
  align-items: center;
}
.burger-line {
  display: block;
  width: 22px;
  height: 3px;
  background: var(--white);
}

.header-nav {
  background: var(--blue);
  border-top: 2px solid var(--black);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.header-nav p {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  padding: 0;
  margin: 0;
  white-space: nowrap;
}
.header-nav p a {
  display: inline-block;
  padding: 0.55rem 1rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  color: var(--black);
  border-right: 2px solid var(--black);
  min-height: 44px;
  line-height: 1.3;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
.header-nav p a:hover { background: var(--yellow); text-decoration: none; }
.header-nav p a:first-child { border-left: none; }

/* ===== 全屏遮罩菜单 ===== */
.fullscreen-nav {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--black);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.fullscreen-nav.is-open {
  opacity: 1;
  pointer-events: auto;
}
.fullscreen-nav nav p {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.fullscreen-nav nav p a {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--white);
  padding: 0.3em 0.8em;
  border: 3px solid transparent;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.fullscreen-nav nav p a:hover {
  color: var(--yellow);
  border-color: var(--yellow);
  text-decoration: none;
}
.nav-close {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  background: var(--red);
  color: var(--white);
  border: var(--border);
  font-size: 1.5rem;
  padding: 0.3em 0.7em;
  box-shadow: var(--shadow-sm);
  min-height: 44px;
  min-width: 44px;
}

/* ===== Hero（首页） ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--black);
}
.hero-media {
  position: absolute;
  inset: 0;
}
.hero-media .hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
}
.hero-slice {
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 120px;
  background: var(--bg);
  clip-path: polygon(0 60%, 100% 0%, 100% 100%, 0% 100%);
}
.hero-content {
  position: relative;
  z-index: 2;
  padding: 3rem 1.5rem 8rem;
  max-width: 800px;
}
.hero-eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  background: var(--red);
  color: var(--white);
  padding: 0.2em 0.8em;
  border: 2px solid var(--white);
  margin-bottom: 1rem;
  letter-spacing: 0.1em;
}
.hero-content h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 4.5rem);
  font-weight: 700;
  color: var(--white);
  line-height: 1.15;
  margin-bottom: 1rem;
  text-shadow: 4px 4px 0 var(--black);
}
.hero-sub {
  font-size: 1.15rem;
  color: #e0e0e0;
  margin-bottom: 2rem;
  max-width: 540px;
}

/* ===== 频道英雄区 ===== */
.channel-hero {
  background: var(--blue);
  border-bottom: var(--border);
  box-shadow: 0 5px 0 var(--black);
}
.channel-hero-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 3rem 1rem 2.5rem;
}
.channel-tag {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  background: var(--black);
  color: var(--yellow);
  padding: 0.15em 0.7em;
  margin-bottom: 0.8rem;
  letter-spacing: 0.12em;
}
.channel-hero-inner h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 700;
  color: var(--black);
  text-shadow: 3px 3px 0 var(--white);
  margin-bottom: 0.6rem;
}
.channel-desc {
  font-size: 1.05rem;
  color: var(--black);
  max-width: 640px;
}

/* ===== 页面主体结构 ===== */
main {
  padding: 2.5rem 0 3rem;
}
.page-section { margin-bottom: 2.5rem; }
.page-article { /* 直接包容内容 */ }

.content-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2rem;
  align-items: start;
  margin-top: 1.5rem;
}
.main-content { min-width: 0; }

/* ===== 侧边栏 ===== */
.sidebar { display: flex; flex-direction: column; gap: 1.5rem; }
.sidebar-block {
  background: var(--white);
  border: var(--border);
  box-shadow: var(--shadow);
  padding: 1.2rem;
}
.sidebar-block h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.sidebar-block hr {
  border: none;
  border-top: 2px solid var(--black);
  margin-bottom: 0.8rem;
}
.sidebar-link {
  display: block;
  padding: 0.35rem 0;
  font-size: 0.95rem;
  color: var(--black);
  border-bottom: 1px dashed #ccc;
}
.sidebar-link:last-child { border-bottom: none; }
.sidebar-link:hover { color: var(--red); text-decoration: none; }
.tag-chip {
  display: inline-block;
  background: var(--yellow);
  border: 2px solid var(--black);
  padding: 0.2em 0.7em;
  margin: 0.2rem 0.2rem 0.2rem 0;
  font-weight: 700;
  border-bottom: 1px dashed #ccc;
}

/* ===== h1/h2/h3 ===== */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.25;
}
h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); margin-bottom: 0.8rem; }
h2 { font-size: clamp(1.3rem, 3vw, 1.9rem); margin-bottom: 0.4rem; }
h3 { font-size: 1.2rem; }
h2 + hr, h3 + hr {
  border: none;
  border-top: 3px solid var(--black);
  margin-bottom: 1.2rem;
}

/* ===== 文章meta ===== */
.article-meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.breadcrumb { font-size: 0.9rem; color: #555; }
.breadcrumb a { color: var(--blue); }
.breadcrumb a:hover { text-decoration: underline; }
.article-dates { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.post-date {
  display: inline-block;
  background: var(--blue);
  color: var(--black);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.15em 0.6em;
  border: 2px solid var(--black);
}
.post-date.mod { background: var(--yellow); }
.article-h1 { margin-bottom: 1rem; }
.article-hero-wrap {
  margin-bottom: 1.5rem;
  border: var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.article-hero-img { width: 100%; height: auto; }

/* ===== 正文 prose ===== */
.prose p { margin-bottom: 1.1rem; }
.prose h2, .prose h3 { margin-top: 2rem; margin-bottom: 0.4rem; }
.prose ul, .prose ol { margin-bottom: 1rem; }
.prose li { margin-bottom: 0.4rem; }
.prose a { color: var(--blue); text-decoration: underline; }
.prose blockquote {
  border-left: 5px solid var(--red);
  padding: 0.6em 1em;
  background: var(--white);
  margin: 1.2rem 0;
  font-style: italic;
}
.prose table { border-collapse: collapse; width: 100%; margin-bottom: 1rem; }
.prose th, .prose td {
  border: 2px solid var(--black);
  padding: 0.5rem 0.8rem;
  text-align: left;
}
.prose th { background: var(--blue); font-weight: 700; }
.prose code {
  background: var(--black);
  color: var(--yellow);
  padding: 0.1em 0.4em;
  font-family: monospace;
  font-size: 0.92em;
}
.prose pre {
  background: var(--black);
  color: var(--yellow);
  padding: 1rem;
  overflow-x: auto;
  border: var(--border);
  margin-bottom: 1rem;
}

/* ===== 首页频道卡片 ===== */
.channels-section { margin-bottom: 1rem; }
.channel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.2rem;
  margin-bottom: 2rem;
}
.channel-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.1rem;
  background: var(--blue);
  border: var(--border);
  box-shadow: var(--shadow);
  border-radius: 4px;
  transition: transform 0.15s, box-shadow 0.15s;
  text-decoration: none;
  color: var(--black);
}
.channel-card:hover {
  transform: translate(-3px, -3px);
  box-shadow: 8px 8px 0 var(--black);
  text-decoration: none;
}
.channel-card strong { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; }
.channel-card span { font-size: 0.9rem; opacity: 0.85; }

/* ===== 首页文章卡片 ===== */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
.article-card {
  background: var(--white);
  border: var(--border);
  box-shadow: var(--shadow);
  border-radius: 4px;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.article-card time {
  font-size: 0.82rem;
  background: var(--yellow);
  border: 2px solid var(--black);
  padding: 0.1em 0.5em;
  font-weight: 700;
  width: fit-content;
}
.article-card-title {
  text-decoration: none;
  color: var(--black);
}
.article-card-title strong {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  display: block;
}
.article-card-title:hover strong { color: var(--red); }
.article-card p { font-size: 0.93rem; color: #333; }
.home-content { margin-top: 2rem; }

/* ===== 频道子页卡片 ===== */
.child-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.2rem;
  margin-bottom: 1.5rem;
}
.channel-child-card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1rem;
  background: var(--white);
  border: var(--border);
  box-shadow: var(--shadow-sm);
  border-radius: 4px;
  text-decoration: none;
  color: var(--black);
  transition: transform 0.12s, box-shadow 0.12s;
}
.channel-child-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--black);
  text-decoration: none;
}
.channel-child-card strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
}
.channel-child-card span {
  font-size: 0.8rem;
  background: var(--yellow);
  border: 1px solid var(--black);
  padding: 0.05em 0.4em;
  width: fit-content;
}
.channel-child-card em { font-size: 0.9rem; font-style: normal; color: #444; }

/* ===== 关于页 ===== */
.about-header {
  background: var(--red);
  border: var(--border);
  box-shadow: var(--shadow);
  padding: 2rem 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--white);
}
.about-tag {
  display: inline-block;
  background: var(--black);
  color: var(--yellow);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.15em 0.7em;
  margin-bottom: 0.7rem;
  letter-spacing: 0.1em;
}
.about-header h1 { color: var(--white); text-shadow: 3px 3px 0 var(--black); }
.about-lead { font-size: 1.05rem; color: #ffe0e0; margin-top: 0.5rem; }
.about-section .content-layout { margin-top: 0; }

/* ===== 标签页 ===== */
.tag-header {
  background: var(--yellow);
  border: var(--border);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.tag-header h1 { font-size: 2rem; }
.tag-article-list { display: flex; flex-direction: column; gap: 0.8rem; margin-top: 1rem; }
.tag-article-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1rem;
  background: var(--white);
  border: var(--border);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--black);
  transition: transform 0.12s, box-shadow 0.12s;
}
.tag-article-item:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--black);
  text-decoration: none;
}
.tag-article-item strong { font-family: var(--font-display); font-size: 1.05rem; }
.tag-article-item span {
  font-size: 0.82rem;
  background: var(--blue);
  border: 2px solid var(--black);
  padding: 0.1em 0.5em;
  white-space: nowrap;
}

/* ===== 页脚 ===== */
.site-footer {
  background: var(--black);
  color: var(--white);
  border-top: 4px solid var(--red);
  padding: 2.5rem 1rem 1.5rem;
  text-align: center;
}
.footer-brand {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 0.8rem;
}
.site-footer p {
  margin-bottom: 0.6rem;
  font-size: 0.95rem;
}
.site-footer p a { color: var(--yellow); }
.site-footer p a:hover { color: var(--blue); }
.site-footer small {
  display: block;
  color: #888;
  font-size: 0.82rem;
  margin-top: 1rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: var(--content-max);
  margin: 1.5rem auto;
  text-align: left;
}
.footer-col p { margin-bottom: 0.4rem; }
.footer-col a { color: var(--yellow); font-size: 0.92rem; }
.footer-col a:hover { color: var(--blue); }
.footer-contact .subscribe-form {
  display: flex;
  gap: 0;
  margin: 0.7rem 0;
  border: var(--border);
  box-shadow: var(--shadow-sm);
}
.footer-contact .subscribe-form input {
  flex: 1;
  padding: 0.5rem 0.8rem;
  border: none;
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--white);
  color: var(--black);
  min-width: 0;
}
.footer-contact .subscribe-form .btn {
  border: none;
  border-left: 3px solid var(--black);
  box-shadow: none;
  border-radius: 0;
}

/* ===== 动效 ===== */
@media (prefers-reduced-motion: no-preference) {
  .channel-card,
  .article-card,
  .channel-child-card,
  .tag-article-item {
    animation: fadeSlideUp 0.4s both;
  }
  .channel-grid .channel-card:nth-child(2) { animation-delay: 0.07s; }
  .channel-grid .channel-card:nth-child(3) { animation-delay: 0.14s; }
  .channel-grid .channel-card:nth-child(4) { animation-delay: 0.21s; }
  .channel-grid .channel-card:nth-child(5) { animation-delay: 0.28s; }
  .article-grid .article-card:nth-child(2) { animation-delay: 0.1s; }
  .article-grid .article-card:nth-child(3) { animation-delay: 0.2s; }
  .article-grid .article-card:nth-child(4) { animation-delay: 0.3s; }

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

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .content-layout {
    grid-template-columns: 1fr;
  }
  .sidebar { order: 2; }
  .main-content { order: 1; }
  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .footer-contact .subscribe-form { flex-direction: column; }
  .footer-contact .subscribe-form input { border-bottom: 3px solid var(--black); }
  .footer-contact .subscribe-form .btn { border-left: none; border-top: 3px solid var(--black); }
  .hero-content { padding: 2rem 1rem 7rem; }
  .header-nav p a { padding: 0.5rem 0.75rem; font-size: 0.9rem; }
  .channel-grid { grid-template-columns: 1fr 1fr; }
  .article-grid { grid-template-columns: 1fr; }
  .child-cards { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .channel-grid { grid-template-columns: 1fr; }
  .fullscreen-nav nav p a { font-size: 1.5rem; }
  .brand-logo { font-size: 1.35rem; }
  .tag-article-item { flex-direction: column; align-items: flex-start; gap: 0.4rem; }
}
