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

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

html {
  scroll-behavior: smooth;
  font-size: 17px;
  background: #fdfbf7;
  color: #1a1a1a;
}

body {
  font-family: 'Open Sans', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: #fdfbf7;
  color: #1a1a1a;
  line-height: 1.75;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* ===== NOISE TEXTURE OVERLAY ===== */
.noise-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Poppins', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-weight: 700;
  line-height: 1.3;
  color: #1a1a1a;
}

h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.3rem, 2.5vw, 1.9rem); margin-bottom: 1rem; }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); margin-bottom: 0.75rem; }

p { margin-bottom: 1.1rem; }
a { color: #1a1a1a; text-decoration: underline; text-underline-offset: 3px; }
a:hover { opacity: 0.65; }
ul, ol { padding-left: 1.4rem; margin-bottom: 1rem; }
li { margin-bottom: 0.35rem; }
strong { font-weight: 700; }

/* ===== ANNOUNCE BAR ===== */
.announce-bar {
  background: #1a1a1a;
  color: #fdfbf7;
  font-family: 'Poppins', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-align: center;
  padding: 7px 16px;
  border-bottom: 1px solid #333;
}

/* ===== HEADER ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fdfbf7;
  border-bottom: 1px solid #1a1a1a;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}

.brand-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-icon {
  height: 38px;
  width: auto;
  display: block;
}

.brand-text-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: #1a1a1a;
  color: #fdfbf7;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: -0.02em;
  border-radius: 4px;
}

/* ===== TOP NAV ===== */
.top-nav {
  margin-left: auto;
}

.nav-list {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 0.15rem;
  flex-wrap: wrap;
}

.nav-link {
  display: block;
  padding: 0.55rem 0.75rem;
  font-family: 'Poppins', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  color: #1a1a1a;
  letter-spacing: 0.03em;
  border: 1px solid transparent;
  border-radius: 3px;
  transition: none;
  white-space: nowrap;
  min-height: 40px;
  display: flex;
  align-items: center;
}

.nav-link:hover {
  border-color: #1a1a1a;
  background: #f5f5f5;
  opacity: 1;
}

/* ===== NAV TOGGLE (mobile) ===== */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 1px solid #1a1a1a;
  border-radius: 3px;
  padding: 8px 10px;
  cursor: pointer;
  margin-left: auto;
  min-height: 40px;
  min-width: 40px;
  align-items: center;
  justify-content: center;
}

.bar {
  display: block;
  width: 20px;
  height: 2px;
  background: #1a1a1a;
}

/* ===== HERO ===== */
.hero-section {
  position: relative;
  min-height: 70vh;
  background: #1a1a1a;
  color: #fdfbf7;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 4rem 1.5rem 6rem;
  overflow: hidden;
  scroll-margin-top: 60px;
}

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

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

.hero-badge {
  display: inline-block;
  font-family: 'Poppins', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  border: 1px solid rgba(253,251,247,0.5);
  color: #fdfbf7;
  padding: 4px 12px;
  border-radius: 2px;
  margin-bottom: 1.2rem;
  text-transform: uppercase;
}

.hero-h1 {
  color: #fdfbf7;
  margin-bottom: 1rem;
  font-size: clamp(1.9rem, 4.5vw, 3rem);
}

.hero-sub {
  color: rgba(253,251,247,0.75);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 0;
}

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

/* ===== MAIN LAYOUT ===== */
main {
  background: #fdfbf7;
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

/* Content section: article + aside side by side */
.content-section {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 3rem;
  align-items: start;
}

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

.article-body {
  font-size: 1rem;
  line-height: 1.85;
}

/* Section styling for injected content */
.article-body section {
  padding-top: 1rem;
  margin-bottom: 3rem;
  border-top: 2px solid #1a1a1a;
  scroll-margin-top: 80px;
}

.article-body section:first-child {
  border-top: none;
  padding-top: 0;
}

.article-body h2 {
  margin-top: 0.25rem;
  margin-bottom: 1rem;
  padding-bottom: 0.4rem;
}

.article-body h3 {
  margin-top: 1.5rem;
}

.article-body ul,
.article-body ol {
  margin-bottom: 1.2rem;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.93rem;
}

.article-body th,
.article-body td {
  border: 1px solid #c8c8c8;
  padding: 0.5rem 0.75rem;
  text-align: left;
}

.article-body th {
  background: #f5f5f5;
  font-weight: 600;
}

.article-body blockquote {
  border-left: 3px solid #1a1a1a;
  padding-left: 1rem;
  margin: 1.5rem 0;
  color: #444;
  font-style: italic;
}

/* ===== ASIDE ===== */
.content-aside {
  position: sticky;
  top: 90px;
}

.aside-inner {
  background: #f5f5f5;
  border: 1px solid #1a1a1a;
  border-radius: 4px;
  padding: 1.4rem 1.2rem;
}

.aside-title {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #1a1a1a;
}

.aside-title span {
  display: inline;
}

.aside-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: aside-counter;
}

