/* iMall H5 商城样式 */
* { box-sizing: border-box; }
html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f7fa;
    color: #1f2937;
    -webkit-tap-highlight-color: transparent;
}
.shop-wrap {
    max-width: 540px;
    margin: 0 auto;
    background: #fff;
    min-height: 100vh;
}
.shop-header {
    padding: 16px;
    background: #fff;
    border-bottom: 1px solid #f3f4f6;
}
.shop-header h1 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

/* 首页商品列表 */
.product-grid {
    padding: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.product-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #f3f4f6;
}
.card-image {
    width: 100%;
    padding-top: 100%;
    background-size: cover;
    background-position: center;
    background-color: #f3f4f6;
}
.card-body {
    padding: 10px;
}
.card-body h3 {
    margin: 0 0 4px;
    font-size: 14px;
    line-height: 1.4;
    height: 40px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.card-subtitle {
    margin: 0 0 8px;
    font-size: 12px;
    color: #6b7280;
    height: 18px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.card-price {
    display: flex;
    align-items: baseline;
    gap: 6px;
}
.card-price .price {
    color: #dc2626;
    font-size: 16px;
    font-weight: 700;
}
.card-price .original {
    color: #9ca3af;
    font-size: 12px;
    text-decoration: line-through;
}

/* 商品详情页 */
.product-page { padding-bottom: 80px; }
.product-gallery img {
    width: 100%;
    display: block;
    background: #f3f4f6;
}
.product-info {
    padding: 16px;
    background: #fff;
}
.product-title {
    margin: 0 0 6px;
    font-size: 18px;
    line-height: 1.4;
    font-weight: 600;
}
.product-subtitle {
    margin: 0 0 12px;
    font-size: 13px;
    color: #6b7280;
}
.product-price-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
}
.product-price-row .price {
    color: #dc2626;
    font-size: 24px;
    font-weight: 700;
}
.product-price-row .original {
    color: #9ca3af;
    text-decoration: line-through;
    font-size: 14px;
}
.stock-text {
    margin: 10px 0 0;
    font-size: 13px;
    color: #16a34a;
}
.stock-text.out { color: #dc2626; }

.section {
    padding: 16px;
    border-top: 8px solid #f5f7fa;
    background: #fff;
}
.section h3 {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 600;
}

/* 规格 */
.spec-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.spec-btn {
    padding: 8px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    background: #fff;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
}
.spec-btn.active {
    border-color: #111827;
    background: #111827;
    color: #fff;
}

/* 数量 */
.qty-control {
    display: inline-flex;
    align-items: center;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}
.qty-control button {
    width: 40px;
    height: 36px;
    border: none;
    background: #f9fafb;
    font-size: 18px;
    color: #374151;
    cursor: pointer;
}
.qty-control input {
    width: 50px;
    height: 36px;
    border: none;
    text-align: center;
    font-size: 15px;
    -moz-appearance: textfield;
}
.qty-control input::-webkit-outer-spin-button,
.qty-control input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* 表单 */
.form-group {
    margin-bottom: 14px;
}
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: #4b5563;
}
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
}
.form-group input:focus,
.form-group textarea:focus { border-color: #111827; }

/* 详情图 */
.detail-section img {
    width: 100%;
    display: block;
    margin-bottom: 8px;
}

/* 底部操作栏 */
.product-action-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    max-width: 540px;
    margin: 0 auto;
    background: #fff;
    border-top: 1px solid #f3f4f6;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    z-index: 100;
}
.product-action-bar .total {
    font-size: 14px;
    color: #4b5563;
}
.total-price {
    color: #dc2626;
    font-size: 20px;
    font-weight: 700;
}
.submit-btn {
    flex: 1;
    max-width: 180px;
    padding: 12px 20px;
    border: none;
    border-radius: 24px;
    background: #111827;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}
.submit-btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}
.safe-bottom { height: 20px; }

/* 支付页 */
.pay-page, .query-page { padding: 16px; }
.pay-card, .qr-card, .logistics-card, .query-card {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid #f3f4f6;
}
.pay-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #4b5563;
    margin-bottom: 12px;
}
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.status-dot.warning { background: #f59e0b; }
.status-dot.info { background: #3b82f6; }
.status-dot.primary { background: #111827; }
.status-dot.success { background: #16a34a; }
.status-dot.muted { background: #9ca3af; }
.pay-amount {
    text-align: center;
    padding: 12px 0;
    border-bottom: 1px dashed #e5e7eb;
}
.pay-amount p { margin: 0 0 4px; font-size: 13px; color: #6b7280; }
.pay-amount h2 { margin: 0; font-size: 36px; color: #dc2626; }
.order-info-list { padding-top: 12px; }
.info-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 8px;
    line-height: 1.4;
}
.info-row span { color: #6b7280; flex-shrink: 0; margin-right: 12px; }
.info-row strong { color: #1f2937; text-align: right; font-weight: 500; }

.qr-card { text-align: center; }
.qr-card h3 { margin: 0 0 14px; font-size: 16px; }
.qr-wrap {
    width: 220px;
    height: 220px;
    margin: 0 auto 12px;
    border: 1px solid #f3f4f6;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.qr-img { width: 100%; height: 100%; object-fit: contain; }
.qr-placeholder {
    width: 220px;
    height: 220px;
    margin: 0 auto 12px;
    background: #f9fafb;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 14px;
}
.qr-tip { font-size: 13px; color: #6b7280; margin: 0 0 12px; line-height: 1.6; }
.qr-amount { font-size: 15px; color: #1f2937; margin: 0; }

.pay-notice {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 12px;
    font-size: 13px;
    color: #92400e;
    margin-bottom: 12px;
}

.query-card h3 { margin: 0 0 12px; font-size: 15px; }
.query-card form, .query-form {
    display: flex;
    gap: 10px;
}
.query-card input, .query-form input {
    flex: 1;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
}
.query-card button, .query-form button {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    background: #111827;
    color: #fff;
    font-size: 15px;
    cursor: pointer;
}

/* 订单列表 */
.query-page h1 { font-size: 20px; margin: 0 0 16px; }
.error-text { color: #dc2626; font-size: 14px; }
.empty-state {
    text-align: center;
    padding: 48px 16px;
    color: #6b7280;
}
.order-list { margin-top: 16px; }
.order-item {
    display: block;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 12px;
    border: 1px solid #f3f4f6;
}
.order-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 13px;
}
.order-no { color: #6b7280; }
.order-status {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
}
.order-status.warning { background: #fff7ed; color: #c2410c; }
.order-status.info { background: #eff6ff; color: #1d4ed8; }
.order-status.primary { background: #f3f4f6; color: #111827; }
.order-status.success { background: #f0fdf4; color: #15803d; }
.order-status.muted { background: #f3f4f6; color: #6b7280; }
.order-product {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}
.order-product img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    background: #f3f4f6;
}
.order-product .title { margin: 0 0 4px; font-size: 14px; }
.order-product .spec { margin: 0; font-size: 12px; color: #6b7280; }
.order-total { text-align: right; font-size: 14px; }
.order-total strong { color: #dc2626; }

/* 通用按钮 */
.btn-primary {
    display: inline-block;
    padding: 10px 20px;
    background: #111827;
    color: #fff;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
}
