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

/* ============================================================
   CSS 自定义属性
   ============================================================ */
:root {
  --c-paper: #fdfbf7;
  --c-surface: #f5f5f5;
  --c-ink: #1a1a1a;
  --c-ink-mid: #444444;
  --c-ink-light: #888888;
  --c-border: #d8d4cc;
  --c-border-light: #e8e4de;
  --c-accent: #1a1a1a;
  --c-accent-hover: #444444;
  --radius-sm: 4px;
  --radius-md: 6px;
  --shadow-card: 0 2px 8px rgba(26,26,26,0.08), 0 1px 2px rgba(26,26,26,0.06);
  --shadow-card-hover: 0 4px 16px rgba(26,26,26,0.12), 0 2px 4px rgba(26,26,26,0.08);
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --header-h: 64px;
  --anchor-h: 44px;
  --sticky-offset: calc(var(--header-h) + var(--anchor-h));
}

/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  background: var(--c-paper);
}

body {
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.7;
  color: var(--c-ink);
  background: var(--c-paper);
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* Paper texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

.site-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

/* Section scroll margin */
section[id] {
  scroll-margin-top: var(--sticky-offset);
}

a {
  color: var(--c-ink);
  text-decoration: none;
  transition: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.25;
  font-weight: 700;
  color: var(--c-ink);
}

/* ============================================================
   Site Header
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--c-paper);
  border-bottom: 1px solid var(--c-border);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 32px;
}

.header-brand {
  flex-shrink: 0;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.brand-text {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--c-ink);
}

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

.primary-nav {
  flex: 1;
}

.primary-nav > ol {
  display: flex;
  align-items: center;
  gap: 4px;
}

.primary-nav > ol > li > a {
  display: block;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--c-ink-mid);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  min-height: 40px;
  display: flex;
  align-items: center;
}

.primary-nav > ol > li > a:hover {
  background: var(--c-surface);
  color: var(--c-ink);
  text-decoration: none;
}

.header-contact {
  flex-shrink: 0;
  display: flex;
  gap: 12px;
}

.contact-link {
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  color: var(--c-ink);
  min-height: 40px;
  display: flex;
  align-items: center;
}

.contact-link:hover {
  background: var(--c-ink);
  color: var(--c-paper);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--c-ink);
}

/* ============================================================
   Mobile Nav
   ============================================================ */
.mobile-nav {
  display: none;
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  z-index: 99;
  background: var(--c-paper);
  border-bottom: 1px solid var(--c-border);
  padding: 16px 24px 24px;
}

.mobile-nav.is-open {
  display: block;
}

.mobile-nav nav ol {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-nav nav ol li a {
  display: block;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  color: var(--c-ink);
  min-height: 44px;
  display: flex;
  align-items: center;
}

.mobile-nav nav ol li a:hover {
  background: var(--c-surface);
  text-decoration: none;
}

/* ============================================================
   Sticky Anchor Bar
   ============================================================ */
.sticky-anchor-bar {
  position: sticky;
  top: var(--header-h);
  z-index: 90;
  height: var(--anchor-h);
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  overflow: hidden;
}

.anchor-bar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.anchor-list {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 0;
  white-space: nowrap;
}

.anchor-list li a {
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--c-ink-mid);
  border-right: 1px solid var(--c-border-light);
}

.anchor-list li:first-child a {
  padding-left: 0;
}

.anchor-list li a:hover {
  color: var(--c-ink);
  text-decoration: none;
  background: var(--c-border-light);
}

/* ============================================================
   Hero Section
   ============================================================ */
.hero-section {
  position: relative;
  min-height: 45vh;
  background: var(--c-ink);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.hero-inner {
  flex: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 48px 24px 72px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 48px;
  position: relative;
  z-index: 2;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.18;
  filter: grayscale(100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: right;
  max-width: 560px;
}

.hero-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-paper);
  border: 1px solid rgba(253,251,247,0.4);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.hero-h1 {
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--c-paper);
  line-height: 1.15;
  margin-bottom: 16px;
}

.hero-desc {
  font-size: 16px;
  line-height: 1.7;
  color: rgba(253,251,247,0.75);
  max-width: 420px;
  margin-left: auto;
}

/* Arc bottom */
.hero-arc {
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 48px;
  background: var(--c-paper);
  clip-path: ellipse(55% 100% at 50% 100%);
  z-index: 3;
}

/* ============================================================
   Main / Content
   ============================================================ */
.site-main {
  padding: 48px 0 64px;
}

.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.content-section {
  width: 100%;
}

.main-article {
  width: 100%;
}

.content-with-aside {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 48px;
  align-items: start;
}

.content-body {
  min-width: 0;
}

/* ============================================================
   Content Body typography (injected HTML)
   ============================================================ */
.content-body h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 40px 0 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--c-border);
}

.content-body h2:first-child {
  margin-top: 0;
}

.content-body h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 28px 0 8px;
}

.content-body p {
  font-size: 16px;
  line-height: 1.75;
  margin-bottom: 16px;
  color: var(--c-ink-mid);
}

.content-body p:last-child {
  margin-bottom: 0;
}

.content-body ul,
.content-body ol {
  margin: 0 0 20px 0;
  padding-left: 0;
}

.content-body ul {
  list-style: none;
}

.content-body ul li {
  padding-left: 20px;
  position: relative;
  margin-bottom: 8px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--c-ink-mid);
}

.content-body ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 11px;
  width: 6px;
  height: 6px;
  border: 1.5px solid var(--c-ink);
  border-radius: 1px;
}

