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

/* ── 变量 ── */
:root {
  --parchment: #f5e6c8;
  --amber: #d4a574;
  --dark: #262117;
  --dark-80: rgba(38, 33, 23, 0.8);
  --dark-40: rgba(38, 33, 23, 0.4);
  --amber-20: rgba(212, 165, 116, 0.2);
  --amber-40: rgba(212, 165, 116, 0.4);
  --parchment-80: rgba(245, 230, 200, 0.8);
  --radius: 18px;
  --radius-sm: 8px;
  --font: 'Atkinson Hyperlegible', 'Segoe UI', Arial, sans-serif;
  --max-content: 1100px;
  --prose-max: 720px;
  --transition: 0.22s ease;
}

/* ── 重置 ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  background-color: var(--parchment);
  color: var(--dark);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ── 辅助 ── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
a { color: var(--dark); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--amber); }
img { max-width: 100%; height: auto; display: block; }
ol, ul { list-style: none; }

/* ── 胶片颗粒遮罩 ── */
.grain-overlay {
  position: fixed; inset: 0; pointer-events: none; z-index: 1000;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='grain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23grain)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

/* ── 漏光效果 ── */
.light-leak {
  position: fixed; top: -20%; right: -10%; width: 55vw; height: 60vh;
  pointer-events: none; z-index: 999;
  background: radial-gradient(ellipse at center,
    rgba(212, 165, 116, 0.18) 0%,
    rgba(245, 230, 200, 0.08) 50%,
    transparent 75%);
  animation: leakMove 12s ease-in-out infinite alternate;
}
@keyframes leakMove {
  from { transform: translate(0, 0) scale(1); opacity: 0.7; }
  to   { transform: translate(-8%, 12%) scale(1.12); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .light-leak { animation: none; }
}

/* ── 头部 ── */
.site-header {
  position: sticky; top: 0; z-index: 200;
  background: rgba(38, 33, 23, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--amber-40);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--max-content); margin: 0 auto;
  padding: 0 1.25rem;
  min-height: 60px;
  gap: 1rem;
}

/* 品牌居中 */
.brand-center {
  display: flex; align-items: center; gap: 0.6rem;
  flex-shrink: 0;
}
.brand-logo { width: 36px; height: 36px; border-radius: 6px; }
.brand-name {
  font-weight: 700; font-size: 1.15rem;
  color: var(--amber); text-decoration: none; letter-spacing: 0.04em;
  white-space: nowrap;
}
.brand-name:hover { color: var(--parchment); }

/* 导航 — 有序列表 */
.nav-left, .nav-right {
  flex: 1;
}
.nav-left { display: flex; justify-content: flex-end; }
.nav-right { display: flex; justify-content: flex-start; }
.nav-left ol, .nav-right ol {
  display: flex; flex-wrap: wrap; gap: 0.15rem; align-items: center;
}
.nav-left ol li a,
.nav-right ol li a {
  display: block; padding: 0.6rem 0.65rem;
  color: var(--parchment); text-decoration: none; font-size: 0.82rem;
  white-space: nowrap; border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
  min-height: 40px; display: flex; align-items: center;
}
.nav-left ol li a:hover,
.nav-right ol li a:hover {
  background: var(--amber-20); color: var(--amber);
}

/* 搜索栏 */
.search-bar-wrap {
  background: var(--dark); border-top: 1px solid rgba(212,165,116,0.15);
  padding: 0.5rem 1.25rem;
}
.search-form {
  display: flex; gap: 0.5rem; max-width: var(--max-content); margin: 0 auto;
}
.search-form input[type=search] {
  flex: 1; padding: 0.5rem 1rem; border-radius: var(--radius-sm);
  border: 1px solid var(--amber-40);
  background: rgba(245,230,200,0.06); color: var(--parchment);
  font-family: var(--font); font-size: 0.9rem;
  min-height: 40px;
}
.search-form input[type=search]::placeholder { color: var(--dark-40); color: rgba(245,230,200,0.4); }
.search-form input[type=search]:focus { outline: 2px solid var(--amber); outline-offset: 1px; }
.search-form button {
  padding: 0.5rem 1.2rem; border-radius: var(--radius-sm);
  background: var(--amber); color: var(--dark); border: none; cursor: pointer;
  font-family: var(--font); font-weight: 700; font-size: 0.9rem;
  min-height: 40px; transition: background var(--transition), transform var(--transition);
}
.search-form button:hover { background: var(--parchment); transform: translateY(-1px); }

/* ── Hero（首页） ── */
.hero-section {
  position: relative; min-height: 45vh;
  background: linear-gradient(135deg, var(--dark) 0%, #3a2e1a 60%, #1a140a 100%);
  display: flex; align-items: center; overflow: hidden;
  padding: 3.5rem 1.25rem 5rem;
}
.hero-content {
  position: relative; z-index: 2;
  max-width: 560px; margin-left: calc((100% - var(--max-content)) / 2 + 1.25rem);
}
.hero-badge {
  display: inline-block; padding: 0.25rem 0.8rem;
  background: var(--amber); color: var(--dark);
  font-size: 0.78rem; font-weight: 700; border-radius: 20px;
  letter-spacing: 0.08em; margin-bottom: 1rem;
  animation: badgePop 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes badgePop {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-badge { animation: none; }
}
.hero-section h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 700;
  color: var(--parchment); line-height: 1.2; margin-bottom: 1rem;
}
.hero-desc { color: var(--amber); font-size: 1rem; margin-bottom: 1.5rem; max-width: 480px; }
.hero-cta {
  display: inline-block; padding: 0.75rem 2rem;
  background: var(--amber); color: var(--dark); font-weight: 700;
  border-radius: var(--radius-sm); text-decoration: none; font-size: 1rem;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 16px rgba(212,165,116,0.35);
}
.hero-cta:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(212,165,116,0.5); color: var(--dark); }

.hero-media {
  position: absolute; right: 0; top: 0; bottom: 0; width: 40%;
  z-index: 1; overflow: hidden;
}
.hero-media img { width: 100%; height: 100%; object-fit: cover; opacity: 0.45; filter: sepia(0.4) contrast(1.1) saturate(0.7); }
.hero-media::before {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to right, var(--dark) 0%, transparent 60%);
}

