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

/* ===========================
   CSS 自定义属性
   =========================== */
:root {
  --mint: #5cc6b0;
  --mint-light: #8eddd0;
  --mint-dark: #3da890;
  --sand: #d4c4a8;
  --sand-light: #e8ddc8;
  --sand-dark: #bfac90;
  --ink: #172623;
  --ink-soft: #2e4a44;
  --ink-mute: #4a6860;
  --cream: #f5f0e8;
  --warm-white: #faf8f4;
  --terracotta: #c67b5c;
  --olive: #6b7b3c;
  --radius-card: 28px;
  --radius-sm: 12px;
  --radius-xs: 6px;
  --nav-w: 220px;
  --nav-collapsed: 64px;
  --shadow-soft: 0 4px 24px rgba(23,38,35,0.10);
  --shadow-card: 0 2px 16px rgba(23,38,35,0.08);
  --font-heading: 'Rubik', 'Nunito Sans', system-ui, sans-serif;
  --font-body: 'Nunito Sans', 'Rubik', system-ui, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --transition: 0.3s var(--ease-out);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body, .body-root {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink);
  background-color: var(--cream);
  min-height: 100vh;
  overflow-x: hidden;
  width: 100%;
}

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

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

ul, ol {
  list-style: none;
}

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

/* ===========================
   Layout Shell
   =========================== */
.site-shell {
  display: flex;
  min-height: 100vh;
  position: relative;
  width: 100%;
  overflow-x: hidden;
}

.page-body {
  flex: 1;
  margin-left: var(--nav-w);
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ===========================
   Side Navigation
   =========================== */
.side-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--nav-w);
  height: 100vh;
  z-index: 100;
  background: var(--ink);
  display: flex;
  flex-direction: column;
  transition: width var(--transition);
  overflow: hidden;
}

.side-nav-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0;
}

.nav-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 72px;
  background: var(--ink-soft);
  flex-shrink: 0;
  transition: background var(--transition);
}

.nav-brand:hover {
  background: var(--mint-dark);
}

.nav-logo-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.nav-logo-text {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--mint);
  color: var(--ink);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1rem 0;
  overflow-y: auto;
  overflow-x: hidden;
  gap: 2px;
}

.nav-list li {
  width: 100%;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.75rem 1.25rem;
  color: var(--sand);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 0;
  transition: background var(--transition), color var(--transition), padding-left var(--transition);
  white-space: nowrap;
  min-height: 48px;
  position: relative;
}

.nav-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 3px;
  height: 60%;
  background: var(--mint);
  border-radius: 0 2px 2px 0;
  transition: transform var(--transition);
}

.nav-link:hover,
.nav-link:focus-visible {
  background: rgba(92,198,176,0.12);
  color: var(--mint-light);
  padding-left: 1.5rem;
}

.nav-link:hover::before,
.nav-link:focus-visible::before {
  transform: translateY(-50%) scaleY(1);
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mint);
  transition: color var(--transition);
}

.nav-link:hover .nav-icon {
  color: var(--mint-light);
}

.nav-label {
  font-size: 0.88rem;
  letter-spacing: 0.02em;
  transition: opacity var(--transition);
}

.nav-footer-mark {
  padding: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mint);
  opacity: 0.5;
  animation: pulse-dot 3s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.3); }
}

/* ===========================
   Hero
   =========================== */
.site-hero {
  min-height: 70vh;
  background: var(--ink);
  position: relative;
  overflow: hidden;
}

.hero-inner {
  display: flex;
  min-height: 70vh;
  position: relative;
}

.hero-media {
  position: absolute;
  inset: 0;
  left: 0;
  width: 55%;
  overflow: hidden;
}

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

.hero-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--ink-soft) 0%, var(--ink) 60%, #0d1c1a 100%);
}

.hero-grain {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.06'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  pointer-events: none;
  opacity: 0.4;
}

.hero-content {
  position: relative;
  z-index: 3;
  margin-left: auto;
  width: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  padding: 4rem 3rem 4rem 2rem;
  text-align: right;
}

.hero-eyebrow {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mint);
  background: rgba(92,198,176,0.12);
  border: 1px solid rgba(92,198,176,0.3);
  border-radius: var(--radius-xs);
  padding: 4px 12px;
  margin-bottom: 1.25rem;
}

.hero-h1 {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 3.5vw, 3rem);
  font-weight: 700;
  color: var(--warm-white);
  line-height: 1.2;
  margin-bottom: 1rem;
  text-shadow: 0 2px 20px rgba(0,0,0,0.4);
  word-break: break-all;
}

.hero-sub {
  font-size: 1rem;
  color: var(--sand);
  line-height: 1.6;
  margin-bottom: 2rem;
  max-width: 360px;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--mint);
  color: var(--ink);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.85rem 2rem;
  border-radius: 100px;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 20px rgba(92,198,176,0.35);
  min-height: 48px;
}

