:root {
  --blue: #1e6fff;
  --blue-dark: #1554cc;
  --blue-light: #eef4ff;
  --green: #0d9f6e;
  --green-light: #e8f7f0;
  --red: #c62828;
  --red-light: #ffebee;
  --orange: #e65100;
  --orange-light: #fff3e0;
  --purple: #7b1fa2;
  --purple-light: #f3e5f5;
  --text: #1a1a2e;
  --muted: #5c6370;
  --border: #e5e9f0;
  --bg: #f7f9fc;
  --card: #fff;
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "SF Mono", Consolas, monospace;
  --shadow: 0 2px 8px rgba(0,0,0,.06);
  --max: 1120px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); font-size: 15px; line-height: 1.75; color: var(--text); background: var(--bg); }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Top nav */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.95); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}
.topbar-inner {
  max-width: var(--max); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; gap: 16px;
}
.topbar-brand { font-size: 14px; font-weight: 700; color: var(--blue); }
.topbar-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.topbar-nav a {
  font-size: 13px; color: var(--muted); padding: 6px 10px;
  border-radius: 6px; text-decoration: none;
}
.topbar-nav a:hover { background: var(--blue-light); color: var(--blue); text-decoration: none; }
.topbar-nav a.active { background: var(--blue-light); color: var(--blue); font-weight: 600; }

.page { max-width: var(--max); margin: 0 auto; padding: 32px 24px 80px; }

