:root {
  --green: #45dc80;
  --accent: #68e598;
  --ink: #ecf2eb;
  --muted: #b0bdaf;
  --faint: #849581;
  --paper: #101912;
  --topbar: #0d1710;
  --surface: #18241a;
  --soft: #1c3322;
  --line: #304332;
  --yellow: #39311a;
  --yellow-ink: #f0ce80;
  --reading-surface: #132019;
  --reading-ink: #dce7de;
  --reading-muted: #9aab9f;
  --reading-line: #314637;
  --reading-quote: #192c20;
  --home-wash: rgba(69, 220, 128, .11);
  --home-grid: rgba(104, 229, 152, .10);
  --library-width: 250px;
  --outline-width: 240px;
  --nav-total: calc(var(--library-width) + var(--outline-width));
  --topbar-height: 64px;
  --reading-width: 1120px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

[data-theme="light"] {
  --green: #06c755;
  --accent: #007f38;
  --ink: #18251d;
  --muted: #67736b;
  --faint: #929b95;
  --paper: #f7f9f6;
  --topbar: #ffffff;
  --surface: #ffffff;
  --soft: #eff7ed;
  --line: #e2e8df;
  --yellow: #fff7df;
  --yellow-ink: #866322;
  --reading-surface: #fbfaf5;
  --reading-ink: #413d35;
  --reading-muted: #837b6c;
  --reading-line: #ddd8ca;
  --reading-quote: #eff4ec;
  --home-wash: rgba(6, 199, 85, .09);
  --home-grid: rgba(0, 127, 56, .09);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-height) + 30px);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.8;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button, a { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
button, a { -webkit-tap-highlight-color: transparent; }

:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 3px;
}

::selection { background: var(--green); color: #082c17; }

.skip-link {
  position: fixed;
  z-index: 200;
  top: -80px;
  left: 20px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

.skip-link:focus-visible { top: 12px; }

.reading-progress {
  position: fixed;
  z-index: 150;
  inset: 0 0 auto;
  height: 2px;
  background: transparent;
}

.reading-progress span {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left;
  background: var(--green);
}

.topbar {
  position: fixed;
  z-index: 100;
  inset: 0 0 auto;
  height: var(--topbar-height);
  display: grid;
  grid-template-columns: var(--library-width) 1fr auto;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--topbar) 94%, transparent);
  backdrop-filter: blur(16px);
}

.brand {
  align-self: stretch;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 24px;
  border-right: 1px solid var(--line);
}

.brand-mark {
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  display: block;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
}

.brand-copy { display: grid; gap: 1px; min-width: 0; line-height: 1.1; }
.brand-copy strong { font-size: 15px; letter-spacing: -.025em; }
.brand-copy small { color: var(--muted); font-size: 10px; font-weight: 650; letter-spacing: .025em; }

.top-tabs {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-left: 22px;
}

.top-tabs a {
  padding: 7px 12px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.top-tabs a.active { background: var(--soft); color: var(--accent); }

.top-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-right: 22px;
  color: var(--faint);
  font-size: 11px;
}

.sellerfde-referral {
  width: 116px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 6px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 5px 18px color-mix(in srgb, var(--paper) 52%, transparent);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.sellerfde-referral:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--green) 62%, #dfe7df);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .16);
}

.sellerfde-referral img {
  display: block;
  width: 100%;
  height: auto;
}

[data-theme="dark"] .sellerfde-referral img {
  filter: grayscale(1) brightness(0) invert(.94);
  opacity: .92;
}

.theme-toggle, .language-toggle, .menu-toggle {
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

.theme-toggle, .language-toggle {
  width: 36px;
  padding: 0;
  display: inline-grid;
  place-items: center;
}

.theme-toggle svg, .language-toggle svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

.theme-icon-moon { display: none; }
[data-theme="light"] .theme-icon-sun { display: none; }
[data-theme="light"] .theme-icon-moon { display: block; }

.language-picker { position: relative; }

.language-menu {
  position: absolute;
  z-index: 180;
  top: calc(100% + 10px);
  right: 0;
  width: 158px;
  display: none;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 97%, transparent);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .24);
  backdrop-filter: blur(18px);
}

.language-picker.open .language-menu { display: grid; gap: 2px; }

.language-menu button {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
}

.language-menu button:hover,
.language-menu button.active { background: var(--soft); color: var(--accent); }
.language-menu button.active { font-weight: 750; }
.language-menu small { color: var(--faint); font-size: 9px; font-weight: 800; letter-spacing: .1em; }

.menu-toggle { display: none; }

.app-shell { padding-top: var(--topbar-height); }