/* 斜切底边 */
.hero-arc {
  position: absolute; bottom: -2px; left: 0; right: 0; height: 60px;
  background: var(--parchment);
  clip-path: ellipse(55% 60px at 50% 100%);
  z-index: 3;
}

/* ── 频道/关于/隐私 Banner ── */
.channel-hero, .page-banner {
  position: relative;
  background: linear-gradient(135deg, var(--dark) 0%, #3a2e1a 100%);
  padding: 3rem 1.25rem 5rem; overflow: hidden;
}
.channel-hero-inner, .page-banner-inner {
  max-width: var(--max-content); margin: 0 auto; position: relative; z-index: 2;
}
.channel-hero h1, .page-banner h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem); font-weight: 700;
  color: var(--parchment); margin: 0.5rem 0 0.8rem;
}
.channel-hero p, .page-banner p { color: var(--amber); font-size: 1rem; max-width: 600px; }
.channel-badge {
  display: inline-block; padding: 0.2rem 0.75rem;
  background: var(--amber); color: var(--dark);
  font-size: 0.75rem; font-weight: 700; border-radius: 20px;
  letter-spacing: 0.08em; margin-bottom: 0.75rem;
}

/* ── main 布局 ── */
main { max-width: var(--max-content); margin: 0 auto; padding: 2rem 1.25rem 3rem; }

/* content-section: aside 左侧 + 正文右侧 */
.content-section {
  display: flex; gap: 2rem; align-items: flex-start;
}

/* aside 在左 */
.site-aside {
  width: 220px; flex-shrink: 0;
  position: sticky; top: 120px;
  background: rgba(212,165,116,0.08);
  border: 1px solid var(--amber-40);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
}
.site-aside h2 {
  font-size: 0.88rem; font-weight: 700; color: var(--dark);
  margin: 0.15rem 0 0.6rem; text-transform: none;
}
.aside-links { display: flex; flex-direction: column; gap: 0.3rem; }
.aside-links li a {
  display: block; padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm); font-size: 0.85rem;
  color: var(--dark); text-decoration: none;
  transition: background var(--transition), color var(--transition);
  min-height: 36px; display: flex; align-items: center;
}
.aside-links li a:hover { background: var(--amber-20); color: var(--amber); }

/* 正文主容器 */
.main-content { flex: 1; min-width: 0; }
.page-content { line-height: 1.75; }
.page-content.prose h2 { font-size: 1.3rem; margin: 2rem 0 0.75rem; }
.page-content.prose h3 { font-size: 1.1rem; margin: 1.5rem 0 0.5rem; }
.page-content.prose p { margin-bottom: 1rem; }
.page-content.prose ul, .page-content.prose ol {
  padding-left: 1.5rem; margin-bottom: 1rem;
}
.page-content.prose ul { list-style: disc; }
.page-content.prose ol { list-style: decimal; }
.page-content.prose a { color: var(--amber); }
.page-content.prose a:hover { color: var(--dark); }
.page-content.prose table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.page-content.prose th, .page-content.prose td {
  padding: 0.5rem 0.75rem; border: 1px solid var(--amber-40); font-size: 0.9rem;
}
.page-content.prose th { background: var(--amber-20); font-weight: 700; }

