/* AutoShop v2 - 现代简洁发卡页面
 * 设计目标：iPhone Safari / Android Chrome / 平板 / 桌面全兼容
 * 主要优化点：
 *   - 解决底部固定栏遮挡购买按钮
 *   - iOS Safari 兼容性（tap highlight、字体、number input spinner）
 *   - 统一圆角、间距、阴影（CSS 变量）
 *   - 弹窗 GPU 加速
 *   - 支付方式始终横排
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

:root {
    /* 间距 */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 16px;
    --space-xl: 24px;

    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-pill: 999px;

    /* 阴影 */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);

    /* 颜色 */
    --color-bg: #f5f5f7;
    --color-card: #ffffff;
    --color-text: #1d1d1f;
    --color-text-secondary: #48484a;
    --color-text-tertiary: #86868b;
    --color-text-quaternary: #aeaeb2;
    --color-border: #e5e5ea;
    --color-primary: #0071e3;
    --color-primary-hover: #0077ed;
    --color-success: #34c759;
    --color-warning: #ff9500;
    --color-danger: #ff3b30;

    /* 底部栏高度（含安全区） */
    --bottom-bar-height: calc(60px + env(safe-area-inset-bottom));
}

html {
    /* iOS Safari 滚动优化 */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', 'Segoe UI', Roboto, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
    line-height: 1.6;
    /* iOS Safari 防止橡皮筋效果影响底部栏 */
    overscroll-behavior-y: contain;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    /* iOS Safari 长按链接不弹出菜单 */
    -webkit-touch-callout: none;
}
a:hover { color: var(--color-primary-hover); }

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* ========== Header ========== */
header {
    padding: 28px 0 8px;
    text-align: center;
}
header h1 {
    font-size: 28px;
    color: var(--color-text);
    font-weight: 700;
    letter-spacing: -0.5px;
}
.notice {
    background: var(--color-card);
    border-radius: var(--radius-md);
    padding: 10px var(--space-lg);
    margin-top: var(--space-md);
    font-size: 13px;
    color: var(--color-text-tertiary);
    box-shadow: var(--shadow-sm);
}

/* ========== Category Tabs ========== */
.category-tabs {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-lg) 0 var(--space-md);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.category-tabs::-webkit-scrollbar { display: none; }
.category-tabs a {
    padding: 8px 18px;
    background: var(--color-card);
    color: var(--color-text-tertiary);
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-pill);
    white-space: nowrap;
    border: 1px solid var(--color-border);
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    flex-shrink: 0;
}
.category-tabs a:hover {
    background: var(--color-bg);
    color: var(--color-text);
    text-decoration: none;
}
.category-tabs a.active {
    background: var(--color-text);
    color: #fff;
    border-color: var(--color-text);
}

/* ========== Nav ========== */
.back-nav {
    display: flex;
    justify-content: space-between;
    padding: var(--space-lg) 0;
    gap: var(--space-sm);
}
.back-nav a {
    color: var(--color-text-tertiary);
    font-size: 14px;
    padding: 10px 16px;
    background: var(--color-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}
.back-nav a:hover {
    color: var(--color-primary);
    background: var(--color-bg);
    text-decoration: none;
    transform: translateY(-1px);
}

/* ========== 底部固定导航栏 ========== */
.bottom-bar {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 999 !important;
    background: rgba(255, 255, 255, 0.98);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    display: flex !important;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0 calc(12px + env(safe-area-inset-bottom));
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
    border-top: 1px solid var(--color-border);
}
.bottom-bar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: var(--color-text-tertiary);
    font-size: 11px;
    text-decoration: none;
    transition: color 0.15s;
    padding: 4px 12px;
    -webkit-user-select: none;
    user-select: none;
}
.bottom-bar a:hover,
.bottom-bar a.active {
    color: var(--color-primary);
}
.bottom-bar a svg {
    stroke-width: 1.8;
}

/* ========== 公告弹窗 ========== */
.announce-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.announce-content {
    background: var(--color-card);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 360px;
    max-height: 80vh;
    overflow-y: auto;
    animation: scaleIn 0.2s ease;
}
@keyframes scaleIn {
    from { transform: translate3d(0, 0, 0) scale(0.9); opacity: 0; }
    to   { transform: translate3d(0, 0, 0) scale(1);   opacity: 1; }
}
.announce-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
    font-size: 16px;
    font-weight: 600;
}
.announce-close {
    font-size: 24px;
    color: #c7c7cc;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.announce-body {
    padding: 20px;
    color: var(--color-text-secondary);
    font-size: 14px;
    line-height: 1.7;
    word-break: break-word;
}
.announce-btn {
    display: block;
    width: 100%;
    padding: 14px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.announce-btn:hover { background: var(--color-primary-hover); }

/* ========== Product Card ========== */
.products {
    display: grid;
    gap: var(--space-md);
    /* 关键：给底部固定栏留出空间，避免最后一张卡片被遮挡 */
    padding-bottom: var(--bottom-bar-height);
}
.product-card {
    background: var(--color-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: inherit;
    display: block;
    /* iOS Safari 点击态 */
    -webkit-tap-highlight-color: transparent;
}
.product-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.product-card:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-sm);
    transition-duration: 0.06s;
}
.product-card:hover * { text-decoration: none; }
.product-card:hover h3 { color: var(--color-primary); }

