/* 与 api/web 现有页面类似的清爽中性色，支持 prefers-color-scheme */
:root {
  --bg: #f0f4f8;
  --bg-alt: #e8eef5;
  --surface: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --border: #e2e8f0;
  --accent: #0f766e;
  --accent-hover: #0d9488;
  --warn-bg: #fffbeb;
  --warn-border: #fcd34d;
  --warn-text: #92400e;
  --focus: #0ea5e9;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;
    --bg-alt: #1e293b;
    --surface: #1e293b;
    --text: #f1f5f9;
    --muted: #94a3b8;
    --border: #334155;
    --accent: #2dd4bf;
    --accent-hover: #5eead4;
    --warn-bg: #422006;
    --warn-border: #b45309;
    --warn-text: #fde68a;
    --focus: #38bdf8;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
  z-index: 100;
  text-decoration: none;
  border-radius: 0 0 8px 0;
}

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

.inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 18px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.site-header .inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  padding-bottom: 14px;
}

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

.logo:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  font-size: 14px;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
}

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

.nav a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

.hero {
  padding: 48px 0 40px;
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  max-width: 720px;
}

.hero-kicker {
  margin: 0 0 8px;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  line-height: 1.2;
}

.hero-lead {
  margin: 0 0 12px;
  font-size: 1.05rem;
  color: var(--text);
}

.hero-note {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.section {
  padding: 40px 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section h2 {
  margin: 0 0 16px;
  font-size: 1.35rem;
  font-weight: 650;
}

.section h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 600;
}

.lead {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 15px;
}

.grid {
  display: grid;
  gap: 16px;
}

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

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

@media (min-width: 700px) {
  .grid.two {
    grid-template-columns: 1fr 1fr;
  }

  .grid.three {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

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

.card p + p {
  margin-top: 10px;
}

.repo-hint {
  margin: 20px 0 8px;
  font-size: 14px;
  color: var(--muted);
}

.link-list {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--muted);
  font-size: 14px;
}

.link-list code {
  font-size: 13px;
}

.muted {
  color: var(--muted);
  font-size: 14px;
  margin: 12px 0 0;
}

.feature-list {
  margin: 0;
  padding-left: 1.25rem;
  max-width: 820px;
}

.feature-list li {
  margin-bottom: 10px;
}

.feature-list li:last-child {
  margin-bottom: 0;
}

.probe-msg {
  margin: 0 0 12px;
  font-size: 14px;
}

.demo-card {
  margin-top: 20px;
}

.card-spaced-top {
  margin-top: 16px;
}

.warn-card {
  margin-top: 16px;
  background: var(--warn-bg);
  border-color: var(--warn-border);
}

.warn-card h3 {
  color: var(--warn-text);
}

.warn-card .muted {
  color: color-mix(in srgb, var(--warn-text) 75%, var(--muted));
}

#demo-offline-text {
  margin: 0 0 12px;
  color: var(--warn-text);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.btn {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
}

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

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

.btn.primary:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.code-block {
  margin: 0;
  padding: 14px 16px;
  background: color-mix(in srgb, var(--surface) 85%, var(--bg));
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
  overflow-x: auto;
}

code {
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.9em;
  padding: 1px 5px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--surface) 70%, var(--border));
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 15px;
}

.contact-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.contact-list li:last-child {
  border-bottom: none;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0 40px;
  font-size: 13px;
  color: var(--muted);
}

.footer-inner p {
  margin: 0;
}

/* 长文说明与折叠块 */
.explain {
  margin: 0 0 16px;
  font-size: 15px;
  max-width: 52rem;
}

.explain:last-child {
  margin-bottom: 0;
}

.explain strong {
  font-weight: 650;
  color: var(--text);
}

.step-list {
  margin: 8px 0 0;
  padding-left: 1.25rem;
  font-size: 15px;
}

.step-list li {
  margin-bottom: 8px;
}

.step-list li:last-child {
  margin-bottom: 0;
}

details.expend {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px 12px;
  background: color-mix(in srgb, var(--surface) 88%, var(--bg));
}

details.expend summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: var(--accent);
  list-style-position: outside;
}

details.expend summary::-webkit-details-marker {
  color: var(--muted);
}

details.expend .expend-body {
  margin-top: 10px;
  font-size: 14px;
  color: var(--text);
  line-height: 1.65;
}

details.expend .expend-body p {
  margin: 0 0 10px;
}

details.expend .expend-body p:last-child {
  margin-bottom: 0;
}

details.expend ul {
  margin: 8px 0 0;
  padding-left: 1.2rem;
}

details.expend li {
  margin-bottom: 6px;
}

.reading-grid {
  display: grid;
  gap: 14px;
  margin-top: 8px;
}

@media (min-width: 640px) {
  .reading-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.reading-card {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
}

.reading-card h3 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 650;
  color: var(--text);
}

.reading-card p {
  margin: 0;
  color: var(--muted);
}

.card .detail-line {
  margin-top: 10px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55;
}
