/* =========================================================
   零点数据 · 教程中心样式
   配色和首页（brand-home）保持一致：墨蓝底 + 香槟金 + 青碧。
   教程页以阅读为主：只保留按钮流光、卡片悬停这类轻量动效，不做首页那种大动画。
   ========================================================= */

:root {
  /* 品牌色（深色底上用提亮版的金和青碧，保证文字对比度） */
  --ink: #0a1a33;
  --ink-deep: #06101f;
  --gold: #c8a24a;
  --gold-light: #e3c77a;
  --jade: #15958f;
  --jade-light: #2fc0b4;
  --paper: #f4f1ea;

  /* 文字、线条、面板 */
  --text: #f4f1ea;
  --text-soft: #d5dbe2;
  --muted: #a9b3bf;
  --line: rgba(227, 199, 122, 0.14);
  --line-soft: rgba(244, 241, 234, 0.1);
  --panel: rgba(14, 30, 56, 0.72);
  --code-bg: #050d1a;

  --gold-gradient: linear-gradient(135deg, #f1dc9c 0%, #e3c77a 38%, #c8a24a 100%);
  --radius-panel: 18px;
  --radius-button: 10px;
  --sans: "Avenir Next", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

/* ---------- 基础 ---------- */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 0%, rgba(200, 162, 74, 0.14), transparent 30%),
    radial-gradient(circle at 90% 6%, rgba(21, 149, 143, 0.18), transparent 28%),
    linear-gradient(180deg, #071225 0%, var(--ink) 45%, #081528 100%);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

/* 顶部一层淡淡的网格，越往下越透明，和首页的背景呼应 */
body::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  z-index: -1;
  height: 620px;
  background-image:
    linear-gradient(rgba(227, 199, 122, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(227, 199, 122, 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 100%);
  pointer-events: none;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

::selection {
  background: rgba(200, 162, 74, 0.45);
  color: #fff;
}

:focus-visible {
  outline: 3px solid var(--jade-light);
  outline-offset: 3px;
}

.container {
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  z-index: 300;
  padding: 10px 14px;
  border-radius: var(--radius-button);
  background: var(--gold-light);
  color: var(--ink);
}

.skip-link:focus {
  top: 12px;
}

/* ---------- 按钮 ---------- */

.btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0.65rem 1.2rem;
  border: 1px solid transparent;
  border-radius: var(--radius-button);
  font-weight: 650;
  line-height: 1.5;
  white-space: nowrap;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-large {
  min-height: 50px;
  padding: 0.8rem 1.5rem;
}

/* 主按钮：香槟金渐变，渐变位置缓慢流动；悬停时一道高光扫过 */
.btn-gold {
  background: var(--gold-gradient);
  background-size: 200% 200%;
  color: var(--ink);
  box-shadow: 0 14px 30px rgba(200, 162, 74, 0.22);
  animation: gradient-shift 6s ease infinite;
}

.btn-gold:hover {
  box-shadow: 0 18px 36px rgba(200, 162, 74, 0.36);
}

.btn-gold::after {
  content: "";
  position: absolute;
  top: 0;
  left: -75%;
  z-index: -1;
  width: 50%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  transform: skewX(-20deg);
  transition: left 0.7s ease;
}

.btn-gold:hover::after {
  left: 130%;
}

.btn-ghost {
  border-color: var(--line-soft);
  background: rgba(244, 241, 234, 0.04);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: rgba(227, 199, 122, 0.5);
  background: rgba(227, 199, 122, 0.08);
}

/* ---------- 顶部导航 ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 16, 31, 0.85);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
}

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

.brand img {
  width: 92px;
  height: auto;
}

/*
  导航栏标志：文字层（logo-text-dark.svg）静止，双旋图形（icon-dark.svg）叠在原来的位置上，
  14 秒匀速转一圈，和首页保持一致。
  位置百分比由两张图的 viewBox 换算：logo 是 (6 10 362 180)，图标是 (15 15 170 170)，
  所以 left=(15-6)/362，top=(15-10)/180，width=170/362，height=170/180，图形与原 logo 完全重合。
  系统开启“减少动态效果”时，下方的规则会让它停止转动。
*/
.brand-logo {
  position: relative;
  display: block;
  flex-shrink: 0;
}

.brand-logo .brand-logo-text {
  display: block;
}

.brand .brand-logo-mark {
  position: absolute;
  left: 2.486%;
  top: 2.778%;
  width: 46.961%;
  height: 94.444%;
  animation: spin-slow 14s linear infinite;
}

/* 标志右侧“数据枢纽 / DATA HUB”，和首页一致 */
.brand-sub {
  display: flex;
  flex-direction: column;
  padding-left: 12px;
  border-left: 1px solid rgba(227, 199, 122, 0.3);
  line-height: 1.3;
}

.brand-sub b {
  font-size: 16px;
  letter-spacing: 0.08em;
}

.brand-sub small {
  color: var(--gold-light);
  font: 600 9px/1.4 var(--mono);
  letter-spacing: 0.22em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  color: var(--muted);
  font-size: 0.92rem;
}

.site-nav a {
  position: relative;
  padding: 6px 0;
  white-space: nowrap;
  transition: color 0.2s ease;
}

/* 导航下划线：悬停或当前所在栏目时，从中间展开一条金色细线 */
.site-nav a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -2px;
  left: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--gold-light), var(--jade-light));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
}

.site-nav a:hover::after,
.site-nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ---------- 面包屑：首页 › 教程中心 › 当前页 ---------- */

.breadcrumb {
  margin-top: 28px;
  color: var(--muted);
  font-size: 0.85rem;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumb li + li::before {
  content: "›";
  margin-right: 6px;
  color: rgba(227, 199, 122, 0.6);
}

.breadcrumb a:hover {
  color: var(--gold-light);
}

/* 小胶囊标签，带一道来回扫过的光 */
.eyebrow {
  position: relative;
  overflow: hidden;
  display: inline-block;
  padding: 0.35rem 0.8rem;
  border: 1px solid rgba(227, 199, 122, 0.28);
  border-radius: 999px;
  background: rgba(200, 162, 74, 0.1);
  color: var(--gold-light);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.eyebrow::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(241, 220, 156, 0.35), transparent 70%);
  transform: translateX(-100%);
  animation: shimmer 3.6s ease-in-out infinite;
}

/* ---------- 教程中心首页 ---------- */

.hub-hero {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  align-items: center;
  gap: 48px;
  padding: 40px 0 24px;
}

.hub-hero h1 {
  margin-top: 16px;
  font-size: clamp(2.2rem, 4.6vw, 3.4rem);
  line-height: 1.2;
}

/* 标题里的金色渐变字 */
.gold-text {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hub-intro {
  max-width: 580px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 1.05rem;
}

/* 右侧“接入信息”卡片 */
.quick-card {
  padding: 26px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: linear-gradient(160deg, rgba(17, 34, 62, 0.9), rgba(8, 20, 40, 0.92));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
}

.quick-card-title {
  color: var(--gold-light);
  font-weight: 650;
}

.endpoint-list {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.endpoint-list dt {
  color: var(--muted);
  font-size: 0.85rem;
}

.endpoint-list dd {
  margin-top: 2px;
  color: var(--text);
  word-break: break-all;
}

.guide-group {
  margin-top: 56px;
}

.group-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 1.3rem;
}

.group-title small {
  color: var(--gold-light);
  font: 600 0.72rem/1 var(--mono);
  letter-spacing: 0.18em;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-top: 18px;
}

/* 教程卡片：悬停时上浮，边框亮起金色 */
.guide-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-panel);
  background: var(--panel);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.guide-card:hover {
  transform: translateY(-4px);
  border-color: rgba(227, 199, 122, 0.45);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(227, 199, 122, 0.12);
}

.guide-card h3 {
  font-size: 1.12rem;
  line-height: 1.5;
}

.guide-card p {
  color: var(--muted);
  font-size: 0.95rem;
}

.card-tag {
  align-self: flex-start;
  padding: 0.15rem 0.6rem;
  border: 1px solid rgba(47, 192, 180, 0.35);
  border-radius: 999px;
  color: var(--jade-light);
  font-size: 0.75rem;
}

.card-more {
  margin-top: auto;
  padding-top: 6px;
  color: var(--gold-light);
  font-size: 0.9rem;
}

.card-more span {
  display: inline-block;
  transition: transform 0.25s ease;
}

.guide-card:hover .card-more span {
  transform: translateX(4px);
}

/* 教程中心首页里的普通内容区（如“常见报错速查”） */
.hub-main {
  padding-bottom: 72px;
}

.hub-section {
  margin-top: 64px;
}

.hub-section .group-title + p {
  margin-top: 10px;
  color: var(--muted);
}

.hub-section .table-scroll {
  margin-top: 16px;
}

/* ---------- 教程文章 ---------- */

.article {
  width: min(820px, calc(100% - 40px));
  margin: 0 auto;
  padding-bottom: 72px;
}

.article-head {
  padding: 24px 0 30px;
  border-bottom: 1px solid var(--line);
}

.article-head h1 {
  margin-top: 14px;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  line-height: 1.3;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.88rem;
}

.lead {
  margin-top: 18px;
  color: var(--text-soft);
  font-size: 1.06rem;
}

/* 本页目录 */
.toc {
  margin-top: 28px;
  padding: 18px 22px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--panel);
}

