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

/* =============================================
   CSS 变量 & 重置
   ============================================= */
:root {
  --black: #000000;
  --white: #ffffff;
  --cherry: #8B1A1A;
  --cherry-light: #c0392b;
  --cherry-muted: #f5e9e9;
  --gray-100: #f7f7f7;
  --gray-200: #ebebeb;
  --gray-400: #aaaaaa;
  --gray-700: #444444;
  --border: 1.5px solid var(--black);
  --radius-card: 28px;
  --radius-sm: 6px;
  --font-heading: 'Calistoga', Georgia, serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --max-w: 1200px;
  --nav-height: 100px;
  --transition: 220ms ease;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--black);
  background: var(--white);
  overflow-x: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ol, ul {
  list-style: none;
}

/* =============================================
   工具
   ============================================= */
.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;
}

/* =============================================
   SITE WRAPPER
   ============================================= */
.site-wrapper {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  min-height: 100vh;
  /* 防止整体撑宽 */
  max-width: 100vw;
  overflow-x: hidden;
}

/* =============================================
   HEADER — 两行布局
   ============================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: var(--border);
  width: 100%;
}

.header-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0.85rem 2rem;
  border-bottom: 1px solid var(--gray-200);
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  color: var(--black);
  transition: color var(--transition);
  white-space: nowrap;
  min-height: 44px;
}

.brand-link:hover {
  color: var(--cherry);
}

.brand-logo-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

/* 搜索框 */
.search-form {
  display: flex;
  align-items: center;
  border: var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}

.search-input {
  font-family: var(--font-body);
  font-size: 0.875rem;
  border: none;
  outline: none;
  padding: 0.4rem 0.75rem;
  background: var(--white);
  color: var(--black);
  width: 160px;
  min-width: 0;
}

.search-input::placeholder {
  color: var(--gray-400);
}

.search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--black);
  color: var(--white);
  border: none;
  cursor: pointer;
  transition: background var(--transition);
  flex-shrink: 0;
}

.search-btn:hover {
  background: var(--cherry);
}

/* 菜单行 nav > ol > li > a */
.site-nav {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.site-nav::-webkit-scrollbar {
  display: none;
}

.site-nav > ol {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
}

.site-nav > ol > li > a {
  display: flex;
  align-items: center;
  padding: 0 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--black);
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
  white-space: nowrap;
  min-height: 44px;
}

.site-nav > ol > li > a:hover,
.site-nav > ol > li > a:focus-visible {
  color: var(--cherry);
  border-bottom-color: var(--cherry);
}

/* scroll-margin for sections */
article[id] {
  scroll-margin-top: calc(var(--nav-height) + 20px);
}

/* =============================================
   HERO
   ============================================= */
.hero-section {
  background: var(--gray-100);
  border-bottom: var(--border);
  width: 100%;
  overflow: hidden;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 0;
  max-width: var(--max-w);
  margin: 0 auto;
  min-height: 45vh;
}

.hero-media {
  position: relative;
  align-self: stretch;
  overflow: hidden;
  border-right: var(--border);
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-placeholder {
  width: 100%;
  height: 100%;
  min-height: 280px;
  background: repeating-linear-gradient(
    45deg,
    var(--gray-200),
    var(--gray-200) 1px,
    transparent 1px,
    transparent 20px
  );
}

.hero-badge {
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  background: var(--cherry);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 0.3rem 0.75rem;
  border-radius: 100px;
}

.hero-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 2.5rem;
  gap: 1rem;
}

.hero-eyebrow {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--cherry);
  text-transform: uppercase;
}

.hero-h1 {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 4vw, 3.25rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--black);
  word-break: break-all;
}

.hero-desc {
  font-size: 1rem;
  color: var(--gray-700);
  max-width: 36ch;
  line-height: 1.6;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  margin-top: 0.5rem;
  padding: 0 1.75rem;
  background: var(--black);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  border: 2px solid var(--black);
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  min-height: 44px;
}

.hero-cta:hover {
  background: var(--cherry);
  border-color: var(--cherry);
}

