* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', sans-serif; background: #f5f5f7; color: #1d1d1f; font-size: 14px; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* 顶栏 */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; height: 48px; padding: 0 16px; background: #fff; border-bottom: 1px solid #e5e5e5; }
.topbar h1 { font-size: 17px; font-weight: 600; }
.topbar .back, .topbar .link-orders { font-size: 14px; color: #1677ff; }
.topbar .back:active, .topbar .link-orders:active { opacity: .6; }

/* 容器 */
.container { max-width: 600px; margin: 0 auto; padding: 12px; min-height: calc(100vh - 48px); }
.loading, .empty, .error { text-align: center; color: #999; padding: 40px 20px; }
.empty a, .error a { color: #1677ff; }

/* 商品网格 */
.product-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.product-card { background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.pc-img { width: 100%; aspect-ratio: 1; background: #f0f0f0; }
.pc-img img { width: 100%; height: 100%; object-fit: cover; }
.pc-info { padding: 10px; }
.pc-name { font-size: 14px; font-weight: 500; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-desc { font-size: 12px; color: #999; margin-bottom: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-bottom { display: flex; align-items: center; justify-content: space-between; }
.pc-price { color: #e03030; font-weight: 600; font-size: 15px; }
.btn-add { border: none; background: #1677ff; color: #fff; font-size: 12px; padding: 5px 14px; border-radius: 14px; }
.btn-add:active { opacity: .85; }

/* 购物车浮层 */
.cart-bar { position: fixed; left: 0; right: 0; bottom: 0; height: 56px; background: #fff; border-top: 1px solid #e5e5e5; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; box-shadow: 0 -2px 8px rgba(0,0,0,.05); }
.cart-info { font-size: 14px; }
.cart-info #cart-total { color: #e03030; font-weight: 600; }

/* 按钮 */
.btn-primary { background: #1677ff; color: #fff; border: none; padding: 12px 28px; border-radius: 22px; font-size: 15px; font-weight: 500; }
.btn-primary:active { opacity: .85; }
.btn-primary:disabled { opacity: .5; }
.btn-outline { background: #fff; color: #333; border: 1px solid #ddd; padding: 10px 20px; border-radius: 20px; font-size: 14px; }
.btn-outline:active { background: #f5f5f5; }
.btn-outline.btn-danger { color: #ff4d4f; border-color: #ffccc7; }
.btn-sm { padding: 6px 14px; font-size: 13px; border-radius: 16px; }

/* 订单卡片 */
.order-card { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.order-status { text-align: center; font-size: 13px; padding: 4px 12px; border-radius: 12px; display: inline-block; margin-bottom: 12px; background: #f0f0f0; }
.status-pending { color: #fa8c16; background: #fff7e6; }
.status-paid { color: #52c41a; background: #f6ffed; }
.status-cancelled { color: #999; background: #f5f5f5; }
.status-expired { color: #ff4d4f; background: #fff1f0; }
.order-subject { text-align: center; color: #666; font-size: 13px; margin-bottom: 4px; }
.order-amount { text-align: center; font-size: 28px; color: #e03030; font-weight: 600; margin-bottom: 16px; }
.items-list { border-top: 1px solid #f0f0f0; padding-top: 12px; margin-bottom: 20px; }
.item-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 13px; color: #555; }
.ir-name { flex: 1; }
.ir-qty { color: #999; margin: 0 12px; }
.ir-price { color: #333; }

/* 二维码区 */
.qrcode-section { text-align: center; }
.qrcode-hint { font-size: 13px; color: #666; margin-bottom: 12px; }
.qrcode-box { display: inline-block; padding: 12px; background: #fff; border: 1px solid #e5e5e5; border-radius: 8px; }
.qrcode-box img, .qrcode-box canvas { display: block; width: 240px !important; height: 240px !important; }
.countdown { color: #fa8c16; font-size: 14px; margin: 12px 0 8px; font-weight: 500; }

/* 成功/过期/取消 */
.success-section, .expired-section, .cancelled-section { text-align: center; padding: 20px 0; }
.success-icon, .expired-icon, .cancelled-icon { font-size: 48px; margin-bottom: 8px; }
.success-text { color: #52c41a; font-size: 18px; font-weight: 500; }
.expired-text, .cancelled-text { color: #999; font-size: 18px; font-weight: 500; }

/* 订单操作按钮 */
.order-actions { display: flex; gap: 12px; justify-content: center; margin-top: 20px; padding-top: 16px; border-top: 1px solid #f0f0f0; }
.order-actions button { flex: 1; max-width: 160px; }

/* 订单列表项 */
.orders-list { display: flex; flex-direction: column; gap: 10px; }
.order-item { background: #fff; border-radius: 10px; padding: 14px; box-shadow: 0 1px 4px rgba(0,0,0,.04); }
.oi-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.oi-subject { font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
.oi-status { font-size: 12px; padding: 2px 10px; border-radius: 10px; }
.oi-status.status-pending { color: #fa8c16; background: #fff7e6; }
.oi-status.status-paid { color: #52c41a; background: #f6ffed; }
.oi-status.status-cancelled { color: #999; background: #f5f5f5; }
.oi-status.status-expired { color: #ff4d4f; background: #fff1f0; }
.oi-amount { color: #e03030; font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.oi-time { color: #999; font-size: 12px; margin-bottom: 12px; }
.oi-actions { display: flex; gap: 10px; }
.oi-actions > * { flex: 1; text-align: center; }
.oi-actions .btn-primary, .oi-actions .btn-outline { display: inline-block; padding: 7px 14px; font-size: 13px; }

/* 响应式 */
@media (min-width: 480px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 640px) {
  .product-grid { grid-template-columns: repeat(4, 1fr); }
}