/* ── 眉题 small ── */
.eyebrow {
  display: block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em;
  color: var(--amber); text-transform: uppercase; margin-bottom: 0.2rem;
}

/* ── 卡片 ── */
.cards-row {
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  margin-top: 1.25rem;
}
.glass-card {
  background: rgba(245,230,200,0.55);
  backdrop-filter: blur(10px) saturate(1.2);
  border: 1px solid rgba(212,165,116,0.45);
  border-radius: var(--radius);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  overflow: hidden;
}
.glass-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(38,33,23,0.16);
  border-color: var(--amber);
}
.card-inner { padding: 1.25rem 1.2rem 1rem; }
.card-inner h3 { font-size: 1rem; margin: 0.15rem 0 0.5rem; line-height: 1.35; }
.card-inner h3 a { text-decoration: none; color: var(--dark); transition: color var(--transition); }
.card-inner h3 a:hover { color: var(--amber); }
.card-inner p { font-size: 0.88rem; color: rgba(38,33,23,0.75); margin-bottom: 0.8rem; }
.card-link {
  font-size: 0.82rem; font-weight: 700; color: var(--amber);
  text-decoration: none; transition: color var(--transition);
}
.card-link:hover { color: var(--dark); }
.badge {
  display: inline-block; padding: 0.15rem 0.55rem;
  background: var(--amber); color: var(--dark);
  font-size: 0.72rem; font-weight: 700; border-radius: 20px;
  margin-bottom: 0.6rem;
}

/* ── div 标题区 ── */
.channels-section, .articles-section, .children-section {
  margin-top: 3rem;
}
.channels-section h2, .articles-section h2, .children-section h2 {
  font-size: 1.4rem; font-weight: 700; margin: 0.2rem 0 0;
}

