:root {
  color-scheme: light;
  --bg: #eef7f6;
  --surface: #ffffff;
  --surface-soft: #f7fbfb;
  --ink: #17212b;
  --ink-soft: #53606d;
  --muted: #71808e;
  --line: #d8e6e5;
  --primary: #0f766e;
  --primary-strong: #115e59;
  --accent: #2563eb;
  --accent-soft: #e9f0ff;
  --success: #0f9f6e;
  --shadow: 0 18px 42px rgba(29, 54, 62, 0.1);
  --radius: 8px;
  font-family: Inter, "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(238, 247, 246, 0.88)),
    var(--bg);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 100;
  transform: translateY(-160%);
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  padding: 8px 12px;
}

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

.help-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid rgba(216, 230, 229, 0.86);
  background: rgba(255, 255, 255, 0.9);
  padding: 14px clamp(16px, 4vw, 44px);
  backdrop-filter: blur(16px);
}

.help-brand,
.header-actions,
.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.help-brand {
  text-decoration: none;
  font-weight: 850;
}

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

.primary-link,
.ghost-link,
.copy-button,
.tab-list button,
.accordion button {
  min-height: 44px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, color 180ms ease, transform 180ms ease;
}

.primary-link,
.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  padding: 9px 15px;
  text-decoration: none;
  font-weight: 760;
}

.primary-link {
  border-color: transparent;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.2);
}

.primary-link:hover,
.primary-link:focus-visible {
  background: var(--primary-strong);
}

.ghost-link {
  background: #fff;
  color: var(--primary-strong);
}

.ghost-link:hover,
.ghost-link:focus-visible {
  border-color: #b8d3d0;
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.08);
}

.help-main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 56px;
}

.hero-section {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 28px;
  align-items: stretch;
  padding: 22px 0 28px;
}

.hero-copy {
  display: grid;
  align-content: center;
  gap: 18px;
  min-height: 360px;
}

.eyebrow {
  margin: 0;
  color: var(--primary);
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
}

h1,
h2,
h3,
p,
dl,
dd {
  margin: 0;
}

h1 {
  max-width: 820px;
  font-size: clamp(36px, 6vw, 72px);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero-lead {
  max-width: 720px;
  color: var(--ink-soft);
  font-size: 18px;
}

.hero-panel,
.search-band,
.toc-panel,
.doc-section,
.step-card,
.spec-panel {
  border: 1px solid rgba(216, 230, 229, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.hero-panel {
  display: grid;
  align-content: center;
  gap: 18px;
  padding: 24px;
}

.progress-ring {
  display: grid;
  width: 96px;
  height: 96px;
  place-items: center;
  border: 10px solid #cfe9e6;
  border-top-color: var(--primary);
  border-radius: 999px;
}

.progress-ring span {
  color: var(--primary-strong);
  font-size: 30px;
  font-weight: 900;
}

.quick-stats {
  display: grid;
  gap: 10px;
}

.quick-stats div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.quick-stats dt {
  color: var(--muted);
  font-size: 13px;
}

.quick-stats dd {
  font-weight: 780;
}

.search-band {
  display: grid;
  gap: 10px;
  margin: 8px 0 24px;
  padding: 18px;
}

.search-box {
  position: relative;
  display: block;
}

.search-box input {
  width: 100%;
  min-height: 52px;
  border: 1px solid #c9dddd;
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--ink);
  padding: 12px 16px 12px 46px;
  font-size: 16px;
}

.search-icon {
  position: absolute;
  left: 17px;
  top: 50%;
  width: 16px;
  height: 16px;
  border: 2px solid var(--muted);
  border-radius: 999px;
  transform: translateY(-58%);
}

.search-icon::after {
  content: "";
  position: absolute;
  right: -6px;
  bottom: -4px;
  width: 8px;
  height: 2px;
  border-radius: 2px;
  background: var(--muted);
  transform: rotate(45deg);
}

#searchSummary {
  color: var(--muted);
  font-size: 14px;
}

.content-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.toc-panel {
  position: sticky;
  top: 82px;
  padding: 12px;
}

.toc-panel nav,
.content-column,
.doc-section,
.step-card,
.spec-panel {
  display: grid;
}

.toc-panel nav {
  gap: 4px;
}

.toc-link {
  border-radius: 7px;
  color: var(--ink-soft);
  padding: 10px 12px;
  text-decoration: none;
  font-weight: 730;
}

.toc-link:hover,
.toc-link:focus-visible,
.toc-link.active {
  background: #e7f4f2;
  color: var(--primary-strong);
}

.content-column {
  gap: 24px;
}

.doc-section {
  gap: 20px;
  padding: 24px;
  scroll-margin-top: 92px;
}

.section-heading {
  display: grid;
  gap: 4px;
}

.section-heading h2 {
  font-size: 28px;
  line-height: 1.18;
}

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

.step-card,
.spec-panel {
  align-content: start;
  gap: 10px;
  padding: 16px;
  box-shadow: none;
}

.step-index {
  color: var(--primary);
  font-size: 13px;
  font-weight: 900;
}

.step-card h3,
.spec-panel h3,
.tab-panel h3 {
  font-size: 17px;
  line-height: 1.25;
}

.step-card p,
.spec-panel p,
.tab-panel p,
.accordion p {
  color: var(--ink-soft);
}

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

.code-panel {
  grid-column: 1 / -1;
}

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

.check-list li {
  position: relative;
  padding-left: 24px;
}

.check-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 10px;
  width: 10px;
  height: 6px;
  border-left: 2px solid var(--success);
  border-bottom: 2px solid var(--success);
  transform: rotate(-45deg);
}

