/* =========================================================
   星图邻 XingTuLink - 全站样式（浅色简洁版）
   纯静态、零构建，所有页面共享
   ========================================================= */

:root {
  --bg-0: #f7f8fc;
  --bg-1: #eef1f8;
  --bg-2: #e4e8f3;
  --surface: #ffffff;
  --line: rgba(15, 23, 42, 0.08);
  --line-2: rgba(15, 23, 42, 0.14);
  --text: #0f172a;
  --text-soft: #475569;
  --text-mute: #94a3b8;
  --brand-1: #6366f1;
  --brand-2: #8b5cf6;
  --brand-3: #0891b2;
  --ok: #16a34a;
  --warn: #d97706;
  --bad: #dc2626;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-1: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-2: 0 20px 60px rgba(99, 102, 241, 0.18);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg-0);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--brand-1);
}

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

/* 背景装饰 —— 浅色柔和光晕 */
.bg-decor {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 500px at 88% -8%, rgba(139, 92, 246, 0.12), transparent 60%),
    radial-gradient(800px 460px at -6% 24%, rgba(99, 102, 241, 0.1), transparent 60%),
    radial-gradient(700px 420px at 50% 116%, rgba(8, 145, 178, 0.08), transparent 60%),
    var(--bg-0);
}

/* 容器 */
.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 22px;
}

/* 顶部导航 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  background: rgba(255, 255, 255, 0.78);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

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

/* logo 是深色，浅色背景下直接显示即可 */
.brand img {
  height: 32px;
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
}

.nav-links a {
  font-size: 14.5px;
  color: var(--text-soft);
}

.nav-links a.active {
  color: var(--brand-1);
  font-weight: 600;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--brand-1);
  color: #fff !important;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.26);
}

.nav-cta:hover {
  background: #5457e6;
  color: #fff !important;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--text);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s, border-color 0.2s;
  font-family: inherit;
}

.btn-primary {
  background: var(--brand-1);
  color: #fff;
  box-shadow: 0 8px 22px rgba(99, 102, 241, 0.28);
}

.btn-primary:hover {
  transform: translateY(-1px);
  color: #fff;
  background: #5457e6;
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.38);
}

.btn-ghost {
  background: #fff;
  color: var(--text);
  border-color: var(--line-2);
}

.btn-ghost:hover {
  border-color: var(--brand-1);
  color: var(--brand-1);
}

/* 通用区块 */
section {
  padding: 80px 0;
  position: relative;
}

.eyebrow {
  display: inline-block;
  padding: 4px 12px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--text-soft);
  background: rgba(99, 102, 241, 0.06);
  margin-bottom: 16px;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 12px;
  line-height: 1.25;
  color: var(--text);
}

h1 {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 800;
  letter-spacing: -0.5px;
}

h2 {
  font-size: clamp(26px, 3.4vw, 36px);
  font-weight: 700;
}

h3 {
  font-size: 20px;
  font-weight: 700;
}

p.lead {
  color: var(--text-soft);
  font-size: 17px;
  max-width: 720px;
}

.gradient-text {
  color: var(--brand-1);
}

/* 统计数字（替代 H2，避免污染标题语义） */
.stat-num {
  font-size: 40px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 8px;
}

/* 卡片 */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.3s;
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--line-2);
  box-shadow: var(--shadow-1);
}

.card .icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #eef0fe;
  border: 1px solid var(--line-2);
  color: var(--brand-1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  font-weight: 800;
  font-size: 20px;
}

.card .icon svg {
  width: 24px;
  height: 24px;
}

/* 网格 */
.grid {
  display: grid;
  gap: 22px;
}

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

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

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

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 50px 0 30px;
  margin-top: 40px;
  background: var(--bg-1);
  color: var(--text-soft);
  font-size: 14px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 36px;
}

