/* 球小策 Studio 官网着陆页样式（浅色晨光草坪基线 · 零外部依赖） */

:root {
  color-scheme: light;
  --brand: #16a34a;
  --brand-strong: #15803d;
  --brand-soft: #e8f6ec;
  --brand-softer: #f2faf4;
  --brand-ring: rgba(22, 163, 74, 0.24);

  --bg: #eef2ea;
  --bg-subtle: #f5f8f2;
  --surface: #ffffff;
  --surface-2: #fbfcfa;
  --muted: #e9eee5;

  --text: #1c2b22;
  --text-secondary: #506357;
  --text-tertiary: #73867a;
  --text-on-brand: #ffffff;

  --border: #dfe6da;
  --border-strong: #c8d3c3;

  --code-bg: #18251e;
  --code-text: #eef6f0;
  --code-muted: #9eb5a6;

  --shadow-sm: 0 1px 2px rgba(28, 43, 34, 0.05);
  --shadow-md: 0 4px 14px rgba(28, 43, 34, 0.07), 0 1px 3px rgba(28, 43, 34, 0.04);
  --radius: 12px;
  --radius-lg: 16px;
  --radius-sm: 8px;
  --container: 1120px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--bg);
  background-image: radial-gradient(circle at 12% 0%, #f6faf3 0%, var(--bg) 52%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--brand-strong);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* 顶部导航 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--brand-soft);
  border: 1px solid #cde8d5;
  color: var(--brand-strong);
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--brand-strong);
  text-decoration: none;
}

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

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
  text-decoration: none;
}

.btn:hover {
  text-decoration: none;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
}

.btn-primary {
  background: var(--brand);
  color: var(--text-on-brand);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--brand-strong);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: var(--brand);
}

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

.btn-ghost:hover {
  background: var(--surface);
  color: var(--text);
}

/* Hero 首屏 */
.hero {
  padding: 56px 0 48px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 36px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--brand-soft);
  border: 1px solid #cbe7d3;
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 18px;
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
}

.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(27px, 3.2vw, 38px);
  line-height: 1.24;
  letter-spacing: -0.02em;
  color: var(--text);
}

.hero-lead {
  margin: 0 0 24px;
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 58ch;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding: 0;
  margin: 0;
  list-style: none;
  font-size: 13px;
  color: var(--text-secondary);
}

.hero-meta li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hero-meta .check {
  color: var(--brand-strong);
  font-weight: 700;
}

/* 右侧产品工作流预览卡 */
.preview-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.preview-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-secondary);
}

.preview-dots {
  display: inline-flex;
  gap: 6px;
}

.preview-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--border-strong);
}

.preview-badge {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-weight: 600;
}

.preview-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.flow-step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
}

.flow-num {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flow-step h3 {
  margin: 0 0 3px;
  font-size: 14px;
  color: var(--text);
}

.flow-step p {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* 通用区块 */
.section {
  padding: 52px 0;
}

.section-alt {
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-head {
  max-width: 680px;
  margin-bottom: 28px;
}

.section-head h2 {
  margin: 0 0 8px;
  font-size: clamp(24px, 3vw, 30px);
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.section-head p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 15px;
}

/* 网格与卡片 */
.card-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

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

.card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  margin-bottom: 14px;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.35;
}

.card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--muted);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
}

/* 架构与数据源 */
.arch-list {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.arch-list li {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 14px;
}

.arch-list strong {
  color: var(--text);
}

.arch-list span {
  display: block;
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 2px;
}

/* 快速上手代码块 */
.code-card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.code-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.code-card-head h3 {
  margin: 0;
  font-size: 16px;
}

.copy-btn {
  padding: 5px 11px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.copy-btn:hover {
  border-color: var(--brand);
  color: var(--brand-strong);
}

.copy-btn.copied {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand-strong);
}

pre.cmd-block {
  margin: 0;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--code-bg);
  color: var(--code-text);
  font-size: 13px;
  line-height: 1.6;
  overflow-x: auto;
}