.toc-title {
  color: var(--gold-light);
  font-size: 0.9rem;
  font-weight: 650;
}

.toc ol {
  margin-top: 8px;
  padding-left: 1.3em;
  color: var(--muted);
  font-size: 0.93rem;
  columns: 2;
  column-gap: 32px;
}

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

.article-body h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 52px;
  font-size: 1.45rem;
  line-height: 1.4;
  scroll-margin-top: 92px;
}

/* 步骤编号：金色圆点里的数字 */
.step-no {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gold-gradient);
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 700;
}

.article-body h3 {
  margin-top: 30px;
  font-size: 1.12rem;
  scroll-margin-top: 92px;
}

.article-body p,
.article-body ul,
.article-body ol,
.article-body .code-block,
.article-body .table-scroll,
.article-body .note,
.article-body .faq {
  margin-top: 16px;
}

.article-body p,
.article-body li {
  color: var(--text-soft);
}

.article-body ul,
.article-body ol {
  padding-left: 1.4em;
}

.article-body li + li {
  margin-top: 6px;
}

.article-body ul li::marker,
.article-body ol li::marker {
  color: var(--gold-light);
}

.article-body strong {
  color: #fff;
}

.article-body a {
  border-bottom: 1px solid rgba(47, 192, 180, 0.35);
  color: var(--jade-light);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.article-body a:hover {
  border-color: var(--gold-light);
  color: var(--gold-light);
}

/* 行内代码，如 `sk-`、`/v1` */
code {
  padding: 0.12em 0.4em;
  border-radius: 6px;
  background: rgba(227, 199, 122, 0.1);
  color: #f1dc9c;
  font-family: var(--mono);
  font-size: 0.88em;
  word-break: break-word;
}

/* 代码块：上方一行小标题，右上角的“复制”按钮由 guide.js 加上 */
.code-block {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--code-bg);
}