.footer-grid h4 {
  color: var(--text);
  font-size: 14px;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.footer-grid ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-grid li {
  margin: 8px 0;
}

.footer-grid a {
  color: var(--text-soft);
}

.footer-grid a:hover {
  color: var(--brand-1);
}

.footer-bottom {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
  color: var(--text-mute);
}

/* Hero */
.hero {
  padding: 90px 0 60px;
  text-align: center;
}

.hero p.lead {
  margin: 18px auto 30px;
}

.hero-cta {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* 表单 */
.input,
.textarea,
.select {
  width: 100%;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  color: var(--text);
  font-size: 14.5px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--brand-1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.textarea {
  resize: vertical;
  min-height: 160px;
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  line-height: 1.55;
}

label {
  display: block;
  font-size: 13.5px;
  color: var(--text-soft);
  margin: 12px 0 6px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* 工具页面布局 */
.tool-wrap {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 28px;
  align-items: start;
}

.tool-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px;
}

/* 进度条 */
.score {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.score .num {
  font-size: 56px;
  font-weight: 800;
  color: var(--brand-1);
  line-height: 1;
}

.score .max {
  color: var(--text-mute);
  font-size: 16px;
}

.bar {
  height: 10px;
  background: var(--bg-2);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}

.bar > i {
  display: block;
  height: 100%;
  background: var(--brand-1);
  border-radius: 999px;
  transition: width 0.6s ease;
}

.bar.warn > i {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
}

.bar.bad > i {
  background: linear-gradient(135deg, #ef4444, #be123c);
}

.bar.ok > i {
  background: var(--ok);
}

.dim-row {
  margin: 18px 0;
}

.dim-row header {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text-soft);
}

.dim-row header b {
  color: var(--text);
}

/* 问题列表 */
.issues {
  list-style: none;
  padding: 0;
  margin: 0;
}

.issues li {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 10px;
  background: #fff;
  font-size: 14.5px;
  color: var(--text);
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  margin-top: 6px;
}

.dot.bad {
  background: var(--bad);
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.14);
}

.dot.warn {
  background: var(--warn);
  box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.14);
}

.dot.ok {
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.14);
}

/* 代码块 —— 浅底深色文字，便于阅读 */
pre.code {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 18px;
  overflow: auto;
  color: #e2e8f0;
  font-size: 13.5px;
  line-height: 1.6;
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  margin: 0;
}

pre.code .k {
  color: #c084fc;
}

pre.code .s {
  color: #86efac;
}

pre.code .n {
  color: #fcd34d;
}

pre.code .b {
  color: #93c5fd;
  font-weight: 700;
}

/* CTA 横幅 */
.cta-banner {
  background: #eef0fe;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
}

.cta-banner h2 {
  margin-bottom: 10px;
}

.cta-banner p {
  color: var(--text-soft);
  margin: 0 auto 22px;
  max-width: 620px;
}

/* 标签 chip */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 12px;
  background: rgba(99, 102, 241, 0.1);
  color: #4f46e5;
  border-radius: 999px;
  border: 1px solid rgba(99, 102, 241, 0.22);
}

.chip.warn {
  background: rgba(217, 119, 6, 0.1);
  color: #b45309;
  border-color: rgba(217, 119, 6, 0.22);
}

/* 总分卡片 */
.score-card {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.06), rgba(139, 92, 246, 0.04));
}

.score-card .score .num {
  font-size: 60px;
}

.score-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

.score-tag.ok {
  background: rgba(22, 163, 74, 0.12);
  color: var(--ok);
}

.score-tag.warn {
  background: rgba(217, 119, 6, 0.12);
  color: var(--warn);
}

.score-tag.bad {
  background: rgba(220, 38, 38, 0.12);
  color: var(--bad);
}

.score-comment {
  flex-basis: 100%;
  color: var(--text-soft);
  margin: 0;
  font-size: 14.5px;
}

/* 结果标签页 */
.result-tabs {
  display: flex;
  gap: 6px;
  margin-top: 22px;
  border-bottom: 1px solid var(--line);
}

.result-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-mute);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  font-family: inherit;
}

.result-tab:hover {
  color: var(--text);
}

.result-tab.active {
  color: var(--brand-1);
  border-bottom-color: var(--brand-1);
}

.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
}

.result-tab.active .count-badge {
  background: rgba(99, 102, 241, 0.14);
  color: var(--brand-1);
}

.result-pane {
  display: none;
  max-height: 400px;
  overflow-y: auto;
  padding: 16px 4px 4px;
  scrollbar-width: thin;
}

.result-pane.active {
  display: block;
}

/* 工具标签切换 */
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.tab {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: #fff;
  color: var(--text-soft);
  font-size: 13.5px;
  cursor: pointer;
  transition: all 0.2s;
}

