:root {
  --ink: #17202a;
  --muted: #657386;
  --line: #dbe3ec;
  --paper: #ffffff;
  --wash: #f4f7fa;
  --teal: #1e8a73;
  --teal-dark: #166d5a;
  --blue: #1d5fd1;
  --yellow: #f6c945;
  --red: #c24132;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
    "PingFang SC", "Hiragino Sans GB", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--wash);
}

a {
  color: inherit;
}

code {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f0f4f8;
  padding: 2px 5px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 68px;
  padding: 12px clamp(18px, 4vw, 54px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--teal);
  color: #ffffff;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
}

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

.nav a {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--muted);
}

.nav a:hover {
  background: #eef3f7;
  color: var(--ink);
}

.hero {
  min-height: calc(100vh - 68px);
  padding: clamp(34px, 6vw, 72px) clamp(18px, 4vw, 54px) 44px;
  display: grid;
  grid-template-columns: minmax(320px, 0.86fr) minmax(360px, 1.14fr);
  gap: clamp(26px, 5vw, 64px);
  align-items: center;
}

.eyebrow {
  color: var(--teal);
  font-weight: 800;
  margin: 0 0 14px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(56px, 7vw, 104px);
  line-height: 0.92;
  letter-spacing: 0;
}

.hero-text {
  max-width: 600px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(18px, 2.3vw, 25px);
  line-height: 1.45;
}

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

.primary-action,
.secondary-action,
.card-action {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 18px;
  text-decoration: none;
  font-weight: 800;
}

.primary-action,
.card-action {
  color: #ffffff;
  background: var(--teal);
}

.primary-action:hover,
.card-action:hover {
  background: var(--teal-dark);
}

.secondary-action {
  border: 1px solid var(--line);
  background: var(--paper);
}

.secondary-action:hover {
  border-color: #aeb9c6;
  background: #f8fafc;
}

.support-row {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.support-row span {
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: #425163;
  font-weight: 700;
  font-size: 13px;
}

.product-shot {
  margin: 0;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 28px 70px rgba(23, 32, 42, 0.16);
  background: var(--paper);
}

.product-shot img {
  display: block;
  width: 100%;
  height: auto;
}

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

.section-heading {
  margin-bottom: 18px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.section h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 44px);
  letter-spacing: 0;
}

.section p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.tools-section {
  background: #ffffff;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

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

.tool-jump-row {
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.tool-jump-row a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
}

.tool-jump-row a:hover {
  border-color: var(--teal);
  background: #edf8f4;
}

.tool-card {
  min-height: 252px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 18px;
  align-content: start;
}

.tool-card h3 {
  margin: 0;
  font-size: 24px;
}

.tool-card dl {
  grid-column: 1 / -1;
}

.tool-card:target {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(30, 138, 115, 0.12);
}

.tool-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  font-weight: 900;
  font-size: 24px;
}

.claude-icon {
  background: #8b5e3c;
}

.codex-icon {
  background: var(--teal);
}

.gemini-icon {
  background: var(--blue);
}

.ccswitch-icon {
  background: var(--red);
}

.tool-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.tool-action {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--teal);
  color: #ffffff;
  text-decoration: none;
  font-weight: 800;
}

.tool-action:hover {
  background: var(--teal-dark);
}

.secondary-tool-action,
.secondary-card-action {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
}

.secondary-tool-action:hover,
.secondary-card-action:hover {
  border-color: var(--teal);
  background: #edf8f4;
}

.tag {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  background: #e7f6ef;
  color: #166d5a;
  padding: 4px 10px;
  font-weight: 800;
  font-size: 13px;
}

.ccswitch-tag {
  background: #ffe6e2;
  color: var(--red);
}

.gemini-tag {
  background: #e6f0ff;
  color: var(--blue);
}

.codex-tag {
  background: #e7f6ef;
  color: var(--teal-dark);
}

.claude-tag {
  background: #f3eadf;
  color: #7a4b2b;
}

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

.classified-card {
  min-height: 260px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  display: grid;
  gap: 18px;
  align-content: space-between;
}

.classified-card h3 {
  margin: 12px 0 0;
  font-size: 24px;
}

.download-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.full-action {
  width: 100%;
}

dl {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

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

dd {
  margin: 4px 0 0;
  font-weight: 800;
}

.split-section,
.checksum-section {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(320px, 1.2fr);
  gap: 28px;
  align-items: start;
}

.steps {
  display: grid;
  gap: 12px;
}

.steps div {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.steps span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--yellow);
  font-weight: 900;
}

.steps p {
  margin: 8px 0 0;
}

.usage-section {
  border-top: 1px solid var(--line);
  background: #f8fafc;
}

.usage-primer,
.command-grid,
.install-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.china-section {
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.usage-primer {
  margin-bottom: 16px;
}

.usage-primer article,
.command-card,
.terminal-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.usage-primer article,
.command-card {
  padding: 20px;
}

.usage-primer h3,
.command-card h3 {
  margin: 0;
  font-size: 22px;
}

.usage-primer code,
.command-list code {
  display: block;
  margin-top: 10px;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.install-grid .command-card code {
  display: block;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.command-card {
  display: grid;
  gap: 12px;
  align-content: start;
}

.command-card p {
  margin-top: 0;
}

.command-list {
  display: grid;
  gap: 6px;
}

.command-list span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.terminal-note {
  margin-top: 16px;
  padding: 16px 20px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  line-height: 1.55;
}

.checksum-section {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.mirror-section {
  background: #ffffff;
  border-top: 1px solid var(--line);
}

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

.mirror-grid > div {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.mirror-grid h3 {
  margin: 0 0 14px;
  font-size: 20px;
}

.mirror-grid code {
  display: block;
  margin-top: 10px;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.footer {
  min-height: 70px;
  padding: 22px clamp(18px, 4vw, 54px);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
}

@media (max-width: 920px) {
  .hero,
  .classified-downloads,
  .tool-actions,
  .download-actions,
  .mirror-grid,
  .tool-grid,
  .tool-jump-row,
  .usage-primer,
  .command-grid,
  .install-grid,
  .split-section,
  .checksum-section {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .section-heading,
  .footer {
    align-items: start;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .topbar {
    align-items: start;
    flex-direction: column;
  }

  .nav {
    width: 100%;
  }

  .nav a {
    flex: 1;
    text-align: center;
  }

  .hero-actions a,
  .card-action {
    width: 100%;
  }
}