.product-cover {
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* iOS Safari 图片渲染 */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}
.no-cover {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: #c7c7cc;
}

.product-info { padding: 14px var(--space-lg); }
.product-tags {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.tag-cat,
.tag-type {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}
.tag-cat {
    color: var(--color-text-tertiary);
    background: var(--color-bg);
}
.tag-type {
    color: #fff;
}
.tag-normal { background: var(--color-success); }
.tag-card { background: var(--color-warning); }

.product-info h3 {
    font-size: 15px;
    color: var(--color-text);
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.4;
    /* 单行省略 */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.summary {
    font-size: 13px;
    color: var(--color-text-tertiary);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 6px;
}
.price {
    color: var(--color-danger);
    font-size: 22px;
    font-weight: 700;
}
.original {
    color: #c7c7cc;
    font-size: 13px;
    text-decoration: line-through;
}

.meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--color-text-quaternary);
    flex-wrap: wrap;
}

/* ========== Section ========== */
.section {
    background: var(--color-card);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin: var(--space-md) 0;
    box-shadow: var(--shadow-sm);
}
.section h2 {
    color: var(--color-text);
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 10px;
}
.section p {
    color: var(--color-text-secondary);
    font-size: 14px;
    word-break: break-word;
}
.content {
    color: var(--color-text);
    font-size: 14px;
    line-height: 1.8;
    word-break: break-word;
}
.content img { max-width: 100%; border-radius: var(--radius-md); }

/* ========== Detail Page ========== */
.product-cover-detail {
    margin-bottom: var(--space-md);
    background: var(--color-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.product-cover-detail img {
    width: 100%;
    height: auto;
    display: block;
    /* iOS Safari 防止图片被压缩 */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}
.product-detail-info {
    background: var(--color-card);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
    box-shadow: var(--shadow-sm);
}
.product-detail-info h1 {
    color: var(--color-text);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.4;
    word-break: break-word;
}

/* ========== Buy Section（核心修复：避开底部栏） ========== */
.buy-section {
    background: var(--color-card);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin: var(--space-md) 0;
    box-shadow: var(--shadow-sm);
    /* 关键：保证最后能给底部固定栏留出空间 */
    margin-bottom: calc(var(--bottom-bar-height) + 12px);
}
.quantity-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: var(--space-md);
    font-size: 14px;
    color: var(--color-text-secondary);
    flex-wrap: wrap;
}
.quantity-box {
    display: flex;
    align-items: center;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    flex-shrink: 0;
}
.quantity-box button {
    width: 36px;
    height: 36px;
    background: var(--color-bg);
    color: var(--color-text);
    border: none;
    cursor: pointer;
    font-size: 18px;
    font-weight: 500;
    transition: background 0.15s;
    /* iOS Safari 防止点击态延迟 */
    touch-action: manipulation;
}
.quantity-box button:active { background: var(--color-border); }
.quantity-box button:first-child { border-right: 1px solid var(--color-border); }
.quantity-box button:last-child { border-left: 1px solid var(--color-border); }
.quantity-box input {
    width: 56px;
    height: 36px;
    text-align: center;
    background: var(--color-card);
    color: var(--color-text);
    border: none;
    font-size: 14px;
    font-weight: 500;
    /* iOS Safari 隐藏 number input 的上下箭头 */
    -webkit-appearance: none;
    -moz-appearance: textfield;
    appearance: none;
}
.quantity-box input::-webkit-outer-spin-button,
.quantity-box input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.total {
    color: var(--color-text-tertiary);
    margin-left: auto;
}
.total b {
    color: var(--color-danger);
    font-size: 22px;
    font-weight: 700;
}

.buy-btn {
    width: 100%;
    padding: 14px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    /* iOS Safari 防止点击延迟 */
    touch-action: manipulation;
}
.buy-btn:hover { background: var(--color-primary-hover); }
.buy-btn:active { transform: scale(0.98); }
.buy-btn:disabled {
    background: #c7c7cc;
    cursor: not-allowed;
}

.out-stock {
    background: #fff3f0;
    border: 1px solid var(--color-danger);
    color: var(--color-danger);
    text-align: center;
    padding: var(--space-lg);
    border-radius: var(--radius-md);
}

/* ========== Pay Check Banner ========== */
.pay-check-banner {
    background: var(--color-card);
    border: 1px solid var(--color-warning);
    border-radius: var(--radius-md);
    padding: 12px var(--space-lg);
    margin: var(--space-md) 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--color-warning);
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
}
.pay-check-banner span {
    flex: 1;
    min-width: 120px;
}
.pay-check-banner button {
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: opacity 0.15s;
    touch-action: manipulation;
}
.pay-check-banner button:active { opacity: 0.7; }
.pay-check-banner button:first-of-type {
    background: var(--color-warning);
    color: #fff;
}
.close-btn {
    background: var(--color-bg) !important;
    color: var(--color-text-tertiary) !important;
    font-size: 16px !important;
    width: 28px;
    height: 28px;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========== Modal（弹窗） ========== */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 9999;
    /* iOS Safari 兼容性 */
    -webkit-overflow-scrolling: touch;
    animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.modal-content {
    background: var(--color-card);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    animation: slideUp 0.25s ease;
    /* 关键：安全区适配 */
    padding-bottom: env(safe-area-inset-bottom);
}
@keyframes slideUp {
    from { transform: translate3d(0, 100%, 0); }
    to   { transform: translate3d(0, 0, 0); }
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    background: var(--color-card);
    z-index: 2;
}
.modal-header h3 {
    color: var(--color-text);
    margin: 0;
    font-size: 17px;
    font-weight: 600;
}
.close {
    color: #c7c7cc;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-user-select: none;
    user-select: none;
}
.close:hover { color: var(--color-text-tertiary); }
.modal-body {
    padding: 20px;
    word-break: break-word;
}
.modal-footer {
    padding: var(--space-lg) 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid var(--color-border);
}

/* ========== Form ========== */
.form-group { margin-bottom: 14px; }
.form-group label {
    display: block;
    color: var(--color-text-tertiary);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
}
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--color-border);
    background: var(--color-card);
    color: var(--color-text);
    border-radius: var(--radius-md);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
    /* iOS Safari 输入框样式重置 */
    -webkit-appearance: none;
    appearance: none;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--color-primary);
}
.req { color: var(--color-danger); }
.email-hint {
    color: var(--color-success);
    font-size: 11px;
    margin-top: 4px;
    display: block;
}

