/* ===== 基础变量 ===== */
:root {
  --bg: #fbfaf7;
  --ink: #14201c;
  --ink-soft: #5c6b64;
  --ink-faint: #9aa39d;
  --rule: #e2e0d8;
  --rule-strong: #c9c6bb;
  --teal: #0f9b86;
  --teal-dark: #0c7d6c;
  --coral: #ff7a59;
  --paper-card: #f3f1ea;
  --footer-bg: #0e1a17;
  --serif: "Songti SC", "STSong", "Noto Serif SC", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --content-w: 720px;
  --wide-w: 1160px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

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

.wrap {
  max-width: var(--wide-w);
  margin: 0 auto;
  padding: 0 28px;
}

.prose {
  max-width: var(--content-w);
}

.prose.center {
  margin: 0 auto;
}

/* ===== 顶部导航：极简 ===== */
.masthead {
  position: sticky;
  top: 0;
  z-index: 250;
  background: rgba(251, 250, 247, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rule);
  padding-top: env(safe-area-inset-top, 0px);
}

.masthead .wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 64px;
}

.masthead-panel {
  display: contents;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: none;
  order: 0;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.01em;
}

.brand-mark {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: url('../img/app-icon.png') center/cover no-repeat;
  box-shadow: 0 1px 3px rgba(20, 32, 28, 0.18);
}

.kicker .brand-mark {
  width: 16px;
  height: 16px;
  border-radius: 5px;
}

.masthead-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 24px;
  flex: 1;
  min-width: 0;
  order: 1;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
}

.masthead-links a:hover {
  color: var(--coral);
}

.masthead-links .is-current {
  color: var(--ink-faint);
  cursor: default;
  border-bottom: 1px solid var(--ink-faint);
  padding-bottom: 2px;
}

.lang-switch {
  position: relative;
  flex: none;
  order: 2;
}

.nav-toggle {
  display: none;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  order: 4;
  background: none;
  border: none;
  color: var(--ink);
  font-size: 22px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.lang-switch-btn {
  border: none;
  background: none;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 4px 2px;
  font-family: inherit;
}

.lang-switch-btn:hover {
  color: var(--ink);
}

.lang-menu {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 168px;
  margin: 0;
  padding: 8px 0;
  list-style: none;
  background: #3a3a3a;
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(14, 26, 23, 0.22);
  z-index: 300;
}

.lang-switch.is-open .lang-menu {
  display: block;
}

.lang-menu a,
.lang-menu .is-current {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.lang-menu a:hover {
  background: rgba(255, 255, 255, 0.08);
}

.lang-menu .is-current {
  cursor: default;
}

.lang-check {
  width: 14px;
  flex: none;
  font-size: 12px;
  line-height: 1;
}

.masthead .btn {
  padding: 9px 18px;
  font-size: 13px;
}

.masthead-download {
  order: 3;
  flex: none;
}

/* ===== 章节索引（桌面端左侧固定） ===== */
.chapter-index {
  position: fixed;
  left: 36px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chapter-index a {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
}

.chapter-index a .line {
  width: 14px;
  height: 1px;
  background: var(--rule-strong);
  transition: all 0.2s ease;
}

.chapter-index a .label {
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}

.chapter-index a:hover .label,
.chapter-index a.active .label {
  opacity: 1;
  transform: translateX(0);
}

.chapter-index a.active {
  color: var(--coral);
}

.chapter-index a.active .line {
  width: 26px;
  background: var(--coral);
}

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 28px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14.5px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--ink);
  color: #fdfcf9;
}

.btn-primary:hover {
  background: var(--teal-dark);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule-strong);
}

.btn-ghost:hover {
  border-color: var(--coral);
  color: var(--coral);
  transform: translateY(-2px);
}

/* ===== 章节通用 ===== */
.chapter {
  padding: 64px 0;
  position: relative;
  border-bottom: 1px solid var(--rule);
}

.chapter:last-of-type {
  border-bottom: none;
}

.chapter-tag {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 18px;
}

.chapter-tag .num {
  font-family: var(--serif);
  font-size: 15px;
  color: var(--coral);
  font-weight: 700;
  letter-spacing: 0.06em;
}

.chapter-tag .name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.chapter h2 {
  font-size: clamp(26px, 3.6vw, 40px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0 0 18px;
}

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

.pull-quote {
  font-family: var(--serif);
  font-size: clamp(20px, 2.2vw, 26px);
  line-height: 1.5;
  color: var(--ink);
  margin: 26px 0;
  padding-left: 22px;
  border-left: 2px solid var(--coral);
}

.aside-note {
  font-size: 13.5px;
  color: var(--ink-faint);
  border-top: 1px solid var(--rule);
  padding-top: 14px;
  margin-top: 22px;
}

/* ===== 场景列表 ===== */
.scenario-list {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--rule);
}