.tab.active {
  background: var(--brand-1);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}

/* 关于页 / FAQ */
.faq {
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 12px;
  background: #fff;
  overflow: hidden;
}

.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 20px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text);
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  font-size: 22px;
  color: var(--text-mute);
  transition: transform 0.2s;
}

.faq[open] summary::after {
  content: "−";
}

.faq .faq-body {
  padding: 0 20px 18px;
  color: var(--text-soft);
  font-size: 14.5px;
}

.toc {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin: 18px 0 30px;
  font-size: 13.5px;
  color: var(--text-soft);
}

.toc a:hover {
  color: var(--brand-1);
}

/* 联系卡片 */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.contact-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  margin-bottom: 12px;
}

.contact-card .ci {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #eef0fe;
  border: 1px solid var(--line-2);
  color: var(--brand-1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-card .ci svg {
  width: 20px;
  height: 20px;
}

.contact-card b {
  display: block;
  font-size: 14px;
  color: var(--text-soft);
  font-weight: 500;
  margin-bottom: 2px;
}

.contact-card a,
.contact-card span {
  color: var(--text);
  font-size: 15px;
}

/* GEO 检测结果分享水印栏 */
.geo-share-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  border: 1px dashed var(--line-2);
  border-radius: 12px;
  background: #fafbff;
}
html[data-lang="en"] .geo-share-bar,
:root .geo-share-bar {
  /* no-op */
}
@media print {
  .geo-share-bar #shareImgBtn { display: none; }
}

/* GitHub 导航图标（圆形描边图标，与语言切换按钮并列） */
.nav-github {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line-2);
  transition: all 0.2s;
  flex-shrink: 0;
}
.nav-github:hover {
  color: var(--brand-1);
  border-color: var(--brand-3);
  transform: translateY(-1px);
}
.nav-github svg { display: block; }

/* 页脚社交图标：放在 footer-bottom 或 brand 下方 */
.footer-social {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
.footer-social a {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--bg-2);
  color: var(--text-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-2);
}
.footer-social a:hover {
  color: var(--brand-1);
  border-color: var(--brand-3);
}
.footer-social svg { display: block; }

/* 工具提示 */
.tip {
  font-size: 12.5px;
  color: var(--text-mute);
  margin-top: 6px;
}

.hr {
  height: 1px;
  background: var(--line);
  margin: 24px 0;
  border: 0;
}

/* 表格（about-geo 对比表） */
table {
  color: var(--text);
}

table th {
  background: rgba(99, 102, 241, 0.1);
  color: var(--text);
}

table td {
  color: var(--text-soft);
}

/* 响应式 */
@media (max-width: 900px) {
  .grid-2,
  .grid-3,
  .grid-4,
  .tool-wrap,
  .footer-grid,
  .contact-grid,
  .field-row {
    grid-template-columns: 1fr;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    flex-direction: column;
    padding: 18px 22px;
    border-bottom: 1px solid var(--line);
    align-items: flex-start;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle {
    display: inline-flex;
  }

  section {
    padding: 56px 0;
  }
}

/* ===== 语言切换按钮 ===== */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: #fff;
  padding: 3px;
  gap: 2px;
  user-select: none;
}
.lang-toggle .lt-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  line-height: 1;
}
.lang-toggle .lt-btn:hover {
  color: var(--brand-1);
}
.lang-toggle .lt-btn.active {
  background: var(--brand-1);
  color: #fff;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.22);
}
.lang-toggle .lt-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* 英文模式：整体字距稍收 + 字号略小（避免换行错位） */
html[data-lang="en"] body {
  font-family: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto,
    "Helvetica Neue", Arial, sans-serif;
}
html[data-lang="en"] .nav-links a {
  font-size: 13.5px;
}
html[data-lang="en"] h1 {
  letter-spacing: -0.3px;
}

/* 响应式：移动端在导航折叠菜单里显示语言切换 */
@media (max-width: 900px) {
  .lang-toggle {
    order: 99;
    margin-left: auto;
  }
  .nav-links.open + .lang-toggle {
    /* 当导航在展开状态也保持在头部 */
  }
  .nav-github { width: 36px; height: 36px; }
  .nav-github svg { width: 18px; height: 18px; }
}

/* 滚动条 */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.18);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(15, 23, 42, 0.3);
}
