/*
 * jky 软件官网统一样式
 * 设计基调：亮色、克制的开发者工具风，参考 CodeBlock 文档页的排版与配色。
 * 圆角只用下面这组 token：卡片 lg，按钮/输入框 md，小标签 xs/sm。
 */

:root {
  color-scheme: light;

  /* 亮色中性色，参考 CodeBlock 文档页：白底、浅灰分区、灰蓝边框 */
  --bg: #ffffff;
  --bg-soft: #f7f7f7;
  --surface: #ffffff;
  --surface-2: #eef1f5;
  --line: #d9dde3;
  --line-strong: #c5cbd4;
  --text: #222222;
  --muted: #5f6673;
  --faint: #8a8f98;

  /* 主色沿用文档页的蓝色，两个产品共用一套强调色 */
  --accent: #3d8bd6;
  --accent-hover: #2f78ba;
  --accent-soft: #eaf3fb;
  --redstone: #c0392b;
  --ok: #2e9e5b;
  --warn: #c9802a;
  --danger: #d9534f;

  /* 唯一的圆角尺度 */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 16px;

  /* 间距尺度 */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 72px;
  --sp-9: 96px;

  --max: 1120px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --shadow: 0 18px 40px -28px rgba(31, 45, 61, 0.22);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: #cfe2f5;
  color: var(--text);
}

a {
  color: inherit;
}

img {
  max-width: 100%;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--sp-5);
}

.hidden {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- 顶部导航 ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  color: var(--text);
  text-decoration: none;
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand-mark {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand small {
  display: block;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 400;
  color: var(--faint);
  letter-spacing: 0;
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

.nav a {
  padding: 7px var(--sp-3);
  border-radius: var(--r-sm);
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.nav a:hover {
  color: var(--text);
  background: var(--surface-2);
}

.nav a.active {
  color: var(--text);
  background: var(--accent-soft);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 9px var(--sp-4);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.nav-cta:hover {
  background: var(--surface-2);
  border-color: var(--line-strong);
}

/* ---------- 通用文字 ---------- */

.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

h1,
h2,
h3 {
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.18;
}

h1 {
  margin-top: var(--sp-4);
  font-size: clamp(2rem, 5vw, 3.4rem);
  letter-spacing: -0.035em;
  line-height: 1.08;
}

h2 {
  font-size: clamp(1.55rem, 3vw, 2.1rem);
}

h3 {
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.lead {
  margin-top: var(--sp-4);
  max-width: 58ch;
  color: var(--muted);
  font-size: 1.0625rem;
}

.section-head {
  max-width: 640px;
  margin-bottom: var(--sp-6);
}

.section-head p {
  margin-top: var(--sp-2);
  color: var(--muted);
  font-size: 15px;
}

.muted {
  color: var(--muted);
}

.faint {
  color: var(--faint);
}

code {
  font-family: var(--mono);
  font-size: 0.92em;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: var(--surface-2);
  color: var(--text);
}

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 44px;
  padding: 10px var(--sp-4);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font: 600 15px/1.2 var(--font);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

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

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--text);
}

.btn-ghost:hover {
  background: var(--surface-2);
  border-color: var(--line-strong);
}

.btn[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
}

.btn-block {
  width: 100%;
}

/* ---------- 首页 ---------- */

.hero {
  padding: var(--sp-9) 0 var(--sp-7);
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
}

.hero-split {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: var(--sp-8);
  align-items: center;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-top: var(--sp-6);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  margin-top: var(--sp-7);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 13px;
}

.hero-meta b {
  color: var(--text);
  font-weight: 600;
}

.stack-visual {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.stack-row {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-5);
}

.stack-row + .stack-row {
  border-top: 1px solid var(--line);
}

.stack-icon {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
  overflow: hidden;
}

.stack-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stack-text h3 {
  font-size: 15px;
}

.stack-text p {
  margin-top: 2px;
  color: var(--faint);
  font-size: 13px;
}

.stack-pill {
  margin-left: auto;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  color: var(--faint);
  font: 11px/1.6 var(--mono);
}

/* 产品入口 */

.products {
  padding: var(--sp-8) 0;
  border-top: 1px solid var(--line);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-5);
}

.product-card {
  display: flex;
  flex-direction: column;
  padding: var(--sp-6);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.product-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.product-card:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}

.product-head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.product-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
  overflow: hidden;
}

.product-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

.product-card h2 {
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.product-card > p {
  margin-top: var(--sp-2);
  color: var(--muted);
  font-size: 14.5px;
}

.product-points {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
  list-style: none;
}

.product-points li {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
}

.product-shot {
  margin-top: var(--sp-5);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--line);
}

.product-shot img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: center top;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}

.product-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: var(--sp-4);
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}

