/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* 顶部通知栏 */
.top-bar {
    background: #333;
    color: #ccc;
    font-size: 12px;
    padding: 8px 0;
}
.top-bar .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
}
.top-bar a { color: #ccc; margin-left: 15px; }
.top-bar a:hover { color: #ff4444; }

/* 头部 */
.header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    height: 80px;
}
.logo {
    font-size: 22px;
    font-weight: bold;
    color: #ff4444;
    display: flex;
    align-items: center;
    gap: 10px;
}
.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #ff4444, #ff7744);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
}
.search-box {
    flex: 1;
    margin: 0 40px;
    display: flex;
    border: 2px solid #ff4444;
    border-radius: 4px;
    overflow: hidden;
}
.search-box input {
    flex: 1;
    padding: 10px 15px;
    border: none;
    outline: none;
    font-size: 14px;
}
.search-box button {
    background: #ff4444;
    color: #fff;
    border: none;
    padding: 0 25px;
    cursor: pointer;
    font-size: 14px;
}
.header-actions {
    display: flex;
    gap: 25px;
    align-items: center;
}
.header-actions a {
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
    position: relative;
}
.cart-badge {
    background: #ff4444;
    color: #fff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    position: absolute;
    top: -8px;
    right: -12px;
}

/* 导航 */
.nav {
    background: #fff;
    border-top: 1px solid #eee;
}
.nav .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}
.nav ul {
    display: flex;
}
.nav li a {
    padding: 14px 22px;
    display: block;
    font-size: 15px;
    font-weight: 500;
    color: #333;
    transition: color 0.2s;
}
.nav li a:hover, .nav li a.active {
    color: #ff4444;
    border-bottom: 2px solid #ff4444;
}

/* 轮播图 */
.banner {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}
.banner-slider {
    position: relative;
    height: 400px;
    border-radius: 8px;
    overflow: hidden;
}
.slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.6s;
}
.slide.active { opacity: 1; }
.slide-content {
    text-align: center;
    color: #fff;
    z-index: 2;
}
.slide-content h2 {
    font-size: 42px;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}
.slide-content p {
    font-size: 18px;
    margin-bottom: 25px;
}
.slide-content .btn {
    background: #ff4444;
    color: #fff;
    padding: 12px 35px;
    border-radius: 30px;
    font-size: 16px;
    display: inline-block;
    transition: transform 0.2s;
}
.slide-content .btn:hover { transform: scale(1.05); }

