/* ============================================================================
   无限摄影社 · 知识库样式 Handbooks
   ========================================================================== */

/* ══════════════════════════════════════════════════════════════════
   手册卡片（列表页）
   ═══════════════════════════════════════════════════════════════════ */
.hb-card {
  padding: var(--sp-5);
  gap: var(--sp-3);
  display: flex;
  flex-direction: column;
  min-height: 210px;
  text-decoration: none;
  color: inherit;
}
.hb-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-1);
}
.hb-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  flex: 0 0 38px;
  border-radius: var(--r-md);
  background: linear-gradient(140deg, rgba(200,16,46,.18), rgba(200,16,46,.05));
  border: 1px solid rgba(200,16,46,.28);
  color: var(--red-400);
}
.hb-card__icon svg { width: 19px; height: 19px; }
.hb-card__title {
  font-size: var(--fs-lg);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.35;
}
.hb-card__summary {
  font-size: var(--fs-sm);
  color: var(--text-3);
  line-height: 1.7;
  flex: 1;
}
.hb-card .card__foot { margin-top: auto; }

/* ══════════════════════════════════════════════════════════════════
   检索命中
   ═══════════════════════════════════════════════════════════════════ */
.hb-hit {
  display: block;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  background: var(--glass-1);
  border: 1px solid var(--stroke-1);
  transition: background var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast);
}
.hb-hit:hover {
  background: var(--glass-3);
  border-color: var(--stroke-2);
  transform: translateX(3px);
}
.hb-hit__chapter {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 4px;
}
.hb-hit__snippet {
  font-size: var(--fs-xs);
  color: var(--text-3);
  line-height: 1.65;
}

/* ══════════════════════════════════════════════════════════════════
   侧栏目录
   ═══════════════════════════════════════════════════════════════════ */
.hb-toc {
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: 46dvh;
  overflow-y: auto;
  margin: 0 calc(var(--sp-2) * -1);
  padding: 0 var(--sp-1);
}
.hb-toc__item {
  display: flex;
  gap: var(--sp-3);
  align-items: baseline;
  padding: 7px var(--sp-2);
  border-radius: var(--r-sm);
  font-size: var(--fs-xs);
  color: var(--text-3);
  line-height: 1.5;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.hb-toc__item:hover { background: var(--glass-2); color: var(--text-1); }
.hb-toc__num {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-4);
  flex: 0 0 18px;
}
.hb-toc__label { flex: 1; }

.hb-rel {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  padding: 7px var(--sp-2);
  border-radius: var(--r-sm);
  font-size: var(--fs-xs);
  color: var(--text-3);
  transition: background var(--dur-fast), color var(--dur-fast);
}
.hb-rel:hover { background: var(--glass-2); color: var(--text-1); }

/* ══════════════════════════════════════════════════════════════════
   阅读页正文
   ═══════════════════════════════════════════════════════════════════ */
.hb-article .article__title { margin-bottom: var(--sp-3); }

.hb-chapter {
  margin-bottom: var(--sp-10);
  scroll-margin-top: calc(var(--topbar-h) + var(--sp-6));
}
.hb-chapter__title {
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
  font-size: var(--fs-xl);
  font-weight: 800;
  letter-spacing: -.02em;
  padding-bottom: var(--sp-3);
  margin-bottom: var(--sp-5);
  border-bottom: 1px solid var(--stroke-1);
  position: relative;
}
.hb-chapter__title::after {
  content: "";
  position: absolute;
  left: 0; bottom: -1px;
  width: 52px; height: 2px;
  border-radius: var(--r-full);
  background: linear-gradient(90deg, var(--red-500), transparent);
}
.hb-chapter__num {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--red-500);
  flex: 0 0 auto;
}

.hb-p {
  font-size: var(--fs-base);
  line-height: 1.95;
  color: var(--text-2);
  margin-bottom: var(--sp-4);
  white-space: pre-wrap;
}

.hb-quote {
  margin: var(--sp-5) 0;
  padding: var(--sp-4) var(--sp-5);
  border-left: 3px solid var(--red-600);
  background: var(--glass-1);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  font-size: var(--fs-md);
  color: var(--text-1);
  line-height: 1.85;
  font-style: italic;
}

/* 无序列表 */
.hb-list {
  margin: 0 0 var(--sp-5) 0;
  padding-left: 0;
}
.hb-list li {
  position: relative;
  padding-left: var(--sp-5);
  margin-bottom: var(--sp-2);
  font-size: var(--fs-base);
  line-height: 1.85;
  color: var(--text-2);
}
.hb-list li::before {
  content: "";
  position: absolute;
  left: 5px; top: .74em;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--red-500);
}

/* 勾选清单 */
.hb-checklist {
  margin: 0 0 var(--sp-5) 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.hb-checklist li {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  background: var(--glass-1);
  border: 1px solid var(--stroke-1);
  font-size: var(--fs-sm);
  line-height: 1.7;
  color: var(--text-2);
}
.hb-check__box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px; height: 17px;
  flex: 0 0 17px;
  margin-top: 2px;
  border-radius: 4px;
  border: 1.5px solid var(--stroke-3);
  color: transparent;
}
.hb-check__box svg { width: 11px; height: 11px; stroke-width: 3; }

