* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    color: #111827;
    background: #F6F7F9;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    padding-bottom: env(safe-area-inset-bottom);
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* 顶部导航 */
.h5-nav {
    height: 48px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    top: 0;
    z-index: 100;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 1px solid #F1F2F4;
}
.h5-nav .back {
    position: absolute;
    left: 12px;
    font-size: 22px;
    line-height: 1;
    padding: 4px 8px;
    color: #111827;
}
.h5-nav .right {
    position: absolute;
    right: 12px;
    font-size: 14px;
    color: #6B7280;
}

/* 商品列表 */
.search-box {
    background: #fff;
    padding: 10px 12px;
}
.search-box .inner {
    height: 36px;
    border-radius: 18px;
    background: #F3F4F6;
    display: flex;
    align-items: center;
    padding: 0 14px;
    gap: 8px;
    color: #9CA3AF;
    font-size: 13px;
}

.goods-list { background: #fff; }
.goods-item {
    display: flex;
    gap: 12px;
    padding: 14px;
    border-bottom: 1px solid #F3F4F6;
}
.goods-item:last-child { border-bottom: none; }
.goods-item .thumb {
    width: 100px; height: 100px;
    flex: 0 0 100px;
    border-radius: 10px;
    background: linear-gradient(135deg, #FFE3D3, #FFC1A1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    overflow: hidden;
}
.goods-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.goods-item .info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2px 0;
}
.goods-item .title {
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.goods-item .meta { font-size: 12px; color: #9CA3AF; margin-top: 4px; }
.goods-item .row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-top: 6px;
}
.price { color: #FF5A1F; font-weight: 700; font-size: 18px; }
.price i { font-style: normal; font-size: 12px; font-weight: 600; margin-right: 1px; }
.origin { color: #9CA3AF; font-size: 12px; text-decoration: line-through; margin-left: 6px; }
.btn-buy-mini {
    height: 28px;
    padding: 0 14px;
    border-radius: 14px;
    background: linear-gradient(90deg, #FF7A3D, #FF4D0F);
    color: #fff;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    font-weight: 500;
}

/* 商品详情 */
.detail-hero {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: linear-gradient(135deg, #FFE3D3, #FFB88F);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 88px;
    overflow: hidden;
}
.detail-hero img { width: 100%; height: 100%; object-fit: cover; }

.detail-block {
    background: #fff;
    padding: 16px 14px 14px;
}
.detail-price {
    display: flex;
    align-items: baseline;
    color: #FF5A1F;
    font-weight: 700;
    font-size: 28px;
    letter-spacing: -0.5px;
}
.detail-price i { font-style: normal; font-size: 15px; margin-right: 2px; }
.detail-price .origin { font-size: 13px; margin-left: 10px; }
.detail-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.45;
    margin-top: 10px;
}
.detail-meta { font-size: 12px; color: #9CA3AF; margin-top: 8px; }

.cell-group {
    background: #fff;
    margin-top: 10px;
    padding: 2px 14px;
}
.cell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 0;
    font-size: 14px;
    border-bottom: 1px solid #F3F4F6;
}
.cell:last-child { border-bottom: none; }
.cell span { color: #9CA3AF; }
.cell b { font-weight: 500; color: #111827; }

.detail-desc {
    background: #fff;
    margin-top: 10px;
    padding: 16px 14px;
    font-size: 14px;
    color: #4B5563;
    line-height: 1.8;
}
.detail-desc h4 { margin: 0 0 10px; font-size: 14px; color: #111827; }

/* 底部操作栏 */
.bottom-bar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: #fff;
    border-top: 1px solid #F1F2F4;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 90;
}
.btn-primary {
    flex: 1;
    height: 44px;
    border: 0;
    border-radius: 22px;
    background: linear-gradient(90deg, #FF7A3D, #FF4D0F);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
}
.btn-ghost {
    flex: 0 0 auto;
    height: 44px;
    padding: 0 20px;
    border-radius: 22px;
    border: 1px solid #E5E7EB;
    background: #fff;
    color: #111827;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    font-family: inherit;
}
.bottom-bar .total {
    flex: 1;
    font-size: 12px;
    color: #6B7280;
}
.bottom-bar .total b { display: block; color: #FF5A1F; font-size: 18px; font-weight: 700; }

/* 订单表单 */
.form-card {
    background: #fff;
    padding: 2px 14px;
    margin-bottom: 10px;
}
.form-row {
    display: flex;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid #F3F4F6;
    font-size: 14px;
}
.form-row:last-child { border-bottom: none; }
.form-row label {
    flex: 0 0 76px;
    color: #111827;
}
.form-row label i { color: #DC2626; font-style: normal; margin-right: 3px; }
.form-row input, .form-row textarea {
    flex: 1;
    border: 0;
    outline: none;
    font-size: 14px;
    font-family: inherit;
    background: transparent;
    color: #111827;
    resize: none;
}
.form-row input::placeholder, .form-row textarea::placeholder { color: #C3C8D1; }

.order-goods {
    display: flex;
    gap: 12px;
    background: #fff;
    padding: 14px;
    margin-bottom: 10px;
}
.order-goods .thumb {
    width: 76px; height: 76px;
    flex: 0 0 76px;
    border-radius: 10px;
    background: linear-gradient(135deg, #FFE3D3, #FFC1A1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    overflow: hidden;
}
.order-goods .thumb img { width: 100%; height: 100%; object-fit: cover; }
.order-goods .info { flex: 1; min-width: 0; }
.order-goods .title { font-size: 14px; font-weight: 500; line-height: 1.4; }
.order-goods .spec { font-size: 12px; color: #9CA3AF; margin-top: 5px; }
.order-goods .price { margin-top: 8px; font-size: 16px; }

.amount-card {
    background: #fff;
    padding: 4px 14px;
    margin-bottom: 10px;
}
.amount-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    font-size: 14px;
    color: #4B5563;
}
.amount-row.total {
    border-top: 1px solid #F3F4F6;
    font-size: 15px;
    color: #111827;
    font-weight: 600;
}
.amount-row.total b { color: #FF5A1F; font-size: 18px; }

/* 成功/异常页 */
.center-page {
    min-height: calc(100vh - 48px);
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 32px 32px;
    text-align: center;
}
.big-icon {
    width: 84px; height: 84px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin-bottom: 24px;
}
.big-icon.ok { background: #E8F7EE; color: #16A34A; }
.big-icon.bad { background: #F1F2F4; color: #9CA3AF; }
.center-page h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 12px;
}
.center-page .sub {
    font-size: 14px;
    color: #9CA3AF;
    line-height: 1.7;
    margin: 0 0 28px;
}
.pay-amount {
    font-size: 34px;
    font-weight: 700;
    color: #FF5A1F;
    letter-spacing: -1px;
    margin-bottom: 6px;
}
.order-no-small {
    font-size: 12px;
    color: #9CA3AF;
    margin-bottom: 32px;
}
.center-page .btn-primary { width: 100%; }
.center-page .btn-ghost {
    width: 100%;
    justify-content: center;
    margin-top: 12px;
}