.code-note {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.callout {
  margin-top: 20px;
  padding: 16px 20px;
  border-radius: var(--radius);
  background: var(--brand-softer);
  border: 1px solid #cce7d4;
  font-size: 14px;
  color: var(--text);
}

.callout strong {
  color: var(--brand-strong);
}

/* 零门槛 AI 代装绿色引导卡 */
.ai-deploy-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 26px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #e7f6ec 0%, #f3fbf5 100%);
  border: 1.5px solid #9ad3ad;
  box-shadow: var(--shadow-md);
}

.ai-deploy-main {
  min-width: 0;
  flex: 1;
}

.ai-deploy-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--brand);
  color: var(--text-on-brand);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 10px;
}

.ai-deploy-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 1.35;
  color: var(--text);
}

.ai-deploy-card p {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 66ch;
}

.ai-deploy-card .tag {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid #cce7d4;
  color: var(--brand-strong);
}

.ai-deploy-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  flex-shrink: 0;
  min-width: 196px;
}

.key-prep-note {
  margin-top: 16px;
  line-height: 1.7;
}

/* 开发者手动命令折叠区 */
.dev-details {
  margin-top: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
}

.dev-details summary {
  padding: 13px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dev-details summary::-webkit-details-marker {
  display: none;
}

.dev-details summary::before {
  content: "▸";
  display: inline-block;
  color: var(--brand-strong);
  transition: transform 160ms ease;
}

.dev-details[open] summary::before {
  transform: rotate(90deg);
}

.dev-details summary:hover {
  color: var(--brand-strong);
  background: var(--surface-2);
}

.dev-details-body {
  padding: 4px 18px 18px;
  border-top: 1px solid var(--border);
}

/* 任务书弹窗 */
body.modal-open {
  overflow: hidden;
}

.ai-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(18, 30, 22, 0.56);
  backdrop-filter: blur(4px);
}

.ai-modal-backdrop[hidden] {
  display: none;
}

.ai-modal-dialog {
  width: 100%;
  max-width: 760px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(15, 28, 20, 0.22);
  overflow: hidden;
}

.ai-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  background: var(--brand-softer);
  border-bottom: 1px solid #cce7d4;
}

.ai-modal-head h3 {
  margin: 0 0 4px;
  font-size: 18px;
  color: var(--text);
}

.ai-modal-head p {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.ai-modal-close {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.ai-modal-close:hover {
  color: var(--text);
  border-color: var(--brand);
}

.ai-modal-body {
  padding: 18px 22px;
  overflow-y: auto;
  flex: 1;
}

pre.ai-prompt-box {
  margin: 0;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: var(--code-bg);
  color: var(--code-text);
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.ai-modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
}

/* 仓库与下载 */
.release-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
}

.release-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #fdf3e3;
  color: #9a4708;
  font-size: 12px;
  font-weight: 600;
  width: fit-content;
}

.release-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mono-url {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--muted);
  color: var(--text);
  font-size: 13px;
  word-break: break-all;
}

/* 常见问题 */
.faq-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.faq-item {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.faq-item h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.faq-item p {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
}

/* 页脚 */
.site-footer {
  padding: 34px 0 44px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  color: var(--text-secondary);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.disclaimer {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-tertiary);
}

/* 响应式 */
@media (max-width: 960px) {
  .hero-grid,
  .card-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 720px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 24px 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
  }

  .nav-links.open {
    display: flex;
  }

  .header-actions .btn-ghost {
    display: none;
  }

  .card-grid-3,
  .card-grid-2,
  .faq-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 36px 0 32px;
  }

  .section {
    padding: 38px 0;
  }

  .ai-deploy-card {
    flex-direction: column;
    align-items: stretch;
    padding: 20px;
  }

  .ai-deploy-actions {
    min-width: 0;
  }

  .ai-modal-backdrop {
    padding: 12px;
  }

  .ai-modal-head,
  .ai-modal-body,
  .ai-modal-foot {
    padding-left: 16px;
    padding-right: 16px;
  }
}
