/* =====================================================================
   SEOXPRTS — Modern SaaS Gradient Design System
   设计语言：浅色底 + 渐变主色(Indigo→Violet) + 大圆角 + 柔和阴影 + 轻插画
   约束：纯 CSS / 原生 JS，无框架；状态不依赖单一颜色（配图标/文字）
   范围：仅工具业务（不含资讯、文章、单页等 CMS 内容样式）
   ===================================================================== */

:root {
  --sx-bg: #f6f7fb;
  --sx-surface: #ffffff;
  --sx-surface-2: #f7f8fc;
  --sx-primary: #4f46e5;
  --sx-primary-700: #4338ca;
  --sx-violet: #7c3aed;
  --sx-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #9333ea 100%);
  --sx-gradient-soft: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);
  --sx-accent: #0ea5e9;
  --sx-success: #10b981;
  --sx-success-bg: #ecfdf5;
  --sx-warn: #f59e0b;
  --sx-warn-bg: #fffbeb;
  --sx-danger: #ef4444;
  --sx-danger-bg: #fef2f2;
  --sx-text: #0f172a;
  --sx-text-2: #334155;
  --sx-muted: #64748b;
  --sx-border: #e6e8ef;
  --sx-border-strong: #d6dae6;
  --sx-radius-sm: 10px;
  --sx-radius: 16px;
  --sx-radius-lg: 24px;
  --sx-radius-xl: 32px;
  --sx-shadow-sm: 0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.05);
  --sx-shadow: 0 10px 30px -12px rgba(79,70,229,.20), 0 4px 12px -6px rgba(15,23,42,.08);
  --sx-shadow-lg: 0 30px 70px -24px rgba(79,70,229,.40);
  --sx-ring: 0 0 0 4px rgba(99,102,241,.18);
  --sx-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sx-maxw: 1160px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.sx-body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--sx-bg);
  color: var(--sx-text);
  line-height: 1.62;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { color: var(--sx-text); line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(28px, 4vw, 44px); font-weight: 800; }
h2 { font-size: clamp(22px, 2.6vw, 30px); font-weight: 700; }
h3 { font-size: 18px; font-weight: 650; }
p { margin: 0 0 1em; color: var(--sx-text-2); }

a { color: var(--sx-primary); text-decoration: none; transition: color .15s; }
a:hover { text-decoration: underline; }

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