.hero {
  margin-bottom: 40px;
}
.hero h1 { font-size: 32px; line-height: 1.25; margin-bottom: 8px; }
.hero-meta { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.hero-lead { font-size: 16px; color: var(--muted); max-width: 720px; }

section { margin-bottom: 56px; scroll-margin-top: 72px; }
section > h2 {
  font-size: 22px; font-weight: 700; margin-bottom: 8px;
  padding-bottom: 10px; border-bottom: 2px solid var(--blue);
}
section > .section-lead { font-size: 14px; color: var(--muted); margin-bottom: 20px; max-width: 780px; }
h3 { font-size: 17px; font-weight: 600; margin: 28px 0 12px; }
h4 { font-size: 14px; font-weight: 600; margin: 20px 0 8px; color: var(--muted); }
p { margin-bottom: 12px; }

/* Pipeline flow (Molly&Cody style) */
.pipeline {
  display: flex; flex-wrap: wrap; gap: 0; margin: 24px 0;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.pipeline-step {
  flex: 1; min-width: 140px; padding: 16px 18px;
  border-right: 1px solid var(--border); text-align: center;
}
.pipeline-step:last-child { border-right: none; }
.pipeline-step .label { font-size: 11px; font-weight: 700; color: var(--blue); text-transform: uppercase; letter-spacing: .04em; }
.pipeline-step .text { font-size: 13px; margin-top: 4px; line-height: 1.45; }
.pipeline-arrow { display: none; }

/* Competitor cards */
.comp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 24px 0;
}
.comp-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: box-shadow .2s, transform .2s;
  display: flex; flex-direction: column;
}
.comp-card:hover { box-shadow: 0 6px 20px rgba(30,111,255,.12); transform: translateY(-2px); }
.comp-card-head {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.comp-card-head.julius { background: linear-gradient(135deg, #eef4ff 0%, #fff 100%); }
.comp-card-head.hex { background: linear-gradient(135deg, #e8f7f0 0%, #fff 100%); }
.comp-card-head.thoughtspot { background: linear-gradient(135deg, #f3e5f5 0%, #fff 100%); }
.comp-card-head.genie { background: linear-gradient(135deg, #fff3e0 0%, #fff 100%); }
.comp-logo {
  width: 48px; height: 48px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; color: #fff; margin-bottom: 12px;
}
.comp-logo.julius { background: var(--blue); }
.comp-logo.hex { background: var(--green); }
.comp-logo.thoughtspot { background: var(--purple); }
.comp-card h3 { font-size: 18px; margin: 0 0 4px; }
.comp-card .domain { font-size: 12px; color: var(--muted); }
.comp-card-body { padding: 16px 20px; flex: 1; font-size: 14px; }
.comp-card-body ul { margin: 8px 0 0 18px; }
.comp-card-body li { margin-bottom: 4px; font-size: 13px; }
.comp-card-metrics {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin-top: 12px;
}
.comp-metric {
  background: var(--bg); border-radius: 8px; padding: 8px 10px;
  text-align: center;
}
.comp-metric .val { font-size: 16px; font-weight: 700; color: var(--text); }
.comp-metric .lbl { font-size: 10px; color: var(--muted); }
.comp-card-foot {
  padding: 14px 20px; border-top: 1px solid var(--border);
  background: var(--bg);
}
.comp-card-foot a.btn {
  display: block; text-align: center; padding: 10px 16px;
  background: var(--blue); color: #fff; border-radius: 8px;
  font-size: 13px; font-weight: 600; text-decoration: none;
}
.comp-card-foot a.btn:hover { background: var(--blue-dark); text-decoration: none; }

.role-badge {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 3px 10px; border-radius: 4px; margin-left: 6px;
}
.role-badge.seo { background: var(--blue-light); color: var(--blue); }
.role-badge.geo { background: var(--green-light); color: var(--green); }
.role-badge.hub { background: var(--purple-light); color: var(--purple); }
.role-badge.platform { background: var(--orange-light); color: var(--orange); }

/* Signal cards (traffic diagnosis) */
.signal-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 20px 0;
}
.signal-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px;
}
.signal-card .channel { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.signal-card .us { font-size: 28px; font-weight: 700; margin: 8px 0 2px; }
.signal-card .us.warn { color: var(--red); }
.signal-card .ref { font-size: 13px; color: var(--muted); }
.signal-card .ref strong { color: var(--text); }
.signal-card .note { font-size: 12px; color: var(--muted); margin-top: 8px; line-height: 1.5; }

/* Tables */
table {
  width: 100%; border-collapse: collapse; font-size: 13px;
  margin: 16px 0; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
}
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--blue-light); font-weight: 600; }
tr:last-child td { border-bottom: none; }
tr:nth-child(even) td { background: #fafbfd; }
.data-src { font-size: 12px; color: var(--muted); margin-top: 8px; }

.tag-p0 { display: inline-block; font-size: 11px; font-weight: 600; background: var(--red-light); color: var(--red); padding: 2px 8px; border-radius: 4px; }
.tag-p1 { display: inline-block; font-size: 11px; font-weight: 600; background: var(--orange-light); color: var(--orange); padding: 2px 8px; border-radius: 4px; }

.verdict-box {
  background: var(--card); border: 2px solid var(--blue); border-radius: var(--radius);
  padding: 22px 26px; margin: 20px 0; font-size: 15px;
}
.tip {
  background: var(--orange-light); border-left: 4px solid var(--orange);
  padding: 12px 16px; border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 14px; margin: 16px 0;
}
.gap-box {
  background: var(--red-light); border: 1px solid #ffcdd2; border-radius: var(--radius);
  padding: 18px 22px; margin: 16px 0; font-size: 14px;
}

.bar-mini { display: flex; height: 22px; border-radius: 6px; overflow: hidden; margin: 10px 0; font-size: 10px; color: #fff; font-weight: 600; }
.bar-mini span { display: flex; align-items: center; justify-content: center; min-width: 36px; }
.b-direct { background: var(--blue); }
.b-google { background: var(--green); }
.b-other { background: #90a4ae; }

/* Charts */
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 24px 0; }
.chart-grid.single { grid-template-columns: 1fr; }
.chart-panel {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.chart-panel.full { grid-column: 1 / -1; }
.chart-panel h3 { font-size: 14px; margin: 0 0 4px; }
.chart-caption { font-size: 11px; color: var(--muted); margin-bottom: 12px; }

/* 图注：解释数字背后的动作 */
.fig-note {
  font-size: 12px; line-height: 1.6; color: var(--text);
  background: var(--blue-light); border-left: 3px solid var(--blue);
  padding: 8px 12px; border-radius: 0 6px 6px 0; margin: 10px 0 4px;
}
.fig-note::before { content: "📌 动作解读："; font-weight: 700; color: var(--blue-dark); }
.fig-note.chart { margin-top: 12px; }
.chart-wrap { position: relative; height: 260px; }
.chart-wrap.tall { height: 320px; }
.chart-wrap.short { height: 220px; }

.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 24px 0; }
.kpi-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; text-align: center;
}
.kpi-card .num { font-size: 26px; font-weight: 700; color: var(--blue); }
.kpi-card .num.warn { color: var(--red); }
.kpi-card .lbl { font-size: 12px; color: var(--muted); margin-top: 4px; }

.exec-box {
  background: var(--blue); color: #fff; border-radius: var(--radius);
  padding: 28px 32px; margin-bottom: 24px;
}
.exec-box h2 { color: #fff; border-bottom-color: rgba(255,255,255,.3); margin-bottom: 16px; font-size: 18px; }
.exec-list { list-style: none; }
.exec-list li { padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.15); font-size: 15px; }
.exec-list li:last-child { border-bottom: none; }

.footer { font-size: 12px; color: var(--muted); padding-top: 32px; border-top: 1px solid var(--border); margin-top: 48px; }

/* Detail page */
.detail-hero {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px; margin-bottom: 32px;
  box-shadow: var(--shadow);
}
.detail-hero.julius { border-top: 4px solid var(--blue); }
.detail-hero.hex { border-top: 4px solid var(--green); }
.detail-hero.thoughtspot { border-top: 4px solid var(--purple); }
.detail-hero.genie { border-top: 4px solid var(--orange); }
.detail-hero h1 { font-size: 28px; margin-bottom: 8px; }
.detail-stats {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-top: 24px;
}
.detail-stat {
  background: var(--bg); border-radius: 8px; padding: 14px; text-align: center;
}
.detail-stat .val { font-size: 20px; font-weight: 700; }
.detail-stat .lbl { font-size: 11px; color: var(--muted); margin-top: 2px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.page-list { list-style: none; margin: 0; }
.page-list li {
  padding: 12px 0; border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.page-list li:last-child { border-bottom: none; }
.page-list .url { font-family: var(--mono); font-size: 12px; color: var(--blue); word-break: break-all; }
.page-list .role { color: var(--muted); margin-top: 2px; }

.copy-box {
  background: var(--green-light); border-radius: var(--radius);
  padding: 18px 22px; margin: 16px 0;
}
.nocopy-box {
  background: var(--red-light); border-radius: var(--radius);
  padding: 18px 22px; margin: 16px 0;
}

.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--blue); }

/* 通俗解释 */
.plain-box {
  background: var(--green-light); border: 1px solid #b8e6d0;
  border-radius: var(--radius); padding: 18px 22px; margin: 20px 0;
  font-size: 14px; line-height: 1.7;
}
.plain-box h3 { font-size: 15px; margin: 0 0 10px; color: var(--green); }
.plain-box dl { margin: 0; }
.plain-box dt { font-weight: 600; margin-top: 8px; }
.plain-box dt:first-child { margin-top: 0; }
.plain-box dd { margin: 2px 0 0 0; color: var(--muted); font-size: 13px; }
.say {
  display: block; font-size: 12px; color: var(--green); font-weight: 600;
  margin-top: 4px; line-height: 1.45;
}
.say::before { content: "人话："; }
td .say, p .say-inline {
  display: inline; font-size: inherit; font-weight: 400; color: var(--muted);
}
td .say::before, .say-inline::before { content: "（"; font-weight: 600; color: var(--green); }
td .say::after, .say-inline::after { content: "）"; color: var(--green); }

/* Growth timeline */
.timeline {
  position: relative; margin: 20px 0 28px; padding-left: 28px;
  border-left: 3px solid var(--border);
}
.timeline-item {
  position: relative; margin-bottom: 22px; padding-bottom: 4px;
}
.timeline-item::before {
  content: ""; position: absolute; left: -34px; top: 6px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--blue); border: 2px solid var(--card);
  box-shadow: 0 0 0 2px var(--blue-light);
}
.timeline-item.burst::before { background: var(--green); box-shadow: 0 0 0 2px var(--green-light); }
.timeline-item.crisis::before { background: var(--orange); box-shadow: 0 0 0 2px var(--orange-light); }
.timeline-item .when {
  font-size: 12px; font-weight: 700; color: var(--blue);
  text-transform: none; letter-spacing: 0.02em; margin-bottom: 4px;
}
.timeline-item.burst .when { color: var(--green); }
.timeline-item.crisis .when { color: var(--orange); }
.timeline-item h4 { font-size: 15px; margin: 0 0 6px; color: var(--text); }
.timeline-item p, .timeline-item ul { font-size: 13px; color: var(--muted); margin: 0 0 6px; }
.timeline-item ul { padding-left: 18px; }
.phase-tag {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 4px; margin-right: 6px; vertical-align: middle;
}
.phase-tag.early { background: var(--blue-light); color: var(--blue); }
.phase-tag.burst { background: var(--green-light); color: var(--green); }
.phase-tag.now { background: #f3e5f5; color: var(--purple); }
.action-table td:first-child { white-space: nowrap; font-size: 13px; }

/* 90-day weekly plan */
.week-block { margin: 28px 0 20px; }
.week-block h4 {
  font-size: 15px; font-weight: 700; margin: 0 0 10px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.week-table { font-size: 13px; }
.week-table th { font-size: 12px; }
.week-table td { vertical-align: top; }
.week-table code { font-size: 11px; }
.phase-checkpoint {
  background: var(--orange-light); border-left: 4px solid var(--orange);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 18px; margin: 20px 0; font-size: 14px;
}
.phase-checkpoint strong { color: var(--orange); }
.plan-legend { font-size: 13px; color: var(--muted); margin-bottom: 16px; }

@media (max-width: 900px) {
  .comp-grid, .signal-grid, .chart-grid, .kpi-row, .detail-stats, .two-col { grid-template-columns: 1fr; }
  .pipeline-step { border-right: none; border-bottom: 1px solid var(--border); }
  .topbar-nav { display: none; }
}

/* Playbook HTML (SEO / Reddit 执行手册) */
.playbook-page { padding-top: 24px; }
.week-jump-wrap {
  position: sticky; top: 56px; z-index: 90;
  background: rgba(247, 249, 252, 0.97); backdrop-filter: blur(6px);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 16px; margin-bottom: 24px;
}
.week-jump-label { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.week-jump { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.week-jump a {
  font-size: 12px; padding: 5px 10px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--border);
  color: var(--text); text-decoration: none;
}
.week-jump a:hover { background: var(--blue-light); border-color: var(--blue); color: var(--blue); text-decoration: none; }
.week-jump-appendix a { font-size: 11px; opacity: 0.85; }
.playbook-content { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px 32px; }
.playbook-content h1 { font-size: 26px; margin-bottom: 12px; }
.playbook-content h2 { scroll-margin-top: 140px; font-size: 20px; margin-top: 36px; padding-top: 8px; border-top: 1px solid var(--border); }
.playbook-content h2:first-of-type { border-top: none; margin-top: 0; }
.playbook-content h3 { scroll-margin-top: 140px; font-size: 16px; color: var(--blue-dark); margin-top: 24px; }
.playbook-content h4 { font-size: 14px; margin-top: 16px; }
.playbook-content blockquote {
  background: var(--blue-light); border-left: 4px solid var(--blue);
  padding: 12px 16px; margin: 16px 0; font-size: 14px; color: var(--muted);
}
.playbook-content pre {
  background: #1e293b; color: #e2e8f0; padding: 14px 16px;
  border-radius: 8px; overflow-x: auto; font-size: 13px; line-height: 1.5;
}
.playbook-content code { font-family: var(--mono); font-size: 0.9em; }
.playbook-content p code, .playbook-content li code, .playbook-content td code {
  background: #f1f5f9; padding: 2px 6px; border-radius: 4px;
}
.playbook-content table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 13px; }
.playbook-content th, .playbook-content td {
  border: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top;
}
.playbook-content th { background: var(--bg); font-weight: 600; }
.playbook-content hr { border: none; border-top: 1px solid var(--border); margin: 28px 0; }
.playbook-content ul, .playbook-content ol { margin: 8px 0 12px 20px; }
.playbook-content li { margin-bottom: 4px; }

@media print {
  .topbar { display: none; }
  .page { padding: 0; max-width: 100%; }
  section { page-break-inside: avoid; }
}
