/* 简易商城 - 简洁卡片式样式 */
:root {
  --alipay: #1677ff;
  --wechat: #07c160;
  --bg: #f5f6fa;
  --card: #ffffff;
  --text: #1f2329;
  --muted: #8a9099;
  --border: #e5e7eb;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.page { width: 100%; max-width: 420px; }

.card {
  background: var(--card);
  border-radius: 16px;
  padding: 32px 28px;
  box-shadow: 0 4px 24px rgba(31, 35, 41, 0.06);
}

h1 { font-size: 22px; text-align: center; margin-bottom: 6px; }
.subtitle { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 24px; }

label { display: block; font-size: 14px; margin-bottom: 16px; }
label input {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 8px; font-size: 15px;
}
label input:focus { outline: none; border-color: var(--alipay); }

.channels { display: flex; flex-direction: column; gap: 10px; margin: 20px 0 8px; }

.btn {
  display: block; width: 100%; padding: 12px; border: none; border-radius: 8px;
  font-size: 15px; cursor: pointer; text-align: center; text-decoration: none; color: #fff;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-alipay { background: var(--alipay); }
.btn-wechat { background: var(--wechat); }
.btn-ghost {
  background: #fff; color: var(--text); border: 1px solid var(--border);
  display: inline-block; width: auto; padding: 9px 16px; font-size: 14px;
}

.badge {
  display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px;
  font-size: 12px; background: rgba(255, 255, 255, 0.25); vertical-align: middle;
}

.hint { color: var(--muted); font-size: 12px; text-align: center; margin: 8px 0; line-height: 1.6; }
.notice {
  background: #fff7e6; border: 1px solid #ffd591; color: #ad6800;
  padding: 10px 12px; border-radius: 8px; font-size: 13px; line-height: 1.7; margin-bottom: 16px;
}
.notice code { background: rgba(0, 0, 0, 0.05); padding: 1px 4px; border-radius: 4px; }
.error { color: var(--danger); font-size: 13px; text-align: center; margin-top: 12px; min-height: 18px; }

.order-info {
  background: #fafbfc; border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px; margin: 20px 0; font-size: 14px;
}
.order-info p { display: flex; justify-content: space-between; gap: 12px; margin: 6px 0; }
.order-info span { color: var(--muted); flex-shrink: 0; }
.order-info code { font-size: 12px; }
.amount { color: #e8541e; font-size: 18px; }

.pay-area { text-align: center; margin: 20px 0; }
.qrcode { width: 200px; height: 200px; border: 1px solid var(--border); border-radius: 8px; }
.qr-amount {
  font-size: 15px; margin-top: 14px; color: var(--text);
}
.qr-amount strong { font-size: 26px; color: #e8541e; margin-left: 4px; }

.status { text-align: center; color: var(--warning); font-size: 13px; margin: 12px 0; }
.status.closed { color: var(--muted); }

.actions { display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }

/* 状态图标（纯 CSS） */
.icon {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center; position: relative;
}
.icon-success { background: #e8f7ee; }
.icon-success span {
  border: 3px solid var(--success); width: 26px; height: 13px;
  border-top: none; border-right: none; transform: rotate(-45deg) translate(1px, -2px);
}
.icon-waiting { background: #fef3e2; }
.icon-waiting span {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--warning); animation: pulse 1.2s infinite;
}
.icon-closed { background: #f3f4f6; }
.icon-closed span { width: 28px; height: 3px; position: relative; }
.icon-closed span::before, .icon-closed span::after {
  content: ""; position: absolute; width: 28px; height: 3px; background: #9ca3af; border-radius: 2px;
}
.icon-closed span::before { transform: rotate(45deg); }
.icon-closed span::after { transform: rotate(-45deg); }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ============ 商店首页 ============ */
.shop-body { display: block; padding-top: 24px; }
.shop-header { text-align: center; margin-bottom: 20px; }
.shop-header h1 { font-size: 24px; }
.shop-header .subtitle { margin-bottom: 0; }
.shop-page { max-width: 860px; margin: 0 auto; padding: 0 16px 40px; }

.product-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px;
}
.product-card {
  background: var(--card); border-radius: 12px; overflow: hidden;
  box-shadow: 0 2px 12px rgba(31, 35, 41, 0.05); display: flex; flex-direction: column;
}
.product-card.sold-out { opacity: 0.55; }
.product-img { width: 100%; height: 130px; display: flex; align-items: center; justify-content: center; }
.product-img img { width: 100%; height: 100%; object-fit: cover; }
.product-img.placeholder {
  background: linear-gradient(135deg, #e8f0fe, #fef3e2);
}
.product-img.placeholder::after { content: "无图"; color: #b6c2d4; font-size: 13px; }
.product-body { padding: 10px 12px 12px; display: flex; flex-direction: column; flex: 1; }
.product-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.product-desc {
  font-size: 12px; color: var(--muted); min-height: 30px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-foot { display: flex; align-items: baseline; justify-content: space-between; margin-top: 8px; }
.product-price { color: #e8541e; font-size: 17px; font-weight: 700; }
.product-stock { color: var(--muted); font-size: 11px; }
.btn-buy {
  margin-top: 10px; padding: 9px; border: none; border-radius: 8px; cursor: pointer;
  font-size: 14px; background: var(--alipay); color: #fff;
}
.btn-buy:disabled { background: #c3c9d1; cursor: not-allowed; }

/* 购买弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal {
  background: #fff; border-radius: 14px; padding: 26px 24px; width: 100%; max-width: 340px;
  text-align: center;
}
.modal h2 { font-size: 17px; margin-bottom: 4px; }
.modal-price { color: #e8541e; font-size: 22px; font-weight: 700; margin: 8px 0 16px; }
.modal .channels { flex-direction: column; gap: 10px; }
.modal .btn-ghost { margin-top: 14px; }

/* ============ 发货区（结果页） ============ */
.delivery {
  background: #f0f9f1; border: 1px solid #bfe3c8; border-radius: 10px;
  padding: 14px 16px; margin: 14px 0; font-size: 14px;
}
.delivery.waiting { background: #fef3e2; border-color: #ffd591; }
.delivery-title { font-weight: 600; margin-bottom: 10px; }
.delivery-box {
  display: flex; gap: 8px; align-items: stretch;
}
.delivery-content {
  flex: 1; background: #fff; border: 1px dashed #bfe3c8; border-radius: 8px;
  padding: 10px 12px; font-size: 14px; word-break: break-all; font-family: Consolas, monospace;
}
.delivery-box .btn-small { flex-shrink: 0; align-self: center; }

/* 小按钮（结果页/管理页共用） */
.btn-small { padding: 6px 14px; font-size: 13px; border: none; border-radius: 6px; cursor: pointer; }
.btn-confirm { background: var(--success); color: #fff; }
.btn-confirm:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- 文章彩票字段：结果徽章（后台列表） ---- */
.badge-hit { background:#e04f3c; color:#fff; padding:1px 8px; border-radius:6px; font-size:11px; font-weight:700; }
.badge-miss { background:#1a1a1a; color:#ddd; padding:1px 8px; border-radius:6px; font-size:11px; font-weight:700; }
.badge-wait { background:#f2a03d; color:#fff; padding:1px 8px; border-radius:6px; font-size:11px; font-weight:700; }