/* ---------- 区块 ---------- */

.section {
  padding: var(--sp-8) 0;
  border-top: 1px solid var(--line);
}

.section-tight {
  padding: var(--sp-7) 0;
}

.feature-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--line);
  overflow: hidden;
}

.feature {
  padding: var(--sp-5) var(--sp-6);
  background: var(--surface);
}

.feature h3 {
  margin-bottom: 6px;
}

.feature p {
  color: var(--muted);
  font-size: 14px;
}

.notice {
  display: flex;
  gap: var(--sp-4);
  padding: var(--sp-5);
  border: 1px solid var(--line);
  border-left: 3px solid var(--warn);
  border-radius: var(--r-lg);
  background: #fdf4f4;
}

.notice h3 {
  font-size: 15px;
}

.notice p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- 产品页 ---------- */

.hero-product {
  padding: var(--sp-8) 0 var(--sp-7);
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
}

.product-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--sp-7);
  align-items: center;
}

.screens {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-2);
}

.screens img {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  object-position: center top;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}

/* 下载区 */

.download-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.download-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--sp-5);
  align-items: center;
  padding: var(--sp-5) var(--sp-6);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.download-row h3 {
  font-size: 16px;
}

.download-row p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13.5px;
}

.dl-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: var(--sp-3);
  color: var(--faint);
  font-size: 12px;
}

.dl-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--faint);
}

.dl-status.is-ready {
  color: var(--ok);
}

.dl-status.is-ready::before {
  background: var(--ok);
}

.dl-status.is-missing {
  color: var(--warn);
}

.dl-status.is-missing::before {
  background: var(--warn);
}

.dl-status.is-deprecated {
  color: var(--danger);
}

.dl-status.is-deprecated::before {
  background: var(--danger);
}

.stop-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  margin-left: 6px;
  border: 1px solid #f0c4c4;
  border-radius: var(--r-xs);
  background: #fdecec;
  color: var(--danger);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  vertical-align: middle;
}

.dl-note {
  margin-top: var(--sp-4);
  color: var(--faint);
  font-size: 12.5px;
}

/* CodeBlock：代码块保持深色，和文档页的 pre.code 一致 */

.terminal {
  border: 1px solid #2a3140;
  border-radius: var(--r-lg);
  background: #0f1218;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px var(--sp-4);
  border-bottom: 1px solid #2a3140;
  background: #161b22;
  color: #8b949e;
  font: 12px/1 var(--mono);
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #3a4250;
}

.dot.red {
  background: #e06c75;
}

.dot.yellow {
  background: #e5c07b;
}

.dot.green {
  background: #98c379;
}

.terminal-title {
  margin-left: var(--sp-2);
  color: #8b949e;
}

.terminal pre {
  margin: 0;
  padding: var(--sp-5);
  overflow-x: auto;
  color: #c9d3e3;
  font: 13px/1.7 var(--mono);
}

.tok-comment {
  color: #6f7a8d;
}

.tok-key {
  color: #8fb0ff;
}

.tok-str {
  color: #9dd49d;
}

.tok-fn {
  color: #e5b567;
}

.tok-num {
  color: #8fd6d0;
}

/* ---------- 页脚 ---------- */

.site-footer {
  padding: var(--sp-7) 0;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 13px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--sp-4);
}

.footer-inner a {
  color: var(--muted);
  text-decoration: none;
}

.footer-inner a:hover {
  color: var(--text);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
}

/* ---------- CodeBlock 内嵌接口文档 ---------- */

#docs .docs-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-bottom: var(--sp-6);
}

#docs .docs-toc a {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
}

#docs .docs-toc a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

#docs .docs-block {
  padding: 8px 0 28px;
  border-bottom: 1px dashed var(--line);
  scroll-margin-top: 80px;
}

#docs .docs-block:last-child {
  border-bottom: 0;
}

#docs .doc-wrap {
  max-width: none;
  padding: 0;
  overflow-x: auto;
}

