:root {
  color-scheme: light;
  --bg: #f7f4ed;
  --bg-soft: #fbfaf6;
  --surface: #ffffff;
  --surface-strong: #f0f7f4;
  --ink: #17212b;
  --muted: #5f6975;
  --line: #ded8cb;
  --line-strong: #c8bda9;
  --blue: #2457d6;
  --green: #2f7d5f;
  --amber: #b86b15;
  --red: #b44439;
  --shadow: 0 24px 60px rgba(42, 35, 25, 0.12);
  --radius: 8px;
  --header-height: 76px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(247, 244, 237, 0.94)),
    var(--bg);
  font-size: 16px;
  line-height: 1.7;
}

body.reader-open {
  background: #f6f7f8;
}

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

a:hover {
  color: var(--blue);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid rgba(36, 87, 214, 0.36);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  transform: translateY(-160%);
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-shell {
  min-height: 100vh;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
  align-items: center;
  min-height: var(--header-height);
  padding: 12px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(222, 216, 203, 0.72);
  background: rgba(251, 250, 246, 0.9);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--ink);
}

.brand-mark {
  display: grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid #222;
  border-radius: 50%;
  background: #fbfaf6;
  color: #17212b;
  font-weight: 800;
  letter-spacing: 0;
}

.brand strong,
.brand small {
  display: block;
  overflow: hidden;
  max-width: 210px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand strong {
  font-size: 15px;
  line-height: 1.25;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.top-nav {
  display: flex;
  justify-content: center;
  gap: clamp(12px, 2vw, 28px);
  font-size: 14px;
  font-weight: 650;
}

.top-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #354252;
}

.header-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.primary-button,
.ghost-button,
.text-button,
.article-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: var(--radius);
  font-weight: 700;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease;
}

.primary-button {
  padding: 10px 18px;
  border: 1px solid var(--blue);
  background: var(--blue);
  color: #fff;
  box-shadow: 0 12px 26px rgba(36, 87, 214, 0.2);
}

.primary-button:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(36, 87, 214, 0.25);
}

.ghost-button,
.text-button {
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: #253040;
}

.ghost-button:hover,
.text-button:hover {
  border-color: var(--line-strong);
  background: #fff;
}

.home {
  padding-bottom: 72px;
}

.section {
  padding: 70px clamp(18px, 4vw, 56px);
}