/* ========== Order Preview ========== */
.order-preview {
    background: var(--color-bg);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: var(--space-lg);
}
.order-preview > div:first-child {
    color: var(--color-text);
    font-size: 14px;
    margin-bottom: 4px;
    font-weight: 500;
}
.order-preview .price {
    color: var(--color-text-tertiary);
    font-size: 13px;
}
.order-preview b {
    color: var(--color-danger);
    font-size: 18px;
    font-weight: 700;
}

/* ========== Buttons ========== */
.btn-cancel,
.btn-buy,
.btn-pay,
.btn-check,
.btn-copy,
.btn-ok,
.btn-search {
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    /* iOS Safari 防止点击延迟 */
    touch-action: manipulation;
}
.btn-cancel {
    padding: 11px 20px;
    border: none;
    background: var(--color-bg);
    color: var(--color-text);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
}
.btn-buy {
    padding: 11px 24px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
}
.btn-buy:active { transform: scale(0.97); }
.btn-buy:disabled { opacity: 0.5; }

.btn-pay {
    padding: 11px 24px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
}
.btn-pay:active { transform: scale(0.97); }
.btn-pay:disabled { opacity: 0.5; }

.btn-check {
    padding: 12px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 500;
    width: 100%;
    margin-bottom: 10px;
}
.btn-copy {
    padding: 11px 20px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
}
.btn-ok {
    padding: 11px 20px;
    background: var(--color-success);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
}
.btn-search {
    width: 100%;
    padding: 11px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: var(--space-lg);
}

/* ========== Pay Methods（核心修复：永远横排） ========== */
.pay-amount {
    text-align: center;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--color-text-tertiary);
}
.pay-amount b {
    color: var(--color-danger);
    font-size: 28px;
    font-weight: 700;
}
.pay-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--space-md);
}
.pay-option {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--color-text-tertiary);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    -webkit-user-select: none;
    user-select: none;
    background: var(--color-card);
    min-height: 56px;
    touch-action: manipulation;
}
.pay-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.pay-option:has(input:checked),
.pay-option.selected {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: #f0f7ff;
}
.pay-option:active { transform: scale(0.97); }
.pay-icon {
    font-size: 20px;
    line-height: 1;
}

