/* ========== blog/article-style.css ==========
   Token Calculator 14 篇文章统一排版
   深炭灰 + 金色（#c9a961）+ 蓝色 callout
   设计原则：不 SEO 过度 / 快速收录 / 海外用户友好
   关键修复：nav 不要 sticky + element-based 选择器（不依赖 class）
   ========================================== */

/* 关键：文章页 nav 不要滚动跟随（覆盖 styles.css 的 sticky） */
.site-header { position: static !important; background: #fff; }

:root {
  --gold: #c9a961;
  --gold-dark: #a08540;
  --gold-soft: #fef9e7;
  --dark: #1a1d29;
  --dark-soft: #2d3142;
  --text: #1f2937;
  --text-muted: #6b7280;
  --bg: #ffffff;
  --bg-soft: #fafbfc;
  --accent: #146bdf;
  --accent-soft: #eff6ff;
  --green: #16a34a;
  --green-soft: #f0fdf4;
  --warn: #dc2626;
  --warn-soft: #fef2f2;
  --border: #e5e7eb;
  --border-soft: #f0f1f3;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  --radius: 10px;
  --max-w: 760px;
}

/* ========== element-based 通用样式（无需 class） ========== */

/* 主区容器 — 直接应用于 article 元素 */
article {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 40px 24px 60px;
  font-size: 17px;
  line-height: 1.75;
  color: var(--text);
}

/* 标题层级 */
article > h1 {
  font-size: 38px;
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 16px;
  color: var(--dark);
  letter-spacing: -0.02em;
}
article > h2 {
  font-size: 26px;
  font-weight: 800;
  margin: 56px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--dark);
  color: var(--dark);
  letter-spacing: -0.015em;
  line-height: 1.25;
}
article > h3 {
  font-size: 19px;
  font-weight: 700;
  margin: 32px 0 12px;
  color: var(--dark);
}

/* 正文段落 */
article > p {
  margin: 0 0 18px;
}
article > p strong { color: var(--dark); font-weight: 700; }
article > p a, article li a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(20, 107, 223, 0.25);
  transition: border-color 0.15s ease;
}
article > p a:hover, article li a:hover { border-bottom-color: var(--accent); }

/* 列表 */
article > ul, article > ol {
  margin: 0 0 20px;
  padding-left: 28px;
}
article li { margin-bottom: 8px; line-height: 1.65; }
article li::marker { color: var(--gold); font-weight: 700; }

/* 表格 — 斑马纹 + 蓝色表头 */
article > table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14.5px;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
article > table th {
  background: var(--accent);
  color: #fff;
  padding: 12px 16px;
  text-align: left;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
}
article > table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
}
article > table tr:nth-child(even) td { background: var(--bg-soft); }
article > table tr:last-child td { border-bottom: none; }

/* 代码 */
article > p code, article li code {
  background: var(--bg-soft);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: ui-monospace, Menlo, monaco, monospace;
  font-size: 14px;
  color: var(--accent);
}
article pre {
  background: var(--dark);
  color: #e5e7eb;
  padding: 16px 20px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 24px 0;
  font-size: 14px;
  line-height: 1.6;
}
article pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: inherit;
}

/* blockquote — 蓝色左边框引用样式 */
article blockquote {
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  padding: 16px 20px;
  margin: 24px 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: #1e3a8a;
  font-style: normal;
}

/* ========== Hero（深炭灰 + 金色） ========== */
.article-hero {
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-soft) 100%);
  color: #fff;
  padding: 64px 24px 56px;
  margin: -32px -24px 0;
  text-align: left;
  border-bottom: 3px solid var(--gold);
}

.article-hero .breadcrumb {
  font-size: 13px;
  color: #a0a8b8;
  margin-bottom: 20px;
}
.article-hero .breadcrumb a { color: var(--gold); text-decoration: none; }
.article-hero .breadcrumb a:hover { color: #fff; }

.article-hero h1 {
  font-size: 38px;
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 16px;
  letter-spacing: -0.02em;
  color: #fff;
}

.article-hero .meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: #a0a8b8;
  margin-bottom: 16px;
}

.article-hero .meta .tag {
  background: var(--gold);
  color: var(--dark);
  padding: 2px 10px;
  border-radius: 3px;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.article-hero .lede {
  font-size: 17px;
  line-height: 1.6;
  color: #d1d5db;
  margin: 0;
  max-width: 640px;
}

/* ========== 主体内容 ========== */
.article-content {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 40px 24px 60px;
  font-size: 17px;
  line-height: 1.75;
  color: var(--text);
}

.article-content h2 {
  font-size: 26px;
  font-weight: 800;
  margin: 56px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--dark);
  color: var(--dark);
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.article-content h3 {
  font-size: 19px;
  font-weight: 700;
  margin: 32px 0 12px;
  color: var(--dark);
}

.article-content p {
  margin: 0 0 18px;
}

.article-content strong { color: var(--dark); font-weight: 700; }

.article-content a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(20, 107, 223, 0.25);
  transition: border-color 0.15s ease;
}
.article-content a:hover { border-bottom-color: var(--accent); }

