:root {
  color-scheme: light;
  --bg: #ffffff;
  --fg: #0b0d12;
  --muted: #525866;
  --card: #f6f7f9;
  --line: rgba(11, 13, 18, 0.12);
  --shadow: 0 16px 40px rgba(11, 13, 18, 0.08);
  --accent: #0b5fff;
  --accent-weak: rgba(11, 95, 255, 0.12);
  --radius: 16px;
  --header-h: 72px;
  --footer-h: 56px;
  --max-w: 1100px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Helvetica,
    Arial,
    "Apple Color Emoji",
    "Segoe UI Emoji";
  background: radial-gradient(1200px 600px at 50% -10%, rgba(11, 95, 255, 0.10), transparent 60%),
    var(--bg);
  color: var(--fg);
  overflow: hidden; /* 关键：不允许页面上下滚动 */
}

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

.container {
  width: min(var(--max-w), calc(100% - 32px));
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 10px 12px;
  background: var(--fg);
  color: var(--bg);
  border-radius: 12px;
  transform: translateY(-150%);
  transition: transform 180ms ease;
  z-index: 1000;
}

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

.site-header {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  z-index: 50;
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.header-inner {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 16px;
  align-items: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.brand-mark {
  width: 14px;
  height: 14px;
  border-radius: 5px;
  background: linear-gradient(180deg, var(--accent), #7aa7ff);
  box-shadow: 0 6px 18px rgba(11, 95, 255, 0.25);
}

.nav {
  display: inline-flex;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.60);
}

.nav-link {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 10px 12px;
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  font-weight: 600;
}

.nav-link:hover {
  background: rgba(11, 13, 18, 0.06);
  color: var(--fg);
}

.lang {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 600;
}

.lang-btn {
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--muted);
}

.lang-btn[aria-pressed="true"] {
  background: var(--accent-weak);
  color: var(--accent);
}

.lang-btn:hover {
  background: rgba(11, 13, 18, 0.06);
  color: var(--fg);
}

.site-main {
  height: 100vh;
  padding-top: var(--header-h);
  padding-bottom: var(--footer-h);
  display: flex;
}

.main-inner {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  align-content: center;
  gap: 18px;
  padding: 22px 0;
}

.hero-title {
  margin: 0;
  font-size: clamp(34px, 4vw, 54px);
  letter-spacing: -0.02em;
}

.hero-subtitle {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.45;
  max-width: 64ch;
}

.hero-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.products {
  margin-top: 6px;
}

.product-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  display: grid;
  gap: 10px;
  min-height: 210px;
}

.card-top {
  display: flex;
  align-items: baseline;
  gap: 10px;
  justify-content: space-between;
}

.card-title {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.pill {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.6);
}

.card-desc {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.card-list {
  margin: 0;
  padding-left: 18px;
  color: var(--fg);
  display: grid;
  gap: 6px;
  line-height: 1.35;
}

.card-actions {
  margin-top: 2px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.2px;
  user-select: none;
  transition:
    transform 120ms ease,
    background 120ms ease,
    border-color 120ms ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: rgba(11, 95, 255, 0.8);
}

.btn-primary:hover {
  background: #0a56e6;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.66);
  color: var(--fg);
}

.btn-ghost:hover {
  background: rgba(11, 13, 18, 0.06);
}

.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--footer-h);
  display: flex;
  align-items: center;
  z-index: 40;
  background: rgba(255, 255, 255, 0.72);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
}

.dot {
  margin: 0 8px;
  opacity: 0.7;
}

.footer-link {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 10px;
}

.footer-link:hover {
  background: rgba(11, 13, 18, 0.06);
  color: var(--fg);
}

/* 弹层 */
.modal-root {
  position: relative;
  z-index: 200;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 13, 18, 0.45);
}

.modal {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(720px, calc(100% - 28px));
  max-height: min(520px, calc(100vh - 120px));
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 20px 70px rgba(11, 13, 18, 0.25);
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}

.modal-header,
.modal-footer {
  padding: 14px 14px;
  background: rgba(255, 255, 255, 0.7);
  border-bottom: 1px solid var(--line);
}

.modal-footer {
  border-bottom: 0;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
}

.modal-title {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.icon-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  width: 36px;
  height: 36px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 800;
}

.icon-btn:hover {
  background: rgba(11, 13, 18, 0.06);
}

.modal-body {
  padding: 14px;
  overflow: auto; /* 弹层内部允许滚动（不影响页面整体无滚动） */
  color: var(--fg);
  line-height: 1.55;
}

.modal-body p {
  margin: 0 0 10px;
  color: var(--muted);
}

.modal-body h4 {
  margin: 14px 0 8px;
  font-size: 14px;
  color: var(--fg);
}

.modal-body ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.modal-body code {
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(11, 13, 18, 0.06);
}

.copy-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 8px;
}

.kbd {
  font-family:
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    "Liberation Mono",
    "Courier New",
    monospace;
}

/* 移动端：切换为 Tab 模式，避免纵向溢出 */
.product-tabs {
  display: none;
}

.tab-bar {
  display: flex;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.60);
  width: fit-content;
}

.tab {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 10px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
  color: var(--muted);
}

.tab[aria-selected="true"] {
  background: var(--accent-weak);
  color: var(--accent);
}

.tab-panels {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.75);
  padding: 14px;
  box-shadow: var(--shadow);
}

@media (max-width: 780px) {
  .header-inner {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand lang"
      "nav nav";
    row-gap: 10px;
  }

  .brand {
    grid-area: brand;
  }
  .lang {
    grid-area: lang;
    justify-self: end;
  }
  .nav {
    grid-area: nav;
    justify-self: start;
  }

  :root {
    --header-h: 108px;
    --footer-h: 56px;
  }

  .product-grid {
    display: none;
  }

  .product-tabs {
    display: block;
  }
}

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

@media (max-height: 700px) {
  .main-inner {
    gap: 12px;
    padding: 14px 0;
  }

  .hero-subtitle {
    margin-top: 6px;
    font-size: 14px;
  }

  .card {
    min-height: 190px;
  }
}