/* =============================================
   MAIN CONTENT LAYOUT
   main > section > article 结构满足抽签要求
   ============================================= */
.site-main {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2rem;
  /* 防止超宽 */
  min-width: 0;
}

.main-article {
  width: 100%;
  min-width: 0;
}

.content-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2.5rem;
  align-items: start;
  width: 100%;
  min-width: 0;
}

/* =============================================
   ASIDE — 左侧侧边栏
   ============================================= */
.content-aside {
  position: sticky;
  top: calc(var(--nav-height) + 24px);
  min-width: 0;
}

.aside-inner {
  border: var(--border);
  border-radius: var(--radius-card);
  padding: 1.5rem 1.25rem;
  background: var(--white);
}

.aside-eyebrow {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--cherry);
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.aside-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.aside-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  counter-reset: aside-counter;
}

.aside-nav > li {
  counter-increment: aside-counter;
}

.aside-nav > li > a {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.82rem;
  line-height: 1.4;
  padding: 0.5rem;
  border-radius: 4px;
  color: var(--black);
  transition: background var(--transition), color var(--transition);
  min-height: 40px;
  word-break: break-all;
}

.aside-nav > li > a::before {
  content: counter(aside-counter, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--cherry);
  flex-shrink: 0;
  margin-top: 0.1em;
}

.aside-nav > li > a:hover {
  background: var(--cherry-muted);
  color: var(--cherry);
}

.aside-divider {
  height: 1px;
  background: var(--gray-200);
  margin: 1.25rem 0;
}

.aside-tip {
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
}

.aside-tip-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--cherry);
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}

.aside-tip-text {
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--gray-700);
}

/* =============================================
   PAGE CONTENT (page.content 正文)
   .page-content 是 section 的直接子 article
   满足 main > section > article 契约
   ============================================= */
.content-main {
  min-width: 0;
  width: 100%;
  overflow-x: hidden;
}

.page-content {
  width: 100%;
  overflow-x: hidden;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* 正文内 article 样式 */
.page-content > article,
.page-content article {
  padding: 3rem 0;
  border-bottom: 1px solid var(--gray-200);
}

.page-content > article:last-child,
.page-content article:last-child {
  border-bottom: none;
}

/* 正文排版 */
.page-content h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin-bottom: 1rem;
  color: var(--black);
}

.page-content h3 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.page-content p {
  font-size: 1rem;
  line-height: 1.75;
  margin-bottom: 1rem;
  color: var(--black);
}

.page-content ul,
.page-content ol {
  list-style: initial;
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.page-content ol {
  list-style: decimal;
}

.page-content li {
  font-size: 1rem;
  line-height: 1.65;
  margin-bottom: 0.4rem;
}

.page-content a {
  color: var(--cherry);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition);
}

.page-content a:hover {
  color: var(--black);
}

.page-content blockquote {
  border-left: 3px solid var(--cherry);
  padding-left: 1.25rem;
  margin: 1.5rem 0;
  color: var(--gray-700);
  font-style: italic;
}

.page-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.925rem;
}

.page-content th,
.page-content td {
  padding: 0.65rem 1rem;
  border: 1px solid var(--gray-200);
  text-align: left;
}

.page-content th {
  background: var(--black);
  color: var(--white);
  font-weight: 600;
  font-family: var(--font-body);
}

.page-content tr:nth-child(even) td {
  background: var(--gray-100);
}

.page-content img {
  border-radius: var(--radius-sm);
  margin: 1.5rem 0;
  border: var(--border);
  max-width: 100%;
}

.page-content small {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--cherry);
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.page-content small + h2,
.page-content small + h3 {
  margin-top: 0;
}

/* =============================================
   FOOTER — 单行极简
   ============================================= */
.site-footer {
  border-top: var(--border);
  background: var(--black);
  color: var(--white);
  width: 100%;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1.25rem 2rem;
  flex-wrap: wrap;
}

.footer-brand-block {
  flex-shrink: 0;
}