.slide-1 { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.slide-2 { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.slide-3 { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.3);
    color: #fff;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    z-index: 3;
    transition: background 0.2s;
}
.slider-btn:hover { background: rgba(0,0,0,0.6); }
.slider-prev { left: 20px; }
.slider-next { right: 20px; }

.slider-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 3;
}
.slider-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: background 0.2s;
}
.slider-dots span.active { background: #fff; }

/* 通用容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 分类入口 */
.category-section {
    padding: 30px 0;
}
.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}
.section-title h2 {
    font-size: 22px;
    color: #333;
    position: relative;
    padding-left: 15px;
}
.section-title h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 22px;
    background: #ff4444;
    border-radius: 2px;
}
.section-title a {
    color: #999;
    font-size: 14px;
}
.section-title a:hover { color: #ff4444; }

.category-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
}
.category-item {
    background: #fff;
    border-radius: 8px;
    padding: 25px 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid #f0f0f0;
}
.category-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border-color: #ff4444;
}
.category-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}
.category-item:nth-child(1) .category-icon { background: #ffe8e8; color: #ff4444; }
.category-item:nth-child(2) .category-icon { background: #e8f4ff; color: #1890ff; }
.category-item:nth-child(3) .category-icon { background: #e8ffef; color: #52c41a; }
.category-item:nth-child(4) .category-icon { background: #fff4e8; color: #fa8c16; }
.category-item:nth-child(5) .category-icon { background: #f0e8ff; color: #722ed1; }
.category-item:nth-child(6) .category-icon { background: #fff0f5; color: #eb2f96; }
.category-item h3 { font-size: 15px; color: #333; margin-bottom: 4px; }
.category-item p { font-size: 12px; color: #999; }

/* 商品网格 */
.products-section { padding: 30px 0; }
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.product-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s;
    border: 1px solid #f0f0f0;
}
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.12);
}
.product-img {
    height: 220px;
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
    position: relative;
    overflow: hidden;
}
.product-img-emoji {
    font-size: 70px;
    opacity: 0.15;
    position: relative;
    z-index: 1;
}
.product-img-real {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 2;
    transition: transform 0.3s;
}
.product-card:hover .product-img-real {
    transform: scale(1.05);
}
.product-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #ff4444;
    color: #fff;
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 3px;
}
.product-info { padding: 15px; }
.product-name {
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 40px;
}
.product-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 10px;
}
.price-current {
    color: #ff4444;
    font-size: 20px;
    font-weight: bold;
}
.price-current::before { content: '¥'; font-size: 13px; }
.price-original {
    color: #999;
    font-size: 13px;
    text-decoration: line-through;
}
.product-sales {
    font-size: 12px;
    color: #999;
}
.product-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}
.btn-add-cart, .btn-buy-now {
    flex: 1;
    padding: 8px 0;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-add-cart {
    background: #fff;
    border: 1px solid #ff4444;
    color: #ff4444;
}
.btn-add-cart:hover { background: #fff0f0; }
.btn-buy-now {
    background: #ff4444;
    color: #fff;
}
.btn-buy-now:hover { background: #e03333; }

/* 页脚 */
.footer {
    background: #2c2c2c;
    color: #aaa;
    padding: 50px 0 20px;
    margin-top: 50px;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}
.footer-col h4 {
    color: #fff;
    font-size: 16px;
    margin-bottom: 20px;
}
.footer-col ul li {
    margin-bottom: 10px;
    font-size: 14px;
}
.footer-col ul li a:hover { color: #ff4444; }
.footer-contact p { font-size: 14px; margin-bottom: 8px; }
.footer-contact strong { color: #ff4444; font-size: 18px; }
.footer-bottom {
    border-top: 1px solid #444;
    padding-top: 20px;
    text-align: center;
    font-size: 13px;
}

/* 页面标题栏 */
.page-header {
    background: #fff;
    padding: 20px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
}
.breadcrumb {
    font-size: 14px;
    color: #666;
}
.breadcrumb a { color: #666; }
.breadcrumb a:hover { color: #ff4444; }
.breadcrumb span { margin: 0 8px; color: #999; }

/* 商品列表页 */
.products-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 20px;
}
.sidebar {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    height: fit-content;
}
.sidebar h3 {
    font-size: 16px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ff4444;
}
.filter-category li {
    padding: 10px 12px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s;
}
.filter-category li:hover { background: #fff0f0; color: #ff4444; }
.filter-category li.active { background: #ff4444; color: #fff; }
.filter-price { margin-top: 25px; }
.filter-price li {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    border-radius: 4px;
}
.filter-price li:hover { background: #f5f5f5; color: #ff4444; }

.products-main {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
}
.sort-bar {
    display: flex;
    gap: 15px;
    padding-bottom: 15px;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}
.sort-bar span {
    cursor: pointer;
    padding: 5px 12px;
    border-radius: 4px;
    color: #666;
}
.sort-bar span.active { background: #ff4444; color: #fff; }

/* 商品详情页 */
.detail-layout {
    display: grid;
    grid-template-columns: 450px 1fr;
    gap: 40px;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
}
.detail-gallery {
    text-align: center;
}
.detail-main-img {
    height: 400px;
    background: #fafafa;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 120px;
    margin-bottom: 15px;
    position: relative;
    overflow: hidden;
}
.detail-main-img-real {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 2;
}
.detail-main-img .product-img-emoji {
    font-size: 100px;
    opacity: 0.1;
}
.detail-thumbnails {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.detail-thumb {
    width: 70px;
    height: 70px;
    background: #fafafa;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    transition: border-color 0.2s;
    position: relative;
    overflow: hidden;
}
.detail-thumb:hover, .detail-thumb.active { border-color: #ff4444; }
.detail-thumb .product-img-emoji {
    font-size: 24px;
    opacity: 0.1;
}
.detail-thumb .product-img-real {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 2;
}

.detail-info h1 {
    font-size: 22px;
    margin-bottom: 15px;
    line-height: 1.4;
}
.detail-subtitle {
    color: #999;
    font-size: 14px;
    margin-bottom: 20px;
}
.detail-price-box {
    background: #fff5f5;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}
.detail-price {
    display: flex;
    align-items: baseline;
    gap: 15px;
}
.detail-price .price-current { font-size: 32px; }
.detail-meta {
    display: flex;
    gap: 30px;
    font-size: 13px;
    color: #666;
    margin-top: 10px;
}
.detail-meta span strong { color: #ff4444; font-size: 16px; }

.detail-specs { margin-bottom: 25px; }
.spec-row {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    font-size: 14px;
}
.spec-label {
    width: 80px;
    color: #666;
    flex-shrink: 0;
}
.spec-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.spec-opt {
    padding: 6px 18px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
}
.spec-opt:hover { border-color: #ff4444; color: #ff4444; }
.spec-opt.active {
    background: #fff0f0;
    border-color: #ff4444;
    color: #ff4444;
}

.quantity-box {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}
.quantity-box button {
    width: 35px;
    height: 34px;
    border: none;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 16px;
}
.quantity-box input {
    width: 55px;
    height: 34px;
    border: none;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    text-align: center;
    font-size: 14px;
    outline: none;
}

.detail-btns {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}
.detail-btns .btn-add-cart, .detail-btns .btn-buy-now {
    padding: 14px 40px;
    font-size: 15px;
    border-radius: 30px;
}

/* 购物车页面 */
.cart-layout {
    background: #fff;
    border-radius: 8px;
    padding: 25px;
}
.cart-empty {
    text-align: center;
    padding: 80px 0;
    color: #999;
}
.cart-empty-icon { font-size: 80px; margin-bottom: 20px; }
.cart-table {
    width: 100%;
    border-collapse: collapse;
}
.cart-table th {
    background: #fafafa;
    padding: 15px;
    font-size: 14px;
    text-align: left;
    color: #666;
    border-bottom: 1px solid #eee;
}
.cart-table td {
    padding: 20px 15px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    vertical-align: middle;
}
.cart-product {
    display: flex;
    gap: 15px;
    align-items: center;
}
.cart-product-img {
    width: 80px;
    height: 80px;
    background: #fafafa;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}
.cart-product-img .product-img-emoji {
    font-size: 28px;
    opacity: 0.15;
}
.cart-product-img .product-img-real {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 2;
}
.cart-product-name {
    color: #333;
    font-size: 14px;
    margin-bottom: 4px;
}
.cart-product-spec { color: #999; font-size: 12px; }

.cart-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
    padding: 20px;
    background: #fafafa;
    border-radius: 8px;
}
.cart-total-info { font-size: 14px; color: #666; }
.cart-total-info span { margin-left: 15px; }
.cart-total-info .total-price {
    color: #ff4444;
    font-size: 28px;
    font-weight: bold;
}
.cart-total-info .total-price::before { content: '¥'; font-size: 16px; }
.btn-checkout {
    background: #ff4444;
    color: #fff;
    border: none;
    padding: 14px 50px;
    border-radius: 30px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-checkout:hover { background: #e03333; }
.cart-table input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }
.remove-btn {
    color: #999;
    cursor: pointer;
    font-size: 13px;
}
.remove-btn:hover { color: #ff4444; }

/* 结算页 */
.checkout-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 20px;
}
.checkout-form {
    background: #fff;
    border-radius: 8px;
    padding: 25px;
}
.form-section { margin-bottom: 30px; }
.form-section h3 {
    font-size: 16px;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    color: #333;
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}
.form-group label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 6px;
}
.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    border-color: #ff4444;
}
.payment-options {
    display: flex;
    gap: 15px;
}
.payment-opt {
    flex: 1;
    padding: 18px;
    border: 2px solid #eee;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}
.payment-opt:hover { border-color: #ff4444; }
.payment-opt.active {
    border-color: #ff4444;
    background: #fff5f5;
}
.payment-opt .pay-icon { font-size: 30px; margin-bottom: 8px; }
.payment-opt .pay-name { font-size: 14px; }

.order-summary {
    background: #fff;
    border-radius: 8px;
    padding: 25px;
    height: fit-content;
    position: sticky;
    top: 100px;
}
.order-summary h3 {
    font-size: 16px;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}
.summary-item {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
}
.summary-total {
    display: flex;
    justify-content: space-between;
    font-size: 16px;
    font-weight: bold;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dashed #eee;
}
.summary-total .price { color: #ff4444; font-size: 24px; }
.btn-submit-order {
    width: 100%;
    margin-top: 20px;
    background: #ff4444;
    color: #fff;
    border: none;
    padding: 14px;
    border-radius: 30px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-submit-order:hover { background: #e03333; }

/* 成功页 */
.success-page {
    text-align: center;
    padding: 80px 20px;
}
.success-icon {
    width: 80px;
    height: 80px;
    background: #52c41a;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto 25px;
}
.success-page h1 { font-size: 26px; margin-bottom: 15px; }
.success-page p { color: #666; margin-bottom: 30px; }
.success-page .btn {
    display: inline-block;
    padding: 12px 40px;
    border-radius: 30px;
    margin: 0 10px;
}
.btn-primary { background: #ff4444; color: #fff; }
.btn-secondary { background: #fff; color: #ff4444; border: 1px solid #ff4444; }

/* Toast提示 */
.toast {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 12px 30px;
    border-radius: 30px;
    font-size: 14px;
    z-index: 9999;
    transition: transform 0.3s ease;
    pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* 响应式 */
@media (max-width: 992px) {
    .products-grid { grid-template-columns: repeat(3, 1fr); }
    .category-grid { grid-template-columns: repeat(3, 1fr); }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
    .detail-layout { grid-template-columns: 1fr; }
    .products-layout { grid-template-columns: 1fr; }
    .checkout-layout { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .header .container { flex-wrap: wrap; height: auto; padding: 15px; }
    .search-box { order: 3; margin: 15px 0 0; width: 100%; }
    .products-grid { grid-template-columns: repeat(2, 1fr); }
    .banner-slider { height: 250px; }
    .slide-content h2 { font-size: 26px; }
    .form-row { grid-template-columns: 1fr; }
    .cart-table th:nth-child(4), .cart-table td:nth-child(4),
    .cart-table th:nth-child(5), .cart-table td:nth-child(5) { display: none; }
}
