/* MoMCP — terminal design system */
:root {
  --bg-deep: #05080d;
  --bg-panel: #0f1419;
  --bg-elevated: #151c24;
  --border: rgba(148, 163, 184, 0.18);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --accent: #22c55e;
  --accent-dim: rgba(34, 197, 94, 0.15);
  --warn: #fbbf24;
  --error: #f87171;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --font-sans: "IBM Plex Sans", system-ui, sans-serif;
  --radius: 10px;
  --shadow-glow: 0 0 80px rgba(34, 197, 94, 0.06);
}

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

html {
  scroll-behavior: smooth;
  overflow-anchor: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg-deep);
  background-image:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(34, 197, 94, 0.08), transparent 55%),
    linear-gradient(180deg, var(--bg-deep) 0%, #080c12 100%);
}

body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  z-index: 9999;
  opacity: 0.45;
}

@media (prefers-reduced-motion: reduce) {
  body::before {
    display: none;
  }
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10000;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: #052e16;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 var(--radius) 0;
}

.skip-link:focus {
  left: 0;
}

.shell {
  width: 100%;
  max-width: min(1240px, calc(100vw - 1.25rem));
  margin: 0 auto;
  padding: 1.5rem clamp(0.65rem, 2.2vw, 1.35rem) 4rem;
}

.terminal-frame {
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  background: var(--bg-panel);
  box-shadow: var(--shadow-glow), 0 24px 64px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.terminal-chrome {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}

.terminal-dots {
  display: flex;
  gap: 6px;
  margin-right: 0.5rem;
}

.terminal-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-close {
  background: #ef4444;
}
.dot-min {
  background: #fbbf24;
}
.dot-max {
  background: #22c55e;
}

.terminal-title {
  flex: 1;
  text-align: center;
  opacity: 0.85;
}

.terminal-body {
  padding: 1.35rem 1.35rem 1.75rem;
}

/* —— 页首：单一视觉层次（眉题 → 标题 → 副标题 → 概述 → 规格 → 目录）—— */
.site-hero {
  margin: 0;
  padding-bottom: 1.35rem;
  border-bottom: 1px solid var(--border);
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  margin: 0 0 0.65rem;
  opacity: 0.9;
}

.hero-title {
  font-family: var(--font-mono);
  font-size: clamp(1.85rem, 5vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  margin: 0 0 0.4rem;
  line-height: 1.12;
}

.hero-subtitle {
  font-family: var(--font-sans);
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--text-muted);
  margin: 0 0 1rem;
  line-height: 1.45;
  max-width: 42em;
}

.hero-tagline {
  font-family: var(--font-mono);
  font-size: clamp(0.88rem, 1.8vw, 1.02rem);
  color: var(--text);
  min-height: 2.35em;
  margin: 0 0 1.15rem;
  font-weight: 500;
  line-height: 1.55;
  max-width: 48em;
}

.hero-specs {
  list-style: none;
  margin: 0 0 1.15rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.55rem;
}

.hero-specs li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-muted);
  padding: 0.55rem 0.7rem;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.hero-specs li svg {
  flex-shrink: 0;
  margin-top: 1px;
  opacity: 0.75;
  color: var(--accent);
}

.hero-specs li span {
  flex: 1;
  min-width: 0;
}

.toc-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  margin: 0 0 0.55rem;
  opacity: 0.88;
}

.hero-tagline .cursor-blink {
  display: inline-block;
  width: 0.55ch;
  height: 1.15em;
  margin-left: 2px;
  vertical-align: -0.15em;
  background: var(--accent);
  animation: blink 1s step-end infinite;
}

@media (prefers-reduced-motion: reduce) {
  .hero-tagline .cursor-blink {
    animation: none;
    opacity: 1;
  }
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

#main {
  padding-top: 1.65rem;
}

.nav-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0;
}

.nav-pills a {
  font-family: var(--font-mono);
  font-size: 12px;
  text-decoration: none;
  color: var(--text-muted);
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.nav-pills a:hover {
  color: var(--text);
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.03);
}

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