.footer-brand-name {
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 3vw, 2.5rem);
  letter-spacing: -0.02em;
  color: var(--white);
  line-height: 1;
}

.footer-nav > ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

.footer-nav > ol > li > a {
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.65);
  transition: color var(--transition);
  min-height: 44px;
  white-space: nowrap;
}

.footer-nav > ol > li > a:hover {
  color: var(--white);
}

.footer-copy p {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.45);
}

/* =============================================
   CARDS
   ============================================= */
.page-content .card,
.card {
  border: var(--border);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  background: var(--white);
  transition: border-color var(--transition);
}

.page-content .card:hover,
.card:hover {
  border-color: var(--cherry);
}

/* =============================================
   CAROUSEL / STAGGER LIST
   ============================================= */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.stagger-list > * {
  animation: fadeInUp 0.4s ease both;
}

.stagger-list > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-list > *:nth-child(2) { animation-delay: 0.12s; }
.stagger-list > *:nth-child(3) { animation-delay: 0.19s; }
.stagger-list > *:nth-child(4) { animation-delay: 0.26s; }
.stagger-list > *:nth-child(5) { animation-delay: 0.33s; }
.stagger-list > *:nth-child(6) { animation-delay: 0.40s; }

.carousel {
  position: relative;
  overflow: hidden;
}

.carousel-track {
  display: flex;
  transition: transform 350ms ease;
}

.carousel-track > * {
  flex: 0 0 100%;
  min-width: 0;
}

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

/* =============================================
   RESPONSIVE — 平板 ≤900px
   ============================================= */
@media (max-width: 900px) {
  .content-layout {
    grid-template-columns: 1fr;
  }

  .content-aside {
    position: static;
  }

  .aside-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .aside-nav > li > a {
    white-space: nowrap;
    word-break: normal;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-media {
    border-right: none;
    border-bottom: var(--border);
    min-height: 220px;
  }

  .hero-text {
    padding: 2rem 1.5rem;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
}

/* =============================================
   RESPONSIVE — 手机 ≤600px
   ============================================= */
@media (max-width: 600px) {
  :root {
    --nav-height: 88px;
  }

  .header-brand-row {
    padding: 0.75rem 1rem;
    gap: 0.5rem;
  }

  .search-input {
    width: 90px;
    font-size: 0.8rem;
  }

  /* 导航横向滚动，不撑宽页面 */
  .site-nav {
    padding: 0;
  }

  .site-nav > ol {
    flex-wrap: nowrap;
    padding: 0 0.75rem;
  }

  .site-nav > ol > li > a {
    padding: 0 0.6rem;
    font-size: 0.78rem;
    min-height: 44px;
  }

  .site-main {
    padding: 1rem;
  }

  .hero-section {
    overflow: hidden;
  }

  .hero-text {
    padding: 1.5rem 1rem;
  }

  .hero-h1 {
    font-size: 1.6rem;
    word-break: break-all;
  }

  .hero-desc {
    font-size: 0.9rem;
    max-width: 100%;
  }

  .footer-inner {
    padding: 1rem;
    gap: 0.75rem;
  }

  .footer-brand-name {
    font-size: 1.25rem;
  }

  .footer-nav > ol {
    flex-wrap: wrap;
  }

  .footer-nav > ol > li > a {
    font-size: 0.75rem;
    padding: 0 0.5rem;
    min-height: 44px;
  }

  .aside-inner {
    border-radius: 16px;
  }

  .page-content h2 {
    font-size: 1.3rem;
  }

  .page-content h3 {
    font-size: 1.1rem;
  }

  /* 防止任何子元素撑出 375px */
  .content-main,
  .page-content,
  .main-article,
  .content-layout {
    max-width: 100%;
    overflow-x: hidden;
  }

  /* 表格单独处理横向滚动 */
  .page-content table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }

  /* 防止预格式化文本撑宽 */
  .page-content pre,
  .page-content code {
    max-width: 100%;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
  }
}

button[aria-expanded]{min-width:44px;min-height:44px}