/* ========== Callout 框（蓝/绿/金/红 4 色） ========== */
.callout {
  padding: 18px 22px;
  border-radius: var(--radius);
  margin: 28px 0;
  border-left: 4px solid;
  font-size: 16px;
}
.callout-title {
  display: block;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.callout p { margin: 6px 0; }

.callout-info {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: #1e3a8a;
}
.callout-info .callout-title { color: #1d4ed8; }

.callout-tip {
  background: var(--green-soft);
  border-color: var(--green);
  color: #14532d;
}
.callout-tip .callout-title { color: #15803d; }

.callout-warn {
  background: var(--gold-soft);
  border-color: var(--gold);
  color: #713f12;
}
.callout-warn .callout-title { color: #92400e; }

.callout-danger {
  background: var(--warn-soft);
  border-color: var(--warn);
  color: #7f1d1d;
}
.callout-danger .callout-title { color: #991b1b; }

/* ========== 表格（斑马纹 + 阴影） ========== */
.article-content table,
.article-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14.5px;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.article-content th,
.article-table th {
  background: var(--accent);
  color: #fff;
  padding: 12px 16px;
  text-align: left;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
}
.article-content td,
.article-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
}
.article-content tr:nth-child(even) td,
.article-table tr:nth-child(even) td {
  background: var(--bg-soft);
}
.article-content tr:last-child td,
.article-table tr:last-child td {
  border-bottom: none;
}

/* ========== 代码块 ========== */
.article-content code {
  background: var(--bg-soft);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: ui-monospace, Menlo, monaco, monospace;
  font-size: 14px;
  color: var(--accent);
}

.article-content pre {
  background: var(--dark);
  color: #e5e7eb;
  padding: 16px 20px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 24px 0;
  font-size: 14px;
  line-height: 1.6;
}
.article-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: inherit;
}

/* ========== 列表 ========== */
.article-content ul,
.article-content ol {
  margin: 0 0 20px;
  padding-left: 28px;
}
.article-content li {
  margin-bottom: 8px;
  line-height: 1.65;
}
.article-content li::marker { color: var(--gold); font-weight: 700; }

/* ========== 编号步骤（4 步流程图风格） ========== */
.steps {
  list-style: none;
  padding: 0;
  margin: 32px 0;
  counter-reset: step;
}
.steps > li {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-soft);
  counter-increment: step;
}
.steps > li:last-child { border-bottom: none; }
.steps > li::before {
  content: counter(step);
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--dark);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 16px;
  font-family: ui-monospace, Menlo, monaco, monospace;
}
.steps > li h3 {
  margin: 4px 0 6px;
  font-size: 17px;
}
.steps > li p {
  margin: 0;
  font-size: 15px;
  color: var(--text-muted);
}

/* ========== FAQ accordion ========== */
.faq-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 12px;
  transition: border-color 0.15s ease;
}
.faq-item[open] { border-color: var(--gold); }
.faq-item summary {
  font-weight: 700;
  color: var(--dark);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 20px;
  color: var(--gold);
  font-weight: 400;
}
.faq-item[open] summary::after { content: "−"; }
.faq-item p {
  margin: 12px 0 0;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.65;
}