.sheet-demo {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  overflow: hidden;
  border: 1px solid #bcd7d5;
  border-radius: 7px;
  background: #eef8f7;
}

.sheet-demo span {
  display: grid;
  min-height: 72px;
  place-items: center;
  border-right: 1px solid #bcd7d5;
  color: var(--primary-strong);
  font-weight: 850;
}

.sheet-demo span:last-child {
  border-right: 0;
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.copy-button {
  border: 1px solid #c9dddd;
  background: #fff;
  color: var(--primary-strong);
  padding: 7px 12px;
  font-weight: 780;
}

pre {
  overflow: auto;
  border-radius: 7px;
  background: #15212a;
  color: #e9fbf8;
  padding: 16px;
}

.tabs {
  display: grid;
  gap: 14px;
}

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

.tab-list button,
.accordion button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  padding: 10px 12px;
  font-weight: 800;
}

.tab-list button[aria-selected="true"] {
  border-color: #b7deda;
  background: #e7f4f2;
  color: var(--primary-strong);
}

.tab-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 18px;
}

.export-checker {
  display: grid;
  gap: 10px;
}

.export-checker label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  padding: 10px 12px;
  cursor: pointer;
}

.export-checker input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.checker-result {
  border-radius: 7px;
  background: var(--accent-soft);
  color: #1e3a8a;
  padding: 12px;
  font-weight: 760;
}

.accordion {
  display: grid;
  gap: 10px;
}

.accordion article {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.accordion button {
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.accordion button::after {
  content: "+";
  float: right;
  font-weight: 900;
}

.accordion button[aria-expanded="true"]::after {
  content: "-";
}

.accordion div {
  border-top: 1px solid var(--line);
  padding: 12px;
}

.doc-section.is-hidden {
  display: none;
}

.doc-section.is-match {
  border-color: #9bd5cf;
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.08), var(--shadow);
}

input:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.24);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

@media (max-width: 960px) {
  .hero-section,
  .content-shell,
  .spec-layout {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    min-height: 0;
  }

  .toc-panel {
    position: static;
  }

  .toc-panel nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    overflow-x: auto;
  }

  .toc-link {
    white-space: nowrap;
  }

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

@media (max-width: 640px) {
  .help-header,
  .header-actions,
  .hero-actions {
    align-items: stretch;
  }

  .help-header {
    display: grid;
  }

  .header-actions,
  .hero-actions,
  .tab-list,
  .step-grid {
    grid-template-columns: 1fr;
  }

  .header-actions,
  .hero-actions {
    display: grid;
  }

  .doc-section,
  .hero-panel,
  .search-band {
    padding: 18px;
  }
}
