/* ===== 教程页共享样式(纯 CSS, 零 JS) =====
   设计令牌与落地页 src/styles/global.css 保持一致(深色科技风);
   本文件被 /guides/*.html 直接引用, 不经任何打包与运行时依赖。 */

:root {
  --bg: #0b1020;
  --bg-soft: #0d1329;
  --text: #eef1ff;
  --muted: #a6aecb;
  --cyan: #06b6d4;
  --indigo: #2563eb;
  --border: rgba(111, 180, 255, 0.16);
  --panel: rgba(18, 25, 54, 0.5);
  --radius: 18px;
  --nav-h: 60px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  background-image:
    radial-gradient(900px 480px at 12% -4%, rgba(37, 99, 235, 0.14), transparent 60%),
    radial-gradient(800px 460px at 88% 8%, rgba(6, 182, 212, 0.1), transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

img,
svg {
  display: block;
}

/* ===== 页头(全站互通导航) ===== */
.g-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(5, 7, 15, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.g-header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 22px;
}

.g-brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 0.02em;
}

.g-brand small {
  font-weight: 400;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.g-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 14px;
  color: var(--muted);
}

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

.g-cta {
  padding: 9px 18px;
  border-radius: 12px;
  color: #0b1020 !important;
  font-weight: 700;
  background: linear-gradient(120deg, #2563eb, #3b82f6 55%, #06b6d4);
  box-shadow: 0 6px 24px rgba(37, 99, 235, 0.35);
}

.g-cta:hover {
  filter: brightness(1.08);
  color: #0b1020;
}

/* ===== 面包屑 ===== */
.g-breadcrumb {
  max-width: 960px;
  margin: 0 auto;
  padding: 18px 20px 0;
  font-size: 13px;
  color: var(--muted);
}

.g-breadcrumb a {
  color: var(--muted);
}

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

.g-breadcrumb .sep {
  margin: 0 8px;
  color: rgba(154, 163, 186, 0.5);
}

/* ===== 正文 ===== */
.g-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 26px 20px 70px;
}

.g-article > h1 {
  font-size: clamp(26px, 4vw, 36px);
  line-height: 1.35;
  font-weight: 800;
}

.g-meta {
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
}

.g-meta .tag {
  display: inline-block;
  margin-right: 10px;
  padding: 3px 12px;
  border-radius: 999px;
  border: 1px solid rgba(6, 182, 212, 0.28);
  background: rgba(6, 182, 212, 0.07);
  color: #7dd3fc;
  letter-spacing: 0.12em;
}

.g-article > h2 {
  margin: 52px 0 16px;
  font-size: 23px;
  font-weight: 700;
  padding-left: 14px;
  border-left: 4px solid;
  border-image: linear-gradient(180deg, #2563eb, #06b6d4) 1;
}

.g-article > h3 {
  margin: 30px 0 10px;
  font-size: 17.5px;
  font-weight: 700;
  color: #c4d2ff;
}

.g-article p {
  margin: 12px 0;
  color: var(--muted);
  line-height: 2;
  font-size: 15.5px;
}

.g-article strong {
  color: var(--text);
}

.g-article ul,
.g-article ol {
  margin: 12px 0;
  padding-left: 24px;
  color: var(--muted);
  line-height: 2;
  font-size: 15.5px;
}

.g-article li {
  margin: 6px 0;
}

.g-article li::marker {
  color: #60a5fa;
}

/* 步骤序号列表 */
.g-article ol.steps {
  counter-reset: step;
  list-style: none;
  padding-left: 0;
}

.g-article ol.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 46px;
  margin: 18px 0;
}

.g-article ol.steps > li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 2px;
  font-weight: 800;
  color: #60a5fa;
  font-size: 15px;
  letter-spacing: 0.04em;
}

/* 行内代码 / 代码块 */
.g-article code {
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(37, 99, 235, 0.14);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: #a5d8ff;
  font-size: 0.92em;
  font-family: 'Cascadia Code', Consolas, 'JetBrains Mono', monospace;
  word-break: break-all;
}

.g-article pre {
  margin: 16px 0;
  padding: 18px 20px;
  border-radius: 14px;
  background: #0a0f22;
  border: 1px solid var(--border);
  overflow-x: auto;
}

.g-article pre code {
  padding: 0;
  background: none;
  border: none;
  color: #9fd0ff;
  font-size: 13.5px;
  line-height: 1.8;
}

/* 表格 */
.g-article table {
  width: 100%;
  margin: 18px 0;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.7;
  display: block;
  overflow-x: auto;
}

.g-article th,
.g-article td {
  padding: 11px 14px;
  border: 1px solid var(--border);
  text-align: left;
}

.g-article th {
  background: rgba(37, 99, 235, 0.12);
  color: var(--text);
  white-space: nowrap;
}

.g-article td {
  color: var(--muted);
}

/* 提示框 */
.g-article .tip,
.g-article .warn {
  margin: 18px 0;
  padding: 14px 18px;
  border-radius: 12px;
  line-height: 1.9;
  font-size: 14.5px;
}

.g-article .tip {
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: #a5e6f5;
}

.g-article .warn {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.32);
  color: #fbd38d;
}

/* 正文内普通链接 */
.g-article p a,
.g-article li a {
  color: #38bdf8;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ===== 相关教程 + 下载 CTA ===== */
.g-related {
  margin-top: 60px;
  padding: 30px 28px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--border);
}

.g-related h2 {
  font-size: 19px;
  margin-bottom: 16px;
}

.g-related ul {
  list-style: none;
}

.g-related li {
  margin: 10px 0;
}

.g-related a {
  color: #38bdf8;
}

.g-related a:hover {
  text-decoration: underline;
}

.g-dl-box {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid rgba(148, 163, 205, 0.12);
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.g-dl-box p {
  flex: 1;
  min-width: 220px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

.g-dl-box .btn-primary {
  padding: 12px 26px;
  border-radius: 12px;
  color: #0b1020;
  font-weight: 700;
  background: linear-gradient(120deg, #2563eb, #3b82f6 55%, #06b6d4);
  box-shadow: 0 8px 32px rgba(37, 99, 235, 0.35);
}

/* ===== 页脚(全站互通) ===== */
.g-footer {
  border-top: 1px solid var(--border);
  padding: 44px 20px 32px;
  background: rgba(5, 7, 15, 0.5);
}

.g-footer-inner {
  max-width: 960px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 30px;
}

.g-footer h3 {
  font-size: 14px;
  margin-bottom: 12px;
  color: var(--text);
  letter-spacing: 0.06em;
}

.g-footer ul {
  list-style: none;
}

.g-footer li {
  margin: 7px 0;
}

.g-footer a {
  color: var(--muted);
  font-size: 13.5px;
}

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

.g-footer .f-brand {
  font-size: 16px;
  font-weight: 800;
}

.g-footer .f-dim {
  margin-top: 10px;
  color: rgba(154, 163, 186, 0.6);
  font-size: 13px;
  line-height: 1.8;
}

.g-copy {
  max-width: 960px;
  margin: 30px auto 0;
  padding-top: 18px;
  border-top: 1px solid rgba(148, 163, 205, 0.08);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 12.5px;
}

@media (max-width: 720px) {
  .g-nav .g-nav-hide {
    display: none;
  }

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