/* ========== Wait Content ========== */
.wait-content {
    text-align: center;
    padding: 30px 20px;
}
.wait-icon {
    font-size: 48px;
    color: var(--color-warning);
    animation: spin 2s linear infinite;
    display: inline-block;
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
.wait-content h3 {
    color: var(--color-text);
    margin: 16px 0 8px;
    font-size: 18px;
}
.wait-content p {
    color: var(--color-text-tertiary);
    font-size: 13px;
    margin: 4px 0;
    word-break: break-all;
}
.wait-tip {
    color: var(--color-primary) !important;
    margin-top: 12px !important;
}

/* ========== Delivery Result ========== */
.delivery-content .success-icon {
    text-align: center;
    font-size: 40px;
    margin-bottom: 10px;
}
.delivery-content p {
    text-align: center;
    color: var(--color-text-tertiary);
    font-size: 13px;
    margin: 4px 0;
}
.delivery-box {
    background: var(--color-bg);
    border-radius: var(--radius-md);
    padding: 14px;
    margin: var(--space-md) 0;
    text-align: left;
}
.delivery-box h4 {
    color: var(--color-success);
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 8px;
}
.delivery-box pre {
    color: var(--color-text);
    font-size: 13px;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
    font-family: 'SF Mono', Menlo, Monaco, Consolas, monospace;
    max-height: 240px;
    overflow-y: auto;
}
.email-sent {
    color: var(--color-success) !important;
    font-size: 12px !important;
}

/* ========== Query Results ========== */
.query-result {
    background: var(--color-bg);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 10px;
    border-left: 3px solid var(--color-border);
}
.query-result.status-0 { border-left-color: var(--color-warning); }
.query-result.status-1 { border-left-color: var(--color-primary); }
.query-result.status-2 { border-left-color: var(--color-success); }
.query-result.status-3 { border-left-color: var(--color-text-quaternary); }
.query-result.status-4 { border-left-color: var(--color-danger); }
.qr-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    gap: 8px;
}
.qr-title {
    color: var(--color-text);
    font-size: 14px;
    font-weight: 500;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.qr-status {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    background: var(--color-border);
    color: var(--color-text-tertiary);
    flex-shrink: 0;
}
.qr-meta {
    color: var(--color-text-quaternary);
    font-size: 12px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.qr-delivery { margin-top: 10px; }
.qr-delivery h4 {
    color: var(--color-success);
    font-size: 12px;
    margin: 0 0 6px;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}
.qr-delivery pre {
    color: var(--color-text);
    font-size: 12px;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
    background: var(--color-card);
    padding: 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
}

/* ========== Empty ========== */
.empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-quaternary);
}

/* ========== Footer ========== */
footer {
    text-align: center;
    padding: var(--space-xl) 0;
    color: #c7c7cc;
    font-size: 12px;
    padding-bottom: calc(var(--bottom-bar-height) + 24px);
}

/* ========== 响应式适配 ========== */

/* iPhone SE 等小屏 */
@media (max-width: 380px) {
    .container { padding: 0 12px; }
    header h1 { font-size: 22px; }
    .pay-methods {
        grid-template-columns: 1fr 1fr;
    }
}

/* 平板及桌面（768px 以上） */
@media (min-width: 768px) {
    .modal { align-items: center; }
    .modal-content {
        border-radius: var(--radius-lg);
        max-width: 480px;
    }
    .product-cover {
        aspect-ratio: 16 / 9;
    }
    .products {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-lg);
    }
}

/* 大屏（1200px 以上） */
@media (min-width: 1200px) {
    .products {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 横屏手机 */
@media (max-height: 500px) and (orientation: landscape) {
    .modal-content {
        max-height: 95vh;
    }
}

/* ========== 支付成功卡密展示 ========== */
.delivery-result {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid #bbf7d0;
    border-radius: var(--radius-lg);
    padding: 20px;
    margin: var(--space-lg) 0;
}
.delivery-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}
.delivery-status-icon {
    font-size: 36px;
}
.delivery-box-main {
    background: var(--color-card);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    margin: 14px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.delivery-label {
    font-size: 12px;
    color: var(--color-success);
    font-weight: 600;
    margin-bottom: 8px;
}
.delivery-content-main {
    white-space: pre-wrap;
    word-break: break-all;
    font-size: 14px;
    color: var(--color-text);
    margin: 0;
    line-height: 1.8;
    font-family: SFMono-Regular, Menlo, monospace;
    background: var(--color-bg);
    padding: var(--space-md);
    border-radius: var(--radius-sm);
    max-height: 280px;
    overflow-y: auto;
}
.delivery-actions {
    display: flex;
    gap: 10px;
}
.btn-copy-main {
    flex: 1;
    padding: 12px 16px;
    background: var(--color-success);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    touch-action: manipulation;
}
.btn-copy-main:active { transform: scale(0.97); }
.btn-close-main {
    padding: 12px 16px;
    background: var(--color-card);
    color: var(--color-text-tertiary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    touch-action: manipulation;
}
.btn-close-main:active { transform: scale(0.97); }