/* ============================================================
   卦相 SEO 页面统一主题
   ------------------------------------------------------------
   此前 SEO 页面存在三套互不相干的视觉：静态页紫色 #7c3aed、
   React 落地页琥珀色 amber-600、而 App 本体是宣纸墨色。用户从
   搜索结果进来再进入应用，会感觉是三个不同的产品。
   这里把静态 SEO 页统一到 App 的设计令牌上（见 src/index.css）。
   ============================================================ */

:root {
  /* 底色：与 App 面板同色，暖白而非冷白 —— 楷体与墨色在冷白上会发脏 */
  --bg: #fdfbf7;
  --bg-soft: #f0ede8;
  --bg-sunk: #e8e4dd;

  /* 墨色文字梯度 */
  --text: #1a1a18;
  --text-secondary: #4a4a45;
  --text-muted: #8a8a82;

  /* 主色：墨绿。另三色为领域色，仅在需要区分语义时使用 */
  --accent: #526c4b;
  --accent-hover: #445c3e;
  --accent-soft: #e8efe6;
  --accent-wash: #f0f5ee;
  --ochre: #8a6d3b;   /* 赭石 */
  --slate: #4a6a78;   /* 黛青 */
  --vermilion: #a04a3f; /* 朱砂 */

  --border: rgba(26, 26, 24, 0.1);
  --border-soft: rgba(26, 26, 24, 0.06);

  --radius: 14px;
  --maxw: 760px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  font-size: 16px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
}

/* 标题用楷体：与 App 内命盘、星曜名同一套字面，是品牌识别的主要载体 */
h1, h2, h3, .kai {
  font-family: 'LXGW WenKai', 'LXGW WenKai TC', 'Noto Serif SC', 'STKaiti',
    'KaiTi', serif;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
}

h1 {
  font-size: 30px;
  line-height: 1.35;
  margin: 0 0 20px;
  padding-bottom: 16px;
  /* 细的墨绿下划线，替代原先 3px 紫色粗线 —— 粗线太抢，压过标题本身 */
  border-bottom: 1px solid var(--border);
  position: relative;
}
h1::after {
  content: '';
  position: absolute;
  left: 0; bottom: -1px;
  width: 56px; height: 2px;
  background: var(--accent);
}

h2 {
  font-size: 21px;
  margin: 40px 0 12px;
  padding-left: 12px;
  border-left: 3px solid var(--accent);
  line-height: 1.5;
}

h3 { font-size: 17px; margin: 28px 0 8px; }

p { margin: 0 0 16px; color: var(--text-secondary); }
strong { color: var(--text); font-weight: 600; }

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

/* ---------- 页面骨架 ---------- */
.gx-page { max-width: var(--maxw); margin: 0 auto; padding: 0 20px 64px; }

.gx-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(253, 251, 247, 0.88);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 32px;
}
.gx-header-inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: 0 20px; height: 56px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.gx-brand {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--text); font-weight: 600; font-size: 16px;
}
.gx-brand:hover { text-decoration: none; }
.gx-brand img { width: 26px; height: 26px; border-radius: 7px; }

/* ---------- 行动号召 ---------- */
.cta, .gx-cta {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff;
  padding: 11px 24px; border-radius: 999px;
  font-size: 15px; font-weight: 500;
  text-decoration: none; border: 0;
  transition: background .2s ease, transform .2s ease;
}
.cta:hover, .gx-cta:hover {
  background: var(--accent-hover); text-decoration: none; transform: translateY(-1px);
}
.gx-cta-sm { padding: 7px 16px; font-size: 14px; }

/* 正文里独立成段的 CTA，给足上下留白 */
main > .cta { margin: 28px 0; }

/* ---------- 卡片 / 提示块 ---------- */
.gx-card {
  background: #fff; border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 20px 22px; margin: 20px 0;
}
.gx-note {
  background: var(--accent-wash); border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 18px; margin: 20px 0; color: var(--text-secondary);
}

/* ---------- 页脚 ---------- */
footer {
  max-width: var(--maxw); margin: 56px auto 0; padding: 24px 20px 40px;
  border-top: 1px solid var(--border-soft);
  text-align: center; font-size: 14px; color: var(--text-muted);
}
footer a {
  color: var(--text-secondary); margin: 0 6px;
  display: inline-block; padding: 10px 8px; min-height: 44px; line-height: 24px;
}
footer a:hover { color: var(--accent); }

.related-links { margin-top: 18px; }
.related-links a {
  display: inline-block; margin: 4px 6px; color: var(--accent);
  font-size: 14px; padding: 6px 12px;
  background: var(--accent-wash); border-radius: 999px;
}
.related-links a:hover { background: var(--accent-soft); text-decoration: none; }

/* ---------- 杂项 ---------- */
ul, ol { color: var(--text-secondary); padding-left: 22px; }
li { margin: 6px 0; }

table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 15px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border-soft); }
th { color: var(--text); font-weight: 600; background: var(--bg-soft); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

@media (max-width: 640px) {
  body { font-size: 15px; }
  h1 { font-size: 25px; }
  h2 { font-size: 19px; margin-top: 32px; }
  .gx-page { padding: 0 16px 48px; }
  .gx-header-inner { padding: 0 16px; }
}

/* 跟随系统深色模式，与 App 的暗色令牌保持一致 */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1c1a;
    --bg-soft: #242624;
    --bg-sunk: #2e302e;
    --text: #f0ede8;
    --text-secondary: #b8b5ae;
    --text-muted: #7a7870;
    --accent: #8fb585;
    --accent-hover: #a3c79a;
    --accent-soft: #2a332a;
    --accent-wash: #22271f;
    --border: rgba(240, 237, 232, 0.14);
    --border-soft: rgba(240, 237, 232, 0.08);
  }
  .gx-header { background: rgba(26, 28, 26, 0.88); }
  .gx-card { background: var(--bg-soft); }
  .cta, .gx-cta { color: #14170f; }
}
