@import url('https://fonts.googleapis.com/css2?family=Amatic+SC:wght@400;700&family=Cabin: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: 16px;
  background: #001e3c;
  color: #c8ffe8;
}

body {
  font-family: 'Cabin', system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  background: #001e3c;
  color: #c8ffe8;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

/* ── Screen-reader only ── */
.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;
}

/* ── Organic background orbs ── */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
  animation: breathe 8s ease-in-out infinite;
}
.orb-1 {
  width: 520px; height: 520px;
  background: radial-gradient(circle, #00ff41 0%, #99ffcc 60%, transparent 100%);
  top: -120px; left: -120px;
  animation-delay: 0s;
  will-change: transform;
}
.orb-2 {
  width: 380px; height: 380px;
  background: radial-gradient(circle, #99ffcc 0%, #00ff41 50%, transparent 100%);
  bottom: 10%; right: -80px;
  animation-delay: 3s;
  will-change: transform;
}
.orb-3 {
  width: 260px; height: 260px;
  background: radial-gradient(circle, #00ff41 0%, transparent 100%);
  top: 50%; left: 40%;
  animation-delay: 5s;
}

@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 0.18; }
  50% { transform: scale(1.12); opacity: 0.26; }
}

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(0, 30, 60, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(153, 255, 204, 0.18);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 0.85rem 2rem 0.6rem;
  border-bottom: 1px solid rgba(153, 255, 204, 0.08);
}

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

.brand-logo { height: 40px; width: auto; }

.brand-text {
  font-family: 'Amatic SC', cursive;
  font-size: 2rem;
  font-weight: 700;
  color: #99ffcc;
  letter-spacing: 0.04em;
  line-height: 1;
  white-space: nowrap;
}

.brand-slogan {
  font-size: 0.82rem;
  color: rgba(153, 255, 204, 0.55);
  letter-spacing: 0.03em;
  line-height: 1.3;
}

.header-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  gap: 1rem;
  min-width: 0;
}

/* nav > ol > li > a — 契约结构 */
.main-nav {
  min-width: 0;
  overflow: hidden;
}

