/* ============================================
   QRCode.wang — 内容页样式(教程/FAQ/专页)
   依赖 style.css 的变量与基础组件
   ============================================ */

/* ---------- 面包屑 ---------- */
.breadcrumb {
  padding: 16px 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.breadcrumb li {
  display: flex;
  align-items: center;
  gap: 6px;
}
.breadcrumb li + li::before {
  content: "/";
  color: var(--text-muted);
  margin: 0 4px;
}
.breadcrumb a {
  color: var(--text-secondary);
  transition: color var(--transition);
}
.breadcrumb a:hover {
  color: var(--primary);
}
.breadcrumb [aria-current="page"] {
  color: var(--primary);
  font-weight: 600;
}

/* ---------- 文章容器 ---------- */
.article {
  max-width: 820px;
  margin: 0 auto;
}
.article-wide {
  max-width: 1080px;
  margin: 0 auto;
}

.article-header {
  text-align: center;
  margin-bottom: 40px;
}
.article-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.article-header .lead {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.7;
}
.article-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.article-meta .tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 999px;
  font-weight: 600;
}

/* ---------- 正文排版 ---------- */
.prose {
  color: var(--text-primary);
  line-height: 1.85;
  font-size: 1rem;
}
.prose h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 48px 0 18px;
  letter-spacing: -0.01em;
  position: relative;
  padding-left: 16px;
  scroll-margin-top: 90px;
}
.prose h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 4px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
}
.prose h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 32px 0 14px;
  scroll-margin-top: 90px;
}
.prose h4 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 24px 0 10px;
  color: var(--text-secondary);
}
.prose p {
  margin-bottom: 16px;
}
.prose ul,
.prose ol {
  margin: 0 0 18px;
  padding-left: 24px;
}
.prose li {
  margin-bottom: 8px;
}
.prose ul li::marker {
  color: var(--primary);
}
.prose ol li::marker {
  color: var(--primary);
  font-weight: 700;
}
.prose a {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-color: var(--primary-light);
  text-underline-offset: 3px;
  transition: all var(--transition);
}
.prose a:hover {
  text-decoration-color: var(--primary);
}
.prose strong {
  font-weight: 700;
  color: var(--text-primary);
}
.prose blockquote {
  margin: 24px 0;
  padding: 16px 20px;
  border-left: 4px solid var(--primary);
  background: var(--primary-light);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--text-secondary);
  font-style: normal;
}
.prose blockquote p:last-child {
  margin-bottom: 0;
}

/* 代码块 */
.prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 2px 6px;
  background: var(--primary-light);
  border-radius: 4px;
  color: var(--primary);
}
.prose pre {
  margin: 20px 0;
  padding: 18px 20px;
  background: var(--surface-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow-x: auto;
  position: relative;
}
.prose pre code {
  display: block;
  padding: 0;
  background: none;
  color: var(--text-primary);
  font-size: 0.88rem;
  line-height: 1.6;
  white-space: pre;
}
.prose pre .copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  font-size: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  opacity: 0;
  transition: all var(--transition);
}
.prose pre:hover .copy-btn {
  opacity: 1;
}
.prose pre .copy-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* 表格 */
.prose table {
  width: 100%;
  margin: 20px 0;
  border-collapse: collapse;
  font-size: 0.92rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.prose table th {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 2px solid var(--border-strong);
}
.prose table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}
.prose table tr:last-child td {
  border-bottom: none;
}
.prose table tr:hover td {
  background: var(--primary-light);
}

/* ---------- 信息提示框 ---------- */
.callout {
  margin: 24px 0;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  display: flex;
  gap: 14px;
  align-items: flex-start;
  border: 1px solid;
}
.callout i {
  font-size: 1.2rem;
  margin-top: 2px;
}
.callout .callout-body {
  flex: 1;
}
.callout .callout-body p:last-child {
  margin-bottom: 0;
}
.callout-tip {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.2);
}
.callout-tip i {
  color: var(--success);
}
.callout-warn {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.25);
}
.callout-warn i {
  color: var(--warning);
}
.callout-info {
  background: var(--primary-light);
  border-color: var(--border-strong);
}
.callout-info i {
  color: var(--primary);
}

