/* ================================================================
 * 纸质资料销售页（/products/paper-book.html、/products/paper-book-orders.html）
 *
 * 骨架仍用 geo-page.css 的 gp-*；支付弹窗、价格卡、表单控件直接复用
 * cert-page.css 的 ct-*——那套是给「官网内嵌下单」写的，本页的链路完全一样，
 * 再抄一份只会让两处样式各自漂移。本文件只补 cert 没有的三块：
 *   1. 预览图集（实物照 + 内页样张）
 *   2. 收货地址表单（cert 的付款流程不收地址，是本页独有的一步）
 *   3. 我的订单列表
 * ================================================================ */

/* ---- 侧栏次级按钮 ----
 * geo-page.css 只有 .gp-side-cta 一种（实心主按钮）。「我的订单」跟「立即购买」
 * 并排时不能同款——两个实心蓝按钮会互相抢，但做成 .gp-toc 里的一条文字链又太轻，
 * 用户找不到。这里补一个描边款，尺寸与主按钮一致。
 */

.bk-side-cta-ghost {
  display: block;
  margin-top: 10px;
  padding: 10px 14px;
  border: 1px solid #dfe5ee;
  border-radius: 8px;
  background: #ffffff;
  color: #56647a;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: border-color 0.18s ease, color 0.18s ease;
}

.bk-side-cta-ghost:hover {
  border-color: #2f6aff;
  color: #2f6aff;
}

/* ---- 预览图集 ---- */

.bk-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.bk-shot {
  margin: 0;
  border: 1px solid #eef1f6;
  border-radius: 10px;
  background: #fbfcfe;
  overflow: hidden;
}

/* 缩略图统一按版心比例（900×1273）裁一个框：原图比例并不一致——封面实拍是
 * 相机照（更宽），版权页是翻拍页（更高），其余是 PDF 渲染的 A4 页。让高度跟着
 * 原图走，同一排的卡片就会参差。裁的是页边留白，点开的大图仍是完整原图。 */
.bk-shot img {
  display: block;
  width: 100%;
  aspect-ratio: 900 / 1273;
  object-fit: cover;
  object-position: center top;
}

.bk-shot figcaption {
  padding: 8px 10px;
  color: #7a8aa2;
  font-size: 12px;
  text-align: center;
}

.bk-shot img {
  cursor: zoom-in;
}

.bk-gallery-note {
  margin: 12px 0 0;
  color: #7a8aa2;
  font-size: 13px;
  line-height: 1.7;
}

/* ---- 预览图放大（lightbox）----
 * 不引灯箱库：站上没有现成的，为这几张图拉一个依赖不划算。
 * 一个遮罩 + 一张 <img> + 左右翻页足够，键盘 Esc / ← / → 也接上。
 */

.bk-lightbox[hidden] {
  display: none;
}

.bk-lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px 64px;
  background: rgba(12, 20, 34, 0.88);
  cursor: zoom-out;
}

.bk-lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  cursor: default;
}

.bk-lightbox-cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22px;
  color: #d9e2f0;
  font-size: 13px;
  text-align: center;
  pointer-events: none;
}

.bk-lightbox-btn {
  position: absolute;
  top: 50%;
  width: 44px;
  height: 44px;
  margin-top: -22px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.18s ease;
}

.bk-lightbox-btn:hover {
  background: rgba(255, 255, 255, 0.26);
}

.bk-lightbox-prev {
  left: 18px;
}

.bk-lightbox-next {
  right: 18px;
}

.bk-lightbox-close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 36px;
  height: 36px;
  margin: 0;
}

@media (max-width: 640px) {
  .bk-lightbox-btn {
    width: 36px;
    height: 36px;
    margin-top: -18px;
    font-size: 18px;
  }

  .bk-lightbox-prev {
    left: 6px;
  }

  .bk-lightbox-next {
    right: 6px;
  }
}

/* ---- 规格表 ---- */