.scenario-list li {
  font-size: 15.5px;
  color: var(--ink-soft);
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
}

.scenario-list strong {
  display: inline-block;
  color: var(--ink);
  font-weight: 800;
  margin-right: 12px;
  min-width: 84px;
}

/* ===== 数据表格 ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14.5px;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 14px 18px;
  border-bottom: 1px solid var(--rule);
}

.data-table th {
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  font-weight: 700;
  border-bottom: 1px solid var(--rule-strong);
}

.data-table td:first-child {
  font-weight: 800;
  color: var(--teal-dark);
  white-space: nowrap;
}

/* ===== 代码块 ===== */
.code-block {
  background: var(--paper-card);
  border-radius: 12px;
  padding: 20px 24px;
  font-family: "SF Mono", ui-monospace, monospace;
  font-size: 13px;
  line-height: 1.8;
  color: var(--ink-soft);
  overflow-x: auto;
  margin: 24px 0;
}

/* ===== 步骤常见错误提示 ===== */
.mistake {
  font-size: 13.5px;
  color: var(--coral);
  background: rgba(255, 122, 89, 0.08);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 0 0 16px !important;
}

/* ===== 术语表 ===== */
.glossary-title {
  font-size: 15px;
  font-weight: 800;
  margin: 32px 0 14px;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.glossary {
  margin: 0;
  border-top: 1px solid var(--rule);
}

.glossary > div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
}

.glossary dt {
  font-weight: 800;
  font-size: 14.5px;
}

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

/* ===== 00 开篇 ===== */
.opening {
  padding-top: 48px;
}

.opening .kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 18px;
}

.opening h1 {
  font-size: clamp(36px, 5.6vw, 62px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 22px;
  max-width: 880px;
}

.opening h1 em {
  font-style: normal;
  font-family: var(--serif);
  color: var(--teal);
}

.opening .lede {
  font-size: 18px;
  color: var(--ink-soft);
  max-width: 600px;
  margin: 0 0 28px;
}

.opening-figure {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 40px;
  align-items: center;
  margin-top: 32px;
}

.opening-figure img {
  width: 100%;
}

.opening-figure figcaption {
  font-size: 12.5px;
  color: var(--ink-faint);
  margin-top: 14px;
  font-family: var(--serif);
}

.opening-meta {
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-top: 1px solid var(--rule);
  padding-top: 20px;
}

.opening-meta div {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}

.opening-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 28px;
  margin-top: 32px;
  border-top: 1px solid var(--rule);
  padding-top: 22px;
}

.opening-meta-bar div {
  flex: 1 1 200px;
  padding-right: 28px;
  border-right: 1px solid var(--rule);
}

.opening-meta-bar div:last-child {
  border-right: none;
  padding-right: 0;
}

.opening-meta-bar span {
  display: block;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  margin-bottom: 8px;
}

.opening-meta-bar strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.5;
}

@media (max-width: 700px) {
  .opening-meta-bar {
    flex-direction: column;
    gap: 0;
    margin-top: 20px;
    padding-top: 0;
    border-top: none;
  }

  .opening-meta-bar div {
    flex: none;
    padding: 14px 0;
    border-right: none;
    border-bottom: 1px solid var(--rule);
  }

  .opening-meta-bar div:last-child {
    border-bottom: none;
    padding-right: 0;
  }

  .opening-meta-bar span {
    margin-bottom: 4px;
  }
}

.opening-meta span:first-child {
  color: var(--ink-faint);
}

.opening-meta strong {
  font-weight: 800;
}

/* ===== 02 转折：内联协议标签 + 唤起框 ===== */
.inline-tags {
  display: inline;
}

.inline-tags .tag {
  display: inline-block;
  font-size: 0.82em;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--paper-card);
  color: var(--teal-dark);
  margin: 0 3px;
  white-space: nowrap;
}

.callout {
  background: var(--ink);
  color: #f3f1ea;
  border-radius: 20px;
  padding: 32px 36px;
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  flex-wrap: wrap;
}

.callout .callout-copy strong {
  display: block;
  font-size: 21px;
  margin-bottom: 6px;
  font-weight: 800;
}

.callout .callout-copy span {
  font-size: 13.5px;
  color: #a9b6b0;
}

