/* =====================================================================
   KeleD shop.css —— 下单支付 / 订单 / 商家订单页面专属样式（B 维护）
   通用样式在 base.css，这里只放页面专属的部分。
   ===================================================================== */

/* ---------------------------------------------------------------- 首页 / 确认页 */
.home-intro { margin-bottom: 16px; }
.home-intro p { font-size: 14px; }
/* 首页上方公告（owner 11-06）在页面最上面：标题不要 .section-title 的上边距，和下面「选择服务卡」隔开一段 */
.home-announcement-top { margin-bottom: 32px; }
.home-announcement-top .section-title { margin-top: 0; }

.product-name { font-size: 20px; font-weight: 700; }
.product-desc { margin-top: 10px; font-size: 14px; line-height: 1.7; color: var(--c-text-2); }
.product-gold .price { color: var(--c-gold-dark); }
.product-gold .product-name::before,
.product-red .product-name::before {
  content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 8px;
  border-radius: 50%; background: var(--c-primary); vertical-align: 2px;
}
.product-gold .product-name::before { background: var(--c-gold); }

.steps {
  list-style: none; margin: 0; padding: 16px 8px;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px;
  background: var(--c-card); border-radius: var(--radius); box-shadow: var(--shadow);
}
.step {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-align: center; font-size: 13px; line-height: 1.3; color: var(--c-text);
}
.step-no {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--c-primary-soft); color: var(--c-primary); font-weight: 700;
}
/* 步骤之间的连接线 */
.step + .step::before {
  content: ""; position: absolute; top: 15px; right: 50%; width: 100%; height: 1px;
  background: var(--c-border-strong);
}

/* ---------------------------------------------------------------- 订单列表 / 详情 */
.order-amount { color: var(--c-text); font-weight: 600; }
.redeem-code { font-size: 26px; padding: 20px 12px; }
@media (max-width: 374.98px) { .redeem-code { font-size: 22px; } }
.detail-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 16px; font-size: 14px; }
.detail-links a { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------------------------------------------------------------- 支付页 */
.pay-amount {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--c-border);
}
.pay-amount .price { font-size: 30px; }
.pay-countdown { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 8px; }
.countdown { font-family: var(--font-mono); font-size: 20px; color: var(--c-primary); font-variant-numeric: tabular-nums; }
.pay-qr {
  display: flex; align-items: center; justify-content: center;
  width: 220px; height: 220px; margin: 0 auto 16px; padding: 16px;
  border: 1px dashed var(--c-border-strong); border-radius: var(--radius-sm); background: #fafafc;
  text-align: center;
}
.pay-qr img { width: 100%; height: 100%; object-fit: contain; }
.pay-closed-actions { justify-content: center; }

/* ---------------------------------------------------------------- 商家：待办 */
.stat-grid > .card + .card { margin-top: 0; }
.stat-card { display: flex; flex-direction: column; gap: 4px; color: var(--c-text); }
.stat-card:hover { text-decoration: none; box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 6px 20px rgba(0, 0, 0, .08); }
.stat-label { font-size: 14px; color: var(--c-text-2); }
.stat-value { font-size: 40px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat-card.is-alert .stat-value { color: var(--c-primary); }
.stat-link { margin-top: 4px; font-size: 14px; font-weight: 600; color: var(--c-primary); }
/* 「首页公告」卡片：上下两块各一段（名称 + 位置、显示状态、预览），中间一道分隔线 */
.m-announcement-brief { margin-top: 12px; }
.m-announcement-brief + .m-announcement-brief { padding-top: 12px; border-top: 1px solid var(--c-border); }
.m-announcement-name { font-size: 15px; font-weight: 600; }

/* ---------------------------------------------------------------- 商家：订单列表 */
.order-search { flex: 1 1 260px; max-width: 380px; }
@media (max-width: 640px) { .order-search { max-width: none; } }

.tabs {
  display: flex; overflow-x: auto; scrollbar-width: none;
  margin-bottom: 12px; border-bottom: 1px solid var(--c-border);
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; display: inline-flex; align-items: center; gap: 4px;
  min-height: 44px; padding: 0 12px; margin-bottom: -1px;
  color: var(--c-text-2); white-space: nowrap; border-bottom: 2px solid transparent;
}
.tab:hover { color: var(--c-text); text-decoration: none; }
.tab.active { color: var(--c-primary); font-weight: 600; border-bottom-color: var(--c-primary); }

.order-table .btn { min-height: 36px; padding: 0 14px; font-size: 14px; }
.order-table .input-row .input { min-height: 36px; padding: 6px 10px; }
/* 表头排序链接：平时和表头文字同色，当前排序列（th[aria-sort]）用主色 */
.order-table .sort-link { color: inherit; }
.order-table .sort-link:hover { color: var(--c-text); text-decoration: none; }
.order-table th[aria-sort] .sort-link { color: var(--c-primary); }
/* 宽屏：收紧单元格留白，给邮箱列留出宽度，避免长邮箱被折成很多行；
   平板宽度放不下整张表时在 .table-wrap 里横向滚动，不撑宽整页 */
@media (min-width: 641px) {
  .order-table th, .order-table td { padding: 12px 10px; }
  .order-table .sort-link { display: block; margin: -12px -10px; padding: 12px 10px; }  /* 整个表头格子都能点 */
  .order-table td.order-user { min-width: 150px; }
  .order-table td .input-row { min-width: 200px; }
  .order-table-wrap { border-radius: var(--radius); box-shadow: var(--shadow); }
  /* 订单列表的「操作」列（最后一列）固定在右边：表格比容器宽、横向滚动时，发码表单和「详情」也一直看得到。
     表格本身不能是滚动容器（base.css 的 overflow: hidden 会让 sticky 失效），圆角改由外层 .order-table-wrap 裁切；
     td 用不透明的卡片白，行悬停时 base.css 的悬停底色照样盖上来；左侧一道淡阴影，看得出浮在上面 */
  .order-list { overflow: visible; }
  .order-list th:last-child, .order-list td:last-child {
    position: sticky; right: 0; z-index: 1;
    box-shadow: -8px 0 8px -8px rgba(0, 0, 0, .16);
  }
  .order-list td:last-child { background: var(--c-card); }
  .order-sort { display: none; }  /* 宽屏点表头排序 */
}
@media (max-width: 640px) {
  .order-sort { margin-bottom: 12px; }  /* 手机卡片模式没有表头：卡片上方的排序下拉框 */
  .order-table-wrap { overflow: visible; }  /* 卡片模式不需要横向滚动，也别裁掉卡片阴影 */
  .order-table .btn, .order-table .input-row .input { min-height: var(--control-h); }
  .order-table td.td-full .btn-outline { width: 100%; }
}

.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; }

/* ---------------------------------------------------------------- 商家：订单详情 / 发码确认 */
.m-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
@media (min-width: 768px) { .m-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.m-detail-grid > .card + .card { margin-top: 0; }

.narrow { max-width: 560px; }
.issue-code { font-size: 30px; padding: 24px 12px; }
@media (max-width: 480px) { .issue-code { font-size: 24px; } }
.issue-length { font-size: 18px; color: var(--c-text); }
.code-void { color: var(--c-text-3); text-decoration: line-through; background: #f5f5f7; border-color: var(--c-border-strong); }