/* ---------- 步骤卡片 ---------- */
.steps {
  display: grid;
  gap: 16px;
  margin: 24px 0;
}
.step {
  display: flex;
  gap: 18px;
  padding: 20px;
  background: var(--surface-input);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.step:hover {
  border-color: var(--primary);
  transform: translateX(4px);
}
.step-num {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
.step-body {
  flex: 1;
}
.step-body h4 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}
.step-body p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

/* ---------- FAQ 折叠 ---------- */
.faq-list {
  display: grid;
  gap: 12px;
  margin: 24px 0;
}
.faq-item {
  background: var(--surface-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition);
}
.faq-item[open] {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.faq-item summary {
  padding: 16px 20px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-primary);
  font-size: 0.98rem;
}
.faq-item summary::-webkit-details-marker {
  display: none;
}
.faq-item summary::after {
  content: "\f067";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  color: var(--primary);
  font-size: 0.85rem;
  transition: transform var(--transition);
}
.faq-item[open] summary::after {
  content: "\f068";
}
.faq-item .faq-answer {
  padding: 0 20px 18px;
  color: var(--text-secondary);
  line-height: 1.75;
  font-size: 0.94rem;
}
.faq-item .faq-answer p:last-child {
  margin-bottom: 0;
}
.faq-item .faq-answer code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 2px 6px;
  background: var(--primary-light);
  border-radius: 4px;
  color: var(--primary);
}

/* FAQ 分类标签 */
.faq-category {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 36px 0 16px;
  font-size: 1.1rem;
  font-weight: 700;
}
.faq-category i {
  color: var(--primary);
}

/* ---------- 目录 TOC ---------- */
.toc {
  position: sticky;
  top: 92px;
  padding: 20px;
  background: var(--surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  max-height: calc(100vh - 110px);
  overflow-y: auto;
}
.toc h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.toc ul {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 6px;
}
.toc a {
  display: block;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  transition: all var(--transition);
  border-left: 2px solid transparent;
}
.toc a:hover {
  color: var(--primary);
  background: var(--primary-light);
}
.toc a.active {
  color: var(--primary);
  border-left-color: var(--primary);
  background: var(--primary-light);
  font-weight: 600;
}

/* ---------- 工具内嵌区 ---------- */
.embed-tool {
  margin: 36px 0;
  padding: 28px;
  background: var(--surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.embed-tool-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}
.embed-tool-header h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}
.embed-tool-header h3 i {
  color: var(--primary);
}

/* ---------- CTA 行动卡 ---------- */
.cta-card {
  margin: 40px 0;
  padding: 32px;
  text-align: center;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: var(--radius-lg);
  color: #fff;
  box-shadow: 0 12px 32px rgba(99, 102, 241, 0.3);
}
.cta-card h3 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 10px;
  color: #fff;
}
.cta-card p {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 20px;
}
.cta-card .btn-white {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: #fff;
  color: var(--primary);
  border-radius: 999px;
  font-weight: 700;
  transition: all var(--transition);
}
.cta-card .btn-white:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* ---------- 相关文章 ---------- */
.related {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.related h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.related h3 i {
  color: var(--primary);
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.related-card {
  display: block;
  padding: 18px;
  background: var(--surface-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: all var(--transition);
}
.related-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  color: var(--primary);
}
.related-card i {
  font-size: 1.4rem;
  color: var(--primary);
  margin-bottom: 10px;
  display: block;
}
.related-card .t {
  font-weight: 600;
  margin-bottom: 4px;
}
.related-card .d {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ---------- 两栏布局(目录+正文) ---------- */
.layout-2col {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
  align-items: start;
}
.layout-2col .toc-col {
  position: sticky;
  top: 92px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .layout-2col {
    grid-template-columns: 1fr;
  }
  .layout-2col .toc-col {
    display: none;
  }
}

@media (max-width: 640px) {
  .prose h2 {
    font-size: 1.3rem;
  }
  .prose h3 {
    font-size: 1.1rem;
  }
  .step {
    padding: 16px;
    gap: 14px;
  }
  .step-num {
    width: 32px;
    height: 32px;
    font-size: 0.95rem;
  }
  .embed-tool {
    padding: 20px;
  }
  .cta-card {
    padding: 24px 20px;
  }
}
