/* =============================================================================
 *  03-components.css — 可复用组件：按钮/卡片/标签/步骤/时间线/提示/表格/TOC
 * ========================================================================== */

/* ------------------------------------------------------------------ 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 999px;
  font-size: 15px; font-weight: 600; font-family: inherit;
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: transform .12s, box-shadow .12s, background .12s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.14); }
.btn-primary:hover { background: var(--accent-2); }
.btn-outline { background: var(--paper-2); border-color: var(--line); color: var(--ink); }
.btn-outline:hover { background: var(--paper-3); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--paper-3); }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13.5px; }

/* ------------------------------------------------------------------ 英雄区 */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(150deg, var(--hero-from), var(--hero-to));
  color: var(--hero-ink);
  border-radius: var(--radius-l);
  padding: clamp(30px, 5vw, 62px) clamp(22px, 4vw, 52px);
  margin-bottom: 30px;
}
.hero::after {
  /* 中式回纹底纹（纯 CSS，无图片） */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image:
    repeating-linear-gradient(45deg, var(--pattern) 0 2px, transparent 2px 16px),
    repeating-linear-gradient(-45deg, var(--pattern) 0 2px, transparent 2px 16px);
  mask-image: radial-gradient(circle at 80% 20%, #000 0%, transparent 62%);
  -webkit-mask-image: radial-gradient(circle at 80% 20%, #000 0%, transparent 62%);
}
.hero-inner { position: relative; z-index: 1; max-width: 780px; }
.hero-kicker {
  display: inline-block; font-size: 12.5px; letter-spacing: .16em; text-transform: uppercase;
  padding: 5px 12px; border: 1px solid rgba(255,255,255,.35); border-radius: 999px;
  margin-bottom: 16px; opacity: .95;
}
.hero h1 { color: #fff; margin-bottom: 14px; font-size: clamp(30px, 5.2vw, 54px); }
.hero p.lead { font-size: clamp(16px, 2.1vw, 19px); opacity: .93; margin-bottom: 24px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero .btn-primary { background: #fff; color: var(--hero-to); }
.hero .btn-primary:hover { background: #f2ece4; }
.hero .btn-outline { background: transparent; border-color: rgba(255,255,255,.5); color: #fff; }
.hero .btn-outline:hover { background: rgba(255,255,255,.12); }

.hero-stats {
  display: flex; flex-wrap: wrap; gap: 26px; margin-top: 28px;
  padding-top: 20px; border-top: 1px solid rgba(255,255,255,.22);
}
.hero-stats div b { display: block; font-size: 22px; font-family: var(--font-display); }
.hero-stats div span { font-size: 13px; opacity: .85; }

/* ------------------------------------------------------------------ 卡片网格 */
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

.card {
  position: relative; display: block;
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px;
  transition: transform .14s, box-shadow .14s, border-color .14s;
}
a.card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--accent); }
.card-icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--accent-soft); font-size: 22px; margin-bottom: 12px;
}
.card h3 { font-size: 17.5px; margin-bottom: 6px; color: var(--ink); }
.card p { font-size: 14.5px; color: var(--muted); margin: 0; }
.card .card-more { display: inline-block; margin-top: 12px; font-size: 13.5px; font-weight: 600; color: var(--accent-2); }
.badge-hot {
  position: absolute; top: 12px; inset-inline-end: 12px;
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
  background: var(--accent); color: #fff; padding: 3px 8px; border-radius: 999px;
}

/* ------------------------------------------------------------------ 区块标题 */
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.sec-head h2 { margin: 0; }
.sec-head .sec-sub { font-size: 14.5px; color: var(--muted); }

.section { margin-block: 34px; }
.section > h2 { position: relative; padding-bottom: 10px; margin-bottom: 16px; }
.section > h2::after {
  content: ""; position: absolute; inset-inline-start: 0; bottom: 0;
  width: 52px; height: 3px; border-radius: 3px; background: var(--accent);
}

/* ------------------------------------------------------------------ 提示框 */
.note, .tip, .warn, .danger-box {
  border-radius: var(--radius-s); padding: 14px 16px; margin: 18px 0;
  font-size: 15px; border: 1px solid var(--line); background: var(--paper-2);
}
.note { border-inline-start: 4px solid var(--accent); background: var(--accent-soft); }
.tip  { border-inline-start: 4px solid var(--ok); background: rgba(47,122,79,.08); }
.warn { border-inline-start: 4px solid var(--warn); background: rgba(179,112,26,.09); }
.danger-box { border-inline-start: 4px solid var(--danger); background: rgba(179,38,30,.08); }
.note b, .tip b, .warn b, .danger-box b { display: block; margin-bottom: 4px; }

/* ------------------------------------------------------------------ 步骤 / 时间线 */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: st; }
.steps > li {
  position: relative; padding-inline-start: 46px; margin-bottom: 18px; counter-increment: st;
}
.steps > li::before {
  content: counter(st);
  position: absolute; inset-inline-start: 0; top: 0;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 14px;
  display: grid; place-items: center; font-family: var(--font-body);
}
.steps > li b { display: block; font-size: 16px; margin-bottom: 2px; }
.steps > li p { margin: 0; color: var(--ink-2); font-size: 15px; }

.timeline { list-style: none; margin: 0; padding-inline-start: 22px; border-inline-start: 2px solid var(--line); }
.timeline > li { position: relative; margin-bottom: 16px; }
.timeline > li::before {
  content: ""; position: absolute; inset-inline-start: -29px; top: 7px;
  width: 12px; height: 12px; border-radius: 50%; background: var(--accent);
  border: 2px solid var(--paper);
}
.timeline > li b { display: block; }

/* ------------------------------------------------------------------ 标签 / 徽标 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.chip {
  font-size: 13px; padding: 5px 11px; border-radius: 999px;
  background: var(--paper-3); color: var(--ink-2); border: 1px solid var(--line);
}
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-2); font-weight: 600; }

/* ------------------------------------------------------------------ 要点清单 */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { position: relative; padding-inline-start: 28px; margin-bottom: 10px; }
.checklist li::before {
  content: "✓"; position: absolute; inset-inline-start: 0; top: 0;
  color: var(--ok); font-weight: 700;
}
.checklist li.bad::before { content: "✕"; color: var(--danger); }

/* ------------------------------------------------------------------ 数据表 / 定义表 */
.kv { width: 100%; }
.kv th { width: 33%; }

/* ------------------------------------------------------------------ 折叠 FAQ */
details.faq {
  border: 1px solid var(--line); border-radius: var(--radius-s);
  background: var(--paper-2); margin-bottom: 10px; overflow: hidden;
}
details.faq > summary {
  cursor: pointer; padding: 14px 16px; font-weight: 600; font-size: 16px;
  list-style: none; display: flex; justify-content: space-between; gap: 12px; align-items: center;
}
details.faq > summary::-webkit-details-marker { display: none; }
details.faq > summary::after { content: "+"; color: var(--accent); font-size: 20px; line-height: 1; }
details.faq[open] > summary::after { content: "–"; }
details.faq .faq-body { padding: 0 16px 14px; color: var(--ink-2); font-size: 15px; }

/* ------------------------------------------------------------------ 目录 TOC */
.toc { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-2); padding: 16px 18px; }
.toc h4 { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; font-family: var(--font-body); }
.toc ol { list-style: none; margin: 0; padding: 0; font-size: 14.5px; }
.toc ol li { margin-bottom: 7px; }
.toc a { color: var(--ink-2); display: block; padding-inline-start: 10px; border-inline-start: 2px solid transparent; }
.toc a:hover, .toc a.active { color: var(--accent-2); border-inline-start-color: var(--accent); text-decoration: none; }

/* ------------------------------------------------------------------ 分享条 */
.share-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line); }
.share-bar .share-label { font-size: 13.5px; color: var(--muted); margin-inline-end: 4px; }

/* ------------------------------------------------------------------ 面包屑 */
.crumbs { font-size: 13.5px; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.crumbs span { margin-inline: 6px; opacity: .6; }

/* ------------------------------------------------------------------ 更新时间 */
.meta-line { font-size: 13.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 18px; }

/* ------------------------------------------------------------------ 联盟推荐卡 */
.aff-card {
  display: flex; gap: 12px; align-items: center; justify-content: space-between;
  background: var(--paper-2); border: 1px dashed var(--accent);
  border-radius: var(--radius-s); padding: 12px 14px; margin: 14px 0; font-size: 14.5px;
}
.aff-card b { font-size: 15px; }
.aff-card p { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }
.aff-disclose { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.aff-disclose:empty { display: none; }
