/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

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

/* 导航栏样式 */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    color: white;
    font-size: 1.8rem;
    font-weight: bold;
}

/* 汉堡菜单按钮 */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
    z-index: 1000;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: white;
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* 导航菜单 */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    transition: all 0.3s ease;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background-color 0.3s;
    font-size: 1rem;
}

.nav-menu a:hover,
.nav-menu a.active {
    background-color: rgba(255,255,255,0.2);
}

/* 移动端导航样式 */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        flex-direction: column;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        width: 250px;
        height: 100vh;
        padding: 80px 20px 20px;
        box-shadow: -2px 0 10px rgba(0,0,0,0.2);
        gap: 1.5rem;
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    /* 汉堡菜单动画 */
    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }
    
    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }
}

/* Banner样式 */
.banner {
    width: 100%;
    overflow: hidden;
}

.banner-image {
    width: 100%;
    height: auto;
    display: block;
    max-height: 400px;
    object-fit: cover;
}

/* 按钮样式 */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* 英雄区域 */
.hero {
    background: url('../banner.jpg') center/cover;
    
    text-align: center;
    padding: 100px 0;
}

.hero-content h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

/* 网格布局 */
.product-grid,
.category-grid,
.feature-grid,
.discount-examples {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

/* 卡片样式 */
.category-card,
.feature-item,
.example {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
}

.product-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 200px;
}

.product-card:hover,
.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.product-card img,
.category-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.price {
    font-size: 1.2rem;
    font-weight: bold;
    color: #e74c3c;
    margin: 0.5rem 0;
}

.category {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* 特色区域 */
.features {
    background: white;
    padding: 60px 0;
}

.features h3 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    color: #333;
}

.feature-item h4 {
    color: #667eea;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

/* 分类页面 - 新样式 */
.categories-container {
    padding: 30px 0;
    min-height: 80vh;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 0 20px;
    flex-wrap: wrap;
    gap: 1rem;
}

.category-header h2 {
    font-size: 2.5rem;
    color: #333;
    margin: 0;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    max-width: 400px;
}

.search-input {
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    width: 100%;
    transition: border-color 0.3s;
    min-width: 200px;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
}

.search-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s;
    white-space: nowrap;
}

.search-btn:hover {
    transform: translateY(-2px);
}

.category-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    align-items: start;
    padding: 0 20px;
}

/* 移动端分类页布局 */
@media (max-width: 992px) {
    .category-layout {
        grid-template-columns: 200px 1fr;
    }
}

@media (max-width: 768px) {
    .category-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .category-header h2 {
        font-size: 2rem;
    }
    
    .search-box {
        max-width: 100%;
    }
    
    .category-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .category-sidebar {
        order: 2;
    }
    
    .category-content {
        order: 1;
    }
}

/* 左侧分类导航 */
.category-sidebar {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    overflow: hidden;
}

.sidebar-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-item {
    padding: 0.8rem 1.2rem;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.3s;
}

.category-item:hover {
    background-color: #f8f9fa;
}

.category-item.active {
    background-color: #667eea;
    color: white;
}

.category-item.active .item-count {
    display: none;
}

.item-count {
    display: none;
}

