/* ===========================
   全局样式
   =========================== */

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

:root {
    --primary-color: #ff6b9d;
    --secondary-color: #c44569;
    --dark-color: #2c3e50;
    --light-color: #f8f9fa;
    --text-color: #333;
    --border-color: #e0e0e0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    background-color: #fff;
    line-height: 1.6;
}

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

/* ===========================
   导航栏
   =========================== */

.navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: white;
    letter-spacing: 2px;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

.nav-links a:hover {
    opacity: 0.8;
}

.cart-link {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

.cart-count {
    background: #ff4757;
    padding: 0.2rem 0.6rem;
    border-radius: 50%;
    font-size: 0.8rem;
    margin-left: 0.3rem;
}

/* ===========================
   顶部横幅
   =========================== */

.banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6rem 2rem;
    text-align: center;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.banner-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: bold;
}

.banner-content p {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

/* ===========================
   按钮样式
   =========================== */

.btn {
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: white;
    color: var(--primary-color);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-add-cart {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    width: 100%;
    margin-bottom: 1rem;
    padding: 1rem;
    font-size: 1.1rem;
}

.btn-add-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 157, 0.4);
}

.btn-buy-now {
    background: var(--dark-color);
    color: white;
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
}

.btn-buy-now:hover {
    background: #1a252f;
    transform: translateY(-2px);
}

.btn-submit {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    margin-top: 2rem;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 157, 0.4);
}

/* ===========================
   产品展示区
   =========================== */

.product-section {
    padding: 4rem 2rem;
    background: #f8f9fa;
}

.product-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--dark-color);
}

.product-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

/* 产品图片 */
.product-image {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.image-gallery {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#mainImage {
    width: 100%;
    height: auto;
    border-radius: 10px;
    object-fit: cover;
    cursor: pointer;
}

.thumbnail-gallery {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-start;
}

.thumbnail-gallery img {
    width: 80px;
    height: 80px;
    border-radius: 5px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s;
}

.thumbnail-gallery img:hover {
    border-color: var(--primary-color);
}

/* 产品信息 */
.product-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.product-category {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    width: fit-content;
}

.product-info h1 {
    font-size: 2rem;
    color: var(--dark-color);
}

/* 价格 */
.price-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.current-price {
    font-size: 2.5rem;
    color: var(--primary-color);
    font-weight: bold;
}

.discount-badge {
    background: var(--primary-color);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 5px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* 评分 */
.rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stars {
    color: #ffc107;
    font-size: 1.2rem;
}

.rating-text {
    color: #666;
    font-size: 0.9rem;
}

/* 信任标签 */
.trust-badges {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.badge {
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: 500;
}

/* 选项部分 */
.options-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.options-section label {
    font-weight: 600;
    color: var(--dark-color);
}

.options-section select,
.options-section input {
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
}

.options-section select:focus,
.options-section input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(255, 107, 157, 0.3);
}

/* 数量选择器 */
.quantity-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: fit-content;
}

.quantity-selector button {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    background: white;
    cursor: pointer;
    font-size: 1.2rem;
    border-radius: 5px;
    transition: all 0.3s;
}

.quantity-selector button:hover {
    background: var(--light-color);
    border-color: var(--primary-color);
}

.quantity-selector input {
    width: 60px;
    text-align: center;
    border: 1px solid var(--border-color);
    padding: 0.5rem;
}

/* 产品描述 */
.product-description {
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

.product-description h3 {
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.product-description p {
    margin-bottom: 1rem;
    color: #666;
    line-height: 1.8;
}

.product-description ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.product-description li {
    color: var(--primary-color);
    font-weight: 500;
}

/* ===========================
   最新订购列表
   =========================== */

.recent-orders {
    padding: 3rem 2rem;
    background: white;
}

.recent-orders h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--dark-color);
}

.orders-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.order-item {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 5px;
    border-left: 4px solid var(--primary-color);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.order-name {
    font-weight: 600;
    color: var(--dark-color);
}

.order-time {
    font-size: 0.85rem;
    color: #999;
}

.order-package {
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: 500;
}

/* ===========================
   订单表单
   =========================== */

.checkout-section {
    padding: 3rem 2rem;
    background: #f8f9fa;
}

.checkout-section h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--dark-color);
}

.order-form {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(255, 107, 157, 0.3);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* 单选按钮 */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: normal;
    margin-bottom: 0;
}

.radio-group input[type="radio"] {
    width: auto;
}

/* 订单总结 */
.order-summary {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 5px;
    margin-bottom: 1.5rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
}

.summary-row.total {
    border-top: 1px solid var(--border-color);
    padding-top: 0.8rem;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* ===========================
   页脚
   =========================== */

.footer {
    background: var(--dark-color);
    color: white;
    padding: 3rem 2rem 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.footer-section p {
    line-height: 1.8;
    opacity: 0.9;
}

.footer-section ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-section a {
    color: white;
    text-decoration: none;
    opacity: 0.9;
    transition: opacity 0.3s;
}

.footer-section a:hover {
    opacity: 1;
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.7;
}

/* ===========================
   响应式设计
   =========================== */

@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        flex-direction: column;
        gap: 0.5rem;
    }

    .banner-content h1 {
        font-size: 2rem;
    }

    .banner-content p {
        font-size: 1rem;
    }

    .product-main {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .product-info h1 {
        font-size: 1.5rem;
    }

    .current-price {
        font-size: 2rem;
    }

    .orders-list {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }

    .logo {
        font-size: 1.4rem;
    }

    .nav-links {
        gap: 0.5rem;
    }

    .nav-links a {
        font-size: 0.9rem;
    }

    .banner {
        padding: 3rem 1rem;
        min-height: 300px;
    }

    .banner-content h1 {
        font-size: 1.5rem;
    }

    .product-section h2,
    .recent-orders h2,
    .checkout-section h2 {
        font-size: 1.5rem;
    }

    .price-section {
        flex-wrap: wrap;
    }

    .current-price {
        font-size: 1.5rem;
    }

    .thumbnail-gallery {
        gap: 0.3rem;
    }

    .thumbnail-gallery img {
        width: 60px;
        height: 60px;
    }
}