.callout .btn-primary {
  background: var(--coral);
  color: #26120a;
}

.callout .btn-primary:hover {
  background: #ff9273;
}

/* ===== 03 上手：图文交替 ===== */
.onboard-step {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 40px;
  align-items: center;
  padding: 32px 0;
  border-top: 1px solid var(--rule);
}

.onboard-step:first-of-type {
  border-top: none;
  padding-top: 12px;
}

.onboard-step.reverse {
  grid-template-columns: 1.15fr 0.85fr;
}

.onboard-step.reverse .onboard-figure {
  order: 2;
}

.onboard-figure {
  background: var(--paper-card);
  border-radius: 20px;
  padding: 20px;
}

.onboard-figure img {
  max-width: 220px;
  margin: 0 auto;
}

.onboard-copy .step-mark {
  font-family: var(--serif);
  font-size: 46px;
  font-weight: 700;
  color: var(--rule-strong);
  line-height: 1;
  margin-bottom: 14px;
}

.onboard-copy h3 {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}

.onboard-copy p {
  font-size: 15.5px;
  color: var(--ink-soft);
  margin: 0;
}

.onboard-copy .tip {
  display: inline-block;
  margin-top: 16px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--coral);
}

/* ===== 小节标题区：编号 + 标题 + 导语，与配图左右分栏 ===== */
.chapter-intro {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 48px;
  align-items: center;
  margin-bottom: 36px;
}

.chapter-intro-text .chapter-tag {
  margin-bottom: 16px;
}

.chapter-intro-text h2 {
  margin-bottom: 16px;
}

.chapter-intro-text p {
  margin: 0;
  font-size: 15.5px;
  color: var(--ink-soft);
}

.chapter-intro-figure {
  background: var(--paper-card);
  border-radius: 24px;
  padding: 26px;
  display: flex;
  justify-content: center;
}

.chapter-intro-figure img {
  width: 100%;
  max-width: 190px;
}

@media (max-width: 780px) {
  .chapter-intro {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 24px;
  }

  .chapter-intro-figure {
    max-width: 140px;
    margin: 0;
    padding: 16px;
  }
}

/* ===== 教程页：图文步骤（竖版界面示意图） ===== */
.tut-step {
  display: grid;
  grid-template-columns: 0.52fr 1.48fr;
  gap: 40px;
  align-items: start;
  padding: 32px 0;
  border-top: 1px solid var(--rule);
}

.tut-step:first-of-type {
  border-top: none;
  padding-top: 12px;
}

.tut-step.reverse {
  grid-template-columns: 1.38fr 0.62fr;
}

.tut-step.reverse .tut-figure {
  order: 2;
}

.tut-figure {
  background: var(--paper-card);
  border-radius: 22px;
  padding: 18px;
  display: flex;
  justify-content: center;
}

.tut-figure img {
  max-width: 210px;
  border-radius: 14px;
  box-shadow: 0 18px 34px rgba(16, 32, 28, 0.1);
}

.tut-copy h3 {
  font-size: 21px;
  font-weight: 800;
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}

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

.tut-copy code,
.chapter code {
  background: var(--paper-card);
  border-radius: 6px;
  padding: 2px 7px;
  font-family: "SF Mono", ui-monospace, monospace;
  font-size: 0.88em;
  color: var(--teal-dark);
  word-break: break-word;
}

/* ===== 连接前后对比 ===== */
.device-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 20px 0;
}

.device-compare figure {
  margin: 0;
  background: var(--paper-card);
  border-radius: 22px;
  padding: 18px;
  text-align: center;
}

.device-compare img {
  max-width: 220px;
  margin: 0 auto;
  border-radius: 14px;
  box-shadow: 0 18px 34px rgba(16, 32, 28, 0.1);
}

.device-compare figcaption {
  font-size: 13px;
  color: var(--ink-faint);
  margin-top: 16px;
  font-family: var(--serif);
}

/* ===== 04 结果 ===== */
.outcome-stats {
  display: flex;
  gap: 0;
  margin-top: 24px;
  border-top: 1px solid var(--rule);
  padding-top: 20px;
}

.outcome-stats div {
  flex: 1;
  padding-right: 24px;
  border-right: 1px solid var(--rule);
}

.outcome-stats div:last-child {
  border-right: none;
}

.outcome-stats strong {
  display: block;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 700;
}

.outcome-stats span {
  font-size: 12.5px;
  color: var(--ink-faint);
}

/* ===== 05 附录：FAQ ===== */
.faq-list {
  border-top: 1px solid var(--rule);
}

