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

/* ===== 根变量 ===== */
:root {
  --c-mint: #b4fde1;
  --c-blue: #add8e6;
  --c-dark: #172620;
  --c-white: #ffffff;
  --c-mint-deep: #7ef5c4;
  --c-blue-deep: #7ec8e3;
  --c-dark-muted: #2e4a3e;
  --c-bg: #eafff7;
  --c-surface: #f5fffe;

  --radius-pill: 999px;
  --radius-card: 20px;
  --radius-sm: 12px;
  --border: 3px solid var(--c-dark);
  --border-thick: 4px solid var(--c-dark);

  --shadow-outer: 4px 6px 0px var(--c-dark);
  --shadow-inner: inset -2px -3px 8px rgba(0,0,0,0.12);
  --shadow-clay: inset -2px -3px 8px rgba(0,0,0,0.10), 4px 6px 0px var(--c-dark);

  --font-head: 'Syncopate', 'Space Mono', monospace;
  --font-body: 'Space Mono', 'Courier New', monospace;

  --nav-h: 72px;
  --sticky-h: 48px;
  --scroll-offset: 128px;

  scroll-behavior: smooth;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-padding-top: var(--scroll-offset); }
body { font-family: var(--font-body); background: var(--c-bg); color: var(--c-dark); line-height: 1.65; min-height: 100vh; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, menu { list-style: none; }
button { font-family: inherit; cursor: pointer; }

/* ===== Clay Body ===== */
.clay-body { background: linear-gradient(135deg, var(--c-bg) 0%, #dff9f0 50%, #e8f7fc 100%); }

/* ===== Page Shell ===== */
.page-shell { display: flex; flex-direction: column; min-height: 100vh; }

/* ===== HEADER ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(90deg, var(--c-mint) 0%, var(--c-blue) 100%);
  border-bottom: var(--border-thick);
  box-shadow: 0 4px 0 var(--c-dark);
  height: var(--nav-h);
}

/* Desktop row */
.nav-desktop-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  gap: 16px;
}

.nav-left, .nav-right { flex: 1; }
.nav-right { display: flex; justify-content: flex-end; }

.nav-pills-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  border: 3px solid var(--c-dark);
  background: var(--c-white);
  font-family: var(--font-head);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--c-dark);
  box-shadow: var(--shadow-clay);
  transition: transform 200ms cubic-bezier(0.34,1.56,0.64,1), box-shadow 200ms ease-out;
  white-space: nowrap;
  min-height: 40px;
}

.nav-pill:hover, .nav-pill:focus-visible {
  transform: translateY(-2px) scale(1.04);
  box-shadow: inset -2px -3px 8px rgba(0,0,0,0.10), 6px 8px 0px var(--c-dark);
  background: var(--c-mint);
  outline: none;
}

.nav-pill:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: inset -1px -1px 4px rgba(0,0,0,0.14), 2px 2px 0px var(--c-dark);
}

/* Brand Center Desktop */
.brand-center-desk {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-head);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--c-dark);
  white-space: nowrap;
}

.logo-link { display: flex; align-items: center; }
.logo-img { border-radius: 50%; border: 3px solid var(--c-dark); }

/* Mobile details nav */
.nav-details { display: none; }

.nav-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: var(--nav-h);
  cursor: pointer;
  list-style: none;
}
.nav-summary::-webkit-details-marker { display: none; }

.brand-center {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-toggle-label {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--c-dark);
  min-width: 40px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, var(--c-mint), var(--c-blue));
  border-top: 3px solid var(--c-dark);
  padding: 12px 16px 16px;
  gap: 8px;
}

.nav-menu li a {
  display: block;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  border: 3px solid var(--c-dark);
  background: var(--c-white);
  font-family: var(--font-head);
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: var(--shadow-clay);
  min-height: 44px;
  display: flex;
  align-items: center;
}

/* ===== STICKY BAR ===== */
.sticky-bar {
  position: sticky;
  top: var(--nav-h);
  z-index: 90;
  background: var(--c-dark);
  border-bottom: 3px solid var(--c-dark);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.sticky-bar::-webkit-scrollbar { display: none; }

.sticky-list {
  display: flex;
  gap: 0;
  min-width: max-content;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
}

.sticky-link {
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  height: var(--sticky-h);
  font-family: var(--font-head);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--c-mint);
  white-space: nowrap;
  border-right: 1px solid rgba(180,253,225,0.2);
  transition: background 180ms ease, color 180ms ease;
  min-height: 40px;
}

