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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部导航 */
.header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: bold;
    color: #333;
}

.logo img {
    height: 40px;
    width: auto;
}

.nav {
    display: flex;
    gap: 30px;
}

.nav-link {
    text-decoration: none;
    color: #666;
    font-size: 16px;
    transition: color 0.3s;
}

.nav-link:hover,
.nav-link.active {
    color: #ff6b6b;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-box {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 20px;
    overflow: hidden;
}

.search-box input {
    border: none;
    padding: 8px 15px;
    width: 200px;
    outline: none;
}

.search-box button {
    background: #ff6b6b;
    color: #fff;
    border: none;
    padding: 8px 15px;
    cursor: pointer;
}

.user-actions {
    display: flex;
    gap: 15px;
}

.action-icon {
    position: relative;
    color: #666;
    font-size: 20px;
    text-decoration: none;
}

.badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff6b6b;
    color: #fff;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 10px;
}

/* Banner */
/* 轮播 Banner */
.banner-slides {
    position: relative;
    width: 100%;
    height: 100%;
}

.banner-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
    z-index: 0;
}

.banner-slide.active {
    opacity: 1;
    z-index: 1;
}

.banner-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 2;
}

.banner-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.3s;
}

.banner-dot.active,
.banner-dot:hover {
    background: #fff;
}

.banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
    height: 400px;
}

.banner img.banner-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.banner .banner-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 20px;
    background: rgba(0,0,0,0.3);
}

.banner-content h1 {
    font-size: 48px;
    margin-bottom: 20px;
}

.banner-content p {
    font-size: 20px;
    margin-bottom: 30px;
}

/* 按钮 */
.btn-primary {
    background: #ff6b6b;
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary:hover {
    background: #ff5252;
    transform: translateY(-2px);
}

.btn-block {
    width: 100%;
}

/* 分类 */
.categories-section,
.products-section {
    padding: 40px 0;
}

.section-title {
    font-size: 28px;
    margin-bottom: 30px;
    text-align: center;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.category-card {
    background: #fff;
    border-radius: 10px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.category-icon {
    font-size: 48px;
    margin-bottom: 10px;
}
.category-icon-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    margin-bottom: 10px;
}


.category-name {
    font-size: 16px;
    color: #666;
}

/* 商品网格 */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.product-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.product-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.product-info {
    padding: 15px;
}

.product-name {
    font-size: 16px;
    margin-bottom: 10px;
    color: #333;
}

.product-price {
    font-size: 20px;
    color: #ff6b6b;
    font-weight: bold;
}

/* 页面 */
.page {
    display: none;
    min-height: calc(100vh - 200px);
    padding: 40px 0;
}

.page.active {
    display: block;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-title {
    font-size: 28px;
    margin-bottom: 30px;
}

.filter-bar {
    display: flex;
    gap: 15px;
}

.filter-bar select {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    outline: none;
}

/* 商品详情 */
.product-detail {
    background: #fff;
    border-radius: 10px;
    padding: 30px;
}

.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.product-gallery {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.main-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 10px;
}

.thumbnail-list {
    display: flex;
    gap: 10px;
}

.thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    border: 2px solid transparent;
}

.thumbnail.active {
    border-color: #ff6b6b;
}

.product-info-detail h1 {
    font-size: 28px;
    margin-bottom: 15px;
}

.product-price-detail {
    font-size: 32px;
    color: #ff6b6b;
    font-weight: bold;
    margin-bottom: 20px;
}

.product-description {
    color: #666;
    margin-bottom: 30px;
    line-height: 1.8;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
}

.quantity-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
}

.quantity-input {
    width: 60px;
    text-align: center;
    border: 1px solid #ddd;
    padding: 5px;
}

/* 购物车 */
.cart-content {
    background: #fff;
    border-radius: 10px;
    padding: 30px;
}

.cart-item {
    display: flex;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 1px solid #eee;
}

.cart-item-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 5px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-size: 16px;
    margin-bottom: 10px;
}