.main-nav ol {
  list-style: none;
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  padding: 0;
  margin: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.main-nav ol::-webkit-scrollbar { display: none; }

.main-nav ol li {
  display: block;
  flex-shrink: 0;
}

.main-nav ol li a {
  display: flex;
  align-items: center;
  padding: 0.85rem 0.9rem;
  font-family: 'Cabin', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(153, 255, 204, 0.8);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.25s, background 0.25s;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  min-height: 44px;
}

.main-nav ol li a:hover,
.main-nav ol li a:focus {
  color: #00ff41;
  border-bottom-color: #00ff41;
  background: rgba(0, 255, 65, 0.05);
  outline: none;
}

/* Search */
.nav-search {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid rgba(153, 255, 204, 0.25);
  border-radius: 2px;
  overflow: hidden;
  background: rgba(0, 30, 60, 0.6);
  flex-shrink: 0;
}

.nav-search input {
  border: none;
  background: transparent;
  color: #c8ffe8;
  font-family: 'Cabin', sans-serif;
  font-size: 0.875rem;
  padding: 0.5rem 0.8rem;
  width: 140px;
  outline: none;
  min-height: 40px;
}

.nav-search input::placeholder { color: rgba(153, 255, 204, 0.35); }
.nav-search input:focus { background: rgba(153, 255, 204, 0.05); }

.nav-search button {
  background: rgba(0, 255, 65, 0.12);
  border: none;
  color: #00ff41;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  min-width: 40px;
  transition: background 0.2s;
}
.nav-search button:hover { background: rgba(0, 255, 65, 0.25); }

/* scroll-margin for sticky header */
article[id] { scroll-margin-top: 100px; }

/* ── Main / Wrap / Section / Article — 契约四层 ── */
main {
  position: relative;
  z-index: 1;
  padding: 2.5rem 0 4rem;
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  box-sizing: border-box;
  width: 100%;
}

.content-section {
  width: 100%;
}

.content-article {
  width: 100%;
}

/* ── h1 ── */
.page-h1 {
  font-family: 'Amatic SC', cursive;
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 700;
  color: #99ffcc;
  line-height: 1.15;
  margin-bottom: 2.5rem;
  letter-spacing: 0.04em;
  position: relative;
}

.page-h1::after {
  content: '';
  display: block;
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, #00ff41, transparent);
  margin-top: 0.6rem;
  border-radius: 2px;
}

/* ── Content layout with aside ── */
.content-with-aside {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 2.5rem;
  align-items: start;
  min-width: 0;
}

.main-content {
  min-width: 0;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* ── page.content inner sections ── */
.main-content article {
  margin-bottom: 3.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(153, 255, 204, 0.1);
  position: relative;
  animation: staggerIn 0.6s ease both;
}

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

/* h2 > span — 契约结构 */
.main-content h2 {
  font-family: 'Amatic SC', cursive;
  font-size: clamp(1.6rem, 3.5vw, 2.3rem);
  font-weight: 700;
  color: #99ffcc;
  margin-bottom: 1.1rem;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.main-content h2 span {
  display: inline;
  background: linear-gradient(135deg, #99ffcc 0%, #00ff41 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.main-content h3 {
  font-family: 'Amatic SC', cursive;
  font-size: clamp(1.2rem, 2.5vw, 1.7rem);
  font-weight: 700;
  color: #00ff41;
  margin: 1.5rem 0 0.7rem;
  letter-spacing: 0.03em;
}

.main-content h3 span {
  display: inline;
}

.main-content h4 {
  font-size: 1rem;
  font-weight: 700;
  color: #99ffcc;
  margin: 1.2rem 0 0.4rem;
}

.main-content p {
  font-size: 1rem;
  line-height: 1.75;
  color: #c8ffe8;
  margin-bottom: 1rem;
  overflow-wrap: break-word;
}

.main-content ul,
.main-content ol {
  margin: 0.8rem 0 1rem 1.4rem;
}

.main-content li {
  line-height: 1.7;
  color: #c8ffe8;
  margin-bottom: 0.4rem;
}

.main-content a {
  color: #00ff41;
  text-decoration: underline;
  text-decoration-color: rgba(0, 255, 65, 0.4);
  transition: text-decoration-color 0.2s;
  overflow-wrap: break-word;
}

.main-content a:hover { text-decoration-color: #00ff41; }

.main-content strong { color: #99ffcc; font-weight: 700; }

.main-content blockquote {
  border-left: 3px solid #00ff41;
  padding: 0.8rem 1.2rem;
  margin: 1.2rem 0;
  background: rgba(0, 255, 65, 0.05);
  color: rgba(200, 255, 232, 0.85);
  font-style: italic;
}

.main-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2rem 0;
  font-size: 0.93rem;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.main-content th {
  background: rgba(153, 255, 204, 0.1);
  color: #99ffcc;
  font-weight: 700;
  padding: 0.6rem 0.9rem;
  text-align: left;
  border: 1px solid rgba(153, 255, 204, 0.15);
  white-space: nowrap;
}

.main-content td {
  padding: 0.55rem 0.9rem;
  border: 1px solid rgba(153, 255, 204, 0.1);
  color: #c8ffe8;
}

.main-content tr:hover td { background: rgba(153, 255, 204, 0.04); }

.main-content img {
  max-width: 100%;
  height: auto;
}

.main-content pre {
  overflow-x: auto;
  max-width: 100%;
}

/* ── Aside ── */
.content-aside {
  position: sticky;
  top: 100px;
  min-width: 0;
}

.aside-inner {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(153, 255, 204, 0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 0;
  padding: 1.5rem;
  overflow: hidden;
  position: relative;
}

.aside-title {
  font-family: 'Amatic SC', cursive;
  font-size: 1.3rem;
  font-weight: 700;
  color: #99ffcc;
  margin-bottom: 1rem;
  letter-spacing: 0.04em;
}

.aside-title span { display: inline; }

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

.aside-nav-list li { margin-bottom: 0.3rem; }

.aside-nav-list a {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.6rem;
  font-size: 0.875rem;
  color: rgba(153, 255, 204, 0.75);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  line-height: 1.4;
  min-height: 40px;
  overflow-wrap: break-word;
  word-break: break-all;
}

.aside-nav-list a:hover,
.aside-nav-list a:focus {
  color: #00ff41;
  border-left-color: #00ff41;
  background: rgba(0, 255, 65, 0.06);
  outline: none;
}

/* aside decorative svg */
.aside-deco {
  position: absolute;
  bottom: -20px;
  right: -20px;
  width: 100px;
  height: 120px;
  opacity: 0.07;
  pointer-events: none;
  animation: breathe 10s ease-in-out infinite;
  animation-delay: 2s;
}

.aside-deco svg { width: 100%; height: 100%; }

.cell-path-a {
  fill: #00ff41;
  stroke: none;
}

/* ── Footer ── */
.site-footer {
  position: relative;
  z-index: 1;
  background: rgba(0, 10, 25, 0.85);
  border-top: 1px solid rgba(153, 255, 204, 0.12);
  padding: 3rem 2rem 1.5rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(153, 255, 204, 0.08);
}

.footer-brand-col {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  min-width: 0;
}

.footer-brand-name {
  font-family: 'Amatic SC', cursive;
  font-size: 1.6rem;
  font-weight: 700;
  color: #99ffcc;
  letter-spacing: 0.04em;
}

.footer-logo { height: 36px; width: auto; }

.footer-desc {
  font-size: 0.875rem;
  color: rgba(200, 255, 232, 0.5);
  line-height: 1.6;
  overflow-wrap: break-word;
}

.footer-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.footer-nav a {
  font-size: 0.875rem;
  color: rgba(153, 255, 204, 0.65);
  text-decoration: none;
  padding: 0.35rem 0;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  min-height: 40px;
}

.footer-nav a:hover { color: #00ff41; }

.footer-bottom {
  max-width: 1200px;
  margin: 1.2rem auto 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.footer-copyright,
.footer-note {
  font-size: 0.8rem;
  color: rgba(153, 255, 204, 0.35);
}

/* ── Stagger list animation ── */
@keyframes staggerIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ── */
@media (max-width: 960px) {
  .content-with-aside {
    grid-template-columns: 1fr;
  }
  .content-aside {
    position: static;
    order: -1;
  }
  .aside-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
  }
  .aside-title { margin-bottom: 0; flex-shrink: 0; }
  .aside-nav-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }
  .aside-nav-list li { margin-bottom: 0; }
  .aside-nav-list a { min-height: 40px; word-break: normal; }
  .aside-deco { display: none; }
}

@media (max-width: 768px) {
  .header-brand {
    padding: 0.75rem 1rem 0.5rem;
    flex-wrap: nowrap;
    overflow: hidden;
  }
  .brand-slogan { display: none; }
  .header-nav-row {
    padding: 0 0.5rem;
    gap: 0.25rem;
  }
  .nav-search { display: none; }
  .footer-inner { grid-template-columns: 1fr; gap: 1.5rem; }
  .wrap { padding: 0 1rem; }
  main { padding: 1.5rem 0 3rem; }
  .site-footer { padding: 2rem 1rem 1rem; }
  article[id] { scroll-margin-top: 84px; }
}

@media (max-width: 480px) {
  .main-nav ol li a {
    padding: 0.75rem 0.6rem;
    font-size: 0.8rem;
  }
  .page-h1 { font-size: 2rem; }
  .main-content h2 { font-size: 1.5rem; }
  .header-brand { padding: 0.6rem 0.75rem 0.4rem; }
}

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

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