/* ========== Breadcrumb（左对齐，与文章 H1 同一位置） ========== */
nav.breadcrumb,
nav.crumb {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 16px 24px 8px;
  font-size: 13px;
  color: #6b7280;
  text-align: left;
}
nav.breadcrumb a,
nav.crumb a {
  color: #6b7280;
  text-decoration: none;
  transition: color 0.15s ease;
}
nav.breadcrumb a:hover,
nav.crumb a:hover { color: #146bdf; }
nav.breadcrumb span,
nav.crumb span { color: #0b1220; font-weight: 500; }

/* ========== Continue Learning（3 列卡片，标题居中） ========== */
.continue-learning {
  max-width: var(--max-w);
  margin: 56px auto 0;
  padding: 0 24px;
  text-align: center;
}
.continue-learning h2 {
  font-size: 32px;
  font-weight: 700;
  color: #0b1220;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.continue-learning .subtitle {
  font-size: 15px;
  color: #6b7280;
  margin: 0 0 32px;
}
.continue-learning .grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  text-align: left;
}
.continue-learning .card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.continue-learning .card:hover {
  border-color: #146bdf;
  box-shadow: 0 4px 12px rgba(20, 107, 223, 0.08);
}
.continue-learning .card h3 {
  font-size: 17px;
  font-weight: 700;
  color: #0b1220;
  margin: 0 0 12px;
  line-height: 1.35;
}
.continue-learning .card p {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.6;
  margin: 0 0 20px;
  flex: 1;
}
.continue-learning .card a {
  color: #0b1220;
  font-weight: 700;
  text-decoration: none;
  font-size: 14px;
}
.continue-learning .card a:hover { color: #146bdf; }
@media (max-width: 700px) {
  .continue-learning .grid { grid-template-columns: 1fr; }
}

/* ========== Related guides block（标题左对齐 + 3 列卡片 + HUB 入口） ========== */
.related-guides-block {
  max-width: var(--max-w);
  margin: 56px auto 0;
  padding: 0 24px;
}
.related-guides-block h2 {
  font-size: 24px;
  font-weight: 700;
  color: #0b1220;
  margin: 0 0 20px;
  letter-spacing: -0.015em;
  text-align: center;
}
.related-guides-block .grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  text-align: left;
  margin-bottom: 24px;
}
.related-guides-block .card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  background: #fff;
}
.related-guides-block .card:hover {
  border-color: #146bdf;
  box-shadow: 0 4px 12px rgba(20, 107, 223, 0.08);
}
.related-guides-block .card h3 {
  font-size: 16px;
  font-weight: 700;
  color: #0b1220;
  margin: 0 0 10px;
  line-height: 1.35;
}
.related-guides-block .card p {
  font-size: 13.5px;
  color: #6b7280;
  line-height: 1.55;
  margin: 0 0 14px;
  flex: 1;
}
.related-guides-block .card a {
  color: #0b1220;
  font-weight: 700;
  text-decoration: none;
  font-size: 13.5px;
}
.related-guides-block .card a:hover { color: #146bdf; }

/* HUB 入口深色条 */
/* HUB CTA v4 — 方案 A：左 65% 标题+链接组 / 右 35% 大按钮 */
.hub-cta {
  background: linear-gradient(135deg, #1a1d29 0%, #2d3142 100%);
  border-radius: 12px;
  border: 1px solid rgba(201, 169, 97, 0.35);
  padding: 24px 28px;
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) auto;
  gap: 20px;
  align-items: center;
  margin-top: 8px;
}
.hub-cta-text {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.hub-cta-label {
  color: #ffffff;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0;
}
.hub-cta-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
}
.hub-cta-link {
  color: #ffffff;
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 600;
  padding-bottom: 3px;
  border-bottom: 2px solid rgba(201, 169, 97, 0.6);
  transition: color 0.15s ease, border-color 0.15s ease;
}
.hub-cta-link:hover {
  color: var(--gold);
  border-bottom-color: var(--gold);
}
.hub-cta-primary {
  background: var(--gold);
  color: var(--dark) !important;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  border-bottom: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.15s ease;
}
.hub-cta-primary:hover {
  background: #d4b870;
  color: var(--dark) !important;
  transform: translateY(-1px);
}

@media (max-width: 700px) {
  .related-guides-block .grid { grid-template-columns: 1fr; }
  .hub-cta { grid-template-columns: 1fr; gap: 18px; padding: 20px 22px; }
  .hub-cta-links { gap: 10px 16px; }
  .hub-cta-primary { justify-content: center; }
}

/* ========== Hub Banner（内容上方） ========== */
.hub-banner {
  background: var(--dark);
  color: #fff;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid rgba(201, 169, 97, 0.3);
}
.hub-banner-left {
  font-size: 13px;
  color: #d1d5db;
}
.hub-banner-left strong { color: var(--gold); }
.hub-banner a {
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  transition: border-color 0.15s ease;
}
.hub-banner a:hover { border-bottom-color: var(--gold); }
.hub-banner-right {
  display: flex;
  gap: 8px;
  align-items: center;
}
.hub-banner-right .hub-cta {
  background: var(--gold);
  color: var(--dark);
  padding: 6px 14px;
  border-radius: 5px;
  font-weight: 700;
  font-size: 13px;
  border: none;
}
.hub-banner-right .hub-cta:hover { background: #d4b870; }

/* ========== 底部 CTA（深炭灰 + 金色按钮） ========== */
.cta-bottom {
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-soft) 100%);
  color: #fff;
  border-radius: 16px;
  padding: 40px 32px;
  margin-top: 56px;
  text-align: center;
  border: 1px solid rgba(201, 169, 97, 0.3);
}
.cta-bottom h2 {
  color: #fff;
  font-size: 24px;
  margin: 0 0 12px;
  padding: 0;
  border: none;
}
.cta-bottom p {
  color: #d1d5db;
  margin: 0 0 24px;
  font-size: 16px;
}
.cta-bottom a {
  display: inline-block;
  background: var(--gold);
  color: var(--dark);
  padding: 14px 32px;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  font-size: 15px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  border: none;
}
.cta-bottom a:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(201, 169, 97, 0.35);
  border: none;
  color: var(--dark);
}

/* ========== Footer 信息栏 ========== */
.article-footer {
  max-width: var(--max-w);
  margin: 40px auto 0;
  padding: 24px 24px 40px;
  font-size: 13px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-soft);
}

/* ========== 响应式 ========== */
@media (max-width: 700px) {
  .article-hero { padding: 40px 16px 32px; }
  .article-hero h1 { font-size: 28px; }
  .article-hero .lede { font-size: 15px; }
  .article-content { padding: 24px 16px 40px; font-size: 16px; }
  .article-content h2 { font-size: 22px; margin: 40px 0 12px; }
  .article-content h3 { font-size: 17px; }
  .steps > li { gap: 14px; }
  .steps > li::before { width: 30px; height: 30px; font-size: 14px; }
}