.sticky-link:hover, .sticky-link:focus-visible {
  background: var(--c-mint);
  color: var(--c-dark);
  outline: none;
}

/* ===== HERO ===== */
.hero-wrap {
  position: relative;
  min-height: 45vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: var(--border-thick);
}

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

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

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    rgba(180,253,225,0.82) 0%,
    rgba(173,216,230,0.75) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 48px 24px 80px;
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 22px;
  border-radius: var(--radius-pill);
  border: 3px solid var(--c-dark);
  background: var(--c-white);
  font-family: var(--font-head);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  box-shadow: var(--shadow-clay);
  animation: floatBadge 3s ease-in-out infinite;
}

@keyframes floatBadge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.hero-h1 {
  font-family: var(--font-head);
  font-size: clamp(1.6rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--c-dark);
  text-shadow: 3px 3px 0 rgba(23,38,32,0.15);
  line-height: 1.3;
}

.hero-sub {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--c-dark-muted);
  max-width: 540px;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  padding: 14px 36px;
  border-radius: var(--radius-pill);
  border: var(--border-thick);
  background: linear-gradient(135deg, var(--c-mint), var(--c-blue));
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--c-dark);
  box-shadow: var(--shadow-clay);
  transition: transform 200ms cubic-bezier(0.34,1.56,0.64,1), box-shadow 200ms ease-out;
  min-height: 52px;
}

.hero-cta:hover, .hero-cta:focus-visible {
  transform: translateY(-3px) scale(1.05);
  box-shadow: inset -2px -3px 8px rgba(0,0,0,0.12), 6px 8px 0px var(--c-dark);
  outline: none;
}

.hero-cta:active {
  transform: translateY(1px) scale(0.97);
  box-shadow: inset -1px -1px 4px rgba(0,0,0,0.16), 2px 2px 0px var(--c-dark);
}

/* Arc bottom */
.hero-arc {
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--c-bg);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  z-index: 3;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  padding: 40px 0 60px;
}

.content-with-aside {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

/* ===== ASIDE ===== */
.content-aside {
  flex: 0 0 240px;
  position: sticky;
  top: calc(var(--nav-h) + var(--sticky-h) + 20px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.aside-card {
  background: linear-gradient(145deg, var(--c-mint) 0%, var(--c-blue) 100%);
  border: var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
  box-shadow: var(--shadow-clay);
}

.aside-title {
  font-family: var(--font-head);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--c-dark);
  margin-bottom: 4px;
}

.aside-card .subtitle {
  font-size: 0.78rem;
  color: var(--c-dark-muted);
  margin-bottom: 14px;
  line-height: 1.5;
}

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

.aside-link {
  display: block;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  border: 3px solid var(--c-dark);
  background: var(--c-white);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--c-dark);
  box-shadow: 3px 3px 0 var(--c-dark);
  transition: transform 150ms ease, box-shadow 150ms ease;
  min-height: 40px;
  display: flex;
  align-items: center;
}

.aside-link:hover, .aside-link:focus-visible {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--c-dark);
  background: var(--c-mint);
  outline: none;
}

.aside-tip {
  background: linear-gradient(135deg, #fffbe6 0%, var(--c-mint) 100%);
}

.aside-tip-text {
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--c-dark);
}

/* ===== MAIN BODY ===== */
.main-body { flex: 1; min-width: 0; }

/* ===== 正文容器契约: main > section.wrap > article > div ===== */
.wrap { width: 100%; }

.content-section {
  background: var(--c-surface);
  border: var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-clay);
  overflow: hidden;
}

.content-article {
  padding: 32px 36px;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--c-dark);
}

/* ===== 正文内样式 ===== */
.content-article h1,
.content-article h2,
.content-article h3,
.content-article h4 {
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--c-dark);
  margin-top: 2em;
  margin-bottom: 0.6em;
  line-height: 1.35;
}

.content-article h2 {
  font-size: 1.25rem;
  border-left: 6px solid var(--c-mint);
  padding-left: 14px;
  background: linear-gradient(90deg, rgba(180,253,225,0.3) 0%, transparent 60%);
  border-radius: 0 8px 8px 0;
  padding-top: 6px;
  padding-bottom: 6px;
}

