:root {
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-display: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  --ink: #243832;
  --muted: #5d726a;
  --line: rgba(36, 56, 50, 0.1);
  --paper: #f3faf7;
  --surface: #ffffff;
  --mint: #1f9f7a;
  --mint-soft: #e4f7ef;
  --sky: #e8f7fb;
  --shadow: 0 12px 30px rgba(36, 56, 50, 0.07);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  background: var(--paper);
}

/* top bar + reading progress */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.read-progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 3px;
  background: var(--mint);
  transform: scaleX(0);
  transform-origin: left center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
  text-decoration: none;
}

.brand::after {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 4px rgba(31, 159, 122, 0.2);
  content: "";
}

.topbar-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--paper);
}

.topbar-links a {
  padding: 7px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.18s, color 0.18s;
}

.topbar-links a:hover { color: var(--ink); }

.topbar-links a.is-current {
  color: #fff;
  background: var(--mint);
}

/* hero: full-bleed light band, left aligned */
.page { padding: 0 0 64px; }

.hero {
  position: relative;
  overflow: hidden;
  padding: 56px max(24px, calc((100% - 1120px) / 2)) 48px;
  background:
    radial-gradient(520px 260px at 92% 20%, rgba(31, 159, 122, 0.16), transparent 70%),
    linear-gradient(180deg, var(--sky) 0%, var(--paper) 100%);
  border-bottom: 1px solid var(--line);
}

.hero::after {
  position: absolute;
  right: max(24px, calc((100% - 1120px) / 2));
  top: 50%;
  width: 150px;
  height: 150px;
  border: 18px solid rgba(31, 159, 122, 0.12);
  border-radius: 50%;
  transform: translateY(-50%);
  content: "";
}

.hero .eyebrow {
  display: inline-block;
  margin: 0 0 14px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--mint-soft);
  color: var(--mint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  position: relative;
  z-index: 1;
  max-width: 20ch;
  margin: 0 0 14px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.hero--long h1 {
  max-width: 30ch;
  font-size: clamp(1.5rem, 3.4vw, 2.2rem);
  line-height: 1.22;
}

.meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.meta::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mint);
  content: "";
}

/* body: timeline rail + section cards */
.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 36px auto 0;
}

.layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

.layout > nav { grid-column: 1; grid-row: 1; }
.layout > article { grid-column: 2; grid-row: 1; }

nav {
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 112px);
  overflow: auto;
  padding: 4px 0 4px 18px;
  border-left: 2px solid var(--line);
  scrollbar-width: thin;
}

nav strong {
  display: block;
  margin: 0 0 12px;
  color: var(--mint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

nav a {
  position: relative;
  display: block;
  padding: 7px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  text-decoration: none;
  transition: color 0.18s ease;
}

nav a::before {
  position: absolute;
  left: -24px;
  top: 13px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  transition: border-color 0.18s, background 0.18s;
  content: "";
}

nav a:hover,
nav a:focus-visible {
  color: var(--ink);
  outline: none;
}

nav a.is-active {
  color: var(--mint);
  font-weight: 800;
}

nav a.is-active::before {
  border-color: var(--mint);
  background: var(--mint);
}

article {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.disclaimer {
  margin: 0;
  padding: 15px 18px;
  border: 1px dashed rgba(31, 159, 122, 0.4);
  border-radius: 16px;
  background: var(--mint-soft);
  color: var(--ink);
  font-size: 14px;
}

section {
  position: relative;
  padding: 30px 34px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  scroll-margin-top: 92px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

section.is-active {
  border-color: rgba(31, 159, 122, 0.35);
  box-shadow: 0 16px 36px rgba(31, 159, 122, 0.1);
}

h2 {
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  font-weight: 800;
  line-height: 1.3;
}

h3 {
  margin: 24px 0 8px;
  color: var(--mint);
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.4;
}

p { margin: 0 0 14px; }
ul, ol { margin: 0 0 16px; padding-left: 1.3em; }
li + li { margin-top: 7px; }
li::marker { color: var(--mint); }

.note {
  margin: 20px 0 4px;
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--sky);
  color: var(--ink);
}

.table-wrap {
  overflow-x: auto;
  margin: 20px 0;
  border-radius: 16px;
  background: var(--paper);
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  min-width: 520px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}

th, td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}

th {
  background: var(--mint);
  color: #fff;
  font-weight: 800;
}

tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) td { background: rgba(255, 255, 255, 0.6); }

a {
  color: var(--mint);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.page-foot {
  width: min(1120px, calc(100% - 32px));
  margin: 36px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--mint);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(31, 159, 122, 0.3);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.2s, transform 0.2s;
}

.to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

@media (max-width: 900px) {
  .hero { padding: 40px 20px 32px; }
  .hero::after { display: none; }
  .layout { grid-template-columns: 1fr; gap: 16px; }
  .layout > nav { grid-column: 1; grid-row: 1; }
  .layout > article { grid-column: 1; grid-row: 2; }
  nav {
    top: 60px;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 8px;
    max-height: none;
    margin: 0 -16px;
    width: calc(100% + 32px);
    padding: 10px 16px;
    border-left: 0;
    border-bottom: 1px solid var(--line);
    background: rgba(243, 250, 247, 0.95);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    white-space: nowrap;
    backdrop-filter: blur(14px);
  }
  nav strong { display: none; }
  nav a {
    flex: 0 0 auto;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--line);
    white-space: nowrap;
  }
  nav a::before { display: none; }
  nav a.is-active {
    color: #fff;
    background: var(--mint);
    border-color: var(--mint);
  }
  section { padding: 22px 18px 18px; border-radius: 18px; scroll-margin-top: 120px; }
}

@media (max-width: 560px) {
  body { font-size: 15px; }
  .topbar { gap: 10px; padding: 10px 12px; }
  .brand { flex: 0 0 auto; font-size: 18px; }
  .topbar-links {
    flex: 0 1 auto;
    flex-wrap: nowrap;
    min-width: 0;
    gap: 2px;
    padding: 3px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .topbar-links::-webkit-scrollbar { display: none; }
  .topbar-links a {
    flex: 0 0 auto;
    padding: 6px 10px;
    font-size: 12px;
    white-space: nowrap;
  }
  /* brand already links home */
  .topbar-links a[href="./index.html"] { display: none; }
  nav { top: 54px; }
  section { scroll-margin-top: 112px; }
  .shell, .page-foot { width: calc(100% - 24px); }
  nav { margin: 0 -12px; width: calc(100% + 24px); padding: 10px 12px; }
  h1 { font-size: clamp(1.75rem, 8.5vw, 2.2rem); }
  .hero--long h1 { font-size: clamp(1.3rem, 6vw, 1.7rem); }
}

@media print {
  body { background: #fff; color: #000; }
  .page { padding: 0; }
  .topbar, nav, .disclaimer, .to-top { display: none; }
  .shell, .page-foot { width: auto; }
  .hero { padding: 0 0 12px; background: none; border: 0; }
  .layout { display: block; }
  section { padding: 0 0 16px; border: 0; box-shadow: none; }
  h1, h2, h3 { color: #000; }
}