section {
  scroll-margin-top: 1rem;
  margin-bottom: 0;
  padding-bottom: 2rem;
}

main > section + section {
  border-top: 1px solid var(--border);
  padding-top: 2rem;
  margin-top: 0;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin: 0 0 0.5rem;
}

h2 {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 1rem;
  color: var(--text);
}

.support-service-title {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  margin: 1.35rem 0 0.5rem;
  color: var(--text);
}

.support-service-title:first-of-type {
  margin-top: 0.85rem;
}

.support-lead {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 0.45rem;
  line-height: 1.6;
}

.support-example {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.9rem;
  background: #080b0f;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-left: 3px solid var(--accent);
  color: var(--text-muted);
}

.support-example strong {
  color: var(--accent);
  font-weight: 600;
}

.type-block {
  font-family: var(--font-sans);
  color: var(--text-muted);
  margin: 0 0 1rem;
}

.type-block strong {
  color: var(--text);
  font-weight: 600;
}

.type-block.done {
  color: var(--text);
}

ul.feature-list {
  margin: 0 0 1rem;
  padding-left: 1.15rem;
  color: var(--text-muted);
}

ul.feature-list li {
  margin-bottom: 0.45rem;
}

ul.feature-list li strong {
  color: var(--text);
}

.principle-box {
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.7;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin: 1rem 0;
  color: var(--text-muted);
}

.principle-box code {
  color: var(--warn);
  font-size: inherit;
}

pre.code-block {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  margin: 0.75rem 0 1rem;
  padding: 1rem 1.1rem;
  background: #080b0f;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  color: #e2e8f0;
}

pre.code-block .cmt {
  color: #64748b;
}

pre.code-block .kw {
  color: var(--accent);
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.65rem;
  background: var(--bg-elevated);
  overflow: hidden;
}

.faq-item summary {
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 0.85rem 1rem;
  cursor: pointer;
  list-style: none;
  color: var(--text);
  transition: background 0.2s ease;
}

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

.faq-item summary::before {
  content: ">";
  display: inline-block;
  width: 1.25rem;
  color: var(--accent);
  font-weight: 700;
  transition: transform 0.2s ease;
}

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

.faq-item summary:hover {
  background: rgba(255, 255, 255, 0.03);
}

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

.faq-answer {
  padding: 0 1rem 1rem 2.25rem;
  font-size: 14px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

.faq-answer p {
  margin: 0.75rem 0 0;
}

.faq-answer pre {
  margin-top: 0.65rem;
}

.footer-bar {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

.footer-bar a {
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.footer-bar a:hover {
  opacity: 0.85;
}

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

/* 回到顶部（右下角悬浮） */
.back-to-top {
  position: fixed;
  right: calc(clamp(0.65rem, 2.2vw, 1.25rem) + env(safe-area-inset-right, 0px));
  bottom: calc(clamp(0.75rem, 3vw, 1.35rem) + env(safe-area-inset-bottom, 0px));
  z-index: 10050;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--accent);
  cursor: pointer;
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    opacity 0.25s ease,
    visibility 0.25s ease,
    transform 0.25s ease,
    border-color 0.2s ease,
    background 0.2s ease,
    color 0.2s ease;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--bg-panel);
  border-color: rgba(34, 197, 94, 0.4);
  color: #4ade80;
}

.back-to-top:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.back-to-top svg {
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  .back-to-top {
    transform: none;
    transition: opacity 0.2s ease, visibility 0.2s ease, border-color 0.2s ease, background 0.2s ease,
      color 0.2s ease;
  }

  .back-to-top.is-visible {
    transform: none;
  }
}

/* ── 模型卡片网格 ── */
.model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.model-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.model-card:hover {
  border-color: rgba(34, 197, 94, 0.35);
}

.model-card-header {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  padding: 0.6rem 0.9rem;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid var(--border);
}

.model-card-body {
  padding: 0.65rem 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.model-card-body code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.3);
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  white-space: nowrap;
}