/* 价格规则样式 */
.price-rules {
    padding: 1.2rem;
    border-top: 1px solid #eee;
    background-color: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

.price-rules h3 {
    margin: 0 0 0.8rem 0;
    font-size: 1rem;
    color: #333;
    font-weight: bold;
}

.price-rules p {
    margin: 0.5rem 0;
    font-size: 0.85rem;
    line-height: 1.4;
    color: #555;
}

.price-rules ul {
    margin: 0.5rem 0;
    padding-left: 1.2rem;
}

.price-rules li {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.3rem;
    line-height: 1.3;
}

.price-rules strong {
    color: #e74c3c;
}

/* 炫彩文字动画效果 */
@keyframes rainbow-text {
    0% { color: #ff6b6b; }
    14% { color: #feca57; }
    28% { color: #48dbfb; }
    42% { color: #1dd1a1; }
    57% { color: #ff9ff3; }
    71% { color: #54a0ff; }
    85% { color: #5f27cd; }
    100% { color: #ff6b6b; }
}

.price-rules h3 {
    animation: rainbow-text 3s ease-in-out infinite;
    font-weight: bold;
    margin-bottom: 1rem !important;
}

/* 右侧商品内容 */
.category-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    padding: 2rem;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f1f3f5;
}

.content-header h3 {
    margin: 0;
    font-size: 1.8rem;
    color: #333;
}

.filter-options {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.filter-select {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background-color: white;
    font-size: 0.9rem;
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    border-color: #667eea;
}

/* 商品卡片新样式 */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.2rem;
    margin-bottom: 2rem;
}

/* 响应式商品网格 */
@media (max-width: 1200px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

@media (max-width: 992px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 0.8rem;
    }
}

@media (max-width: 576px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.6rem;
    }
}

.product-card {
    border: 1px solid #eee;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    background: white;
}

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

.product-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

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



.product-info {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.product-image-small {
    align-self: center;
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

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

.product-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.product-info h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: #333;
    line-height: 1.4;
}

.product-desc {
    color: #666;
    font-size: 0.9rem;
    margin: 0 0 1rem 0;
    line-height: 1.4;
}

.price-section {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.current-price {
    font-size: 1.2rem;
    font-weight: bold;
    color: #e74c3c;
}

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

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.8rem;
    color: #666;
}

.sales {
    color: #666;
}

.rating {
    color: #f39c12;
    font-weight: bold;
}



/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.page-btn {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.page-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.page-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.page-btn.next {
    padding: 8px 16px;
}

/* 折扣计算器 */
.discount-calculator {
    padding: 60px 0;
}

.discount-calculator h2 {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 2.5rem;
    color: #333;
}

.discount-calculator > p {
    text-align: center;
    margin-bottom: 2rem;
    color: #666;
}

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

.form-group {
    margin-bottom: 1.5rem;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: #666;
    transition: color 0.3s;
}

.checkbox-label:hover {
    color: #333;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"]:checked {
    accent-color: #667eea;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #333;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

/* 滚轮选择器样式 */
.form-group input[type="range"] {
    width: 100%;
    height: 40px;
    margin: 10px 0;
    background: #f8f9fa;
    border-radius: 20px;
    border: 2px solid #ddd;
    padding: 0 10px;
    -webkit-appearance: none;
    appearance: none;
}

.form-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.form-group input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.form-group input[type="range"]::-webkit-slider-track {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
}

.form-group input[type="range"]::-moz-range-track {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    border: none;
}

.range-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 0.8rem;
    color: #666;
}

.range-labels span {
    text-align: center;
    flex: 1;
    padding: 0 5px;
    position: relative;
}

.range-labels span::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 6px;
    background: #ddd;
}

/* 滚轮选择器悬停效果 */
.form-group input[type="range"]:hover {
    border-color: #667eea;
}

.form-group input[type="range"]:hover::-webkit-slider-thumb {
    transform: scale(1.1);
}

.form-group input[type="range"]:hover::-moz-range-thumb {
    transform: scale(1.1);
}

.result-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #eee;
}

.result-section h3 {
    margin-bottom: 1rem;
    color: #333;
}

.result-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    padding: 0.5rem 0;
}

.result-item.total {
    font-weight: bold;
    font-size: 1.2rem;
    color: #e74c3c;
    border-top: 1px solid #eee;
    padding-top: 1rem;
    margin-top: 1rem;
}

.discount-info {
    margin-top: 3rem;
    text-align: center;
}

.discount-info h3 {
    margin-bottom: 1.5rem;
    color: #333;
}

.example h4 {
    color: #667eea;
    margin-bottom: 0.5rem;
}

.example p {
    color: #666;
}

/* 页脚 */
footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-menu {
        gap: 1rem;
    }
    
    .hero-content h2 {
        font-size: 2rem;
    }
    
    .product-grid,
    .category-grid {
        grid-template-columns: 1fr;
    }
    
    .calculator-form {
        margin: 0 1rem;
    }
}

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

.product-card,
.category-card,
.feature-item,
.calculator-form {
    animation: fadeIn 0.6s ease-out;
}

/* 折扣列表样式 */
.discount-table {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.discount-category {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid #dee2e6;
    overflow: hidden;
}

.discount-category h4 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    border-bottom: 2px solid #667eea;
    padding-bottom: 8px;
}

/* 表格容器，添加滚动 */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.discount-category table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    min-width: 300px;
}

.discount-category th,
.discount-category td {
    padding: 12px 8px;
    text-align: center;
    border: 1px solid #dee2e6;
    white-space: nowrap;
}

.discount-category th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    font-size: 14px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.discount-category td {
    background: white;
    font-size: 14px;
}

.discount-category tr:nth-child(even) td {
    background: #f8f9fa;
}

.discount-category tr:hover td {
    background: #e3f2fd;
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .discount-table {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .discount-category {
        padding: 15px;
    }
    
    .discount-category h4 {
        font-size: 16px;
    }
    
    .discount-category th,
    .discount-category td {
        padding: 8px 6px;
        font-size: 12px;
    }
}

/* 通用表格响应式样式 */
table {
    width: 100%;
    border-collapse: collapse;
}

@media (max-width: 768px) {
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}