.section-inner {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.hero {
  min-height: calc(100vh - var(--header-height));
  padding-top: clamp(34px, 6vw, 74px);
  padding-bottom: 48px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(320px, 0.78fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 850px;
  margin: 0;
  font-size: clamp(44px, 7vw, 92px);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero-lead {
  max-width: 720px;
  margin: 24px 0 0;
  color: #3f4b59;
  font-size: clamp(18px, 2.2vw, 22px);
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 34px;
  max-width: 720px;
}

.stat-item {
  min-height: 98px;
  padding: 18px;
  border-left: 3px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.42);
}

.stat-item strong {
  display: block;
  font-size: 28px;
  line-height: 1.1;
}

.stat-item span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.hero-panel {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.route-preview {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.route-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.route-preview-header strong {
  font-size: 18px;
}

.route-preview-header span {
  color: var(--muted);
  font-size: 13px;
}

.mini-steps {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mini-steps li {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 14px;
  align-items: start;
  padding: 18px 20px;
  border-top: 1px solid #eee8dd;
}

.mini-steps li:first-child {
  border-top: 0;
}

.mini-steps b {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: #e6f2ee;
  color: var(--green);
  font-size: 13px;
}

.mini-steps strong {
  display: block;
  line-height: 1.25;
}

.mini-steps span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.visual-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.visual-strip img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 18px;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(260px, 0.42fr);
  gap: 34px;
  align-items: end;
  margin-bottom: 30px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1.08;
  letter-spacing: 0;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
}

.roadmap {
  background: #eef4f2;
}

.roadmap-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.roadmap-item {
  display: grid;
  grid-template-columns: 110px 1fr minmax(180px, 0.28fr);
  gap: 24px;
  align-items: center;
  min-height: 126px;
  padding: 24px;
  border: 1px solid rgba(47, 125, 95, 0.18);
  border-radius: var(--radius);
  background: #fff;
}

.roadmap-item time {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: #f6efe2;
  color: var(--amber);
  font-weight: 850;
}

.roadmap-item h3,
.chapter-card h3,
.ai-panel h3,
.word-card h3,
.method-card h3 {
  margin: 0;
  font-size: 21px;
  line-height: 1.25;
}

.roadmap-item p,
.chapter-card p,
.ai-panel p,
.word-card p,
.method-card p {
  margin: 8px 0 0;
  color: var(--muted);
}

.roadmap-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfaf6;
  color: #485566;
  font-size: 13px;
  font-weight: 650;
}

.chapters {
  background: var(--bg-soft);
}

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.chapter-card {
  display: grid;
  grid-template-rows: 118px auto;
  min-height: 310px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.chapter-card:hover {
  color: var(--ink);
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: 0 18px 42px rgba(35, 30, 23, 0.12);
}

.chapter-art {
  display: grid;
  place-items: center;
  background: #f0f7f4;
}

.chapter-card:nth-child(3n + 2) .chapter-art {
  background: #eef2ff;
}

.chapter-card:nth-child(3n) .chapter-art {
  background: #fbf1df;
}

.chapter-art img {
  width: min(190px, 78%);
  max-height: 82px;
  object-fit: contain;
}

.chapter-body {
  display: flex;
  flex-direction: column;
  padding: 22px;
}

.chapter-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.chapter-body .article-link {
  align-self: flex-start;
  margin-top: auto;
  color: var(--blue);
}

.method-band {
  background: #17212b;
  color: #fff;
}

.method-band .section-heading p,
.method-band .eyebrow,
.method-card p {
  color: rgba(255, 255, 255, 0.72);
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.method-card {
  min-height: 226px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
}

.method-card span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin-bottom: 28px;
  color: #95d8c0;
  font-weight: 850;
}

.ai-section {
  background: #fff7ea;
}

.ai-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(320px, 0.48fr);
  gap: 18px;
}

.ai-panel {
  min-height: 380px;
  padding: 28px;
  border: 1px solid #ecd6b7;
  border-radius: var(--radius);
  background: #fff;
}

.ai-panel.featured {
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(135deg, rgba(36, 87, 214, 0.1), rgba(47, 125, 95, 0.12)),
    #fff;
}

.ai-panel img {
  width: min(330px, 92%);
  margin: 6px auto 22px;
  object-fit: contain;
}

.ai-steps {
  display: grid;
  gap: 10px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.ai-steps li {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  align-items: start;
  min-height: 56px;
}

.ai-steps b {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: #173f8f;
  color: #fff;
  font-size: 13px;
}

.word-lists {
  background: var(--bg-soft);
}

.word-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.word-card {
  display: flex;
  min-height: 156px;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.word-card span {
  margin-top: auto;
  color: var(--blue);
  font-weight: 750;
}

.cefr {
  background: #fff;
}

.cefr-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.6fr) minmax(320px, 0.8fr);
  gap: 34px;
  align-items: center;
}

.cefr-copy h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.1;
}

.cefr-copy p {
  color: var(--muted);
}

.cefr-image {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfaf6;
  padding: 18px;
}

.cefr-image img {
  display: block;
  width: 100%;
  height: auto;
}

.reader {
  display: grid;
  grid-template-columns: 282px minmax(0, 1fr);
  min-height: calc(100vh - var(--header-height));
}

.reader-sidebar {
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow: auto;
  border-right: 1px solid #dfe3e8;
  background: #fff;
  padding: 22px 18px;
}

.reader-sidebar h2 {
  margin: 0 0 16px;
  font-size: 16px;
}

.reader-nav {
  display: grid;
  gap: 4px;
}

.reader-nav a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 10px;
  border-radius: var(--radius);
  color: #435064;
  font-size: 14px;
  font-weight: 650;
}

.reader-nav a:hover,
.reader-nav a.active {
  background: #eef2ff;
  color: #173f8f;
}

.reader-main {
  min-width: 0;
  padding: 34px clamp(18px, 4vw, 58px) 80px;
}

.reader-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(920px, 100%);
  margin: 0 auto 18px;
}