.content-article h3 { font-size: 1.05rem; color: var(--c-dark-muted); }
.content-article h4 { font-size: 0.95rem; }

.content-article p { margin-bottom: 1.2em; }

.content-article ul, .content-article ol {
  padding-left: 1.5em;
  margin-bottom: 1.2em;
}

.content-article li { margin-bottom: 0.5em; }

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

.content-article a {
  color: var(--c-dark);
  border-bottom: 2px solid var(--c-mint-deep);
  transition: border-color 150ms;
}
.content-article a:hover { border-color: var(--c-dark); }

.content-article article {
  margin-bottom: 3em;
  padding-bottom: 2em;
  border-bottom: 3px dashed rgba(23,38,32,0.12);
  scroll-margin-top: var(--scroll-offset);
}

.content-article article:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.content-article blockquote {
  margin: 1.5em 0;
  padding: 16px 20px;
  border-left: 4px solid var(--c-mint-deep);
  background: rgba(180,253,225,0.2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
}

.content-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.9rem;
}

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

.content-article th {
  background: linear-gradient(90deg, var(--c-mint), var(--c-blue));
  font-family: var(--font-head);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

/* Section headings from page.content */
.content-article article h2:first-child {
  margin-top: 0;
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--c-dark);
  border-top: var(--border-thick);
  padding: 20px 0;
}

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

.footer-logo-block {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.footer-brand {
  font-family: var(--font-head);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--c-mint);
}

.footer-nav { flex: 1; }

.footer-nav-list {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: 2px solid rgba(180,253,225,0.25);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--c-blue);
  font-family: var(--font-head);
  letter-spacing: 0.04em;
  transition: background 150ms, color 150ms;
  min-height: 40px;
}

.footer-link:hover, .footer-link:focus-visible {
  background: var(--c-mint);
  color: var(--c-dark);
  border-color: var(--c-mint);
  outline: none;
}

.footer-copy { flex-shrink: 0; }

.copyright {
  font-size: 0.72rem;
  color: rgba(180,253,225,0.55);
  font-family: var(--font-head);
  white-space: nowrap;
}

/* ===== H2 + p.subtitle 契约 ===== */
.aside-title + .subtitle {
  margin-top: 4px;
}

h2 + .subtitle,
h2 + p.subtitle {
  font-size: 0.9rem;
  color: var(--c-dark-muted);
  line-height: 1.55;
  margin-top: -0.3em;
  margin-bottom: 1em;
}

/* ===== Scroll margin for sections ===== */
article[id] { scroll-margin-top: var(--scroll-offset); }

/* ===== Parallax hint ===== */
@media (prefers-reduced-motion: no-preference) {
  .hero-wrap { will-change: transform; }

  .hero-badge {
    animation: floatBadge 3s ease-in-out infinite;
  }

  .aside-card {
    transition: transform 200ms cubic-bezier(0.34,1.56,0.64,1);
  }

  .aside-card:hover {
    transform: translateY(-3px);
  }

  .content-section {
    transition: box-shadow 200ms ease;
  }
}

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

/* ===== 平板断点 ===== */
@media (max-width: 900px) {
  .content-aside { flex: 0 0 200px; }
  .nav-desktop-row { gap: 8px; }
  .nav-pill { padding: 8px 12px; font-size: 0.65rem; }
}

/* ===== 手机断点 ===== */
@media (max-width: 680px) {
  .nav-desktop-row { display: none; }
  .nav-details { display: block; }

  .content-with-aside {
    flex-direction: column;
    padding: 0 16px;
  }

  .content-aside {
    flex: none;
    width: 100%;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
  }

  .aside-card { flex: 1 1 200px; }

  .content-article { padding: 20px 18px; }

  .hero-content { padding: 36px 16px 72px; }

  .hero-h1 { font-size: 1.5rem; }

  .sticky-list { padding: 0 8px; }
  .sticky-link { padding: 0 10px; font-size: 0.62rem; }

  .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }

  .footer-nav-list {
    justify-content: center;
  }

  .copyright { white-space: normal; }
}

@media (max-width: 400px) {
  .nav-pill { padding: 7px 10px; font-size: 0.6rem; }
  .content-article { padding: 16px 14px; font-size: 0.95rem; }
}

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