.aside-nav-list li {
  counter-increment: aside-counter;
  margin-bottom: 0.1rem;
}

.aside-nav-link {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.4rem 0.3rem;
  font-size: 0.82rem;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  text-decoration: none;
  color: #1a1a1a;
  border-radius: 2px;
  min-height: 40px;
  line-height: 1.4;
}

.aside-nav-link::before {
  content: counter(aside-counter, decimal-leading-zero);
  font-size: 0.7rem;
  font-weight: 700;
  opacity: 0.4;
  flex-shrink: 0;
  margin-top: 2px;
}

.aside-nav-link:hover {
  background: #ece9e3;
  opacity: 1;
}

/* ===== FOOTER ===== */
.site-footer {
  background: #1a1a1a;
  color: #fdfbf7;
  padding: 2.5rem 1.5rem 1.8rem;
  border-top: 2px solid #1a1a1a;
}

/* Footer nav with dl structure */
.footer-nav {
  max-width: 1200px;
  margin: 0 auto 2rem;
}

.footer-dl {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1rem;
  align-items: center;
}

.footer-dt {
  font-family: 'Poppins', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(253,251,247,0.5);
  margin-right: 0.5rem;
  flex-basis: 100%;
  margin-bottom: 0.5rem;
}

.footer-dl dd {
  margin: 0;
}

.footer-dl dd a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.2rem 0.6rem;
  font-size: 0.8rem;
  font-family: 'Poppins', sans-serif;
  color: rgba(253,251,247,0.8);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 3px;
}

.footer-dl dd a:hover {
  border-color: rgba(253,251,247,0.3);
  color: #fdfbf7;
  opacity: 1;
}

.footer-copy {
  max-width: 1200px;
  margin: 0 auto 0.4rem;
  font-size: 0.8rem;
  color: rgba(253,251,247,0.55);
  border-top: 1px solid rgba(253,251,247,0.15);
  padding-top: 1.2rem;
}

.footer-note {
  display: block;
  max-width: 1200px;
  margin: 0 auto;
  font-size: 0.72rem;
  color: rgba(253,251,247,0.35);
  line-height: 1.5;
}

/* ===== SCROLL REVEAL ===== */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.5s ease, transform 0.5s ease;
  }
  .reveal.visible {
    opacity: 1;
    transform: none;
  }
  .stagger > * {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.45s ease, transform 0.45s ease;
  }
  .stagger.visible > * {
    opacity: 1;
    transform: none;
  }
  .stagger.visible > *:nth-child(1) { transition-delay: 0.05s; }
  .stagger.visible > *:nth-child(2) { transition-delay: 0.12s; }
  .stagger.visible > *:nth-child(3) { transition-delay: 0.19s; }
  .stagger.visible > *:nth-child(4) { transition-delay: 0.26s; }
  .stagger.visible > *:nth-child(5) { transition-delay: 0.33s; }
  .stagger.visible > *:nth-child(6) { transition-delay: 0.40s; }
  .stagger.visible > *:nth-child(7) { transition-delay: 0.47s; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .stagger > * {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .content-section {
    grid-template-columns: 1fr;
  }
  .content-aside {
    position: static;
    order: -1;
  }
  .aside-nav-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
  }
  .aside-nav-link {
    border: 1px solid #c8c8c8;
    border-radius: 3px;
    padding: 0.35rem 0.6rem;
    font-size: 0.78rem;
    min-height: 40px;
  }
}

@media (max-width: 680px) {
  .top-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fdfbf7;
    border-top: 1px solid #1a1a1a;
    border-bottom: 2px solid #1a1a1a;
    z-index: 200;
    padding: 0.75rem 1rem;
  }
  .top-nav.open {
    display: block;
  }
  .nav-list {
    flex-direction: column;
    gap: 0.15rem;
  }
  .nav-link {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid #e8e8e4;
  }
  .nav-toggle {
    display: flex;
  }
  .hero-section {
    justify-content: flex-start;
    padding: 3rem 1.25rem 5rem;
    min-height: 60vh;
  }
  .hero-inner {
    text-align: left;
  }
  .wrap {
    padding: 2rem 1rem 3rem;
  }
  .footer-dl {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
  }
}

@media (max-width: 400px) {
  html { font-size: 16px; }
  .hero-h1 { font-size: 1.6rem; }
}
