:root {
  --ink: #101828;
  --muted: #667085;
  --line: #e4e7ec;
  --soft: #f7f9fc;
  --blue: #246bfd;
  --green: #0f9f6e;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; }

.guide-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 30px;
  padding: 0 max(24px, calc((100vw - 1160px) / 2));
  border-bottom: 1px solid rgba(16, 24, 40, .08);
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(18px);
}
.guide-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 18px;
  font-weight: 900;
  white-space: nowrap;
}
.guide-brand em { color: var(--blue); font-style: normal; }
.brand-mark {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: #101828;
  font-size: 11px;
}
.guide-header nav {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: auto;
  color: var(--muted);
  font-size: 14px;
}
.guide-header nav a:hover { color: var(--ink); }
.back-link {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
}
.back-link svg,
.official-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

main { min-height: calc(100vh - 150px); }
.guide-intro {
  padding: 64px max(24px, calc((100vw - 1160px) / 2)) 52px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 12% 20%, rgba(36, 107, 253, .11), transparent 34%),
    radial-gradient(circle at 84% 10%, rgba(15, 159, 110, .08), transparent 30%),
    #fbfcfe;
}
.guide-label {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}
.guide-label span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(15, 159, 110, .12);
}
.guide-intro h1 {
  margin: 18px 0 14px;
  font-size: 46px;
  line-height: 1.15;
  letter-spacing: 0;
}
.guide-intro > p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}
.intro-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin-top: 26px;
  color: #475467;
  font-size: 13px;
}
.intro-meta a { color: var(--blue); font-weight: 700; }

.guide-layout {
  width: min(1160px, calc(100% - 48px));
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 56px;
  margin: 0 auto;
  padding: 48px 0 80px;
}
.toc {
  position: sticky;
  top: 94px;
  align-self: start;
  display: grid;
  gap: 4px;
  padding-right: 20px;
  border-right: 1px solid var(--line);
}
.toc strong { margin-bottom: 8px; font-size: 13px; }
.toc a {
  padding: 8px 0;
  color: var(--muted);
  font-size: 13px;
  transition: color .2s ease, transform .2s ease;
}
.toc a:hover { color: var(--blue); transform: translateX(3px); }

.guide-content { min-width: 0; }
.guide-section {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 22px;
  padding: 10px 0 56px;
  scroll-margin-top: 88px;
}
.guide-section > div { min-width: 0; }
.guide-section + .guide-section { border-top: 1px solid var(--line); padding-top: 52px; }
.section-number {
  display: grid;
  width: 38px;
  height: 28px;
  place-items: center;
  border: 1px solid #d0d5dd;
  border-radius: 999px;
  color: #475467;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  font-weight: 800;
}
.guide-section h2 { margin: 0 0 12px; font-size: 28px; letter-spacing: 0; }
.guide-section h3 { margin: 0 0 8px; font-size: 18px; }
.guide-section p { margin: 0 0 18px; color: var(--muted); line-height: 1.8; }

.check-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 24px;
}
.check-grid > div {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}
.check-grid span {
  display: grid;
  width: 24px;
  height: 24px;
  margin-bottom: 18px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}
.check-grid strong,
.check-grid small { display: block; }
.check-grid strong { font-size: 14px; }
.check-grid small { margin-top: 5px; color: var(--muted); line-height: 1.5; }

