/* SpaceModal / GraphSpace — 站点样式 */

:root {
  --bg: #0f1419;
  --bg-elevated: #1a2332;
  --bg-card: #1e2a3a;
  --text: #e8edf4;
  --text-muted: #94a3b8;
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.15);
  --product: #10b981;
  --product-soft: rgba(16, 185, 129, 0.15);
  --border: #2d3a4d;
  --radius: 12px;
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "Cascadia Code", "Consolas", monospace;
  --max-width: 960px;
  --touch-min: 44px;
  --header-h: 3.5rem;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
  -webkit-tap-highlight-color: rgba(59, 130, 246, 0.2);
}

body.nav-scroll-lock {
  overflow: hidden;
  touch-action: none;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  width: min(100% - 2rem, var(--max-width));
  margin: 0 auto;
  padding-left: max(0px, var(--safe-left));
  padding-right: max(0px, var(--safe-right));
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(15, 20, 25, 0.9);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  gap: 1rem;
}

.logo {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
}

.logo span { color: var(--accent); }

.nav {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.nav a {
  color: var(--text-muted);
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
  text-decoration: none;
}

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

/* 移动端导航 */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: var(--touch-min);
  height: var(--touch-min);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elevated);
  cursor: pointer;
  flex-shrink: 0;
}

.nav-toggle-bar {
  display: block;
  width: 18px;
  height: 2px;
  margin: 0 auto;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}

.site-header.nav-open .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.site-header.nav-open .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.site-header.nav-open .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-backdrop {
  display: none;
}

/* Hero */
.hero {
  padding: 4rem 0 3rem;
}

.hero-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  line-height: 1.2;
  margin: 0 0 1rem;
  font-weight: 700;
}

.hero .subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 36em;
  margin: 0 0 1.5rem;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

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

.btn-primary:hover {
  background: #2563eb;
  text-decoration: none;
  color: #fff;
}

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

.btn-secondary:hover {
  border-color: var(--accent);
  text-decoration: none;
  color: var(--text);
}

.btn-product {
  background: var(--product);
  color: #fff;
}

.btn-product:hover {
  background: #059669;
  text-decoration: none;
  color: #fff;
}

/* Sections */
section { padding: 2.5rem 0; }

section h2 {
  font-size: 1.35rem;
  margin: 0 0 1.25rem;
  font-weight: 600;
}

.section-lead {
  color: var(--text-muted);
  margin: -0.75rem 0 1.5rem;
  max-width: 40em;
}

/* Cards grid */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.card h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.card .step-num {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

/* Pipeline */
.pipeline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

.pipeline span {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
}

.pipeline .arrow { color: var(--text-muted); }

/* Content page */
.page-header {
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.page-header h1 { margin: 0 0 0.5rem; font-size: 1.75rem; }

.page-header .meta {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.prose h2 { font-size: 1.2rem; margin: 2rem 0 0.75rem; }
.prose h3 { font-size: 1.05rem; margin: 1.5rem 0 0.5rem; }
.prose p { margin: 0 0 1rem; color: var(--text-muted); }
.prose ul, .prose ol { color: var(--text-muted); padding-left: 1.25rem; }
.prose li { margin-bottom: 0.35rem; }

.prose blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text);
}

.code-block {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 1rem 0;
}

.status-badge {
  display: inline-block;
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-weight: 500;
}

.status-draft { background: rgba(234, 179, 8, 0.15); color: #fbbf24; }
.status-soon { background: var(--accent-soft); color: var(--accent); }
.status-live { background: var(--product-soft); color: var(--product); }

/* Product highlight */
.product-banner {
  background: linear-gradient(135deg, var(--product-soft), var(--accent-soft));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin: 2rem 0;
}

.product-banner h2 { margin-top: 0; }

.feature-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.feature-list li {
  padding: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
  color: var(--text-muted);
}

.feature-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--product);
  font-weight: 700;
}

/* Footer */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links { display: flex; gap: 1rem; flex-wrap: wrap; }
.footer-links a { color: var(--text-muted); }

.logo-sub {
  display: block;
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.tag {
  display: inline-block;
  font-size: 0.8rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.privacy-notice {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid rgba(234, 179, 8, 0.35);
  background: rgba(234, 179, 8, 0.08);
  color: var(--text);
}

.privacy-notice strong { color: #fbbf24; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin: 1.25rem 0;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}

.metric-card .value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent);
}

.metric-card .label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 1rem 0;
}