.sidebar-stack {
  position: fixed;
  z-index: 80;
  inset: var(--topbar-height) auto 0 0;
  width: var(--nav-total);
  display: grid;
  grid-template-columns: var(--library-width) var(--outline-width);
  background: var(--surface);
}

.library-sidebar,
.outline-sidebar {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.outline-sidebar { background: color-mix(in srgb, var(--surface) 72%, var(--paper)); }

.library-head {
  padding: 27px 18px 21px;
  border-bottom: 1px solid var(--line);
}

.library-head > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}

.library-head h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.library-head small { color: var(--faint); font-size: 10px; }

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-top: 15px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--paper) 74%, var(--surface));
}

.mode-switch a {
  min-width: 0;
  padding: 7px 4px;
  border-radius: 5px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.2;
  text-align: center;
}

.mode-switch a:hover { color: var(--ink); }
.mode-switch a.active { background: var(--soft); color: var(--accent); }

.library-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 12px 24px;
  scrollbar-width: thin;
}

.article-item {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 3px 8px;
  margin-bottom: 7px;
  padding: 13px 11px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--muted);
}

.article-item .article-index {
  grid-row: 1 / span 2;
  color: var(--faint);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .06em;
}

.article-title { font-size: 12px; font-weight: 650; line-height: 1.55; }
.article-item small { color: var(--faint); font-size: 9px; line-height: 1.5; }
.article-item.active { border-color: var(--line); background: var(--soft); color: var(--accent); }
.article-item.active .article-index { color: var(--accent); }
.article-item:not(.pending):hover { background: var(--paper); color: var(--ink); }
.article-item.pending { opacity: .58; cursor: default; }

.library-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 17px 20px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 10px;
}

.library-foot i {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--green);
}

.sidebar-head {
  padding: 28px 26px 22px;
  border-bottom: 1px solid var(--line);
}

.sidebar-eyebrow {
  color: var(--accent);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .14em;
}

.sidebar-head h2 {
  margin: 8px 0 2px;
  font-size: 18px;
  line-height: 1.45;
  letter-spacing: -.02em;
}

.sidebar-head p { margin: 0; color: var(--muted); font-size: 12px; }

.article-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 14px 26px;
  scrollbar-width: thin;
}

.nav-group { margin-top: 18px; }

.nav-group-title {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 0 11px 6px;
  color: var(--muted);
}

.nav-group-title > span, .nav-group-title small, .nav-no {
  color: var(--faint);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .06em;
}

.nav-group-title strong { font-size: 12px; font-weight: 700; }
.nav-group-title small { font-weight: 500; }
.nav-sublist { position: relative; padding-left: 13px; }

.nav-sublist::before {
  content: "";
  position: absolute;
  inset: 5px auto 5px 10px;
  width: 1px;
  background: var(--line);
}

.nav-link {
  position: relative;
  display: grid;
  grid-template-columns: 26px 1fr;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 9px 11px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.nav-link:hover { background: var(--paper); color: var(--ink); }
.nav-link.active { background: var(--soft); color: var(--accent); font-weight: 650; }
.nav-link.active .nav-no { color: var(--accent); }

.sidebar-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 17px 24px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 10px;
}

.sidebar-foot i {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--green);
}

.sidebar-foot a { color: var(--accent); }

.sidebar-backdrop {
  display: none;
  position: fixed;
  z-index: 70;
  inset: var(--topbar-height) 0 0;
  border: 0;
  background: rgba(0, 0, 0, .56);
}

.main {
  min-width: 0;
  margin-left: var(--nav-total);
}

.breadcrumb {
  position: sticky;
  z-index: 20;
  top: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 9px;
  height: 50px;
  padding: 0 clamp(28px, 5vw, 68px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 95%, transparent);
  backdrop-filter: blur(14px);
  color: var(--faint);
  font-size: 11px;
}

.breadcrumb b { font-weight: 400; color: var(--line); }
.breadcrumb a { color: var(--faint); transition: color .15s ease; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb strong { color: var(--muted); font-weight: 600; }

.article {
  width: min(calc(100% - 64px), var(--reading-width));
  margin: 0 auto;
  padding: 70px 0 110px;
}

.article-header { scroll-margin-top: 120px; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
}

.eyebrow span { width: 24px; height: 1px; background: currentColor; }

h1, h2, p { margin-top: 0; }

h1 {
  margin: 22px 0 18px;
  font-size: clamp(42px, 4vw, 54px);
  line-height: 1.18;
  letter-spacing: -.045em;
  white-space: nowrap;
}

.dek {
  display: block;
  width: 100%;
  max-width: 100%;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.7;
  text-wrap: wrap;
  word-break: normal;
  overflow-wrap: normal;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
  color: var(--faint);
  font-size: 11px;
}

.story-figure {
  width: 100%;
  margin: 30px 0 0;
}

.lead-figure { margin-top: 44px; }

.story-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
}