#docs .docs-h2 {
  margin: 6px 0 10px;
  font-size: 1.55rem;
  letter-spacing: -0.01em;
}

#docs .docs-sub {
  margin-bottom: var(--sp-4);
  color: var(--muted);
}

#docs h3.api-h {
  margin: 26px 0 10px;
  font-size: 1.05rem;
}

#docs p.doc-p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.85;
}

#docs ul.doc-ul {
  margin: 0 0 14px 20px;
  color: var(--muted);
  line-height: 1.9;
}

#docs ul.doc-ul li {
  margin-bottom: 4px;
}

#docs .api-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 18px;
  font-size: 13.5px;
}

#docs .api-table th,
#docs .api-table td {
  padding: 8px 10px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

#docs .api-table th {
  background: var(--surface-2);
  font-weight: 700;
}

#docs .api-table td code {
  white-space: nowrap;
}

#docs pre.code {
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: 6px;
  background: #0f1218;
  color: #e6e6e6;
  overflow: auto;
  font: 13px/1.65 var(--mono);
}

#docs pre.code code {
  font-family: var(--mono);
  white-space: pre;
}

#docs code.inl {
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 13px;
}

#docs .note {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-left: 4px solid #3d8bd6;
  background: #f4f8fd;
  color: var(--text);
  line-height: 1.8;
}

#docs .note--warn {
  border-left-color: #d9534f;
  background: #fdf4f4;
}

#docs .note--ok {
  border-left-color: #3a8f5a;
  background: #f4fcf6;
}

#docs .note strong {
  color: #111;
}

#docs .tag {
  display: inline-block;
  margin-left: 6px;
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
}

#docs .tag--ok {
  background: #2e9e5b;
  color: #fff;
}

#docs .tag--plan {
  background: #8a8f98;
  color: #fff;
}

#docs .tag--chg {
  background: #c9802a;
  color: #fff;
}

#docs .k { color: #3d7bd6; }
#docs .s { color: #4f8f4f; }
#docs .c { color: #8a94a3; font-style: italic; }
#docs .f { color: #b5791c; }

/* ---------- 后台 Markdown 文档渲染 ---------- */

.doc-render {
  max-width: 820px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.85;
}

.doc-render h1,
.doc-render h2,
.doc-render h3 {
  margin: var(--sp-6) 0 var(--sp-3);
  letter-spacing: -0.01em;
}

.doc-render h1 {
  font-size: 1.5rem;
}

.doc-render h2 {
  font-size: 1.25rem;
}

.doc-render h3 {
  font-size: 1.05rem;
}

.doc-render p {
  margin-bottom: var(--sp-3);
  color: var(--muted);
}

.doc-render ul {
  margin: 0 0 var(--sp-3) var(--sp-5);
  color: var(--muted);
}

.doc-render li {
  margin-bottom: 4px;
}

.doc-render code {
  padding: 1px 5px;
  border-radius: var(--r-xs);
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 13px;
}

.doc-render pre {
  margin-bottom: var(--sp-4);
  padding: var(--sp-4);
  border-radius: var(--r-md);
  background: #0f1218;
  color: #e6e6e6;
  overflow: auto;
  font: 13px/1.65 var(--mono);
}

.doc-render pre code {
  padding: 0;
  background: none;
  color: inherit;
}

.doc-render a {
  color: var(--accent);
}

/* ---------- 响应式 ---------- */

@media (max-width: 900px) {
  .hero-split,
  .product-layout {
    grid-template-columns: 1fr;
    gap: var(--sp-7);
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .stack-visual {
    max-width: 520px;
  }

  .nav {
    display: none;
  }
}

@media (max-width: 640px) {
  .wrap {
    padding: 0 var(--sp-4);
  }

  .header-inner {
    height: 60px;
  }

  .brand small {
    display: none;
  }

  .hero,
  .hero-product {
    padding: var(--sp-7) 0 var(--sp-6);
  }

  .section {
    padding: var(--sp-7) 0;
  }

  .feature-list {
    grid-template-columns: 1fr;
  }

  .download-row {
    grid-template-columns: 1fr;
    align-items: stretch;
    padding: var(--sp-5);
  }

  .download-row .btn {
    width: 100%;
  }

  .product-card {
    padding: var(--sp-5);
  }

  .footer-inner {
    flex-direction: column;
  }
}

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