:root {
  --navy-950: #091327;
  --navy-900: #0f1c3f;
  --navy-800: #1a2e63;
  --navy-700: #24407f;
  --sky-100: #dfeafc;
  --sky-050: #f3f7ff;
  --paper: #fbfbfd;
  --ink: #18233f;
  --muted: #5d6a88;
  --gold-500: #f0a500;
  --gold-300: #ffd36e;
  --line: rgba(27, 49, 103, 0.12);
  --card-shadow: 0 24px 70px rgba(7, 18, 44, 0.14);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 211, 110, 0.28), transparent 28%),
    radial-gradient(circle at 85% 15%, rgba(53, 90, 180, 0.20), transparent 25%),
    linear-gradient(180deg, #f6f8fd 0%, #eef2fa 100%);
}

html.lang-zh body {
  font-family: "IBM Plex Sans", "Noto Sans SC", sans-serif;
}

a {
  color: inherit;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.site-header {
  position: sticky;
  top: 16px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  margin-bottom: 28px;
  background: rgba(251, 251, 253, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px);
  border-radius: 999px;
  box-shadow: 0 16px 40px rgba(17, 26, 54, 0.08);
}

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

.brand img {
  width: 44px;
  height: 44px;
  border-radius: 14px;
}

.brand span {
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

.nav-links a,
.github-link {
  text-decoration: none;
}

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

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(15, 28, 63, 0.06);
  border: 1px solid rgba(15, 28, 63, 0.08);
}

.lang-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 999px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.lang-btn.is-active {
  background: white;
  color: var(--navy-900);
  box-shadow: 0 6px 16px rgba(17, 26, 54, 0.10);
}

.nav-links a:hover,
.github-link:hover,
.resource-links a:hover,
.release-card a:hover {
  color: var(--navy-700);
}

.github-link {
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--navy-900);
  color: white;
  font-weight: 600;
}

.hero,
.section,
.site-footer {
  margin-bottom: 28px;
}

.hero {
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
  gap: 28px;
  align-items: stretch;
}

.hero-copy,
.hero-card,
.section,
.site-footer {
  background: rgba(251, 251, 253, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: var(--radius-xl);
  box-shadow: var(--card-shadow);
}

.hero-copy {
  padding: 44px;
  background:
    linear-gradient(135deg, rgba(15, 28, 63, 0.98), rgba(28, 51, 104, 0.95)),
    linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0));
  color: white;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold-300);
}

.hero h1,
.section h2 {
  margin: 0;
  font-family: "Fraunces", serif;
  line-height: 1.03;
  letter-spacing: -0.03em;
}

.hero h1 {
  font-size: clamp(2.7rem, 5vw, 4.8rem);
  max-width: 10.5ch;
}

.hero-text {
  max-width: 58ch;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 1.08rem;
  line-height: 1.7;
}

.hero-actions,
.resource-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button.primary {
  background: var(--gold-500);
  color: var(--navy-950);
  box-shadow: 0 16px 34px rgba(240, 165, 0, 0.28);
}

.button.secondary {
  background: rgba(255, 255, 255, 0.14);
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.resource-links .button.secondary {
  background: var(--sky-050);
  border-color: var(--line);
  color: var(--navy-800);
}

.hero-points {
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.hero-points li {
  position: relative;
  padding-left: 18px;
  color: rgba(255, 255, 255, 0.78);
}

.hero-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.68em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold-300);
}

.hero-card {
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(36, 64, 127, 0.10), rgba(255, 255, 255, 0.95)),
    var(--paper);
}

.release-card {
  height: 100%;
  padding: 26px;
  border-radius: calc(var(--radius-xl) - 8px);
  background: linear-gradient(180deg, rgba(255,255,255,0.88), rgba(247, 249, 255, 0.96));
  border: 1px solid rgba(36, 64, 127, 0.09);
}