.hero-cta:hover {
  background: var(--mint-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(92,198,176,0.45);
}

.hero-bg-text {
  position: absolute;
  bottom: -0.2em;
  right: 2.5rem;
  font-family: var(--font-heading);
  font-size: clamp(4rem, 12vw, 12rem);
  font-weight: 700;
  color: transparent;
  -webkit-text-stroke: 1px rgba(92,198,176,0.12);
  letter-spacing: 0.08em;
  pointer-events: none;
  user-select: none;
  z-index: 1;
  line-height: 1;
}

/* ===========================
   Overlay gradient
   =========================== */
.site-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, transparent 40%, rgba(23,38,35,0.7) 70%, rgba(23,38,35,0.92) 100%);
  pointer-events: none;
  z-index: 1;
}

/* ===========================
   Main Content
   =========================== */
.main-content {
  flex: 1;
  padding: 3rem 2rem;
  background: var(--warm-white);
  overflow-x: hidden;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2.5rem;
  align-items: start;
}

/* ===========================
   Content Section & Article
   =========================== */
.content-section {
  min-width: 0;
  overflow-x: hidden;
}

.prose-article {
  color: var(--ink);
  min-width: 0;
  overflow-x: hidden;
}

.prose-article h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.2rem, 2.5vw, 1.75rem);
  font-weight: 700;
  color: var(--ink);
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--sand);
  position: relative;
}

.prose-article h2::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 3rem;
  height: 2px;
  background: var(--mint);
  border-radius: 2px;
}

.prose-article h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 2rem 0 0.75rem;
}

.prose-article p {
  margin-bottom: 1.25rem;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--ink-soft);
}

.prose-article a {
  color: var(--mint-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition);
}

.prose-article a:hover {
  color: var(--mint);
}

.prose-article ul,
.prose-article ol {
  margin: 1rem 0 1.5rem 1.5rem;
  list-style: disc;
}

.prose-article ol {
  list-style: decimal;
}

.prose-article li {
  margin-bottom: 0.5rem;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink-soft);
}

.prose-article strong {
  font-weight: 700;
  color: var(--ink);
}

.prose-article em {
  color: var(--mint-dark);
  font-style: italic;
}

.prose-article blockquote {
  border-left: 4px solid var(--mint);
  background: rgba(92,198,176,0.06);
  padding: 1rem 1.5rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.5rem 0;
  color: var(--ink-soft);
  font-style: italic;
}

.prose-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  display: block;
  overflow-x: auto;
}

.prose-article th {
  background: var(--ink);
  color: var(--sand);
  padding: 0.6rem 1rem;
  text-align: left;
  font-weight: 600;
}

.prose-article td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--sand-light);
  color: var(--ink-soft);
}

.prose-article tr:nth-child(even) td {
  background: rgba(212,196,168,0.15);
}

.prose-article section {
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--sand-light);
  scroll-margin-top: 80px;
}

.prose-article section:last-child {
  border-bottom: none;
}

/* ===========================
   Aside
   =========================== */
.side-aside {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: 1.5rem;
  min-width: 0;
}

.aside-card {
  background: var(--warm-white);
  border: 1px solid var(--sand);
  border-radius: var(--radius-card);
  border-bottom: 4px solid var(--mint);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition), box-shadow var(--transition);
}

.aside-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-soft);
}

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

.aside-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 1rem;
}

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

.aside-nav-list li {
  border-radius: var(--radius-xs);
  overflow: hidden;
}

.aside-link {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
  border-radius: var(--radius-xs);
  transition: background var(--transition), color var(--transition), padding-left var(--transition);
  font-weight: 500;
  min-height: 40px;
}

.aside-link:hover {
  background: rgba(92,198,176,0.1);
  color: var(--mint-dark);
  padding-left: 1rem;
}

.aside-tip {
  background: linear-gradient(135deg, rgba(23,38,35,0.03) 0%, rgba(92,198,176,0.06) 100%);
  border-color: var(--sand-dark);
  border-bottom-color: var(--terracotta);
}

.aside-tip-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.aside-tip-text {
  font-size: 0.85rem;
  color: var(--ink-mute);
  line-height: 1.6;
}

/* ===========================
   Footer
   =========================== */
