* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'SimSun', serif;
    overflow-x: hidden;
    overflow-y: hidden;
    height: 100vh;
    position: relative;
    /* 确保body不会因为子元素变换而改变 */
    transform: translateZ(0);
}

/* 全屏背景图 */
.background-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('web/images/背景.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    z-index: -1;
    /* 兵学风格滤镜 */
    filter: sepia(30%) saturate(70%) brightness(85%) contrast(120%);
    /* 确保背景不受任何变换影响 */
    will-change: auto;
    transform: none !important;
}

/* 容器 */
.container {
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: flex-start;
    align-items: stretch;
    position: relative;
    /* 创建新的层叠上下文，隔离背景 */
    z-index: 0;
}

/* 内容区域 - 右侧三分之二 */
.content-area {
    width: 66.67%;
    height: 100vh;
    display: flex;
    flex-direction: row;
    gap: 0; /* 条之间没有缝隙 */
}

/* 竖条样式 */
.vertical-strip {
    flex: 1;
    height: 100vh;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease;
    /* 兵学配色边框效果 */
    box-shadow: inset 0 0 20px rgba(47, 79, 79, 0.3);
    /* 设置变换原点，避免影响背景 */
    transform-origin: center center;
    /* 确保不影响背景层 */
    isolation: isolate;
    /* 创建新的层叠上下文 */
    will-change: transform;
}

.vertical-strip img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

/* 鼠标悬停效果 - 放大 */
.vertical-strip:hover {
    transform: scale(1.05);
    z-index: 10;
    /* 增强阴影效果 */
    box-shadow: 0 0 30px rgba(85, 107, 47, 0.5), inset 0 0 20px rgba(47, 79, 79, 0.4);
    /* 确保变换不影响背景 */
    transform-origin: center center;
}

.vertical-strip:hover img {
    transform: scale(1.02);
}

/* 兵学配色叠加层（可选，增强兵学风格） */
.vertical-strip::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        180deg,
        rgba(47, 79, 79, 0.1) 0%,
        transparent 50%,
        rgba(85, 107, 47, 0.1) 100%
    );
    pointer-events: none;
    z-index: 1;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .content-area {
        width: 100%;
        flex-direction: column;
    }
    
    .vertical-strip {
        height: 25vh;
    }
}

/* 兵学风格装饰元素（可选） */
.vertical-strip::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(85, 107, 47, 0.6),
        transparent
    );
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.vertical-strip:hover::after {
    opacity: 1;
}

/* 右上角功能图标区域 */
.top-right-icons {
    position: fixed;
    top: 30px;
    right: 30px;
    display: flex;
    gap: 20px;
    z-index: 2000;
    align-items: center;
}

.icon-item {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, rgba(85, 107, 47, 0.9) 0%, rgba(47, 79, 79, 0.9) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(47, 79, 79, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.2);
    position: relative;
    color: #fff;
}

.icon-item:hover {
    transform: scale(1.2);
    background: linear-gradient(135deg, rgba(47, 79, 79, 0.95) 0%, rgba(34, 56, 56, 0.95) 100%);
    box-shadow: 0 8px 25px rgba(47, 79, 79, 0.6);
}

.icon-item svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
}

.icon-label {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 8px;
    background: rgba(47, 79, 79, 0.9);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1001;
}

.icon-item:hover .icon-label {
    opacity: 1;
}

/* 响应式设计 - 右上角图标 */
@media (max-width: 768px) {
    .top-right-icons {
        top: 15px;
        right: 15px;
        gap: 10px;
    }
    
    .icon-item {
        width: 40px;
        height: 40px;
    }
    
    .icon-item svg {
        width: 20px;
        height: 20px;
    }
}

/* 产品详情模态框 */
.product-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.product-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    background: linear-gradient(135deg, #f5e6d3 0%, #e8d5c4 100%);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(139, 69, 19, 0.5);
    z-index: 1001;
    overflow-y: auto;
    border: 3px solid rgba(205, 133, 63, 0.3);
    animation: slideUp 0.3s ease;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(139, 69, 19, 0.8);
    color: #f5e6d3;
    border: none;
    border-radius: 50%;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1002;
}

.close-btn:hover {
    background: rgba(139, 69, 19, 1);
    transform: rotate(90deg) scale(1.1);
}

