/* =============================================================================
 * site-monitor 营销站全局样式
 * 纯静态、零框架、零构建。可直接双击打开或托管。
 * 设计原则：语义化、响应式、与 site-monitor 数据纪律（估算/缺失/模拟）一致。
 * ========================================================================== */

/* ----------------------------- 设计令牌 ----------------------------------- */
:root {
  /* 品牌色 */
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #0f172a;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;

  /* 中性色 */
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --border-strong: #cbd5e1;

  /* 排版 */
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 8px 24px rgba(15, 23, 42, 0.06);
  --maxw: 1120px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
    "PingFang SC", Roboto, Helvetica, Arial, sans-serif;
}

/* ----------------------------- 基础重置 ----------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; display: block; }

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

h1, h2, h3, h4 { line-height: 1.25; color: var(--accent); margin: 0 0 .5em; }
h1 { font-size: clamp(28px, 4vw, 44px); }
h2 { font-size: clamp(22px, 3vw, 32px); }
h3 { font-size: 20px; }
p { margin: 0 0 1em; }

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

.muted { color: var(--muted); }
.center { text-align: center; }
.lead { font-size: 18px; color: var(--muted); }

/* ----------------------------- 顶部导航 ----------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--accent);
  font-size: 18px;
}
.brand img { width: 34px; height: 34px; }
.brand:hover { text-decoration: none; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  display: inline-block;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
}
.nav-links a:hover { background: var(--surface-2); text-decoration: none; }
.nav-links a.active { color: var(--primary); background: #eff6ff; }

.nav-cta { display: flex; align-items: center; gap: 10px; }

/* 语言切换器（i18n）：与 .nav-cta 内的「免费试用」按钮并排，移动端保持可见 */
.lang-switcher {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  overflow: hidden;
  font-size: 13px;
  flex: none;
}
.lang-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 6px 12px;
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
  line-height: 1;
  transition: background .15s ease, color .15s ease;
}
.lang-btn + .lang-btn { border-left: 1px solid var(--border); }
.lang-btn:hover { background: var(--surface-2); color: var(--text); }
.lang-btn.active { background: var(--primary); color: #fff; }

/* 移动端汉堡按钮 */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 20px;
  margin: 0 auto;
  background: var(--accent);
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* 锚点高亮（JS 切换） */
.nav-links a.anchor-active { color: var(--primary); background: #eff6ff; }

/* ----------------------------- 按钮 --------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .15s ease, border-color .15s ease, transform .05s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); text-decoration: none; }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); text-decoration: none; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-xl { padding: 18px 40px; font-size: 18px; border-radius: 12px; }

/* --------------------- 「免费试用」CTA 强化（第一转化动作）-----------------
 * 全站 .trial-link 统一升级为品牌渐变 + 光晕 + 轻微呼吸动画，与普通主按钮
 * 拉开视觉层级，让「进系统」的动作第一眼可见、第一下可点。
 * ------------------------------------------------------------------------ */
a.trial-link {
  position: relative;
  background: linear-gradient(135deg, #2563eb 0%, #4f46e5 55%, #7c3aed 100%);
  color: #fff;
  border-color: transparent;
  font-weight: 700;
  letter-spacing: .02em;
  box-shadow: 0 6px 18px rgba(79, 70, 229, .38), 0 0 0 0 rgba(124, 58, 237, .45);
  animation: trialPulse 2.6s ease-in-out infinite;
}
a.trial-link::after {
  content: "→";
  font-weight: 700;
  margin-left: 2px;
  transition: transform .15s ease;
}
a.trial-link:hover {
  text-decoration: none;
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(79, 70, 229, .5), 0 0 0 0 rgba(124, 58, 237, .45);
}
a.trial-link:hover::after { transform: translateX(4px); }
a.trial-link:active { transform: translateY(1px); }

@keyframes trialPulse {
  0%   { box-shadow: 0 6px 18px rgba(79, 70, 229, .38), 0 0 0 0 rgba(124, 58, 237, .45); }
  70%  { box-shadow: 0 6px 18px rgba(79, 70, 229, .38), 0 0 0 14px rgba(124, 58, 237, 0); }
  100% { box-shadow: 0 6px 18px rgba(79, 70, 229, .38), 0 0 0 0 rgba(124, 58, 237, 0); }
}

/* 顶部导航里的试用按钮保持渐变但不再呼吸，避免全局干扰 */
.nav-cta a.trial-link { animation: none; }

/* 尊重「减少动态效果」偏好 */
@media (prefers-reduced-motion: reduce) {
  a.trial-link,
  .hero-pill::before { animation: none !important; }
}

/* ----------------------------- Hero -------------------------------------- */
.hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 55%, #2563eb 100%);
  color: #fff;
  padding: 72px 0 80px;
}
.hero h1 { color: #fff; }
.hero .lead { color: rgba(255, 255, 255, 0.82); }
.hero .hero-cta { margin-top: 28px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.hero .btn-ghost { color: #fff; border-color: rgba(255,255,255,.45); background: rgba(255,255,255,.08); }
.hero .btn-ghost:hover { background: rgba(255,255,255,.16); }

/* Hero 顶部的「演示环境已开放」提示条 */
.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 20px;
  padding: 6px 15px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .26);
  color: #e8eefc;
  font-size: 13.5px;
  font-weight: 600;
}
.hero-pill::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, .28);
  animation: pillBlink 2s ease-in-out infinite;
}
@keyframes pillBlink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* 试用按钮下方的一句说明，降低「点了会发生什么」的顾虑 */
.hero-cta-note {
  margin: 14px 0 0;
  font-size: 13.5px;
  color: rgba(255, 255, 255, .74);
}
.hero-badges { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 10px 22px; }
.hero-badges .stat { font-size: 14px; color: rgba(255,255,255,.85); }
.hero-badges .stat b { display: block; font-size: 24px; color: #fff; }

/* ----------------------------- 卡片网格 ----------------------------------- */
.section { padding: 64px 0; }
.section.alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 720px; margin: 0 auto 36px; text-align: center; }
.section-head p { color: var(--muted); font-size: 17px; }

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.card h3 { margin-top: 0; }
.card .icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: #eff6ff; color: var(--primary);
  font-size: 22px; font-weight: 700; margin-bottom: 14px;
}
.card p { color: var(--muted); font-size: 15px; }