figcaption {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-top: 9px;
  color: var(--faint);
  font-size: 10px;
  line-height: 1.5;
}

.image-explain {
  margin: 24px 0 0;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.85;
}

.summary-card {
  margin: 54px 0 0;
  padding: 24px 28px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--green);
  border-radius: 0 10px 10px 0;
  background: var(--soft);
}

.summary-card > span {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
}

.summary-card p { margin: 0; font-size: 18px; font-weight: 650; line-height: 1.75; }

.story-section {
  margin-top: 104px;
  scroll-margin-top: 120px;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 760;
  letter-spacing: .055em;
}

.section-label span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 27px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--faint);
  font-size: 11px;
  font-weight: 760;
}

html[lang="en"] .article h1,
html[lang="en"] .story-section h2 {
  white-space: normal;
  text-wrap: balance;
}

html[lang="en"] .article h1 { font-size: clamp(38px, 4vw, 58px); }
html[lang="en"] .story-section h2 { font-size: clamp(30px, 3vw, 42px); }
html[lang="en"] .section-label { letter-spacing: .015em; }
html[lang="en"] .breadcrumb strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html[lang="en"] .home-copy h1 { font-size: clamp(58px, 5.6vw, 86px); letter-spacing: -.055em; }

h2 {
  margin: 16px 0 0;
  font-size: clamp(31px, 3vw, 40px);
  line-height: 1.35;
  letter-spacing: -.035em;
  white-space: nowrap;
}

.story-section > p:not(.image-explain) {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.9;
}

blockquote {
  margin: 26px 0 0;
  padding: 20px 24px;
  border-left: 3px solid var(--green);
  border-radius: 0 9px 9px 0;
  background: var(--soft);
  font-size: 18px;
  font-weight: 650;
  line-height: 1.75;
}

.formula {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  margin: 28px 0 0;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  text-align: center;
  font-size: 16px;
  font-weight: 650;
}

.formula b { color: var(--accent); font-size: 26px; }

.takeaway-list {
  margin-top: 42px;
  padding: 27px 28px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.takeaway-title { margin: 0 0 17px; font-size: 18px; font-weight: 700; }
.takeaway-list ol { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; counter-reset: takeaways; }
.takeaway-list li { display: grid; grid-template-columns: 66px 1fr; gap: 16px; align-items: start; padding-top: 10px; border-top: 1px solid var(--line); }
.takeaway-list li:first-child { padding-top: 0; border-top: 0; }
.takeaway-list b { color: var(--accent); font-size: 14px; }
.takeaway-list span { color: var(--muted); font-size: 15px; }

.article-footer {
  margin-top: 100px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 12px;
  line-height: 1.8;
}

.article-footer p { margin-bottom: 12px; }
.article-footer .source-link { color: var(--accent); font-weight: 650; }

.creator-network {
  display: grid;
  grid-template-columns: max-content 1px minmax(0, 1fr);
  align-items: center;
  gap: clamp(16px, 1.8vw, 26px);
}

.article-footer .creator-network { margin-top: 24px; }

.creator-credit {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}

.creator-label {
  color: var(--faint);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.creator-credit strong {
  color: var(--ink);
  font-size: 13px;
  letter-spacing: -.01em;
  line-height: 1.35;
}

.creator-credit strong a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent);
  text-underline-offset: 3px;
}

.creator-disclaimer {
  margin: 0 !important;
  color: var(--faint);
  font-size: 10px;
  line-height: 1.4;
}

.creator-divider {
  width: 1px;
  min-height: 48px;
  background: var(--line);
}