/* ===================== Header ===================== */
.sx-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--sx-border);
}
.sx-header .sx-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.sx-logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; color: var(--sx-text); letter-spacing: -0.02em; }
.sx-logo img { height: 30px; width: auto; border-radius: 8px; }
.sx-logo span span { background: var(--sx-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sx-nav { display: flex; align-items: center; gap: 28px; }
.sx-nav a { color: var(--sx-text-2); font-weight: 500; font-size: 15px; }
.sx-nav a:hover { color: var(--sx-primary); text-decoration: none; }
.sx-header-cta {
  background: var(--sx-gradient); color: #fff !important; padding: 9px 18px; border-radius: 999px;
  box-shadow: var(--sx-shadow-sm); font-weight: 600; white-space: nowrap;
}
.sx-header-cta:hover { text-decoration: none; box-shadow: var(--sx-shadow); transform: translateY(-1px); }
@media (max-width: 760px) {
  .sx-nav a:not(.sx-header-cta) { display: none; }
}

/* ===================== Buttons ===================== */
.sx-btn, .sx-btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 600; font-size: 15px; min-height: 46px; padding: 12px 24px;
  border-radius: 999px; cursor: pointer; border: none; white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease;
}
.sx-btn { background: var(--sx-gradient); color: #fff; box-shadow: var(--sx-shadow-sm); }
.sx-btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--sx-shadow); }
.sx-btn:active { transform: translateY(0); }
.sx-btn-secondary { background: #fff; color: var(--sx-primary); border: 1.5px solid var(--sx-border-strong); }
.sx-btn-secondary:hover { text-decoration: none; border-color: var(--sx-primary); box-shadow: var(--sx-ring); }

/* ===================== Layout containers ===================== */
.sx-main { min-height: 60vh; padding: 8px 0 72px; }
.sx-section, .sx-tool-panel, .sx-cta-section { max-width: var(--sx-maxw); margin: 0 auto; padding: 44px 24px; }

/* ===================== Hero ===================== */
.sx-hero {
  position: relative; overflow: hidden;
  max-width: var(--sx-maxw); margin: 28px auto 0;
  background: var(--sx-gradient); color: #fff;
  border-radius: var(--sx-radius-lg); padding: 64px 56px;
  text-align: center; box-shadow: var(--sx-shadow-lg);
}
.sx-hero::before, .sx-hero::after {
  content: ""; position: absolute; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.28), transparent 62%);
}
.sx-hero::before { width: 460px; height: 460px; top: -200px; right: -150px; }
.sx-hero::after { width: 360px; height: 360px; bottom: -200px; left: -120px; background: radial-gradient(circle, rgba(255,255,255,.18), transparent 62%); }
.sx-hero > * { position: relative; z-index: 1; }
.sx-hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.05fr .95fr; gap: 44px; align-items: center; text-align: left; }
.sx-hero-copy { text-align: left; }
.sx-hero-art { display: flex; justify-content: center; align-items: center; }
.sx-hero-art svg { width: 100%; max-width: 440px; height: auto; filter: drop-shadow(0 24px 48px rgba(15,23,42,.30)); }
.sx-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.30);
  color: #fff; font-size: 13px; font-weight: 600; padding: 7px 14px; border-radius: 999px;
  backdrop-filter: blur(4px);
}
.sx-dot { width: 8px; height: 8px; border-radius: 50%; background: #6ee7b7; box-shadow: 0 0 0 4px rgba(110,231,183,.30); }
.sx-hero h1 { color: #fff; font-size: clamp(30px, 4.4vw, 50px); margin-bottom: .35em; }
.sx-hero p { color: rgba(255,255,255,.92); font-size: 18px; max-width: 640px; margin: 0 0 28px; }
@media (max-width: 880px) {
  .sx-hero { padding: 48px 28px; }
  .sx-hero-grid { grid-template-columns: 1fr; gap: 30px; text-align: center; }
  .sx-hero-copy { text-align: center; }
  .sx-hero p { margin-left: auto; margin-right: auto; }
  .sx-hero-actions { justify-content: center; }
}
.sx-hero-eyebrow { display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.85); margin-bottom: 14px; }
.sx-hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.sx-hero .sx-btn { background: #fff; color: var(--sx-primary); }
.sx-hero .sx-btn:hover { box-shadow: 0 12px 30px -10px rgba(0,0,0,.35); }
.sx-hero .sx-btn-secondary { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.45); }
.sx-hero .sx-btn-secondary:hover { background: rgba(255,255,255,.22); border-color: #fff; box-shadow: none; }

/* ===================== Section headings ===================== */
.sx-eyebrow {
  display: inline-block; font-size: 12.5px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--sx-primary); margin-bottom: 12px;
}
.sx-section-title { margin-bottom: 10px; }
.sx-section-sub { color: var(--sx-muted); font-size: 17px; max-width: 660px; margin-bottom: 30px; }

/* ===================== Cards / Tools grid ===================== */
.sx-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.sx-card {
  display: block; background: var(--sx-surface); border: 1px solid var(--sx-border);
  border-radius: var(--sx-radius); padding: 26px; color: inherit;
  box-shadow: var(--sx-shadow-sm); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.sx-card:hover { text-decoration: none; transform: translateY(-4px); box-shadow: var(--sx-shadow); border-color: transparent; }
.sx-icon {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  background: var(--sx-gradient-soft); color: var(--sx-primary); margin-bottom: 16px;
}
.sx-card h3 { color: var(--sx-text); margin-bottom: 6px; }
.sx-card p { color: var(--sx-muted); margin: 0; font-size: 15px; }

/* ===================== Features ===================== */
.sx-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.sx-feature {
  background: var(--sx-surface); border: 1px solid var(--sx-border); border-radius: var(--sx-radius);
  padding: 24px; box-shadow: var(--sx-shadow-sm);
}
.sx-feature .sx-icon { width: 42px; height: 42px; border-radius: 12px; margin-bottom: 14px; }
.sx-feature h3 { font-size: 17px; margin-bottom: 6px; }
.sx-feature p { color: var(--sx-muted); margin: 0; font-size: 15px; }

/* ===================== CTA band ===================== */
.sx-cta-section { text-align: center; }
.sx-cta-inner {
  background: var(--sx-gradient); color: #fff; border-radius: var(--sx-radius-lg);
  padding: 56px 40px; box-shadow: var(--sx-shadow-lg); position: relative; overflow: hidden;
}
.sx-cta-inner h2 { color: #fff; }
.sx-cta-inner p { color: rgba(255,255,255,.92); margin-bottom: 24px; }
.sx-cta-inner .sx-btn-secondary { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.45); }
.sx-cta-inner .sx-btn-secondary:hover { background: rgba(255,255,255,.24); border-color: #fff; box-shadow: none; }

/* ===================== Tool page ===================== */
.sx-tool-panel { padding-top: 36px; }
.sx-tool-header { margin-bottom: 28px; }
.sx-tool-header .sx-eyebrow { color: var(--sx-primary); }
.sx-tool-panel > .sx-eyebrow { color: var(--sx-primary); }
.sx-meta { color: var(--sx-muted); font-size: 16px; max-width: 720px; }
.sx-verified {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 14px;
  font-size: 13px; font-weight: 600; color: var(--sx-success);
  background: var(--sx-success-bg); border: 1px solid #bbf7d0; padding: 6px 12px; border-radius: 999px;
}
.sx-verified::before { content: "✓"; font-weight: 800; }

.sx-tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 860px) { .sx-tool-grid { grid-template-columns: 1fr; } }
.sx-tool-col {
  background: var(--sx-surface); border: 1px solid var(--sx-border); border-radius: var(--sx-radius);
  padding: 24px; box-shadow: var(--sx-shadow-sm);
}
.sx-tool-col label { display: block; font-weight: 600; font-size: 14px; color: var(--sx-text); margin: 16px 0 7px; }
.sx-tool-col label:first-child { margin-top: 0; }
.sx-tool-col input[type="text"], .sx-tool-col textarea, .sx-tool-col select {
  width: 100%; font: inherit; color: var(--sx-text); background: var(--sx-surface-2);
  border: 1.5px solid var(--sx-border); border-radius: var(--sx-radius-sm); padding: 11px 13px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.sx-tool-col textarea { resize: vertical; min-height: 92px; font-family: var(--sx-mono); font-size: 13.5px; }
.sx-tool-col input:focus, .sx-tool-col textarea:focus, .sx-tool-col select:focus {
  outline: none; border-color: var(--sx-primary); background: #fff; box-shadow: var(--sx-ring);
}
.sx-count { font-size: 12.5px; color: var(--sx-muted); margin-top: 6px; }

/* device toggle (SERP) */
.sx-device-toggle { display: inline-flex; gap: 4px; background: var(--sx-surface-2); border: 1px solid var(--sx-border); border-radius: 999px; padding: 4px; margin-bottom: 16px; }
.sx-toggle { border: none; background: transparent; color: var(--sx-muted); font: inherit; font-weight: 600; font-size: 14px; padding: 8px 18px; border-radius: 999px; cursor: pointer; min-height: 40px; transition: .15s; }
.sx-toggle.active { background: #fff; color: var(--sx-primary); box-shadow: var(--sx-shadow-sm); }

/* SERP preview card */
.sx-google { background: #fff; border: 1px solid var(--sx-border); border-radius: var(--sx-radius); padding: 20px; box-shadow: var(--sx-shadow-sm); }
.sx-serp-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.sx-serp-favicon { width: 26px; height: 26px; border-radius: 50%; background: var(--sx-gradient); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.sx-serp-url { color: #4d5156; font-size: 13px; }
.sx-serif-title, .sx-serp-title { color: #1a0dab; font-size: 19px; font-weight: 500; margin-bottom: 4px; }
.sx-serp-desc { color: #4d5156; font-size: 14px; }

/* Result / output panel */
.sx-output {
  background: #0f172a; color: #e2e8f0; font-family: var(--sx-mono); font-size: 13px; line-height: 1.55;
  border-radius: var(--sx-radius); padding: 16px; margin: 10px 0 0; white-space: pre-wrap; word-break: break-word;
  max-height: 460px; overflow: auto; border: 1px solid #1e293b;
}
.sx-copy { margin-top: 12px; }
.sx-result-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

/* checklist (preflight) — status uses icon + text, not color alone */
.sx-checklist { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.sx-checklist li {
  display: flex; align-items: flex-start; gap: 10px; background: var(--sx-surface); border: 1px solid var(--sx-border);
  border-radius: var(--sx-radius-sm); padding: 12px 14px; font-size: 14.5px;
}
.sx-checklist li::before {
  flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: 13px; font-weight: 800; color: #fff; margin-top: 1px;
}
.sx-checklist li.ok::before { content: "✓"; background: var(--sx-success); }
.sx-checklist li.warn::before { content: "!"; background: var(--sx-warn); }
.sx-checklist li.bad::before { content: "✕"; background: var(--sx-danger); }
.sx-checklist li.ok { border-color: #bbf7d0; }
.sx-checklist li.warn { border-color: #fde68a; }
.sx-checklist li.bad { border-color: #fecaca; }

/* note / info box */
.sx-note {
  margin-top: 22px; background: var(--sx-gradient-soft); border: 1px solid #dcdcff; border-left: 4px solid var(--sx-primary);
  color: var(--sx-text-2); border-radius: var(--sx-radius-sm); padding: 14px 16px; font-size: 14.5px;
}

/* ===================== Doc sections (§8.1 components) ===================== */
.sx-doc-section { max-width: 820px; margin: 30px auto 0; padding: 30px 0; border-top: 1px solid var(--sx-border); }
.sx-doc-section:first-child { border-top: none; padding-top: 8px; }
.sx-doc-section h2 { font-size: 22px; }

.sx-methodology { background: var(--sx-surface-2); border: 1px solid var(--sx-border); border-radius: var(--sx-radius); padding: 20px 22px; }
.sx-methodology h2 { font-size: 20px; margin-bottom: 10px; }
.sx-methodology code, .sx-prose code { font-family: var(--sx-mono); font-size: .9em; background: #eef2ff; color: var(--sx-primary-700); padding: 2px 6px; border-radius: 6px; }

.sx-limitations { background: var(--sx-warn-bg); border: 1px solid #fde68a; border-radius: var(--sx-radius); padding: 20px 22px; }
.sx-limitations h2 { color: #92400e; }
.sx-limitations p, .sx-limitations li { color: #7c4a03; }

.sx-source-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.sx-source-list li { position: relative; padding-left: 30px; color: var(--sx-text-2); font-size: 15px; }
.sx-source-list li::before { content: "🔗"; position: absolute; left: 0; top: 1px; font-size: 14px; }
.sx-source-list a { font-weight: 600; }

.sx-related { display: flex; flex-wrap: wrap; gap: 10px; }
.sx-related a {
  display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--sx-border);
  color: var(--sx-text); font-weight: 600; font-size: 14px; padding: 9px 16px; border-radius: 999px;
  transition: .15s;
}
.sx-related a::before { content: "→"; color: var(--sx-primary); }
.sx-related a:hover { text-decoration: none; border-color: var(--sx-primary); box-shadow: var(--sx-ring); transform: translateY(-1px); }

.sx-faq-item { background: var(--sx-surface); border: 1px solid var(--sx-border); border-radius: var(--sx-radius); padding: 16px 20px; margin-bottom: 12px; }
.sx-faq-item h3 { font-size: 16px; margin-bottom: 6px; }
.sx-faq-item p { margin: 0; color: var(--sx-muted); font-size: 14.5px; }

/* Feedback widget (§8.1) */
.sx-feedback {
  margin-top: 28px; background: var(--sx-gradient-soft); border: 1px solid #dcdcff; border-radius: var(--sx-radius);
  padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.sx-feedback p { margin: 0; font-weight: 600; color: var(--sx-text); }
.sx-feedback-actions { display: flex; gap: 10px; }
.sx-feedback button {
  border: 1.5px solid var(--sx-border-strong); background: #fff; color: var(--sx-text); font: inherit; font-weight: 600;
  border-radius: 999px; padding: 8px 18px; min-height: 40px; cursor: pointer; transition: .15s;
}
.sx-feedback button:hover { border-color: var(--sx-primary); box-shadow: var(--sx-ring); }
.sx-feedback button[aria-pressed="true"] { background: var(--sx-primary); color: #fff; border-color: var(--sx-primary); }

/* ===================== Footer ===================== */
.sx-footer { background: #0f172a; color: #cbd5e1; margin-top: 40px; }
.sx-footer .sx-inner { padding-top: 56px; padding-bottom: 24px; }
.sx-footer > .sx-inner { display: grid; grid-template-columns: 1.6fr 1fr; gap: 32px; }
.sx-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; color: #fff; }
.sx-brand img { height: 30px; border-radius: 8px; }
.sx-brand span span { color: #a5b4fc; }
.sx-tagline { color: #94a3b8; margin-top: 12px; max-width: 280px; font-size: 14.5px; }
.sx-footer h4 { color: #fff; font-size: 14px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 14px; }
.sx-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.sx-footer a { color: #cbd5e1; font-size: 14.5px; }
.sx-footer a:hover { color: #fff; text-decoration: none; }
.sx-bottom {
  grid-column: 1 / -1;
  border-top: 1px solid rgba(255,255,255,.10); margin-top: 36px; padding-top: 20px;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: #94a3b8; font-size: 13px;
}
@media (max-width: 760px) { .sx-footer > .sx-inner { grid-template-columns: 1fr 1fr; } }

/* ===================== Reduced motion & a11y ===================== */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
:focus-visible { outline: 3px solid var(--sx-primary); outline-offset: 2px; border-radius: 4px; }
