/* 全局样式 - 橙色系 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 750px;
    margin: 0 auto;
    background-color: #fff;
    min-height: 100vh;
    padding-bottom: 80px; /* 增加底部间距，防止底部导航遮挡 */
}

/* 头部样式 - 橙色渐变 */
.header {
    background: linear-gradient(to bottom, #ff8533 0%, #ff6600 100%);
    padding: 12px 20px;
    text-align: center;
    color: #fff;
}

.header h1 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

/* 商品列表样式 */
.product-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
    padding: 15px;
}

@media (min-width: 480px) {
    .product-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

.product-item {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    padding: 10px;
}

.product-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(255, 102, 0, 0.3);
}

.product-badge {
    position: absolute;
    top: 0;
    left: 0;
    background: linear-gradient(135deg, #ffaa00 0%, #ff6600 100%);
    color: #fff;
    padding: 5px 15px;
    font-size: 12px;
    border-radius: 0 0 12px 0;
    z-index: 1;
}

.product-image {
    width: 100%;
    height: 160px;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 10px;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
    background-color: #f0f0f0;
    /* 图片加载优化 */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* 图片加载时的占位背景 */
.product-image {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.product-image.loaded {
    animation: none;
    background: transparent;
}

.product-item:hover .product-image img {
    transform: scale(1.05);
}

.product-title {
    font-size: 14px;
    color: #333;
    line-height: 1.4;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 40px;
}

.product-price {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.price-current {
    color: #ff6600;
    font-size: 18px;
    font-weight: 700;
}

.price-original {
    color: #999;
    font-size: 13px;
    text-decoration: line-through;
}

/* 商品详情页样式 */
.product-detail {
    background: #fff;
}

.detail-image {
    width: 100%;
    height: 350px;
    overflow: hidden;
}

.detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-info {
    padding: 20px 15px 10px 15px;
}

.detail-badge {
    display: inline-block;
    background: linear-gradient(135deg, #ffaa00 0%, #ff6600 100%);
    color: #fff;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 12px;
    margin-bottom: 12px;
}

.detail-title {
    font-size: 20px;
    color: #333;
    line-height: 1.5;
    margin-bottom: 15px;
    font-weight: 600;
}

.detail-price-box {
    background: linear-gradient(135deg, #ff6600 0%, #ff8533 100%);
    padding: 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.3);
}

.detail-price {
    color: #fff;
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.price-symbol {
    font-size: 20px;
}

.price-number {
    font-size: 36px;
    font-weight: 700;
}

.detail-original-price {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    text-decoration: line-through;
}

.detail-sales {
    color: #fff;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.2);
    padding: 5px 10px;
    border-radius: 4px;
}

/* 商品简介区域 */
.cart-info {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    background: #fff3e6;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #ffe0cc;
}

.cart-icon {
    font-size: 18px;
    color: #ff6600;
    margin-top: 2px;
}

.cart-content {
    flex: 1;
}

.cart-title {
    font-size: 14px;
    color: #ff6600;
    font-weight: 600;
    margin-bottom: 8px;
}

.cart-description {
    font-size: 14px;
    color: #333;
    line-height: 1.6;
    white-space: pre-wrap;
}

.quantity-box {
    margin-bottom: 15px;
}

.quantity-box label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #333;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qty-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 8px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
    color: #666;
}

.qty-btn:hover {
    background: #ff6600;
    color: #fff;
    border-color: #ff6600;
}

.qty-btn:active {
    transform: scale(0.95);
}

#quantity {
    width: 80px;
    height: 40px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
}

.stock-info {
    background: #fff3e6;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
}

.stock-info span {
    color: #ff6600;
    font-weight: 600;
}

.order-price {
    font-size: 16px;
    margin-bottom: 20px;
}

.order-price span {
    color: #ff6600;
    font-size: 24px;
    font-weight: 700;
}

.submit-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #ff6600 0%, #ff8533 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

.submit-btn:hover {
    background: linear-gradient(135deg, #ff7700 0%, #ff9944 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.3);
}

.submit-btn:active {
    transform: translateY(0);
}

/* 相关推荐 */
.related-products {
    margin-bottom: 20px; /* 增加底部间距 */
}

.section-title {
    font-size: 16px;
    padding: 8px 0;
    border-left: 3px solid #ff6600;
    padding-left: 10px;
}

/* 底部导航 - 修复遮挡问题 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    max-width: 750px;
    width: 100%;
    background: #fff;
    display: flex;
    justify-content: space-around;
    padding: 10px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.nav-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: #f5f5f5;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    margin: 0 5px;
    font-size: 14px;
}

.nav-btn:hover {
    background: #e6e6e6;
}

.nav-btn-primary {
    background: linear-gradient(135deg, #ff6600 0%, #ff8533 100%);
    color: #fff;
}

.nav-btn-primary:hover {
    background: linear-gradient(135deg, #ff7700 0%, #ff9944 100%);
}

.nav-icon {
    font-size: 18px;
    display: block;
    margin-bottom: 2px;
}

/* 订单成功页样式 */
.order-success {
    padding: 20px;
    text-align: center;
}

.success-header {
    background: linear-gradient(to bottom, #ff8533 0%, #ff6600 100%);
    color: #fff;
    padding: 12px 20px;
    font-size: 20px;
    font-weight: 600;
    border-radius: 12px 12px 0 0;
    margin: -20px -20px 20px;
}

.order-info {
    background: #fff;
    padding: 12px 0;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.order-info-row {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
    font-size: 12px;
}

.order-label-inline {
    color: #666;
}

.order-value-inline {
    color: #333;
    font-weight: 500;
}

.order-price-inline {
    color: #ff6600;
    font-size: 14px;
    font-weight: 700;
}

.order-item {
    padding: 12px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
}

.order-item-compact {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.order-label {
    color: #666;
}

.order-label-small {
    color: #999;
    font-size: 12px;
}

.order-value {
    color: #333;
    font-weight: 600;
}

.order-value-small {
    color: #333;
    font-size: 14px;
    font-weight: 500;
}

.order-price-highlight {
    color: #ff6600;
    font-size: 20px;
}

.order-price-highlight span {
    font-size: 24px;
    font-weight: 700;
}

.order-price-compact {
    color: #ff6600;
    font-size: 18px;
    font-weight: 700;
}

/* 支付区域 */
.payment-section {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.payment-title {
    font-size: 18px;
    color: #333;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.payment-title i {
    color: #ff6600;
    font-size: 20px;
}

.qrcode-container {
    margin: 20px 0;
}

.qrcode-box {
    background: #fff;
    display: inline-block;
    margin-bottom: 15px;
}

.qrcode-box img {
    max-width: 100%;
}

.qrcode-hint {
    color: #666;
    font-size: 14px;
    margin-top: 10px;
}

.return-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #ff6600 0%, #ff8533 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 30px;
    transition: all 0.3s;
}

.return-btn:hover {
    background: linear-gradient(135deg, #ff7700 0%, #ff9944 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.3);
}

.order-system {
    margin-top: 30px;
    padding: 20px;
    color: #999;
    font-size: 14px;
}

/* 支付方式信息框 */
.payment-info-box {
    background: #fff;
    padding: 12px 15px;
    border-radius: 8px;
    border: 2px dashed #ff6600;
}

.payment-info-title {
    font-size: 15px;
    font-weight: bold;
    margin-bottom: 8px;
    color: #ff6600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.payment-info-title i {
    font-size: 16px;
}

.payment-info-content {
    font-size: 13px;
    line-height: 1.6;
    color: #666;
}

/* 悬浮商品横幅 */
.product-float-banner {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 750px;
    background: linear-gradient(to right, #ff6600 0%, #ff8533 100%);
    z-index: 999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 15px;
}

.banner-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.banner-left img {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.banner-info {
    flex: 1;
    min-width: 0;
}

.banner-title {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.banner-sales {
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    margin-top: 2px;
}

.banner-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.banner-price {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
}

.banner-btn {
    background: #fff;
    color: #ff6600;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s;
}

.banner-btn:hover {
    background: #fff3e6;
    transform: scale(1.05);
}

/* 为顶部横幅预留空间 */
.product-detail {
    margin-top: 70px;
}

/* 相关商品 - 一排三个 */
.related-products .product-list {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 10px !important;
}

.related-products .product-item {
    padding: 8px;
}

.related-products .product-image {
    height: 100px;
}

.related-products .product-title {
    font-size: 12px;
    min-height: 32px;
    -webkit-line-clamp: 2;
}

.related-products .price-current {
    font-size: 14px;
}

.related-products .price-original {
    font-size: 11px;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .header h1 {
        font-size: 18px;
    }

    .product-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 10px;
    }

    .product-image {
        height: 140px;
    }

    .product-title {
        font-size: 13px;
    }

    .price-current {
        font-size: 16px;
    }

    .detail-image {
        height: 280px;
    }

    .detail-title {
        font-size: 18px;
    }

    .price-number {
        font-size: 28px;
    }

    .qrcode-box img {
        width: 250px;
        height: 250px;
    }
}

/* 加载动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-item {
    animation: fadeIn 0.5s ease-out;
}

/* 公告弹窗样式 - 温馨提示风格 */
.notice-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.notice-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
}

.notice-modal-content {
    position: relative;
    background: linear-gradient(to bottom, #fff 0%, #f8f9fa 100%);
    width: 90%;
    max-width: 450px;
    min-height: 550px;
    max-height: 600px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    animation: noticeSlideIn 0.3s ease-out;
    border: 3px solid;
    border-image: linear-gradient(135deg, #ff6600, #ff8533, #ffaa00, #ff6600) 1;
    overflow: hidden;
}

@keyframes noticeSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.notice-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #666;
    transition: all 0.3s;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notice-close-btn:hover {
    background: rgba(255, 102, 0, 0.8);
    color: #fff;
    transform: rotate(90deg);
}

.notice-body {
    padding: 40px 30px;
    min-height: 300px;
    max-height: 480px;
    overflow-y: auto;
    font-size: 15px;
    line-height: 1.8;
    color: #333;
    text-align: center;
}

.notice-body h1,
.notice-body h2,
.notice-body h3 {
    color: #ff6600;
    margin: 20px 0 15px;
    margin-block-start: 0;
    margin-block-end: 0;
    font-weight: 600;
}

.notice-body h1 {
    font-size: 24px;
    border-bottom: 2px solid #ff6600;
    padding-bottom: 10px;
}

.notice-body h2 {
    font-size: 20px;
}

.notice-body h3 {
    font-size: 18px;
}

.notice-body p {
    margin: 0;
    line-height: 0.8;
}

.notice-body strong {
    color: #ff6600;
    font-weight: 600;
}

.notice-body ul,
.notice-body ol {
    text-align: left;
    padding-left: 30px;
    margin: 15px 0;
}

.notice-body li {
    margin: 8px 0;
}

.notice-confirm-btn {
    display: block;
    width: calc(100% - 60px);
    margin: 0 30px 30px;
    padding: 15px;
    background: linear-gradient(135deg, #ff6600 0%, #ff8533 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.notice-confirm-btn:hover {
    background: linear-gradient(135deg, #ff7700 0%, #ff9944 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.3);
}

.notice-confirm-btn:active {
    transform: translateY(0);
}

/* 公告内容滚动条样式 - 隐藏滚动条 */
.notice-body::-webkit-scrollbar {
    display: none;
}

.notice-body {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* 二维码图片自适应样式 */
.qrcode-image-auto {
    width: auto !important;
    height: auto !important;
    max-width: 100%;
    max-height: 400px;
    display: block;
    margin: 0 auto;
}