.code-label {
  display: block;
  padding: 7px 16px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted);
  font: 600 0.75rem/1.6 var(--mono);
  letter-spacing: 0.06em;
}

.code-block pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  color: #e6e9ee;
  font: 0.88rem/1.7 var(--mono);
}

.code-block pre code {
  padding: 0;
  background: none;
  color: inherit;
  font-size: inherit;
  white-space: pre;
  word-break: normal;
}

.copy-btn {
  position: absolute;
  top: 5px;
  right: 8px;
  padding: 1px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(244, 241, 234, 0.06);
  color: var(--muted);
  font-size: 0.78rem;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.copy-btn:hover {
  border-color: rgba(227, 199, 122, 0.5);
  color: var(--text);
}

.copy-btn.is-done {
  border-color: var(--jade);
  color: var(--jade-light);
}

/* 表格：手机上放不下时左右滑动 */
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
}

table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 0.93rem;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}

th {
  background: rgba(227, 199, 122, 0.06);
  color: var(--gold-light);
  font-weight: 600;
  white-space: nowrap;
}

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

/* 表格里的配置名、地址保持在同一行，不从中间折断；放不下时整个表格左右滑动 */
td code {
  white-space: nowrap;
  word-break: normal;
}

tr:last-child td {
  border-bottom: 0;
}