/* 模块卡（功能页六大模块 + GEO/SEO） */
.module-card { position: relative; }
.module-card .tag {
  position: absolute; top: 16px; right: 16px;
  font-size: 12px; color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px;
}
.module-card.seo { border-top: 3px solid var(--success); }
.module-card.geo { border-top: 3px solid #7c3aed; }

/* ----------------------------- 维度 / 差异化 ------------------------------ */
.dim-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px dashed var(--border);
  align-items: start;
}
.dim-row:last-child { border-bottom: none; }
.dim-key { font-weight: 700; color: var(--accent); }
.dim-key small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.badge-pill {
  display: inline-block; font-size: 12px; font-weight: 600;
  padding: 2px 10px; border-radius: 999px; margin-left: 8px;
}
.badge-auto { background: #dcfce7; color: #166534; }
.badge-manual { background: #fef3c7; color: #92400e; }

/* ----------------------------- CTA 区 ------------------------------------ */
.cta-band {
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  margin: 48px 0;
}
.cta-band h2 { color: #fff; }
.cta-band .btn-ghost { color: #fff; border-color: rgba(255,255,255,.45); background: rgba(255,255,255,.08); }
.demo-note { font-size: 13px; color: rgba(255,255,255,.7); margin-top: 12px; }

/* ----------------------------- 「模拟数据」角标 --------------------------- */
/* 用于标注任何来自身份为「模拟」的数据源 / 估算值 */
.sim-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 999px;
  padding: 2px 10px;
  vertical-align: middle;
}
.sim-badge::before { content: "●"; font-size: 9px; }

/* ----------------------------- 空状态 ------------------------------------- */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--muted);
}
.empty-state .empty-icon { font-size: 32px; opacity: .5; margin-bottom: 8px; }
.empty-state p { margin: 4px 0; }

/* ----------------------------- 数据纪律提示条 ----------------------------- */
.data-disclaimer {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 14px;
  margin: 20px 0;
}
.data-disclaimer b { color: #7c2d12; }

/* ----------------------------- 洞察页：表格/卡片/条形图 ------------------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}
.panel h3 { margin-top: 0; }
.panel .sub { color: var(--muted); font-size: 14px; margin-bottom: 16px; }

/* 条形分布（CSS 实现，无 JS 依赖，仅作静态展示骨架；JS 会注入数据条） */
.bar-row { display: grid; grid-template-columns: 140px 1fr 64px; gap: 10px; align-items: center; margin: 8px 0; }
.bar-row .bar-label { font-size: 14px; color: var(--text); }
.bar-track { background: var(--surface-2); border-radius: 999px; height: 16px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--primary); border-radius: 999px; }
.bar-row .bar-val { font-size: 13px; color: var(--muted); text-align: right; }

/* 洞察卡片网格 */
.insight-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.insight-card .n { font-size: 28px; font-weight: 800; color: var(--primary); }
.insight-card .t { font-weight: 600; margin: 6px 0 4px; }
.insight-card .d { color: var(--muted); font-size: 14px; }

table.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data-table th, table.data-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
table.data-table th { background: var(--surface-2); color: var(--accent); font-weight: 600; }
table.data-table tr:hover td { background: #f8fafc; }

/* ----------------------------- FAQ 折叠 ----------------------------------- */
.faq-item { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 12px; background: var(--surface); }
.faq-item summary { cursor: pointer; padding: 16px 18px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--muted); font-size: 20px; }
.faq-item[open] summary::after { content: "−"; }
.faq-item .faq-body { padding: 0 18px 16px; color: var(--muted); }

/* ----------------------------- 定价页 ------------------------------------- */
.price-card { display: flex; flex-direction: column; }
.price-card.featured { border: 2px solid var(--primary); box-shadow: 0 12px 32px rgba(37,99,235,.18); }
.price-card .plan-name { font-size: 18px; font-weight: 700; }
.price-card .price { font-size: 34px; font-weight: 800; color: var(--accent); margin: 8px 0; }
.price-card .price small { font-size: 14px; color: var(--muted); font-weight: 500; }
.price-card ul { list-style: none; padding: 0; margin: 16px 0; flex: 1; }
.price-card li { padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 14px; color: var(--text); }
.price-card li::before { content: "✓"; color: var(--success); font-weight: 700; margin-right: 8px; }
.price-card .no::before { content: "—"; color: var(--muted); }

/* ----------------------------- 页脚 --------------------------------------- */
.site-footer {
  background: var(--accent);
  color: rgba(255,255,255,.78);
  padding: 40px 0 28px;
  margin-top: 40px;
}
.site-footer a { color: rgba(255,255,255,.92); }
.site-footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 24px; }
.site-footer h4 { color: #fff; font-size: 15px; margin-bottom: 12px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 6px 0; font-size: 14px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 28px; padding-top: 16px; font-size: 13px; }

/* ----------------------------- 14 数据源配色 ------------------------------ */
/* 注：site-monitor 当前未提供 SOURCE_COLORS 常量，以下为营销站自定的清晰配色，
 * 与 site-monitor 数据源清单（config.SOURCES）一一对应。 */
:root {
  --src-gsc: #4285F4;
  --src-ga4: #E8710A;
  --src-semrush: #FF6739;
  --src-ahrefs: #FF4F4F;
  --src-similarweb: #1EC8C8;
  --src-ubersuggest: #1A73E8;
  --src-serpstat: #7C3AED;
  --src-seranking: #059669;
  --src-spyfu: #D97706;
  --src-sitechecker: #0EA5E9;
  --src-seoreviewtools: #DB2777;
  --src-cloudflare_radar: #F6821F;
  --src-tranco: #64748B;
  --src-umbrella: #0D9488;
}
.src-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.src-legend { display: flex; flex-wrap: wrap; gap: 10px 18px; margin: 12px 0; }
.src-legend span { font-size: 13px; color: var(--text); }

/* 14 源展示条（用 data-src 取色） */
.src-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; padding: 4px 12px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
}
.src-chip[data-src="gsc"] .src-dot { background: var(--src-gsc); }
.src-chip[data-src="ga4"] .src-dot { background: var(--src-ga4); }
.src-chip[data-src="semrush"] .src-dot { background: var(--src-semrush); }
.src-chip[data-src="ahrefs"] .src-dot { background: var(--src-ahrefs); }
.src-chip[data-src="similarweb"] .src-dot { background: var(--src-similarweb); }
.src-chip[data-src="ubersuggest"] .src-dot { background: var(--src-ubersuggest); }
.src-chip[data-src="serpstat"] .src-dot { background: var(--src-serpstat); }
.src-chip[data-src="seranking"] .src-dot { background: var(--src-seranking); }
.src-chip[data-src="spyfu"] .src-dot { background: var(--src-spyfu); }
.src-chip[data-src="sitechecker"] .src-dot { background: var(--src-sitechecker); }
.src-chip[data-src="seoreviewtools"] .src-dot { background: var(--src-seoreviewtools); }
.src-chip[data-src="cloudflare_radar"] .src-dot { background: var(--src-cloudflare_radar); }
.src-chip[data-src="tranco"] .src-dot { background: var(--src-tranco); }
.src-chip[data-src="umbrella"] .src-dot { background: var(--src-umbrella); }

/* ----------------------------- 响应式 ------------------------------------- */
@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .site-footer .cols { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute;
    top: 64px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 8px 16px 16px;
    gap: 2px;
    display: none;
    box-shadow: var(--shadow);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 10px; }
  .nav-cta .btn { display: none; } /* 移动端 CTA 收进展开菜单 */
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .dim-row { grid-template-columns: 1fr; gap: 6px; }
  .hero { padding: 56px 0 60px; }
  .cta-band { padding: 28px 20px; }
  .site-footer .cols { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 110px 1fr 56px; }
}