/* ── 文章页 ── */
.article-header-section {
  display: flex; gap: 2rem; align-items: flex-start;
  padding-bottom: 2rem; border-bottom: 1px solid var(--amber-40);
  margin-bottom: 2rem; flex-wrap: wrap;
}
.article-header-inner { flex: 1; min-width: 0; }
.breadcrumb {
  font-size: 0.82rem; color: var(--dark-40); margin-bottom: 0.75rem;
}
.breadcrumb a { color: var(--amber); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.article-header-inner h1 {
  font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; line-height: 1.25;
  margin-bottom: 0.75rem;
}
.article-desc { font-size: 1rem; color: rgba(38,33,23,0.7); margin-bottom: 0.75rem; }
.article-meta { display: flex; gap: 1rem; flex-wrap: wrap; font-size: 0.82rem; }
.meta-label { color: var(--dark-40); }
.meta-date { font-size: 0.82rem; color: var(--dark-40); margin-bottom: 0.5rem; }

/* Polaroid */
.polaroid {
  background: var(--parchment); padding: 0.6rem 0.6rem 2rem;
  border: 1px solid var(--amber-40);
  border-radius: 4px;
  box-shadow: 2px 4px 16px rgba(38,33,23,0.2);
  max-width: 260px; flex-shrink: 0;
  animation: polaroidShake 0.6s ease both;
}
@keyframes polaroidShake {
  0%  { transform: rotate(-3deg) scale(0.95); opacity: 0; }
  60% { transform: rotate(1.5deg) scale(1.02); }
  100% { transform: rotate(-1.5deg) scale(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .polaroid { animation: none; }
}
.article-hero-img, .article-hero-img-wrap img {
  width: 100%; height: 180px; object-fit: cover;
  filter: sepia(0.35) contrast(1.1) saturate(0.75);
  border-radius: 2px;
}

.article-footer-nav {
  margin-top: 2.5rem; display: flex; gap: 1rem; flex-wrap: wrap;
  border-top: 1px solid var(--amber-40); padding-top: 1.5rem;
}
.back-link {
  font-size: 0.88rem; color: var(--amber); text-decoration: none;
  padding: 0.4rem 0; transition: color var(--transition);
}
.back-link:hover { color: var(--dark); }

/* children div（div > section×n 直接子元素） */
.children-section { margin-top: 2.5rem; }
.children-section > section {
  background: rgba(245,230,200,0.55);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(212,165,116,0.45);
  border-radius: var(--radius);
  padding: 1.2rem 1.25rem;
  margin-bottom: 1rem;
  transition: transform var(--transition), border-color var(--transition);
}
.children-section > section:hover {
  transform: translateX(4px); border-color: var(--amber);
}
.children-section > section h3 { font-size: 1rem; margin: 0.15rem 0 0.4rem; }
.children-section > section h3 a { color: var(--dark); text-decoration: none; }
.children-section > section h3 a:hover { color: var(--amber); }
.children-section > section p { font-size: 0.88rem; color: rgba(38,33,23,0.7); margin-bottom: 0.4rem; }

/* ── 页脚（极简：仅 p + small） ── */
.site-footer {
  background: var(--dark);
  border-top: 2px solid var(--amber);
  margin-top: 4rem;
}
.footer-cta-block {
  text-align: center; padding: 2.5rem 1.25rem;
  border-bottom: 1px solid rgba(212,165,116,0.25);
}
.footer-cta-text {
  color: var(--parchment); font-size: 1.1rem; margin-bottom: 1.1rem;
}
.footer-cta-btn {
  display: inline-block; padding: 0.75rem 2rem;
  background: var(--amber); color: var(--dark); font-weight: 700;
  border-radius: var(--radius-sm); text-decoration: none;
  transition: transform var(--transition), background var(--transition);
}
.footer-cta-btn:hover { background: var(--parchment); transform: translateY(-2px); }
.footer-bottom {
  max-width: var(--max-content); margin: 0 auto;
  padding: 1.25rem 1.25rem;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 0.75rem;
}
.footer-bottom p {
  color: rgba(245,230,200,0.65); font-size: 0.82rem;
}
.footer-bottom p a { color: var(--amber); text-decoration: none; }
.footer-bottom p a:hover { text-decoration: underline; }
.footer-bottom small {
  color: rgba(245,230,200,0.38); font-size: 0.75rem;
}

/* ── VHS tracking 动画（hover on card） ── */
@keyframes vhsTrack {
  0%   { transform: skewX(0deg) translateY(0); }
  20%  { transform: skewX(-0.6deg) translateY(-1px); }
  40%  { transform: skewX(0.4deg) translateY(1px); }
  60%  { transform: skewX(-0.3deg) translateY(0); }
  80%  { transform: skewX(0.2deg) translateY(0.5px); }
  100% { transform: skewX(0deg) translateY(0); }
}
.glass-card:hover .card-inner {
  animation: vhsTrack 0.4s ease;
}
@media (prefers-reduced-motion: reduce) {
  .glass-card:hover .card-inner { animation: none; }
}

/* ── 响应式 ── */
@media (max-width: 900px) {
  .header-inner { flex-wrap: wrap; padding: 0.5rem 1rem; min-height: auto; gap: 0.5rem; }
  .nav-left, .nav-right { width: 100%; justify-content: center; }
  .brand-center { order: -1; width: 100%; justify-content: center; padding: 0.5rem 0; }
  .nav-left ol, .nav-right ol { justify-content: center; }
  .hero-content { margin-left: 0; }
  .hero-media { display: none; }
  .content-section { flex-direction: column; }
  .site-aside { width: 100%; position: static; }
  .polaroid { max-width: 100%; }
  .article-header-section { flex-direction: column; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  .hero-section { padding: 2.5rem 1rem 4rem; min-height: 45vh; }
  .hero-section h1 { font-size: 1.6rem; }
  .channel-hero, .page-banner { padding: 2rem 1rem 4rem; }
  main { padding: 1.5rem 1rem 2rem; }
  .cards-row { grid-template-columns: 1fr; }
  .site-aside { padding: 1rem; }
  .nav-left ol li a, .nav-right ol li a { font-size: 0.78rem; padding: 0.55rem 0.45rem; }
  .footer-cta-block { padding: 2rem 1rem; }
  .footer-bottom { padding: 1rem; }
}

/* 375px 保障 */
@media (max-width: 375px) {
  .header-inner { padding: 0.4rem 0.75rem; }
  .brand-name { font-size: 1rem; }
  .nav-left ol, .nav-right ol { gap: 0; }
  .nav-left ol li a, .nav-right ol li a { font-size: 0.72rem; padding: 0.5rem 0.35rem; min-height: 40px; }
  .search-form button { padding: 0.5rem 0.75rem; }
}