.reader-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.article {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: clamp(24px, 5vw, 54px);
  border: 1px solid #dde2e8;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 18px 54px rgba(22, 30, 40, 0.08);
}

.article.loading,
.article.error {
  min-height: 360px;
}

.article h1,
.article h2,
.article h3 {
  color: #111827;
  line-height: 1.25;
  letter-spacing: 0;
}

.article h1 {
  margin: 0 0 22px;
  font-size: clamp(34px, 5vw, 54px);
}

.article h2 {
  margin: 44px 0 14px;
  font-size: clamp(25px, 3vw, 34px);
}

.article h3 {
  margin: 32px 0 12px;
  font-size: 22px;
}

.article p {
  margin: 16px 0;
  color: #2c3644;
}

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

.article ul,
.article ol {
  padding-left: 1.35em;
}

.article li {
  margin: 8px 0;
}

.article blockquote {
  margin: 24px 0;
  padding: 16px 18px;
  border-left: 4px solid var(--green);
  background: #f0f7f4;
  color: #2d4a3f;
}

.article code {
  border-radius: 5px;
  background: #f1f5f9;
  padding: 0.15em 0.36em;
  color: #a13f16;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
}

.article pre {
  overflow: auto;
  border-radius: var(--radius);
  background: #111827;
  padding: 18px;
  color: #e5e7eb;
}

.article pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.article img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 22px auto;
  border-radius: var(--radius);
}

.article hr {
  height: 1px;
  margin: 34px 0;
  border: 0;
  background: #e5e7eb;
}

.article table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
}

.article th,
.article td {
  border: 1px solid #d7dde5;
  padding: 8px 10px;
}

.article .word-list-terms {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 24px 0;
  padding: 0;
  list-style: none;
}

.article .word-list-terms li {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #d7dde5;
  border-radius: var(--radius);
  background: #f8fafc;
  color: #263344;
  font-weight: 650;
}

.article-meta {
  color: var(--muted);
  font-size: 14px;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px clamp(18px, 4vw, 56px);
  border-top: 1px solid var(--line);
  background: #fbfaf6;
  color: var(--muted);
  font-size: 14px;
}

.site-footer p {
  margin: 0;
}

.site-footer div {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.site-footer a {
  color: #354252;
  font-weight: 700;
}

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

@media (max-width: 1020px) {
  .site-header {
    grid-template-columns: 1fr auto;
    row-gap: 10px;
  }

  .top-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .hero-grid,
  .section-heading,
  .ai-layout,
  .cefr-layout {
    grid-template-columns: 1fr;
  }

  .chapter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .method-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .word-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .reader {
    grid-template-columns: 1fr;
  }

  .reader-sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid #dfe3e8;
  }

  .reader-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  :root {
    --header-height: 64px;
  }

  .site-header {
    position: static;
    grid-template-columns: 1fr;
    padding: 12px 16px;
  }

  .brand strong,
  .brand small {
    max-width: none;
  }

  .header-actions {
    justify-content: stretch;
  }

  .header-actions a {
    flex: 1 1 auto;
  }

  .top-nav {
    display: none;
  }

  .section {
    padding: 52px 16px;
  }

  .hero {
    min-height: auto;
    padding-top: 34px;
  }

  .hero h1 {
    font-size: 44px;
  }

  .hero-stats,
  .visual-strip,
  .chapter-grid,
  .method-grid,
  .word-grid,
  .reader-nav {
    grid-template-columns: 1fr;
  }

  .roadmap-item {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .roadmap-item time {
    width: 70px;
    height: 70px;
  }

  .article {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .reader-main {
    padding-right: 0;
    padding-left: 0;
  }

  .reader-toolbar {
    padding: 0 16px;
  }

  .site-footer {
    display: grid;
  }
}