.bk-spec {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.bk-spec div {
  padding: 12px 14px;
  border: 1px solid #eef1f6;
  border-radius: 10px;
  background: #fbfcfe;
}

.bk-spec span {
  display: block;
  color: #7a8aa2;
  font-size: 12px;
}

.bk-spec b {
  display: block;
  margin-top: 4px;
  color: #1c2e4a;
  font-size: 15px;
}

/* ---- 单商品价格卡 ---- */

.bk-buy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  margin-top: 16px;
  padding: 20px;
  border: 1px solid #dfe7f5;
  border-radius: 12px;
  background: linear-gradient(180deg, #f7faff 0%, #ffffff 100%);
}

.bk-buy-price {
  color: #1c2e4a;
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
}

.bk-buy-price i {
  margin-right: 2px;
  font-size: 20px;
  font-style: normal;
}

/* 原价划线。与现价相等时由 JS 隐藏，不占位 */
.bk-buy-origin {
  margin-left: 8px;
  color: #9aa8bd;
  font-size: 15px;
  font-weight: 400;
  text-decoration: line-through;
}

.bk-buy-body {
  flex: 1 1 220px;
  color: #56647a;
  font-size: 13px;
  line-height: 1.8;
}

.bk-buy .ct-price-buy {
  min-width: 160px;
  padding: 12px 18px;
  font-size: 15px;
}

/* ---- 收货地址表单（弹窗内） ---- */

.bk-modal-box {
  max-width: 440px;
  text-align: left;
}

.bk-modal-box h3 {
  text-align: center;
}

.bk-form {
  margin-top: 16px;
}

.bk-field {
  margin-top: 12px;
}

.bk-field label {
  display: block;
  margin-bottom: 5px;
  color: #56647a;
  font-size: 13px;
}

.bk-field input,
.bk-field select,
.bk-field textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #dfe5ee;
  border-radius: 8px;
  background: #ffffff;
  color: #1c2e4a;
  font-family: inherit;
  font-size: 14px;
  box-sizing: border-box;
}

.bk-field textarea {
  min-height: 62px;
  resize: vertical;
}

.bk-field input:focus,
.bk-field select:focus,
.bk-field textarea:focus {
  border-color: #2f6aff;
  outline: none;
}

.bk-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.bk-terms {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 14px;
  color: #56647a;
  font-size: 12px;
  line-height: 1.7;
}

.bk-terms input {
  margin-top: 3px;
  flex: 0 0 auto;
}

.bk-form-err {
  margin: 10px 0 0;
  color: #d24a43;
  font-size: 13px;
}

.bk-form-err[hidden] {
  display: none;
}

/* ---- 我的订单 ---- */

.bk-orders {
  margin-top: 18px;
}

.bk-order {
  padding: 16px 18px;
  border: 1px solid #eef1f6;
  border-radius: 12px;
  background: #ffffff;
}

.bk-order + .bk-order {
  margin-top: 12px;
}

.bk-order-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.bk-order-no {
  color: #7a8aa2;
  font-size: 12px;
}

.bk-order-status {
  padding: 2px 10px;
  border-radius: 999px;
  background: #eef3ff;
  color: #2f6aff;
  font-size: 12px;
  font-weight: 600;
}

.bk-order-status.done {
  background: #eaf7ef;
  color: #2f8f52;
}

.bk-order-status.off {
  background: #f2f4f8;
  color: #8a97ab;
}

.bk-order dl {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 6px 10px;
  margin: 12px 0 0;
  color: #1c2e4a;
  font-size: 13px;
}

.bk-order dt {
  color: #7a8aa2;
}

.bk-order dd {
  margin: 0;
}

.bk-order-actions {
  margin-top: 14px;
}

.bk-order-actions .ct-price-buy {
  display: inline-block;
  min-width: 130px;
}

.bk-empty {
  padding: 40px 20px;
  border: 1px dashed #dfe5ee;
  border-radius: 12px;
  color: #7a8aa2;
  font-size: 14px;
  text-align: center;
}

.bk-empty a {
  color: #2f6aff;
  text-decoration: none;
}

@media (max-width: 520px) {
  .bk-field-row {
    grid-template-columns: 1fr;
  }

  .bk-order dl {
    grid-template-columns: 72px 1fr;
  }
}