/* 编号步骤 */
.hb-steps {
  margin: 0 0 var(--sp-5) 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  counter-reset: none;
}
.hb-step {
  display: flex;
  gap: var(--sp-4);
  padding: var(--sp-4);
  border-radius: var(--r-md);
  background: var(--glass-1);
  border: 1px solid var(--stroke-1);
}
.hb-step__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  flex: 0 0 26px;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--red-500), var(--red-700));
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: 800;
  box-shadow: var(--shadow-red);
}
.hb-step__title {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 3px;
}
.hb-step__text {
  font-size: var(--fs-sm);
  color: var(--text-3);
  line-height: 1.7;
}

/* 键值对 */
.hb-kv { margin-bottom: var(--sp-5); }

/* 表格 */
.hb-table-wrap {
  margin: 0 0 var(--sp-5) 0;
  border-radius: var(--r-lg);
  border: 1px solid var(--stroke-1);
  background: var(--glass-1);
  overflow: hidden;
}
.hb-table { min-width: 460px; font-size: var(--fs-sm); }
.hb-table th {
  text-align: left;
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-2xs);
  font-weight: 800;
  letter-spacing: var(--ls-wide);
  color: var(--text-3);
  background: rgba(255,255,255,.03);
  border-bottom: 1px solid var(--stroke-1);
  white-space: nowrap;
}
.hb-table td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid rgba(255,255,255,.045);
  color: var(--text-2);
  line-height: 1.7;
  vertical-align: top;
}
.hb-table tbody tr:last-child td { border-bottom: none; }
.hb-table tbody tr:hover { background: rgba(255,255,255,.028); }

/* 提示块 */
.hb-callout {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  padding: var(--sp-4) var(--sp-5);
  margin: 0 0 var(--sp-5) 0;
  border-radius: var(--r-md);
  border: 1px solid var(--stroke-1);
  background: var(--glass-1);
  font-size: var(--fs-sm);
  line-height: 1.8;
}
.hb-callout__icon {
  display: inline-flex;
  width: 18px; height: 18px;
  flex: 0 0 18px;
  margin-top: 3px;
}
.hb-callout__icon svg { width: 100%; height: 100%; }
.hb-callout__title {
  font-weight: 800;
  margin-bottom: 4px;
  color: var(--text-1);
}
.hb-callout__text { color: var(--text-2); white-space: pre-wrap; }

.hb-callout--info {
  background: rgba(74,144,196,.08);
  border-color: rgba(74,144,196,.24);
}
.hb-callout--info .hb-callout__icon { color: #7FC0EF; }

.hb-callout--warn {
  background: rgba(214,158,26,.09);
  border-color: rgba(214,158,26,.28);
}
.hb-callout--warn .hb-callout__icon { color: #E0B44A; }
.hb-callout--warn .hb-callout__title { color: #F2DCA8; }

.hb-callout--danger {
  background: rgba(200,16,46,.10);
  border-color: rgba(200,16,46,.30);
}
.hb-callout--danger .hb-callout__icon { color: var(--red-400); }
.hb-callout--danger .hb-callout__title { color: #F6C9D1; }

.hb-callout--success {
  background: rgba(24,160,96,.09);
  border-color: rgba(24,160,96,.26);
}
.hb-callout--success .hb-callout__icon { color: #4ADE93; }
.hb-callout--success .hb-callout__title { color: #B6F0D2; }

/* ── 手机端 ── */
@media (max-width: 720px) {
  .hb-card { min-height: 0; padding: var(--sp-4); }
  .hb-chapter { margin-bottom: var(--sp-8); }
  .hb-chapter__title { font-size: var(--fs-lg); }
  .hb-p, .hb-list li { font-size: var(--fs-sm); line-height: 1.85; }
  .hb-quote { padding: var(--sp-3) var(--sp-4); font-size: var(--fs-sm); }
  .hb-callout { padding: var(--sp-3) var(--sp-4); }
  .hb-toc { max-height: none; }

  /* 表格在手机上转成卡片式 */
  .hb-table { min-width: 0; }
  .hb-table thead { display: none; }
  .hb-table tbody tr {
    display: block;
    padding: var(--sp-3) var(--sp-4);
    border-bottom: 1px solid var(--stroke-1);
  }
  .hb-table tbody tr:last-child { border-bottom: none; }
  .hb-table td {
    display: flex;
    gap: var(--sp-3);
    padding: 4px 0;
    border: none;
  }
  .hb-table td::before {
    content: attr(data-label);
    flex: 0 0 34%;
    font-size: var(--fs-2xs);
    font-weight: 700;
    color: var(--text-4);
    padding-top: 2px;
  }
}

/* ── 打印：手册存 PDF ── */
@media print {
  .hb-toc, .detail-aside, .back-link, .hb-card__top { display: none !important; }
  .hb-callout, .hb-table-wrap, .hb-checklist li, .hb-step {
    break-inside: avoid;
    border-color: #ccc;
    background: #fff;
  }
  .hb-chapter { break-before: page; }
  .hb-p, .hb-list li, .hb-callout__text { color: #000; }
}