.install-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 24px 0 22px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}
.install-tabs button {
  flex: 1 1 130px;
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}
.install-tabs button.is-active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 1px 4px rgba(16, 24, 40, .1);
}
.install-panel { min-height: 164px; }
.install-panel[hidden] { display: none; }
.download-grid,
.alternative-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 22px;
}
.download-grid a,
.alternative-grid a {
  position: relative;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  transition: border-color .2s ease, background .2s ease;
}
.download-grid a:hover,
.alternative-grid a:hover { border-color: #a9c3ff; background: #f8faff; }
.download-grid strong,
.download-grid small,
.alternative-grid strong,
.alternative-grid small { display: block; }
.download-grid strong,
.alternative-grid strong { font-size: 14px; }
.download-grid small,
.alternative-grid small { margin-top: 6px; color: var(--muted); line-height: 1.55; }
.download-card {
  display: flex;
  min-height: 132px;
  flex-direction: column;
  align-items: flex-start;
}
.download-card em {
  margin-top: auto;
  padding-top: 16px;
  color: var(--blue);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}
.download-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 7px;
  border-radius: 999px;
  color: #087854;
  background: #dcfaec;
  font-size: 10px;
  font-weight: 800;
}
.download-card:has(.download-badge) strong { padding-right: 42px; }
.mac-download-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.official-source { margin-top: -6px !important; font-size: 12px; }
.official-source a { color: var(--blue); font-weight: 800; }
.third-party-option { margin: 14px 0 20px; border-bottom: 1px solid var(--line); }
.third-party-option summary { color: #475467; font-size: 13px; }
.third-party-option p { font-size: 13px; }
.access-grid,
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0;
}
.access-grid article,
.feature-grid article {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}
.access-grid article > span,
.feature-grid article > span {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
}
.access-grid h3,
.feature-grid h3 { margin-bottom: 8px; }
.access-grid p,
.feature-grid p { margin-bottom: 12px; font-size: 13px; }
.access-grid a { color: var(--blue); font-size: 13px; font-weight: 800; }
.access-grid .codex-download-button {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding: 0 14px;
  border-radius: 7px;
  color: #fff;
  background: var(--blue);
  box-shadow: 0 7px 18px rgba(36, 107, 253, .2);
}
.access-grid .codex-download-button:hover { background: #1457dc; }
.access-grid .codex-download-button small {
  flex: 0 0 auto;
  color: rgba(255, 255, 255, .75);
  font-size: 11px;
  font-weight: 600;
}
.feature-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.code-block {
  overflow: hidden;
  margin: 16px 0 20px;
  border: 1px solid #29354a;
  border-radius: 8px;
  background: #101828;
  color: #eef4ff;
}
.code-head {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  color: #98a2b3;
  font-size: 11px;
}
.code-head button {
  border: 0;
  background: transparent;
  color: #d0d5dd;
  cursor: pointer;
  font-size: 12px;
}
.code-head button:hover { color: #fff; }
.code-block > code {
  display: block;
  overflow-x: auto;
  padding: 18px 16px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 13px;
  line-height: 1.8;
  white-space: nowrap;
}
.official-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}
.safe-note,
.tip-line {
  display: flex;
  gap: 12px;
  padding: 15px 16px;
  border-left: 3px solid var(--green);
  background: #f0fdf8;
  color: #35605a;
  font-size: 13px;
  line-height: 1.7;
}
.safe-note strong,
.tip-line strong { flex: 0 0 auto; color: #087854; }
.safe-note code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.result-line { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.result-line span { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }

.steps-list {
  display: grid;
  gap: 0;
  padding: 0;
  margin: 24px 0 0;
  list-style: none;
}
.steps-list li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 14px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.steps-list li > span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: #eef4ff;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}
.steps-list strong { font-size: 15px; }
.steps-list p { margin: 4px 0 0; font-size: 13px; }

.prompt-examples { display: grid; gap: 10px; margin: 22px 0; }
.prompt-examples button {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 14px;
  width: 100%;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #344054;
  cursor: pointer;
  text-align: left;
}
.prompt-examples button:hover { border-color: #a9c3ff; background: #f8faff; }
.prompt-examples span { color: var(--blue); font-weight: 800; }

.command-table { border-top: 1px solid var(--line); }
.command-table > div {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 16px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}
.command-table code { color: var(--ink); font-weight: 800; }

details { border-top: 1px solid var(--line); }
details:last-child { border-bottom: 1px solid var(--line); }
summary {
  padding: 17px 28px 17px 0;
  cursor: pointer;
  font-weight: 700;
}
details p { max-width: 720px; margin-bottom: 18px; font-size: 14px; }

.finish-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
  border-radius: 8px;
  background: #101828;
  color: #fff;
}
.finish-band span { color: #7fb0ff; font-size: 12px; font-weight: 800; }
.finish-band h2 { margin: 8px 0; font-size: 24px; }
.finish-band p { margin: 0; color: #b7c0d0; line-height: 1.7; }
.finish-band a {
  flex: 0 0 auto;
  padding: 12px 16px;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

footer {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px max(24px, calc((100vw - 1160px) / 2));
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
footer div { display: flex; gap: 18px; }
footer a:hover { color: var(--blue); }

.copy-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 40;
  padding: 10px 16px;
  border-radius: 999px;
  background: #101828;
  color: #fff;
  box-shadow: 0 12px 30px rgba(16, 24, 40, .24);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity .2s ease, transform .2s ease;
}
.copy-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 820px) {
  .guide-header { height: 58px; gap: 12px; padding: 0 16px; }
  .guide-header nav { display: none; }
  .back-link { margin-left: auto; min-height: 36px; padding: 0 12px; }
  .guide-intro { padding: 46px 20px 38px; }
  .guide-intro h1 { font-size: 36px; }
  .guide-intro > p { font-size: 15px; }
  .guide-layout { width: min(100% - 32px, 760px); display: block; padding: 34px 0 60px; }
  .toc { display: none; }
  .guide-section { grid-template-columns: 1fr; gap: 12px; padding-bottom: 42px; }
  .guide-section + .guide-section { padding-top: 40px; }
  .guide-section h2 { font-size: 24px; }
  .check-grid { grid-template-columns: 1fr; }
  .download-grid,
  .alternative-grid,
  .feature-grid { grid-template-columns: 1fr; }
  .access-grid { grid-template-columns: 1fr; }
  .check-grid span { margin-bottom: 10px; }
  .prompt-examples button { grid-template-columns: 1fr; gap: 5px; }
  .command-table > div { grid-template-columns: 110px minmax(0, 1fr); }
  .finish-band { align-items: flex-start; flex-direction: column; padding: 22px; }
  footer { align-items: flex-start; flex-direction: column; padding: 22px 20px; }
}

@media (max-width: 480px) {
  .guide-brand { font-size: 16px; }
  .brand-mark { width: 28px; height: 28px; }
  .back-link { font-size: 12px; }
  .guide-intro h1 { font-size: 31px; }
  .intro-meta { flex-direction: column; gap: 8px; }
  .install-tabs button { flex-basis: calc(50% - 4px); }
  .code-block > code { font-size: 12px; }
  .safe-note { flex-direction: column; gap: 5px; }
  .command-table > div { grid-template-columns: 1fr; gap: 5px; }
}