/* 提示框：青碧色是一般提示，金色是需要注意的地方 */
.note {
  padding: 14px 18px;
  border-left: 3px solid var(--jade-light);
  border-radius: 0 12px 12px 0;
  background: rgba(21, 149, 143, 0.1);
  font-size: 0.95rem;
}

.note-warn {
  border-left-color: var(--gold-light);
  background: rgba(200, 162, 74, 0.1);
}

.note p {
  margin: 0;
}

.note p + p {
  margin-top: 6px;
}

/* 常见问题：用原生的 details 展开收起，不需要脚本 */
.faq {
  display: grid;
  gap: 10px;
}

.faq details {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--panel);
  transition: border-color 0.2s ease;
}

.faq details[open] {
  border-color: rgba(227, 199, 122, 0.35);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

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

.faq summary::after {
  content: "+";
  flex: none;
  color: var(--gold-light);
  font-size: 1.3rem;
  line-height: 1;
  transition: transform 0.25s ease;
}

.faq details[open] summary::after {
  transform: rotate(45deg);
}

.faq-body {
  padding: 0 18px 16px;
}

.faq-body p {
  margin-top: 0;
}

.faq-body p + p {
  margin-top: 8px;
}

/* 文末的试用引导 */
.cta-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 56px;
  padding: 30px 32px;
  border: 1px solid rgba(227, 199, 122, 0.3);
  border-radius: var(--radius-panel);
  background:
    radial-gradient(circle at 0% 0%, rgba(200, 162, 74, 0.18), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(21, 149, 143, 0.2), transparent 55%),
    var(--panel);
}

.cta-title {
  font-size: 1.25rem;
  font-weight: 700;
}

.cta-box p + p {
  margin-top: 4px;
  color: var(--muted);
}

.related {
  margin-top: 48px;
}

.related-title {
  font-size: 1.15rem;
}

/* ---------- 页脚 ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(6, 16, 31, 0.7);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
  padding: 32px 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.footer-brand img {
  width: 96px;
  height: auto;
}

.footer-brand p {
  margin-top: 8px;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 6px 28px;
  align-content: start;
}

.footer-info {
  display: grid;
  gap: 4px;
  align-content: start;
  text-align: right;
}

.footer-links a:hover,
.footer-info a:hover {
  color: var(--gold-light);
}

/* ---------- 响应式 ---------- */

@media (max-width: 960px) {
  .hub-hero {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .footer-info {
    text-align: left;
  }
}

/* 手机：导航链接收起（面包屑和标志已经能回到首页和教程中心），按钮缩小 */
@media (max-width: 640px) {
  .container,
  .article {
    width: calc(100% - 32px);
  }

  .header-inner {
    gap: 10px;
    min-height: 62px;
  }

  .site-nav {
    display: none;
  }

  .brand {
    gap: 10px;
  }

  .brand img {
    width: 76px;
  }

  .brand-sub {
    padding-left: 10px;
  }

  .brand-sub b {
    font-size: 14px;
  }

  .header-actions {
    gap: 8px;
  }

  .header-actions .btn {
    min-height: 36px;
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .toc ol {
    columns: 1;
  }

  .article-body h2 {
    margin-top: 44px;
    font-size: 1.25rem;
  }

  .cta-box {
    padding: 24px;
  }

  .footer-links {
    grid-template-columns: 1fr 1fr;
  }
}

/* 超窄屏（≤374px）：和首页一样隐藏“数据枢纽”小字，让按钮和标志留在同一行 */
@media (max-width: 374px) {
  .brand-sub {
    display: none;
  }
}

/* 系统开启“减少动态效果”时，关闭所有动画和过渡 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- 关键帧 ---------- */

@keyframes spin-slow {
  to {
    transform: rotate(360deg);
  }
}

@keyframes gradient-shift {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  60%,
  100% {
    transform: translateX(100%);
  }
}