.creator-sites {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.creator-site {
  width: 178px;
  min-height: 58px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.creator-site:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
  background: var(--surface);
}

.partner-logo {
  width: 100%;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow: hidden;
  background: transparent;
}

.partner-logo img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.partner-logo-seller img { width: auto; height: 20px; }
.partner-logo-jev img { width: auto; height: 27px; }

[data-theme="dark"] .partner-logo-seller img,
[data-theme="dark"] .partner-logo-jev img {
  filter: grayscale(1) brightness(0) invert(.94);
  opacity: .9;
}

.partner-logo-live {
  justify-content: center;
  gap: 6px;
  color: var(--ink);
}

.partner-logo-live img { flex: 0 0 22px; width: 22px; height: 22px; }
.partner-logo-live strong { min-width: 0; font-size: 12.5px; line-height: 1; white-space: nowrap; }

.creator-site-caption {
  overflow: hidden;
  color: var(--faint);
  font-size: 10.5px;
  font-weight: 650;
  line-height: 1.35;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Original article reading mode */
.original-article { width: min(calc(100% - 64px), 1040px); }
.original-header h1 { font-size: clamp(38px, 3.7vw, 48px); }

.original-paper {
  margin-top: 48px;
  padding: clamp(36px, 5vw, 68px) clamp(28px, 6vw, 76px) 72px;
  border: 1px solid var(--reading-line);
  border-radius: 14px;
  background: var(--reading-surface);
  color: var(--reading-ink);
}

.source-content {
  width: min(100%, 760px);
  margin: 0 auto;
  color: var(--reading-ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.95;
}

.source-content *,
.source-content *::before,
.source-content *::after {
  box-sizing: border-box;
  max-width: 100%;
  font-family: inherit !important;
}

.source-content p {
  margin: 0 0 1.25em;
  color: var(--reading-ink) !important;
  font-size: 17px;
  line-height: 1.95;
  overflow-wrap: anywhere;
}

.source-content p,
.source-content span,
.source-content section {
  background-color: transparent !important;
}

.source-content p:empty,
.source-content p:has(> br:only-child),
.source-content p:has(> span:only-child > br:only-child) { display: none; }

.source-content .source-heading {
  scroll-margin-top: calc(var(--topbar-height) + 72px);
  margin: 3.25em 0 1.15em;
  padding-top: 1.1em;
  border-top: 1px solid var(--reading-line);
  color: var(--ink) !important;
  font-family: var(--font);
  font-size: clamp(22px, 2.4vw, 29px);
  font-weight: 760;
  line-height: 1.45;
  letter-spacing: -.025em;
}

.source-content .source-heading:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.source-content strong, .source-content b { color: var(--ink) !important; font-weight: 760; }
.source-content em, .source-content i { color: var(--reading-muted) !important; }

.source-content img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 2.1em auto .8em;
  border-radius: 8px;
}

.source-content section:has(img) + p {
  margin-top: -.25em;
  color: var(--reading-muted) !important;
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.7;
  text-align: center;
}

.source-content blockquote {
  margin: 2em 0;
  padding: 1.1em 1.35em;
  border-left: 3px solid #3f9e62;
  border-radius: 0 6px 6px 0;
  background: var(--reading-quote);
  color: var(--reading-ink);
  font-family: var(--font);
  font-size: 16px;
}

.source-content ul, .source-content ol { margin: 1.1em 0 1.6em; padding-left: 1.5em; }
.source-content li { margin: .55em 0; }
.source-content a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.source-content video, .source-content iframe { display: block; width: 100%; min-height: 420px; margin: 2em auto; border: 0; }
.source-content mp-style-type { display: none; }

.source-nav .nav-link { min-height: 38px; padding-block: 7px; font-size: 12px; }
.source-nav .nav-link span:last-child { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }

p, li, h1, h2, figcaption {
  word-break: normal;
  overflow-wrap: break-word;
  line-break: strict;
}

/* Homepage */
.home-page {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 76% 36%, var(--home-wash), transparent 31rem),
    var(--paper);
}

.topbar.home-topbar {
  grid-template-columns: auto 1fr auto;
}

.home-topbar .brand { width: max-content; border-right: 0; }
.home-topbar .top-tabs { justify-content: flex-start; padding: 0 18px 0 10px; }

.home-main {
  width: min(1480px, calc(100% - 96px));
  min-height: calc(100vh - 122px);
  margin: 0 auto;
  padding-top: var(--topbar-height);
}

.home-hero {
  min-height: calc(100vh - 190px);
  display: grid;
  grid-template-columns: minmax(390px, .82fr) minmax(560px, 1.18fr);
  align-items: center;
  gap: clamp(20px, 3vw, 64px);
  padding: clamp(72px, 8vh, 118px) 0 clamp(44px, 6vh, 80px);
}

.home-copy {
  position: relative;
  z-index: 2;
  align-self: center;
}

.home-kicker {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 28px;
  color: var(--accent);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: .035em;
  line-height: 1;
}

.home-kicker-mark {
  width: 36px;
  height: 36px;
  display: inline-flex;
  flex: 0 0 36px;
}

.home-kicker-mark img {
  display: block;
  width: 100%;
  height: 100%;
}

.home-kicker-name { white-space: nowrap; }

.home-copy h1 {
  max-width: none;
  margin: 0;
  color: var(--ink);
  font-size: clamp(64px, 7vw, 108px);
  font-weight: 820;
  letter-spacing: -.075em;
  line-height: .98;
  white-space: nowrap;
  text-wrap: nowrap;
}

.home-lead {
  max-width: none;
  margin: 34px 0 0;
  color: var(--muted);
  font-size: clamp(20px, 1.45vw, 25px);
  line-height: 1.6;
  white-space: nowrap;
}

.home-cta {
  width: max-content;
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  gap: 20px;
  margin-top: 42px;
  padding: 12px 16px 12px 22px;
  border-radius: 13px;
  background: var(--green);
  color: #082714;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 14px 38px rgba(0, 0, 0, .15);
  transition: transform .18s ease, box-shadow .18s ease;
}

.home-cta svg {
  width: 32px;
  height: 32px;
  padding: 7px;
  border-radius: 9px;
  background: rgba(8, 39, 20, .12);
}

.home-cta:hover { transform: translateY(-2px); box-shadow: 0 18px 44px rgba(0, 0, 0, .2); }

.home-visual {
  position: relative;
  min-width: 0;
  isolation: isolate;
}

.home-visual::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: 10% 8% 4%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--home-wash), transparent 68%);
  filter: blur(12px);
}