.release-label {
  display: inline-block;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(36, 64, 127, 0.08);
  color: var(--navy-700);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.release-card h2 {
  margin: 18px 0 14px;
  font-size: 2rem;
}

.release-card ul {
  margin: 0 0 18px;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.65;
}

.release-card a {
  color: var(--navy-700);
  font-weight: 700;
  text-decoration: none;
}

.section {
  padding: 34px;
}

.section-heading {
  margin-bottom: 24px;
}

.section-heading h2 {
  font-size: clamp(2rem, 3vw, 3rem);
}

html.lang-zh .hero h1,
html.lang-zh .section h2 {
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.section-heading p:last-child {
  max-width: 60ch;
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.feature-grid,
.interface-grid,
.install-grid {
  display: grid;
  gap: 16px;
}

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

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

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

.feature-card,
.interface-card,
.install-card,
.privacy-card,
.workflow-steps article {
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, #f8faff);
}

.feature-card h3,
.interface-card h3,
.install-card h3,
.privacy-card h3,
.workflow-steps h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.feature-card p,
.interface-card p,
.install-card p,
.privacy-card p,
.workflow-steps p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.install-steps {
  margin: 0 0 16px 1.2rem;
  padding: 0;
  color: var(--muted);
}

.install-steps li {
  margin-bottom: 10px;
  line-height: 1.65;
}

.install-steps li:last-child {
  margin-bottom: 0;
}

.install-steps code {
  font-size: 0.92em;
}

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

.workflow-steps article {
  position: relative;
  padding-top: 54px;
}

.workflow-steps span {
  position: absolute;
  top: 18px;
  left: 18px;
  display: inline-flex;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--navy-900);
  color: white;
  font-size: 0.85rem;
  font-weight: 700;
}

.interface-card ul,
.privacy-card ul {
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.65;
}

.privacy-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.privacy-note {
  margin: 18px 0 0;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: rgba(240, 165, 0, 0.10);
  color: var(--navy-800);
  line-height: 1.65;
}

pre {
  margin: 0;
  overflow: auto;
  padding: 16px;
  border-radius: 14px;
  background: #0f1731;
  color: #edf2ff;
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 0.92rem;
  line-height: 1.7;
}

code {
  font-family: "IBM Plex Sans", sans-serif;
}

.site-footer {
  padding: 24px 28px;
}

.site-footer p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.footer-meta {
  margin-top: 8px !important;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-size: 0.96rem;
}

.footer-meta a {
  color: var(--navy-700);
  font-weight: 700;
  text-decoration: none;
}

.footer-sep {
  color: rgba(24, 35, 63, 0.28);
}

/* ── API Keys section ───────────────────────────────────────────────────── */

.api-keys-tip {
  margin: 0 0 20px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: rgba(36, 64, 127, 0.06);
  border-left: 3px solid var(--navy-700);
  color: var(--navy-800);
  line-height: 1.65;
  font-size: 0.97rem;
}

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

.provider-card {
  padding: 22px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, #f8faff);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.provider-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.provider-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.provider-tag {
  flex-shrink: 0;
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.provider-tag.free {
  background: rgba(22, 163, 74, 0.11);
  color: #15803d;
}

.provider-tag.paid {
  background: rgba(36, 64, 127, 0.08);
  color: var(--navy-700);
}

.provider-desc {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  font-size: 0.96rem;
}

.img-placeholder {
  width: 100%;
  min-height: 110px;
  border-radius: 10px;
  border: 2px dashed rgba(27, 49, 103, 0.18);
  background: var(--sky-050);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  padding: 14px 16px;
  line-height: 1.55;
}

.provider-card img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  display: block;
  cursor: zoom-in;
  transition: opacity 0.15s ease, box-shadow 0.15s ease;
}

.provider-card img:hover {
  opacity: 0.92;
  box-shadow: 0 4px 18px rgba(7, 18, 44, 0.18);
}

/* ── .env guide ─────────────────────────────────────────────────────────── */

.env-guide {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.env-guide-heading h3 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.env-guide-heading p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  max-width: 72ch;
}

.env-format-block {
  padding: 20px 22px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, #f8faff);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.env-format-label {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--navy-700);
}

.env-format-note {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.6;
}

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

.env-step-callout {
  margin: 8px 0 4px;
  padding: 10px 13px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.07);
  color: #991b1b;
  font-size: 0.88rem;
  line-height: 1.6;
}

.env-step-callout--info {
  background: rgba(36, 64, 127, 0.07);
  color: var(--navy-800);
}

.env-inline-note {
  margin: 6px 0 0;
  font-size: 0.87rem;
  color: var(--muted);
  line-height: 1.6;
}

kbd {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid rgba(27, 49, 103, 0.22);
  background: var(--sky-050);
  color: var(--navy-800);
  font-size: 0.83em;
  font-family: inherit;
  line-height: 1.6;
  white-space: nowrap;
}

/* ── Lightbox ────────────────────────────────────────────────────────────── */

.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(7, 15, 36, 0.88);
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: zoom-out;
}

.lightbox-overlay.is-open {
  display: flex;
}

.lightbox-overlay img {
  max-width: min(90vw, 1100px);
  max-height: 88vh;
  width: auto;
  height: auto;
  border-radius: 14px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.55);
  cursor: default;
  animation: lightbox-in 0.18s ease;
}

@keyframes lightbox-in {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

.lightbox-close {
  position: fixed;
  top: 20px;
  right: 24px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
  z-index: 1001;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.28);
}

.api-key-where {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(240, 165, 0, 0.09);
  color: var(--navy-800);
  font-size: 0.91rem;
  line-height: 1.65;
}

.api-key-where strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--navy-700);
}

.api-key-never {
  padding: 11px 14px;
  border-radius: var(--radius-md);
  background: rgba(239, 68, 68, 0.07);
  color: #991b1b;
  font-size: 0.88rem;
  line-height: 1.6;
}

.provider-link {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--navy-700);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
}

.provider-link:hover {
  color: var(--navy-800);
  text-decoration: underline;
}

/* ── Credits section ────────────────────────────────────────────────────────── */

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

.credits-card {
  padding: 22px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, #f8faff);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.credits-card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.credits-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  font-size: 0.96rem;
}

.credits-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.8;
  font-size: 0.95rem;
}

.credits-list a {
  color: var(--navy-700);
  font-weight: 600;
  text-decoration: none;
}

.credits-list a:hover {
  text-decoration: underline;
}

.credits-placeholder {
  font-style: italic;
  color: var(--muted) !important;
  font-size: 0.9rem !important;
  padding: 10px 13px;
  border-radius: 8px;
  background: rgba(36, 64, 127, 0.04);
  border: 1px dashed rgba(36, 64, 127, 0.15);
}

.credits-disclaimer {
  font-size: 0.86rem !important;
  color: rgba(93, 106, 136, 0.8) !important;
  padding-top: 4px;
  border-top: 1px solid var(--line);
  margin-top: 4px !important;
}

@media (max-width: 1080px) {
  .hero,
  .feature-grid,
  .interface-grid,
  .workflow-steps,
  .privacy-layout,
  .install-grid,
  .provider-grid,
  .env-platform-grid,
  .credits-grid {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    max-width: none;
  }
}

@media (max-width: 820px) {
  .page-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 14px;
  }

  .site-header {
    position: static;
    border-radius: 24px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .nav-links {
    order: 3;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .header-actions {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .hero-copy,
  .section,
  .site-footer {
    padding: 24px;
  }
}