.site-footer {
  background: var(--ink);
  padding: 2rem 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.footer-copy {
  font-size: 0.9rem;
  color: var(--sand);
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.site-footer small {
  display: block;
  font-size: 0.78rem;
  color: var(--ink-mute);
  line-height: 1.6;
  max-width: 560px;
  margin: 0 auto;
}

/* ===========================
   Scroll margin for anchors
   =========================== */
section[id] {
  scroll-margin-top: 80px;
}

/* ===========================
   Stagger List Animation
   =========================== */
@media (prefers-reduced-motion: no-preference) {
  .nav-list li {
    opacity: 0;
    transform: translateX(-16px);
    animation: stagger-in 0.45s var(--ease-out) forwards;
  }

  .nav-list li:nth-child(1) { animation-delay: 0.05s; }
  .nav-list li:nth-child(2) { animation-delay: 0.10s; }
  .nav-list li:nth-child(3) { animation-delay: 0.15s; }
  .nav-list li:nth-child(4) { animation-delay: 0.20s; }
  .nav-list li:nth-child(5) { animation-delay: 0.25s; }
  .nav-list li:nth-child(6) { animation-delay: 0.30s; }
  .nav-list li:nth-child(7) { animation-delay: 0.35s; }

  @keyframes stagger-in {
    to { opacity: 1; transform: translateX(0); }
  }

  .aside-card {
    opacity: 0;
    transform: translateY(20px);
    animation: fade-up 0.5s var(--ease-out) 0.2s forwards;
  }

  .aside-card:nth-child(2) {
    animation-delay: 0.35s;
  }

  @keyframes fade-up {
    to { opacity: 1; transform: translateY(0); }
  }

  .hero-h1 {
    opacity: 0;
    transform: translateY(24px);
    animation: fade-up 0.6s var(--ease-out) 0.1s forwards;
  }

  .hero-sub {
    opacity: 0;
    transform: translateY(16px);
    animation: fade-up 0.6s var(--ease-out) 0.25s forwards;
  }

  .hero-cta {
    opacity: 0;
    transform: translateY(12px);
    animation: fade-up 0.5s var(--ease-out) 0.4s forwards;
  }
}

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

/* ===========================
   Responsive: Tablet
   =========================== */
@media (max-width: 1024px) {
  :root {
    --nav-w: var(--nav-collapsed);
  }

  .nav-label {
    display: none;
  }

  .nav-link {
    justify-content: center;
    padding: 0.85rem;
  }

  .nav-link:hover,
  .nav-link:focus-visible {
    padding-left: 0.85rem;
  }

  .wrap {
    grid-template-columns: 1fr 240px;
    gap: 1.5rem;
  }
}

/* ===========================
   Responsive: Mobile
   =========================== */
@media (max-width: 768px) {
  :root {
    --nav-w: 0px;
  }

  .site-shell {
    flex-direction: column;
  }

  .side-nav {
    width: 100%;
    height: auto;
    position: sticky;
    top: 0;
    flex-direction: row;
    z-index: 200;
    overflow: hidden;
  }

  .side-nav-inner {
    flex-direction: row;
    align-items: center;
    width: 100%;
    padding: 0 0.5rem;
    height: 52px;
    overflow: hidden;
  }

  .nav-brand {
    width: auto;
    height: 52px;
    background: transparent;
    padding: 0 0.75rem 0 0;
    flex-shrink: 0;
  }

  .nav-list {
    flex-direction: row;
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0;
    gap: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    height: 52px;
    align-items: center;
  }

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

  .nav-list li {
    flex-shrink: 0;
    width: auto;
    height: 52px;
    display: flex;
    align-items: center;
  }

  .nav-label {
    display: block;
    font-size: 0.68rem;
    white-space: nowrap;
  }

  .nav-link {
    flex-direction: column;
    gap: 2px;
    padding: 0.35rem 0.6rem;
    min-height: 44px;
    justify-content: center;
    align-items: center;
    white-space: nowrap;
  }

  .nav-link:hover,
  .nav-link:focus-visible {
    padding-left: 0.6rem;
  }

  .nav-link::before {
    display: none;
  }

  .nav-footer-mark {
    display: none;
  }

  .page-body {
    margin-left: 0;
    width: 100%;
  }

  .hero-inner {
    flex-direction: column;
    min-height: auto;
  }

  .hero-media {
    width: 100%;
    height: 38vw;
    min-height: 160px;
    position: relative;
    inset: auto;
  }

  .hero-content {
    width: 100%;
    padding: 1.75rem 1.25rem;
    text-align: right;
    align-items: flex-end;
    background: var(--ink);
    position: relative;
    z-index: 2;
  }

  .site-hero {
    min-height: auto;
  }

  .site-hero::after {
    display: none;
  }

  .hero-bg-text {
    font-size: 3.5rem;
    right: 0.75rem;
  }

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

  .main-content {
    padding: 1.5rem 0.875rem;
  }

  .wrap {
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 100%;
  }

  .side-aside {
    position: static;
  }

  .site-footer {
    padding: 1.5rem 1rem;
  }
}

@media (max-width: 480px) {
  .hero-h1 {
    font-size: 1.4rem;
  }

  .hero-sub {
    font-size: 0.875rem;
  }

  .nav-icon {
    width: 16px;
    height: 16px;
  }

  .nav-label {
    font-size: 0.62rem;
  }

  .nav-link {
    padding: 0.3rem 0.5rem;
    min-height: 44px;
  }

  .main-content {
    padding: 1.25rem 0.75rem;
  }

  .prose-article h2 {
    font-size: 1.15rem;
  }
}

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