.compare-table th,
.compare-table td {
  border: 1px solid var(--border);
  padding: 0.65rem 0.85rem;
  text-align: left;
}

.compare-table th {
  background: var(--bg-elevated);
  color: var(--text);
}

.compare-table td { color: var(--text-muted); }

.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1rem 0;
}

.table-scroll .compare-table {
  min-width: 520px;
  margin: 0;
}

.link-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Breadcrumb */
.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
}

.breadcrumb a {
  color: var(--text-muted);
}

.breadcrumb a:hover {
  color: var(--accent);
}

/* AI search */
.ai-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1.5rem;
  align-items: start;
}

.search-box-main {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  margin-bottom: 1rem;
}

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

.search-results {
  list-style: none;
  padding: 0;
  margin: 0;
}

.search-result-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin-bottom: 0.5rem;
  background: var(--bg-card);
}

.search-result-item a {
  font-weight: 600;
  text-decoration: none;
}

.search-result-item a:hover {
  text-decoration: underline;
}

.search-result-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.search-tag {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-right: 0.35rem;
}

.ai-chat-panel {
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  position: sticky;
  top: 5rem;
}

.ai-chat-panel h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.migrate-notice {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: var(--accent-soft);
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  .ai-layout {
    grid-template-columns: 1fr;
  }
  .ai-chat-panel {
    position: static;
  }

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

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

/* 手机端 — 移动优先断点 */
@media (max-width: 768px) {
  .container {
    width: min(100% - 1.25rem, var(--max-width));
  }

  .header-inner {
    flex-wrap: nowrap;
    align-items: center;
    padding: 0.65rem 0;
    padding-top: calc(0.65rem + var(--safe-top));
  }

  .logo {
    font-size: 1rem;
    flex: 1;
    min-width: 0;
  }

  .logo-sub {
    font-size: 0.62rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 12rem;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 199;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
  }

  .nav {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 200;
    width: min(280px, 88vw);
    height: 100dvh;
    height: 100vh;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    padding: calc(var(--header-h) + var(--safe-top)) 1rem calc(1rem + var(--safe-bottom));
    background: var(--bg-elevated);
    border-left: 1px solid var(--border);
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.45);
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.23, 1, 0.32, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .site-header.nav-open .nav {
    transform: translateX(0);
  }

  .nav a {
    font-size: 1rem;
    padding: 0.85rem 1rem;
    min-height: var(--touch-min);
    display: flex;
    align-items: center;
    border-radius: 10px;
  }

  .hero {
    padding: 2rem 0 1.75rem;
  }

  .hero h1 {
    font-size: clamp(1.65rem, 8vw, 2.25rem);
  }

  .hero .subtitle {
    font-size: 1rem;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .btn {
    width: 100%;
    justify-content: center;
    min-height: var(--touch-min);
  }

  section {
    padding: 1.75rem 0;
  }

  .page-header {
    padding: 1.5rem 0 1rem;
    margin-bottom: 1.25rem;
  }

  .page-header h1 {
    font-size: 1.45rem;
  }

  .page-header .meta {
    font-size: 0.82rem;
    line-height: 1.5;
  }

  .breadcrumb {
    font-size: 0.78rem;
    line-height: 1.45;
  }

  .pipeline {
    gap: 0.4rem;
    font-size: 0.82rem;
  }

  .pipeline span {
    padding: 0.45rem 0.65rem;
  }

  .product-banner {
    padding: 1.25rem;
  }

  .btn {
    min-height: var(--touch-min);
    padding: 0.75rem 1.15rem;
  }

  .search-box-main {
    font-size: 16px;
    min-height: var(--touch-min);
    padding: 0.85rem 1rem;
  }

  .site-footer {
    padding: 1.25rem 0 calc(1.25rem + var(--safe-bottom));
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .footer-links {
    gap: 0.75rem 1rem;
  }

  .footer-links a,
  .fold-sound-toggle {
    min-height: var(--touch-min);
    display: inline-flex;
    align-items: center;
  }

  .code-block {
    font-size: 0.75rem;
    padding: 0.85rem;
  }

  .prose blockquote {
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }

  .privacy-notice {
    font-size: 0.88rem;
    padding: 0.85rem 1rem;
  }
}
