/* ============================================
   文章详情页样式 - doubao-geo 等长文页面
   依赖 base.css / components.css / pages.css
   ============================================ */

.article-main {
  padding-top: 96px;
}

/* ===== 文章头部 ===== */
.article-hero {
  position: relative;
  padding: 5rem 0 3rem;
  background:
    radial-gradient(ellipse 80% 60% at 20% 0%, rgba(99, 102, 241, 0.18), transparent),
    radial-gradient(ellipse 70% 50% at 85% 20%, rgba(6, 182, 212, 0.14), transparent);
  border-bottom: 1px solid var(--border-subtle);
}

.article-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--fs-sm);
  color: var(--text-tertiary);
  margin-bottom: 1.25rem;
}

.article-breadcrumb a {
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color 0.2s;
}

.article-breadcrumb a:hover {
  color: var(--brand-primary);
}

.article-breadcrumb em {
  font-style: normal;
  color: var(--text-secondary);
}

.article-pill {
  display: inline-block;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--brand-primary);
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.35);
  margin-bottom: 1.25rem;
}

.article-hero h1 {
  font-size: clamp(1.9rem, 4.5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  background-clip: text;
}

.article-hero-desc {
  max-width: 720px;
  font-size: var(--fs-lg);
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 1.75rem;
}

.article-hero .article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: var(--fs-sm);
  color: var(--text-tertiary);
}

.article-hero .article-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.article-hero .article-meta svg {
  color: var(--brand-primary);
}

/* ===== 正文 + 目录布局 ===== */
.article-body-wrap {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 3rem;
  padding-top: 3rem;
  padding-bottom: 4rem;
  align-items: start;
}

.article-toc {
  position: sticky;
  top: 96px;
}

.article-toc-inner {
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 1.25rem 1.4rem;
  background: var(--bg-secondary, rgba(255, 255, 255, 0.03));
}

.article-toc-inner h4 {
  font-size: var(--fs-sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  margin-bottom: 0.75rem;
}

.article-toc-inner ol {
  list-style: none;
  display: grid;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.article-toc-inner a {
  display: block;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  text-decoration: none;
  padding-left: 0.75rem;
  border-left: 2px solid transparent;
  transition: all 0.2s;
}

.article-toc-inner a:hover,
.article-toc-inner a.active {
  color: var(--brand-primary);
  border-left-color: var(--brand-primary);
}

.toc-cta {
  width: 100%;
  font-size: var(--fs-sm);
}

/* ===== 正文排版 (.prose) ===== */
.prose {
  max-width: 100%;
}

.article-lead {
  font-size: var(--fs-lg);
  line-height: 1.8;
  color: var(--text-secondary);
  padding-left: 1rem;
  border-left: 3px solid var(--brand-primary);
  margin-bottom: 2rem;
}

.prose h2 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 2.75rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.prose h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 2rem 0 0.75rem;
  color: var(--text-primary);
}

.prose p {
  line-height: 1.85;
  color: var(--text-secondary);
  margin-bottom: 1.1rem;
}

.prose strong {
  color: var(--text-primary);
  font-weight: 650;
}

.prose code {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.88em;
  padding: 0.15em 0.45em;
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.12);
  color: var(--brand-primary);
}

.prose pre {
  background: rgba(6, 8, 24, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.25rem 1.4rem;
  overflow-x: auto;
  margin: 1.25rem 0 1.75rem;
}

[data-theme="light"] .prose pre {
  background: rgba(15, 23, 42, 0.92);
}

.prose pre code {
  background: none;
  padding: 0;
  color: #cbd5e1;
  font-size: 0.85rem;
  line-height: 1.7;
  white-space: pre;
}

.formula {
  text-align: center;
  font-weight: 650;
  color: var(--text-primary);
  background: rgba(99, 102, 241, 0.08);
  border: 1px dashed rgba(99, 102, 241, 0.4);
  border-radius: 10px;
  padding: 1rem 1.25rem;
}

/* ===== 引用块 ===== */
.prose .quote,
.quote {
  position: relative;
  margin: 1.75rem 0;
  padding: 1.1rem 1.4rem 1.1rem 2.6rem;
  border-radius: 12px;
  border: 1px solid rgba(99, 102, 241, 0.28);
  background: rgba(99, 102, 241, 0.07);
  color: var(--text-secondary);
  font-size: 1.02rem;
  line-height: 1.75;
}

.quote::before {
  content: "\201C";
  position: absolute;
  left: 0.9rem;
  top: 0.35rem;
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--brand-primary);
  opacity: 0.75;
  line-height: 1;
}

/* ===== 数据表格 ===== */
.data-table-wrap {
  margin: 1.75rem 0;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
}

.data-table caption {
  caption-side: top;
  text-align: left;
  font-size: var(--fs-sm);
  color: var(--text-tertiary);
  padding-bottom: 0.6rem;
}

.data-table th,
.data-table td {
  padding: 0.7rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  line-height: 1.55;
}

.data-table thead th {
  background: rgba(99, 102, 241, 0.12);
  color: var(--text-primary);
  font-weight: 700;
  white-space: nowrap;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

[data-theme="light"] .data-table tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.02);
}

/* ===== 关键要点高亮框 ===== */
.highlight-box {
  margin: 1.5rem 0 2rem;
  padding: 1.1rem 1.4rem;
  border-radius: 12px;
  border: 1px solid rgba(6, 182, 212, 0.35);
  background: rgba(6, 182, 212, 0.08);
}

[data-theme="light"] .highlight-box {
  background: rgba(6, 182, 212, 0.06);
}

.highlight-box strong {
  display: block;
  color: var(--brand-primary);
  font-size: var(--fs-sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.4rem;
}

.highlight-box p {
  margin: 0;
  line-height: 1.75;
  color: var(--text-secondary);
}

/* ===== Checklist ===== */
.checklist ul {
  list-style: none;
  display: grid;
  gap: 0.6rem;
  margin-top: 1rem;
}

.checklist li {
  position: relative;
  padding-left: 1.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.checklist li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  top: 0.1rem;
  width: 1.25rem;
  height: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  color: #fff;
  border-radius: 5px;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
}

/* ===== 底部 CTA ===== */
.article-cta {
  padding: 4.5rem 0;
  text-align: center;
  background:
    radial-gradient(ellipse 70% 80% at 50% 100%, rgba(99, 102, 241, 0.2), transparent),
    rgba(99, 102, 241, 0.05);
  border-top: 1px solid var(--border-subtle);
}

.article-cta h2 {
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  font-weight: 800;
  margin-bottom: 0.9rem;
}

.article-cta p {
  max-width: 640px;
  margin: 0 auto 1.75rem;
  color: var(--text-secondary);
  line-height: 1.75;
}

.article-cta-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ===== 响应式 ===== */
@media (max-width: 960px) {
  .article-body-wrap {
    grid-template-columns: 1fr;
  }

  .article-toc {
    position: static;
  }

  .article-toc-inner ol {
    columns: 2;
    column-gap: 1.5rem;
  }
}

@media (max-width: 600px) {
  .article-hero {
    padding: 3.5rem 0 2.25rem;
  }

  .article-toc-inner ol {
    columns: 1;
  }
}