.cart-item-price {
    color: #ff6b6b;
    font-weight: bold;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cart-summary {
    margin-top: 30px;
    text-align: right;
}

.cart-total {
    font-size: 24px;
    color: #ff6b6b;
    font-weight: bold;
    margin-bottom: 20px;
}

/* 订单 */
.orders-content {
    background: #fff;
    border-radius: 10px;
    padding: 30px;
}

.order-card {
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.order-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.order-id {
    font-weight: bold;
}

.order-status {
    color: #ff6b6b;
}

.order-items {
    margin-bottom: 15px;
}

.order-item {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
}

.order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.order-total {
    font-size: 18px;
    color: #ff6b6b;
    font-weight: bold;
}

/* 登录 */
.login-box {
    max-width: 400px;
    margin: 50px auto;
    background: #fff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.login-box h2 {
    text-align: center;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #666;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    outline: none;
}

.login-tip {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

.login-tip a {
    color: #ff6b6b;
    text-decoration: none;
}

/* 底部 */
.footer {
    background: #333;
    color: #fff;
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h3 {
    margin-bottom: 15px;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 8px;
    color: #999;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    color: #fff;
    font-size: 24px;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #555;
    color: #999;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    background: #fff;
    margin: 15% auto;
    padding: 30px;
    border-radius: 10px;
    width: 400px;
    text-align: center;
}

.close {
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 28px;
    cursor: pointer;
}

/* 响应式 */
@media (max-width: 768px) {
    .nav {
        display: none;
    }
    
    .search-box input {
        width: 150px;
    }
    
    .banner-content h1 {
        font-size: 32px;
    }
    
    .product-detail-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
}

/* ========== 移动端适配（2026-08-25） ========== */

/* 平板与窄屏 */
@media (max-width: 1024px) {
    .container { padding: 0 15px; }
}

/* 手机端 */
@media (max-width: 768px) {
    /* 顶部 header：两行布局（logo+搜索+图标 / 导航横滑），不再隐藏导航 */
    .header-content {
        flex-wrap: wrap;
        row-gap: 8px;
        padding: 10px 0;
    }
    .logo {
        flex-shrink: 0;
        font-size: 18px;
    }
    .logo span {
        white-space: nowrap;
    }
    .logo img {
        height: 34px;
    }
    .header-actions {
        gap: 12px;
    }
    .search-box input {
        width: 110px;
        padding: 6px 10px;
    }
    .search-box button {
        padding: 6px 10px;
    }
    /* 导航：第二行横向滑动，不隐藏 */
    .header .nav {
        order: 3;
        display: flex !important;
        width: 100%;
        gap: 22px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        padding-bottom: 2px;
    }
    .nav::-webkit-scrollbar { display: none; }
    .nav-link {
        font-size: 15px;
        flex-shrink: 0;
    }

    /* banner */
    .banner { height: 280px; margin-bottom: 24px; }
    .banner-content h1 { font-size: 30px; margin-bottom: 12px; }
    .banner-content p { font-size: 17px; margin-bottom: 18px; }

    /* 商品网格：2 列 */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .product-card { border-radius: 8px; }
    .product-image { height: 170px; }
    .product-info { padding: 10px; }
    .product-name {
        font-size: 14px;
        margin-bottom: 6px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .product-price { font-size: 17px; }

    /* 分类 */
    .categories-section, .products-section { padding: 24px 0; }
    .section-title { font-size: 22px; margin-bottom: 20px; }
    .categories-grid { gap: 12px; }
    .category-card { padding: 18px 10px; }
    .category-icon { font-size: 36px; }

    /* 商品详情（覆盖 app.js 内联样式） */
    .product-detail { padding: 16px; }
    .product-detail-grid { grid-template-columns: 1fr !important; gap: 20px !important; }
    .main-image { height: 320px; }
    .product-info-detail h1 { font-size: 22px; }
    .product-price-detail { font-size: 26px; }

    /* 页面通用 */
    .page { padding: 24px 0; }
    .page-title { font-size: 22px; margin-bottom: 20px; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
    .filter-bar { flex-wrap: wrap; gap: 10px; }

    /* 购物车 */
    .cart-content { padding: 16px; }
    .cart-item { gap: 12px; padding: 14px 0; }
    .cart-item-image { width: 80px; height: 80px; }
    .cart-item-name { font-size: 14px; }
    .cart-total { font-size: 20px; }

    /* 订单 */
    .orders-content { padding: 16px; }
    .order-card { padding: 14px; }
    .order-header { flex-direction: column; gap: 4px; }

    /* 登录/注册 */
    .login-box { margin: 24px auto; padding: 24px 20px; }

    /* 模态框 */
    .modal-content { width: 90%; padding: 24px 18px; margin: 30% auto; }

    /* 底部 */
    .footer { padding: 30px 0 16px; }
}

/* 小屏手机 */
@media (max-width: 480px) {
    .search-box input { width: 90px; }
    .banner { height: 200px; }
    .banner-content h1 { font-size: 24px; }
    .banner-content p { font-size: 14px; }
    .product-image { height: 150px; }
    .main-image { height: 280px; }
    .btn-primary { padding: 10px 20px; font-size: 14px; }
    .quantity-selector { flex-wrap: wrap; }
    .order-item { flex-wrap: wrap; }
    .cart-item-actions { flex-wrap: wrap; gap: 8px; }
}

/* ========== 收货地址管理（2026-08-25） ========== */
.address-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.btn-back,
.btn-cancel,
.btn-ghost {
    background: #fff;
    color: #666;
    border: 1px solid #ddd;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}
.btn-back:hover,
.btn-cancel:hover,
.btn-ghost:hover {
    border-color: #ff6b6b;
    color: #ff6b6b;
}
.btn-ghost {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 6px;
}
.btn-danger {
    color: #ff5252;
}
.btn-danger:hover {
    border-color: #ff5252;
    color: #ff5252;
}
.address-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.address-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}
.address-card-main {
    flex: 1;
    min-width: 0;
}
.address-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.address-name {
    font-size: 16px;
    font-weight: bold;
}
.address-mobile {
    color: #666;
    font-size: 14px;
}
.address-default-tag {
    background: #ff6b6b;
    color: #fff;
    font-size: 12px;
    padding: 1px 8px;
    border-radius: 10px;
}
.address-detail {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    word-break: break-all;
}
.address-card-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}
.address-form-box {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 24px;
    margin-top: 20px;
}
.address-form-box h3 {
    margin-bottom: 20px;
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.form-row .form-group:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}
.form-check {
    margin: 10px 0 20px;
}
.form-check label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    cursor: pointer;
}
.form-check input[type="checkbox"] {
    width: auto;
}
.form-actions {
    display: flex;
    gap: 12px;
}
/* 移动端地址卡片 */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .address-card {
        flex-direction: column;
        align-items: flex-start;
    }
    .address-card-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* ========== 订单支付页（2026-08-25） ========== */
.order-pay-info {
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 20px;
}
.pay-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 15px;
}
.pay-label { color: #666; }
.pay-value { color: #333; }
.pay-amount {
    color: #ff6b6b;
    font-size: 24px;
    font-weight: bold;
}
.pay-note {
    background: #fff8e1;
    color: #b76e00;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    margin-top: 12px;
}
.order-pay-qr {
    background: #fff;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    margin-bottom: 20px;
}
.order-pay-qr img {
    width: 280px;
    height: 280px;
    max-width: 100%;
    border: 1px solid #eee;
    border-radius: 6px;
}
.pay-tip {
    color: #666;
    font-size: 14px;
    margin-top: 16px;
}
.order-pay-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}
@media (max-width: 768px) {
    .order-pay-qr img {
        width: 220px;
        height: 220px;
    }
    .order-pay-actions {
        flex-direction: column;
    }
}

/* ========== 双通道支付页（2026-08-25） ========== */
.pay-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    background: #f5f5f5;
    border-radius: 25px;
    padding: 4px;
}
.pay-tab {
    flex: 1;
    border: none;
    background: transparent;
    color: #666;
    padding: 10px 0;
    border-radius: 22px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s;
}
.pay-tab.active {
    background: #fff;
    color: #ff6b6b;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.pay-status {
    margin-top: 12px;
    color: #ff6b6b;
    font-size: 14px;
    min-height: 20px;
}
.btn-disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
@media (max-width: 768px) {
    .pay-tab {
        font-size: 14px;
        padding: 9px 0;
    }
}

/* ===== Pagination ===== */
.pagination-container {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 30px 0 40px;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.page-btn {
    min-width: 44px;
    height: 44px;
    padding: 0 16px;
    border: 1px solid #d9d9d9;
    background: #fff;
    color: #333;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.page-btn:hover:not(.disabled):not(.active) {
    border-color: #ff6b35;
    color: #ff6b35;
    transform: translateY(-1px);
}

.page-btn.active {
    background: #ff6b35;
    color: #fff;
    border-color: #ff6b35;
    font-weight: 600;
}

.page-btn.disabled {
    color: #bfbfbf;
    cursor: not-allowed;
    border-color: #e8e8e8;
    background: #fafafa;
}

.page-info {
    color: #666;
    font-size: 14px;
    margin-left: 12px;
    padding: 0 8px;
}

@media (max-width: 768px) {
    .page-btn {
        min-width: 40px;
        height: 40px;
        font-size: 14px;
        padding: 0 12px;
    }
    .page-info {
        display: none;
    }
}