.content-body ol {
  list-style: decimal;
  padding-left: 24px;
}

.content-body ol li {
  margin-bottom: 8px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--c-ink-mid);
}

.content-body a {
  color: var(--c-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.content-body a:hover {
  color: var(--c-ink-mid);
}

.content-body strong {
  font-weight: 700;
  color: var(--c-ink);
}

.content-body em {
  font-style: italic;
}

.content-body blockquote {
  margin: 24px 0;
  padding: 16px 20px;
  border-left: 3px solid var(--c-ink);
  background: var(--c-surface);
  font-size: 16px;
  color: var(--c-ink-mid);
}

.content-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 15px;
}

.content-body th,
.content-body td {
  padding: 10px 14px;
  border: 1px solid var(--c-border);
  text-align: left;
}

.content-body th {
  background: var(--c-surface);
  font-weight: 700;
}

.content-body section {
  margin-bottom: 48px;
}

.content-body section:last-child {
  margin-bottom: 0;
}

/* Card-like sections inside content */
.content-body section {
  padding: 32px;
  background: var(--c-paper);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

/* ============================================================
   Aside
   ============================================================ */
.content-aside {
  position: sticky;
  top: var(--sticky-offset);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.aside-block {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.aside-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--c-ink);
  margin-bottom: 4px;
}

.aside-block .subtitle {
  font-size: 12px;
  color: var(--c-ink-light);
  margin-bottom: 16px;
  line-height: 1.5;
}

.aside-nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.aside-nav-list li a {
  display: block;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--c-ink-mid);
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  min-height: 32px;
  display: flex;
  align-items: center;
}

.aside-nav-list li a:hover {
  background: var(--c-paper);
  border-left-color: var(--c-ink);
  color: var(--c-ink);
  text-decoration: none;
}

.aside-tip-text {
  font-size: 13px;
  line-height: 1.6;
  color: var(--c-ink-mid);
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: var(--c-ink);
  color: var(--c-paper);
  padding: 24px 0;
  border-top: 2px solid var(--c-ink);
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
}

.footer-logo a {
  display: flex;
  align-items: center;
  color: var(--c-paper);
  text-decoration: none;
}

.footer-brand-text {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--c-paper);
}

.footer-logo img {
  height: 28px;
  width: auto;
  filter: invert(1);
  opacity: 0.9;
}

.footer-nav {
  flex: 1;
}

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

.footer-nav > ol > li > a {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(253,251,247,0.65);
  border-radius: var(--radius-sm);
  min-height: 36px;
  white-space: nowrap;
}

.footer-nav > ol > li > a:hover {
  color: var(--c-paper);
  background: rgba(253,251,247,0.1);
  text-decoration: none;
}

.footer-copyright {
  text-align: right;
  flex-shrink: 0;
}

.footer-copyright p {
  font-size: 12px;
  color: rgba(253,251,247,0.5);
  line-height: 1.6;
}

.footer-icp {
  font-size: 11px;
  opacity: 0.6;
}

/* ============================================================
   Scroll Reveal Animation
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  .content-body section {
    opacity: 0;
    transform: translateY(20px);
  }

  .content-body section.is-visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease, transform 0.4s ease;
  }

  .aside-block {
    opacity: 0;
    transform: translateX(12px);
  }

  .aside-block.is-visible {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.4s ease 0.1s, transform 0.4s ease 0.1s;
  }
}

@media (prefers-reduced-motion: reduce) {
  .content-body section,
  .aside-block {
    opacity: 1;
    transform: none;
  }
}

/* ============================================================
   Responsive — Tablet
   ============================================================ */
@media (max-width: 1024px) {
  .content-with-aside {
    grid-template-columns: 1fr 240px;
    gap: 32px;
  }

  .primary-nav > ol > li > a {
    padding: 8px 8px;
    font-size: 13px;
  }
}

/* ============================================================
   Responsive — Mobile
   ============================================================ */
@media (max-width: 768px) {
  :root {
    --header-h: 56px;
  }

  .primary-nav {
    display: none;
  }

  .header-contact {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .header-inner {
    padding: 0 16px;
    gap: 16px;
    justify-content: space-between;
  }

  .sticky-anchor-bar {
    top: var(--header-h);
  }

  .anchor-list li a {
    font-size: 12px;
    padding: 0 10px;
  }

  .hero-inner {
    padding: 40px 16px 64px;
    justify-content: flex-start;
  }

  .hero-content {
    text-align: left;
    max-width: 100%;
  }

  .hero-h1 {
    font-size: clamp(24px, 7vw, 36px);
  }

  .hero-desc {
    margin-left: 0;
    font-size: 15px;
  }

  .hero-badge {
    font-size: 10px;
  }

  .site-main {
    padding: 32px 0 48px;
  }

  .wrap {
    padding: 0 16px;
  }

  .content-with-aside {
    grid-template-columns: 1fr;
  }

  .content-aside {
    position: static;
  }

  .content-body section {
    padding: 20px 16px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 0 16px;
  }

  .footer-copyright {
    text-align: left;
  }

  .footer-nav > ol {
    gap: 2px;
  }

  .footer-nav > ol > li > a {
    padding: 8px 8px;
    min-height: 40px;
  }
}

@media (max-width: 375px) {
  .hero-h1 {
    font-size: 22px;
  }

  .anchor-list li a {
    font-size: 11px;
    padding: 0 8px;
  }
}
