:root {
  --canvas: #f6f4f0;
  --surface: #fffefc;
  --ink: #1c1917;
  --ink-soft: #57534e;
  --ink-mute: #8a847c;
  --line: rgba(28, 25, 23, 0.08);
  --font: "Instrument Sans", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html[lang="en"] [data-lang="zh"],
html[lang="zh"] [data-lang="en"] { display: none !important; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.page {
  display: grid;
  grid-template-columns: 232px minmax(0, 860px);
  gap: 56px;
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 40px 0 96px;
  align-items: start;
}

.outline {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding-bottom: 12px;
}

.outline-card {
  background: var(--surface);
  border-radius: 22px;
  padding: 18px 16px 16px;
  box-shadow: 0 0 0 1px var(--line);
}

.outline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 12px;
}

.outline-title {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.outline-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.outline a {
  display: block;
  padding: 7px 10px;
  border-radius: 10px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  text-decoration: none;
}

.outline a:hover { background: #f3efe8; color: var(--ink); }

.outline a.active {
  background: var(--ink);
  color: var(--surface);
}

.outline a.sub {
  margin-left: 8px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-mute);
}

.outline a.sub.active {
  background: rgba(28, 25, 23, 0.08);
  color: var(--ink);
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border-radius: 999px;
  background: #f3efe8;
}

.lang-switch button {
  appearance: none;
  border: 0;
  height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-mute);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.lang-switch button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(28, 25, 23, 0.08);
}

.main { min-width: 0; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 28px;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.kicker {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

h1 {
  margin: 0 0 12px;
  font-size: 42px;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.lead {
  margin: 0 0 36px;
  max-width: 640px;
  color: var(--ink-soft);
  font-size: 17px;
}

.module {
  margin: 0 0 8px;
  padding-top: 8px;
}

.module > h2,
.module-head {
  scroll-margin-top: 24px;
}

.module-head {
  margin: 40px 0 12px;
}

.module-head .kicker { margin-bottom: 6px; }

.module-head h2 {
  margin: 0 0 6px;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.module-head p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
}

.subs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 16px;
}

.subs a {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
}

.subs a:hover { background: #fff; }

.card {
  background: var(--surface);
  border-radius: 22px;
  padding: 28px 28px 24px;
  margin: 0 0 16px;
  box-shadow: 0 0 0 1px var(--line);
  scroll-margin-top: 24px;
}

.plan {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 16px;
}

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

.plan .href {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  word-break: break-all;
}

.plan .card { margin: 0; }

.plan strong {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
}

.plan p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
}

.step {
  display: inline-flex;
  align-items: center;
  height: 22px;
  margin-bottom: 10px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--surface);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.marks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 10px;
}

.marks .step,
.marks .mark { margin: 0; }

.mark {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.mark.done { background: var(--ink); color: var(--surface); }

.mark.open {
  color: var(--ink-soft);
  box-shadow: inset 0 0 0 1px rgba(28, 25, 23, 0.18);
}

.mark.part {
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}

h2 {
  margin: 48px 0 8px;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
  scroll-margin-top: 24px;
}

h3 {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 600;
}

p { margin: 0 0 12px; }

.card p:last-child,
.card ul:last-child,
.card ol:last-child,
.card table:last-child { margin-bottom: 0; }

ul, ol {
  margin: 0 0 12px;
  padding-left: 20px;
}

li { margin: 0 0 8px; }

.muted { color: var(--ink-soft); }

.phones,
.pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 18px 0 4px;
}

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

figure {
  margin: 18px 0 4px;
}

figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
  background: #ece8e1;
}

figure.phone img {
  border-radius: 28px;
  box-shadow: 0 16px 40px rgba(28, 25, 23, 0.12);
}

figure.wide img {
  border-radius: 18px;
  box-shadow: 0 0 0 1px var(--line);
}

figcaption {
  margin-top: 8px;
  color: var(--ink-mute);
  font-size: 13px;
  line-height: 1.45;
}

.capsule {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--surface);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.capsule.ghost {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 0 0 1px var(--line);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

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

.stat {
  background: var(--surface);
  border-radius: 22px;
  padding: 22px 20px 18px;
  box-shadow: 0 0 0 1px var(--line);
}

.stat b {
  display: block;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.stat span {
  display: block;
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 13px;
}

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

.week {
  background: var(--surface);
  border-radius: 22px;
  padding: 20px 18px 16px;
  box-shadow: 0 0 0 1px var(--line);
}

.week .step { margin-bottom: 8px; }

.week strong {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
}

.week p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.alloc {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.alloc th,
.alloc td {
  padding: 10px 8px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.alloc th {
  color: var(--ink-mute);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.alloc th:first-child,
.alloc td:first-child {
  min-width: 7.5em;
  padding-right: 14px;
}

.alloc td:first-child {
  font-weight: 600;
}

.alloc td.num,
.alloc th.num { text-align: right; white-space: nowrap; }

.alloc a { font-weight: 500; text-decoration: none; }
.alloc a:hover { text-decoration: underline; }
.alloc td code { word-break: break-all; }

.alloc .bar {
  display: block;
  height: 6px;
  margin-top: 6px;
  border-radius: 999px;
  background: #ece8e1;
  overflow: hidden;
}

.alloc .bar i {
  display: block;
  height: 100%;
  background: var(--ink);
  border-radius: inherit;
}

.alloc tfoot td {
  font-weight: 600;
  border-bottom: 0;
  padding-top: 14px;
}

.alloc .subline {
  display: block;
  margin-top: 2px;
  color: var(--ink-mute);
  font-size: 12px;
  font-weight: 400;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 48px 0;
}

footer {
  color: var(--ink-mute);
  font-size: 13px;
}

@media (max-width: 980px) {
  .page {
    grid-template-columns: 1fr;
    gap: 20px;
    width: min(100% - 28px, 860px);
    padding-top: 20px;
  }

  .outline {
    position: sticky;
    top: 0;
    z-index: 8;
    max-height: none;
    margin: 0 -6px;
    padding: 8px 6px;
    background: rgba(246, 244, 240, 0.92);
    backdrop-filter: blur(10px);
  }

  .outline-card { padding: 12px 14px; }

  .outline-nav {
    margin-top: 10px;
    max-height: min(52vh, 420px);
    overflow: auto;
  }

  h1 { font-size: 32px; }
  .module-head h2,
  h2 { font-size: 24px; }
}

@media (max-width: 720px) {
  .plan,
  .plan.three,
  .phones,
  .phones.three,
  .pair,
  .stats,
  .weeks { grid-template-columns: 1fr; }
  .card { padding: 22px 18px 18px; }
  .alloc-wrap { overflow-x: auto; margin: 0 -6px; }
  .alloc { font-size: 13px; min-width: 560px; }
}