.product-details {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.product-image-section {
    flex: 1;
    position: relative;
}

.product-main-image {
    width: 100%;
    max-width: 500px;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(139, 69, 19, 0.3);
    cursor: pointer;
    transition: transform 0.3s ease;
    border: 2px solid rgba(205, 133, 63, 0.3);
}

.product-main-image:hover {
    transform: scale(1.02);
    box-shadow: 0 15px 40px rgba(139, 69, 19, 0.5);
}

.image-zoom-hint {
    margin-top: 15px;
    text-align: center;
    color: #8B4513;
    font-size: 14px;
    font-style: italic;
    opacity: 0.7;
}

.product-info-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.product-name {
    font-size: 36px;
    color: #8B4513;
    margin: 0;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(139, 69, 19, 0.2);
    border-bottom: 3px solid rgba(205, 133, 63, 0.5);
    padding-bottom: 15px;
}

.product-price {
    font-size: 28px;
    color: #A0522D;
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.price-label {
    font-size: 20px;
    color: #8B4513;
}

.price-value {
    font-size: 32px;
    font-weight: bold;
    color: #CD853F;
    text-shadow: 1px 1px 2px rgba(139, 69, 19, 0.3);
}

.product-description {
    font-size: 16px;
    line-height: 1.8;
    color: #654321;
    background: rgba(255, 255, 255, 0.5);
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #CD853F;
}

.product-actions {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.btn {
    flex: 1;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 5px 15px rgba(139, 69, 19, 0.3);
}

.btn-buy {
    background: linear-gradient(135deg, #CD853F 0%, #A0522D 100%);
    color: #fff;
}

.btn-buy:hover {
    background: linear-gradient(135deg, #A0522D 0%, #8B4513 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 69, 19, 0.5);
}

.btn-cart {
    background: linear-gradient(135deg, #D2691E 0%, #CD853F 100%);
    color: #fff;
}

.btn-cart:hover {
    background: linear-gradient(135deg, #CD853F 0%, #A0522D 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 69, 19, 0.5);
}

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

/* 大图查看模态框 */
.image-zoom-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.image-zoom-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
}

.zoom-close-btn {
    position: absolute;
    top: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    font-size: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 2001;
}

.zoom-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg) scale(1.1);
}

.zoomed-image {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    z-index: 2001;
    position: relative;
    animation: zoomIn 0.3s ease;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* 响应式设计 */
@media (max-width: 968px) {
    .product-details {
        flex-direction: column;
    }
    
    .product-main-image {
        max-width: 100%;
    }
    
    .product-name {
        font-size: 28px;
    }
    
    .product-actions {
        flex-direction: column;
    }
}

/* ========== 通用模态框样式 ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1500;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: linear-gradient(135deg, #e8e8e8 0%, #d3d3d3 100%);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(47, 79, 79, 0.5);
    z-index: 1501;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border: 3px solid rgba(85, 107, 47, 0.3);
    animation: slideUp 0.3s ease;
}

.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(47, 79, 79, 0.8);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1502;
}

.modal-close-btn:hover {
    background: rgba(47, 79, 79, 1);
    transform: rotate(90deg) scale(1.1);
}

/* ========== 登录/注册模态框 ========== */
.login-modal-content {
    width: 450px;
    max-width: 90%;
}

.login-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid rgba(85, 107, 47, 0.3);
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #2F4F4F;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn.active {
    color: #556B2F;
    border-bottom-color: #556B2F;
}

.tab-content {
    margin-top: 20px;
}

.tab-content.hidden {
    display: none;
}

.tab-content h2 {
    color: #2F4F4F;
    margin-bottom: 25px;
    text-align: center;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #2F4F4F;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid rgba(85, 107, 47, 0.3);
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #fff;
}

.form-group input:focus {
    outline: none;
    border-color: #556B2F;
    box-shadow: 0 0 10px rgba(85, 107, 47, 0.3);
}

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

.btn-submit:hover {
    background: linear-gradient(135deg, #2F4F4F 0%, #1C2E2E 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(47, 79, 79, 0.5);
}

/* ========== 购物车模态框 ========== */
.cart-modal-content {
    width: 800px;
    max-width: 90%;
}

.cart-modal-content h2 {
    color: #2F4F4F;
    margin-bottom: 25px;
    text-align: center;
}

.cart-items {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.empty-cart {
    text-align: center;
    padding: 40px;
    color: #708090;
    font-size: 18px;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #fff;
    border-radius: 10px;
    margin-bottom: 15px;
    border: 2px solid rgba(85, 107, 47, 0.2);
}

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

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

.cart-item-info h4 {
    color: #2F4F4F;
    margin-bottom: 5px;
}

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

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-btn {
    width: 30px;
    height: 30px;
    background: #556B2F;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
}

.quantity-btn:hover {
    background: #2F4F4F;
}

.quantity {
    min-width: 30px;
    text-align: center;
    font-weight: bold;
    color: #2F4F4F;
}

.remove-btn {
    padding: 5px 10px;
    background: #d32f2f;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.remove-btn:hover {
    background: #b71c1c;
}

.cart-item-total {
    font-size: 18px;
    font-weight: bold;
    color: #556B2F;
    min-width: 80px;
    text-align: right;
}

.cart-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 2px solid rgba(85, 107, 47, 0.3);
}

.cart-total {
    font-size: 24px;
    font-weight: bold;
    color: #2F4F4F;
}

.total-price {
    color: #556B2F;
    font-size: 28px;
}

.btn-checkout {
    padding: 15px 40px;
    background: linear-gradient(135deg, #556B2F 0%, #2F4F4F 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-checkout:hover {
    background: linear-gradient(135deg, #2F4F4F 0%, #1C2E2E 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(47, 79, 79, 0.5);
}

/* ========== 搜索模态框 ========== */
.search-modal-content {
    width: 700px;
    max-width: 90%;
}

.search-modal-content h2 {
    color: #2F4F4F;
    margin-bottom: 25px;
    text-align: center;
}

.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.search-box input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid rgba(85, 107, 47, 0.3);
    border-radius: 8px;
    font-size: 16px;
}

.search-box input:focus {
    outline: none;
    border-color: #556B2F;
    box-shadow: 0 0 10px rgba(85, 107, 47, 0.3);
}

.btn-search {
    padding: 12px 30px;
    background: linear-gradient(135deg, #556B2F 0%, #2F4F4F 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-search:hover {
    background: linear-gradient(135deg, #2F4F4F 0%, #1C2E2E 100%);
}

.search-results {
    max-height: 400px;
    overflow-y: auto;
}

.search-loading,
.search-info {
    text-align: center;
    padding: 40px;
    color: #708090;
    font-size: 16px;
}

/* 响应式设计 - 模态框 */
@media (max-width: 768px) {
    .modal-content {
        padding: 20px;
        max-width: 95%;
    }
    
    .cart-modal-content,
    .search-modal-content {
        width: 95%;
    }
    
    .cart-item {
        flex-wrap: wrap;
    }
    
    .cart-footer {
        flex-direction: column;
        gap: 15px;
    }
}