.faq-item {
  border-bottom: 1px solid var(--rule);
  padding: 18px 0;
}

.faq-item summary {
  cursor: pointer;
  font-size: 16.5px;
  font-weight: 700;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary .q-num {
  font-family: var(--serif);
  color: var(--coral);
  font-weight: 700;
  flex: none;
  font-size: 14px;
}

.faq-item summary .q-text {
  flex: 1;
}

.faq-item summary .q-icon {
  font-size: 18px;
  color: var(--ink-faint);
  transition: transform 0.2s ease;
}

.faq-item[open] summary .q-icon {
  transform: rotate(45deg);
  color: var(--coral);
}

.faq-item p {
  font-size: 15px;
  color: var(--ink-soft);
  margin: 16px 0 0 30px;
  max-width: 600px;
}

/* ===== 页末（colophon） ===== */
.colophon {
  background: var(--footer-bg);
  color: #8a9c96;
  padding: 60px 0 32px;
}

.colophon .wrap {
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.colophon-top {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  padding-bottom: 26px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.colophon .brand {
  color: #fdfcf9;
  font-size: 16px;
}

.colophon-links {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
  font-size: 13.5px;
}

.colophon-links a:hover {
  color: var(--coral);
}

.colophon-links .is-current {
  color: #7a8b83;
  cursor: default;
}

.colophon-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: #5f7169;
}

/* ===== 博客：列表页 ===== */
.blog-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}

.blog-filter .tag {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--rule-strong);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
}

.blog-list {
  border-top: 1px solid var(--rule);
}

.blog-item {
  display: block;
  padding: 32px 0;
  border-bottom: 1px solid var(--rule);
}

.blog-item .blog-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
  font-size: 12.5px;
  color: var(--ink-faint);
}

.blog-item .blog-tag {
  color: var(--coral);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11.5px;
}

.blog-item h2,
.blog-item h3 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
  line-height: 1.35;
}

.blog-item a.blog-title-link {
  color: inherit;
}

.blog-item a.blog-title-link:hover {
  color: var(--teal);
}

.blog-item p {
  font-size: 15.5px;
  color: var(--ink-soft);
  margin: 0 0 12px;
  max-width: var(--content-w);
}

.blog-item .blog-readmore {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--teal-dark);
}

/* ===== 面包屑 ===== */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 18px;
  padding-bottom: 18px;
  font-size: 13px;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--rule);
}

.breadcrumb a {
  color: var(--ink-faint);
}

.breadcrumb a:hover {
  color: var(--teal);
}

.breadcrumb .sep {
  color: var(--rule-strong);
}

.breadcrumb .current {
  color: var(--ink-soft);
  font-weight: 600;
}

/* ===== 右下角悬浮下载入口 ===== */
.float-download {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 300px;
  padding: 14px 16px 14px 14px;
  background: var(--ink);
  color: #fff;
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(14, 26, 23, 0.28);
}

.float-download .float-download-icon {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.float-download .float-download-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.float-download .float-download-copy {
  flex: 1;
  min-width: 0;
}

.float-download .float-download-copy strong {
  display: block;
  font-size: 13.5px;
  font-weight: 800;
  margin-bottom: 2px;
}

.float-download .float-download-copy span {
  display: block;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.62);
}

.float-download a.float-download-btn {
  flex: none;
  background: #fff;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 800;
  padding: 8px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.float-download button.float-download-close {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: var(--coral);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}


/* ===== 博客：文章页 ===== */
.article-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 28px;
  margin-top: 28px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 20px 0;
}

.article-meta-bar div span {
  display: block;
  font-size: 12px;
  color: var(--ink-faint);
  margin-bottom: 6px;
}

.article-meta-bar div strong {
  display: block;
  font-size: 14.5px;
  font-weight: 800;
}

.article-callout {
  background: var(--paper-card);
  border-radius: 18px;
  padding: 24px 26px;
  margin: 24px 0;
}

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

.article-callout p {
  margin: 0;
  font-size: 14.5px;
  color: var(--ink-soft);
}