.home-visual::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 110px;
  height: 110px;
  right: 5%;
  top: 11%;
  background-image: radial-gradient(circle, var(--home-grid) 1.5px, transparent 1.5px);
  background-size: 16px 16px;
  mask-image: linear-gradient(135deg, #000, transparent 82%);
}

.home-visual img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  filter: saturate(.86) contrast(1.03);
}

[data-theme="dark"] .home-visual img {
  filter: saturate(.82) contrast(1.05) drop-shadow(0 22px 36px rgba(0, 0, 0, .18));
}

.home-orbit {
  position: absolute;
  z-index: 0;
  display: block;
  border: 1px solid var(--home-grid);
  border-radius: 50%;
}

.home-orbit-one { width: 68%; aspect-ratio: 1; left: 20%; top: 8%; }
.home-orbit-two { width: 48%; aspect-ratio: 1; left: 30%; top: 19%; border-style: dashed; }

.home-series {
  display: grid;
  grid-template-columns: 230px 1fr;
  align-items: stretch;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.home-series-label {
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 22px 26px 22px 0;
  border-right: 1px solid var(--line);
}

.home-series-label span { color: var(--faint); font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.home-series-label strong { font-size: 17px; }

.home-lesson-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.home-lesson-links a {
  min-height: 82px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 18px 24px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  transition: background .16s ease, color .16s ease;
}

.home-lesson-links a + a { border-left: 1px solid var(--line); }
.home-lesson-links a:hover { background: var(--surface); color: var(--ink); }
.home-lesson-links small { color: var(--accent); font-size: 10px; font-weight: 850; letter-spacing: .08em; }

.home-footer {
  width: min(1480px, calc(100% - 96px));
  margin: 0 auto;
  padding: 24px 0 30px;
  color: var(--faint);
  font-size: 10px;
}

/* Hidden reading analytics dashboard */
.traffic-page { min-height: 100vh; background: var(--paper); color: var(--ink); }
.traffic-topbar { grid-template-columns: var(--library-width) 1fr auto; }
.traffic-main {
  width: min(1440px, calc(100% - 96px));
  margin: var(--topbar-height) auto 0;
  padding: 70px 0 100px;
}
.traffic-hero { display: flex; align-items: end; justify-content: space-between; gap: 40px; padding-bottom: 34px; border-bottom: 1px solid var(--line); }
.traffic-eyebrow { margin: 0 0 12px; color: var(--accent); font-size: 11px; font-weight: 850; letter-spacing: .14em; }
.traffic-hero h1 { margin: 0; font-size: clamp(42px, 5vw, 72px); line-height: 1.04; letter-spacing: -.045em; white-space: nowrap; }
.traffic-hero > div > p:last-child { max-width: 760px; margin: 20px 0 0; color: var(--muted); font-size: clamp(17px, 1.6vw, 22px); line-height: 1.7; }
.traffic-controls { display: inline-flex; flex: 0 0 auto; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.traffic-controls button { min-width: 62px; min-height: 38px; padding: 8px 13px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-size: 12px; font-weight: 750; cursor: pointer; }
.traffic-controls button:hover, .traffic-controls button.active { background: var(--soft); color: var(--accent); }
.traffic-status { display: flex; align-items: center; gap: 10px; min-height: 54px; color: var(--faint); font-size: 11px; }
.traffic-status strong { color: var(--muted); font-weight: 700; }
.traffic-status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent); }
.traffic-status.error .traffic-status-dot { background: #e29b55; box-shadow: 0 0 0 4px color-mix(in srgb, #e29b55 14%, transparent); }
.traffic-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 14px; }
.traffic-kpi { min-height: 154px; padding: 23px 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.traffic-kpi dt { color: var(--muted); font-size: 12px; font-weight: 750; }
.traffic-kpi dd { margin: 10px 0 5px; color: var(--ink); font-size: clamp(30px, 3vw, 46px); font-weight: 850; line-height: 1; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.traffic-kpi small { color: var(--faint); font-size: 10px; line-height: 1.5; }
.traffic-grid { display: grid; gap: 14px; margin-top: 14px; }
.traffic-grid-primary { grid-template-columns: minmax(0, 1.65fr) minmax(360px, .85fr); }
.traffic-grid-secondary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.traffic-panel { min-width: 0; padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.traffic-panel > header { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.traffic-panel > header > div { display: flex; align-items: center; gap: 10px; }
.traffic-panel > header span { display: grid; place-items: center; min-width: 30px; height: 24px; border: 1px solid var(--line); border-radius: 6px; color: var(--accent); font-size: 9px; font-weight: 850; }
.traffic-panel h2, .traffic-method h2 { margin: 0; font-size: 18px; line-height: 1.3; white-space: normal; }
.traffic-panel > header p { margin: 2px 0 0; color: var(--faint); font-size: 10px; text-align: right; }
.traffic-chart { min-height: 280px; overflow: hidden; }
.traffic-chart svg { display: block; width: 100%; height: 280px; overflow: visible; }
.traffic-chart-grid line { stroke: var(--line); stroke-width: 1; }
.traffic-chart-grid text, .traffic-chart-date { fill: var(--faint); font: 9px var(--font); }
.traffic-line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.traffic-line-visitors { stroke: var(--accent); }
.traffic-line-reads { stroke: #84a9ff; }
.traffic-line-completions { stroke: #e5a65b; }
.traffic-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; color: var(--muted); font-size: 10px; }
.traffic-legend span::before { content: ''; display: inline-block; width: 16px; height: 3px; margin-right: 6px; border-radius: 99px; vertical-align: middle; }
.traffic-legend .visitors::before { background: var(--accent); }
.traffic-legend .reads::before { background: #84a9ff; }
.traffic-legend .completions::before { background: #e5a65b; }
.traffic-funnel, .traffic-milestones, .traffic-dimensions, .traffic-outbound { display: grid; gap: 15px; }
.traffic-bar-row { display: grid; gap: 7px; }
.traffic-bar-label { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 11px; }
.traffic-bar-label strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.traffic-bar { height: 8px; overflow: hidden; border-radius: 99px; background: var(--soft); }
.traffic-bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.funnel-row { display: grid; grid-template-columns: minmax(120px, 1fr) 1.4fr 48px; align-items: center; gap: 12px; }
.funnel-row > div:first-child { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 11px; }
.funnel-row > div:first-child strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.funnel-track { height: 8px; overflow: hidden; border-radius: 99px; background: var(--soft); }
.funnel-track i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.funnel-row small { color: var(--faint); font-size: 9px; text-align: right; }
.traffic-article-panel { margin-top: 14px; }
.traffic-table-wrap { overflow-x: auto; }
.traffic-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.traffic-table th { padding: 11px 12px; border-bottom: 1px solid var(--line); color: var(--faint); font-size: 9px; font-weight: 800; letter-spacing: .06em; text-align: right; white-space: nowrap; }
.traffic-table th:first-child, .traffic-table td:first-child { text-align: left; }
.traffic-table td { padding: 16px 12px; border-bottom: 1px solid var(--line); color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.traffic-table tbody tr:last-child td { border-bottom: 0; }
.traffic-table td:first-child { min-width: 260px; color: var(--ink); font-weight: 700; }
.traffic-dimension-group { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.traffic-dimension-group:last-child { padding-bottom: 0; border-bottom: 0; }
.traffic-dimension-group > strong { display: block; margin-bottom: 10px; color: var(--faint); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.traffic-milestones > div, .traffic-outbound > div { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.traffic-milestones > div:last-child, .traffic-outbound > div:last-child { padding-bottom: 0; border-bottom: 0; }
.traffic-milestones strong, .traffic-outbound strong { color: var(--ink); font-size: 18px; font-variant-numeric: tabular-nums; }
.traffic-milestones span, .traffic-outbound span { color: var(--muted); font-size: 11px; }
.traffic-milestones small { color: var(--accent); font-size: 9px; }
.traffic-dimensions section + section { margin-top: 22px; }
.traffic-dimensions h3 { margin: 0 0 11px; color: var(--faint); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.dimension-row { display: grid; grid-template-columns: 88px 1fr 42px; align-items: center; gap: 10px; min-height: 28px; }
.dimension-row span { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.dimension-row > i { height: 6px; overflow: hidden; border-radius: 99px; background: var(--soft); }
.dimension-row > i b { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.dimension-row strong { color: var(--ink); font-size: 10px; font-variant-numeric: tabular-nums; text-align: right; }
.traffic-empty { display: grid; place-items: center; min-height: 150px; color: var(--faint); font-size: 12px; text-align: center; }
.traffic-method { display: grid; grid-template-columns: 160px 1fr; gap: 24px 40px; margin-top: 52px; padding-top: 30px; border-top: 1px solid var(--line); }
.traffic-method > div { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.traffic-method p { margin: 0; }
.traffic-method strong { display: block; margin-bottom: 8px; color: var(--ink); font-size: 11px; }
.traffic-method span { color: var(--faint); font-size: 10px; line-height: 1.7; }
.traffic-method > small { grid-column: 2; color: var(--faint); font-size: 9px; }

@media (max-width: 1120px) {
  .traffic-main { width: min(100% - 48px, 1000px); }
  .traffic-grid-primary { grid-template-columns: 1fr; }
  .traffic-grid-secondary { grid-template-columns: 1fr 1fr; }
  .traffic-grid-secondary .traffic-panel:last-child { grid-column: 1 / -1; }
  .traffic-method { grid-template-columns: 1fr; }
  .traffic-method > small { grid-column: 1; }
}

@media (max-width: 680px) {
  .traffic-main { width: calc(100% - 28px); padding: 44px 0 70px; }
  .traffic-hero { display: grid; gap: 26px; }
  .traffic-hero h1 { font-size: 42px; }
  .traffic-controls { width: 100%; }
  .traffic-controls button { flex: 1; min-width: 0; }
  .traffic-kpis { grid-template-columns: 1fr 1fr; }
  .traffic-kpi { min-height: 132px; padding: 19px 17px; }
  .traffic-grid-secondary { grid-template-columns: 1fr; }
  .traffic-grid-secondary .traffic-panel:last-child { grid-column: auto; }
  .traffic-panel { padding: 19px 16px; }
  .traffic-panel > header { display: grid; gap: 8px; }
  .traffic-panel > header p { text-align: left; }
  .traffic-table td:first-child { min-width: 210px; }
  .traffic-method > div { grid-template-columns: 1fr; }
}

@media (max-width: 1100px) {
  .home-main, .home-footer { width: min(100% - 48px, 920px); }
  .home-hero { min-height: auto; grid-template-columns: 1fr; padding-top: 92px; }
  .home-copy { text-align: center; }
  .home-kicker { justify-content: center; }
  .home-lead { margin-inline: auto; }
  .home-cta { margin-inline: auto; }
  .home-visual { width: min(820px, 100%); margin: -12px auto 0; }
  .home-series { grid-template-columns: 1fr; }
  .home-series-label { grid-template-columns: auto auto; justify-content: center; gap: 12px; padding: 18px; border-right: 0; border-bottom: 1px solid var(--line); }
  .creator-network { grid-template-columns: 1fr; }
  .creator-divider { width: 100%; min-height: 1px; height: 1px; }
  .creator-credit { justify-content: center; text-align: center; }
  .creator-sites { justify-content: center; }
}

@media (max-width: 680px) {
  .topbar.home-topbar { grid-template-columns: 1fr auto; }
  .home-topbar .top-tabs { display: none; }
  .home-main, .home-footer { width: calc(100% - 32px); }
  .home-hero { gap: 22px; padding: 82px 0 44px; }
  .home-kicker { margin-bottom: 22px; font-size: 16px; }
  .home-kicker-mark { width: 32px; height: 32px; flex-basis: 32px; font-size: 18px; }
  .home-copy h1 { font-size: clamp(46px, 14vw, 66px); white-space: nowrap !important; word-break: keep-all; }
  .home-lead { margin-top: 24px; font-size: 18px; line-height: 1.65; white-space: normal; }
  .home-cta { min-height: 50px; margin-top: 30px; }
  .home-visual { width: calc(100% + 22px); margin-left: -11px; }
  .home-lesson-links { grid-template-columns: 1fr; }
  .home-lesson-links a { min-height: 58px; padding: 12px 16px; }
  .home-lesson-links a + a { border-left: 0; border-top: 1px solid var(--line); }
  .home-footer { padding-bottom: 24px; }
  .creator-credit { flex-wrap: wrap; justify-content: flex-start; row-gap: 2px; text-align: left; white-space: normal; }
  .creator-disclaimer { flex-basis: 100%; }
  .creator-sites { justify-content: flex-start; }
  .creator-site { width: calc(50% - 4px); min-height: 58px; }
}

@media (max-width: 420px) {
  .creator-site { width: 100%; }
}

@media (max-width: 1440px) {
  :root { --library-width: 230px; --outline-width: 220px; }
  .article { width: min(calc(100% - 56px), var(--reading-width)); }
  h1 { font-size: 42px; }
  h2 { font-size: 34px; }
}

@media (max-width: 1180px) {
  .topbar { grid-template-columns: 1fr auto; }
  .brand { border-right: 0; }
  .top-tabs { display: none; }
  .top-meta > span { display: none; }
  .menu-toggle { display: inline-flex; }
  .sidebar-stack {
    width: min(92vw, 680px);
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    transform: translateX(-102%);
    transition: transform .18s ease;
    box-shadow: 18px 0 50px rgba(0, 0, 0, .25);
  }
  .sidebar-stack.open { transform: translateX(0); }
  .sidebar-backdrop.open { display: block; }
  .main { margin-left: 0; }
  .breadcrumb { padding-inline: 24px; }
  .article { width: min(calc(100% - 48px), 980px); padding-top: 56px; }
  h1, h2 { white-space: normal; text-wrap: balance; }
}

@media (max-width: 620px) {
  :root { --topbar-height: 58px; }
  .brand { padding-inline: 16px; }
  .brand-mark { width: 30px; height: 30px; flex-basis: 30px; }
  .brand-copy strong { font-size: 14px; }
  .brand-copy small { display: none; }
  .top-meta { gap: 8px; padding-right: 12px; }
  .sellerfde-referral { width: 82px; min-height: 34px; margin-right: 4px; padding: 6px 8px; }
  .theme-toggle, .language-toggle, .menu-toggle { min-height: 36px; padding: 5px 9px; font-size: 11px; }
  .language-menu { position: fixed; top: calc(var(--topbar-height) - 4px); right: 12px; }
  .sidebar-stack {
    width: min(92vw, 360px);
    display: block;
    overflow-y: auto;
  }
  .library-sidebar,
  .outline-sidebar { overflow: visible; border-right: 0; }
  .library-list,
  .article-nav { flex: none; overflow: visible; }
  .library-list { padding-bottom: 12px; }
  .library-foot { display: none; }
  .outline-sidebar { border-top: 1px solid var(--line); }
  .breadcrumb { height: 46px; padding-inline: 16px; overflow: hidden; white-space: nowrap; }
  .article { width: calc(100% - 28px); padding: 40px 0 80px; }
  h1 {
    margin-top: 16px;
    max-width: 100%;
    font-size: clamp(27px, 7.6vw, 31px);
    line-height: 1.3;
    white-space: normal !important;
    text-wrap: auto;
    overflow-wrap: anywhere;
    word-break: break-all;
  }
  .dek { font-size: 17px; }
  .article-meta { display: grid; gap: 4px; }
  .lead-figure { margin-top: 34px; }
  .story-figure { margin-top: 24px; }
  .story-figure img { border-radius: 8px; }
  figcaption { display: grid; gap: 2px; }
  .image-explain { margin-top: 18px; font-size: 16px; line-height: 1.85; }
  .section-label { gap: 9px; font-size: 13px; }
  .section-label span { min-width: 32px; height: 26px; font-size: 10px; }
  .summary-card { margin-top: 42px; padding: 20px; }
  .summary-card p { font-size: 16px; }
  .story-section { margin-top: 76px; }
  h2 {
    margin-top: 12px;
    font-size: 28px;
    line-height: 1.45;
    max-width: 100%;
    white-space: normal !important;
    text-wrap: auto;
    overflow-wrap: anywhere;
    word-break: break-all;
  }
  .formula { grid-template-columns: 1fr; gap: 4px; padding: 20px 16px; }
  .formula b { transform: rotate(90deg); }
  .takeaway-list { padding: 22px 18px; }
  .takeaway-list li { grid-template-columns: 52px 1fr; gap: 10px; }
  .original-article { width: calc(100% - 22px); }
  .original-header h1 { font-size: clamp(27px, 7.6vw, 31px); }
  .original-paper { margin-top: 34px; padding: 30px 19px 54px; border-radius: 10px; }
  .source-content { font-size: 16px; line-height: 1.9; }
  .source-content p { font-size: 16px; line-height: 1.9; }
  .source-content .source-heading { margin-top: 2.6em; font-size: 22px; }
  .source-content video, .source-content iframe { min-height: 220px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sidebar-stack { transition: none; }
}

@media print {
  .topbar, .sidebar-stack, .breadcrumb, .reading-progress { display: none; }
  .main { margin: 0; }
  .article { width: 174mm; padding: 10mm 0; }
  .story-section { break-before: page; margin-top: 0; }
  .story-figure { break-inside: avoid; }
}
