/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* 轮播样式 */
.carousel {
    position: relative;
    width: 100%;
    height: 40vh;
    overflow: hidden;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.carousel-slide.active {
    opacity: 1;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: white;
    padding: 20px;
    text-align: center;
}

.carousel-caption h2 {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.carousel-caption p {
    font-size: 1rem;
    opacity: 0.9;
}

.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    padding: 10px;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
}

.carousel-control.prev {
    left: 10px;
}

.carousel-control.next {
    right: 10px;
}

/* 快捷入口 */
.quick-access {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    padding: 20px;
    background: white;
    margin: 10px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.quick-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 15px;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.quick-item:hover {
    background-color: #f0f0f0;
}

.quick-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.quick-item span {
    font-size: 0.8rem;
    color: #666;
}

/* 实时动态 */
.dynamic-section {
    background: white;
    margin: 10px;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.dynamic-section h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: #333;
}

.dynamic-content {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
    animation: scroll 20s linear infinite;
}

@keyframes scroll {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-100%);
    }
}

/* 底部导航 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    padding: 10px 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 100;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 5px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.bottom-nav-item.active {
    color: #ff6b6b;
    background-color: #fff5f5;
}

.nav-icon {
    font-size: 1.2rem;
    margin-bottom: 2px;
}

.bottom-nav-item span {
    font-size: 0.6rem;
}

/* 购物车按钮样式 */
.cart-button {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(255,107,107,0.4);
    cursor: pointer;
    z-index: 99;
    transition: all 0.3s ease;
}

.cart-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(255,107,107,0.6);
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: white;
    color: #ff6b6b;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* AI小精灵样式 */
.ai-assistant {
    position: fixed;
    bottom: 160px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4ecdc4, #45b7d1);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(78, 205, 196, 0.4);
    cursor: pointer;
    z-index: 99;
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

.ai-assistant:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(78, 205, 196, 0.6);
}

@keyframes pulse {
    0% {
        box-shadow: 0 4px 12px rgba(78, 205, 196, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px rgba(78, 205, 196, 0.8);
    }
    100% {
        box-shadow: 0 4px 12px rgba(78, 205, 196, 0.4);
    }
}

/* AI对话框样式 */
.ai-dialog {
    position: fixed;
    bottom: 240px;
    right: 20px;
    width: 300px;
    max-height: 400px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    z-index: 100;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.ai-dialog-header {
    background: linear-gradient(135deg, #4ecdc4, #45b7d1);
    color: white;
    padding: 15px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-dialog-content {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    max-height: 300px;
}

.ai-message, .user-message {
    margin-bottom: 15px;
    padding: 10px 15px;
    border-radius: 18px;
    max-width: 80%;
    line-height: 1.4;
}

.ai-message {
    background: #f0f0f0;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
}

.user-message {
    background: #4ecdc4;
    color: white;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
    margin-left: auto;
}

.ai-dialog-input {
    display: flex;
    border-top: 1px solid #f0f0f0;
    padding: 10px;
}

.ai-dialog-input input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
}

.ai-dialog-input button {
    background: linear-gradient(135deg, #4ecdc4, #45b7d1);
    color: white;
    border: none;
    padding: 0 15px;
    border-radius: 20px;
    margin-left: 10px;
    cursor: pointer;
}

.ai-dialog-input button:hover {
    background: linear-gradient(135deg, #45b7d1, #4ecdc4);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .carousel {
        height: 30vh;
    }
    
    .carousel-caption h2 {
        font-size: 1.5rem;
    }
    
    .quick-access {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
        padding: 15px;
    }
    
    .quick-icon {
        font-size: 1.5rem;
    }
    
    .bottom-nav {
        grid-template-columns: repeat(9, 1fr);
    }
    
    .nav-icon {
        font-size: 1rem;
    }
    
    .bottom-nav-item span {
        font-size: 0.5rem;
    }
    
    .cart-button {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
        bottom: 70px;
        right: 15px;
    }
    
    .cart-count {
        width: 18px;
        height: 18px;
        font-size: 0.6rem;
    }
}

@media (max-width: 480px) {
    .carousel {
        height: 25vh;
    }
    
    .carousel-caption h2 {
        font-size: 1.2rem;
    }
    
    .carousel-caption p {
        font-size: 0.8rem;
    }
    
    .quick-access {
        gap: 8px;
        padding: 10px;
    }
    
    .quick-item {
        padding: 10px;
    }
    
    .quick-icon {
        font-size: 1.2rem;
    }
    
    .quick-item span {
        font-size: 0.7rem;
    }
    
    .cart-button {
        width: 45px;
        height: 45px;
        font-size: 1rem;
        bottom: 65px;
        right: 10px;
    }
    
    .cart-count {
        width: 16px;
        height: 16px;
        font-size: 0.5rem;
    }
}