.article-nav {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid var(--rule);
  padding-top: 24px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.article-nav a {
  font-size: 14px;
  font-weight: 700;
  color: var(--teal-dark);
  max-width: 47%;
}

.article-nav a.nav-next {
  margin-left: auto;
  text-align: right;
}

/* ===== 响应式 ===== */
@media (max-width: 1240px) {
  .chapter-index {
    display: none;
  }
}

@media (max-width: 1080px) {
  body.nav-open {
    overflow: hidden;
  }

  .masthead .wrap {
    gap: 8px;
  }

  .nav-toggle {
    display: flex;
  }

  .lang-switch {
    margin-left: auto;
  }

  .lang-switch-btn {
    padding: 8px 4px;
    min-height: 44px;
  }

  .masthead-panel {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
    max-height: 0;
    overflow: hidden;
    z-index: 99;
    box-shadow: none;
    transition: max-height 0.25s ease;
  }

  .masthead-panel.is-open {
    max-height: min(80vh, 720px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 18px 32px rgba(20, 32, 28, 0.1);
  }

  .masthead-links {
    flex: none;
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 0;
  }

  .masthead-links a,
  .masthead-links .is-current {
    width: 100%;
    padding: 14px 28px;
    border-bottom: 1px solid var(--rule);
  }

  .masthead-links .is-current {
    border-bottom: 1px solid var(--rule);
    color: var(--ink);
  }

  .masthead-download {
    width: auto;
    align-self: stretch;
    margin: 16px 28px 20px;
  }
}

@media (max-width: 860px) {
  .opening-figure {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .onboard-step,
  .onboard-step.reverse {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .onboard-step.reverse .onboard-figure {
    order: 0;
  }

  .onboard-figure {
    max-width: 260px;
    margin: 0 auto;
  }

  .tut-step,
  .tut-step.reverse {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .tut-step.reverse .tut-figure {
    order: 0;
  }

  .tut-figure {
    max-width: 240px;
    margin: 0 auto;
  }

  .device-compare {
    grid-template-columns: 1fr;
  }

  .chapter {
    padding: 32px 0;
  }

  .onboard-step,
  .tut-step {
    padding: 20px 0;
  }

  .callout {
    padding: 28px 24px;
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
  }

  .callout .btn-primary {
    width: 100%;
    white-space: normal;
  }

  .outcome-stats {
    flex-direction: column;
    gap: 0;
  }

  .outcome-stats div {
    flex: none;
    border-right: none;
    padding-right: 0;
    padding: 14px 0;
    border-bottom: 1px solid var(--rule);
  }

  .outcome-stats div:last-child {
    padding-bottom: 0;
    border-bottom: none;
  }

  .glossary > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .data-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 13.5px;
  }

  .data-table th,
  .data-table td {
    padding: 12px 14px;
  }

  .data-table td:first-child {
    white-space: normal;
  }

  .scenario-list strong {
    display: block;
    min-width: 0;
    margin: 0 0 6px;
  }

  .faq-item p {
    margin-left: 0;
  }

  .faq-item summary {
    align-items: flex-start;
    gap: 12px;
    font-size: 15.5px;
  }

  .colophon-top,
  .colophon-bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .colophon-links {
    gap: 12px 20px;
  }
}

@media (max-width: 640px) {
  .wrap {
    padding: 0 16px;
  }

  .opening {
    padding-top: 24px;
  }

  .opening h1 {
    font-size: clamp(28px, 8vw, 40px);
  }

  .opening .lede {
    font-size: 16px;
  }

  .chapter h2 {
    font-size: clamp(22px, 6vw, 32px);
  }

  .masthead-links a,
  .masthead-links .is-current {
    padding-left: 16px;
    padding-right: 16px;
  }

  .masthead-download {
    margin-left: 16px;
    margin-right: 16px;
  }

  .code-block {
    padding: 16px;
    font-size: 12.5px;
  }

  .blog-item h2,
  .blog-item h3 {
    font-size: 20px;
  }

  .blog-item .blog-meta {
    flex-wrap: wrap;
    gap: 8px 12px;
  }

  .article-nav a {
    max-width: 100%;
  }

  .article-nav a.nav-next {
    margin-left: 0;
    text-align: left;
  }

  .article-meta-bar {
    flex-direction: column;
    gap: 0;
  }

  .article-meta-bar div {
    padding: 12px 0;
    border-bottom: 1px solid var(--rule);
  }

  .article-meta-bar div:last-child {
    border-bottom: none;
  }

  .btn {
    white-space: normal;
  }
}

@media (max-width: 560px) {
  .float-download {
    left: 16px;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    max-width: none;
    gap: 10px;
  }

  .float-download .float-download-copy span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body:has(.float-download) {
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 480px) {
  .chapter {
    padding: 28px 0;
  }

  .onboard-copy .step-mark {
    font-size: 36px;
  }

  .onboard-copy h3,
  .tut-copy h3 {
    font-size: 19px;
  }

  .callout .callout-copy strong {
    font-size: 18px;
  }

  .colophon {
    padding: 40px 0 28px;
  }
}

