/* ============ 全局重置 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; color: #333; background: #f5f5f5; line-height: 1.6; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; outline: none; font-family: inherit; }
input, select, textarea { font-family: inherit; outline: none; }

/* ============ 颜色变量 ============ */
:root {
  --primary: #e74c3c;
  --primary-dark: #c0392b;
  --primary-light: #ff6b5b;
  --secondary: #f39c12;
  --text: #333;
  --text-light: #666;
  --text-lighter: #999;
  --bg: #fff;
  --bg-gray: #f5f5f5;
  --border: #eee;
  --success: #27ae60;
}

/* ============ 顶部栏 ============ */
.top-bar { background: #333; color: #ccc; font-size: 12px; padding: 6px 0; }
.top-bar .container { display: flex; justify-content: space-between; align-items: center; }
.top-bar a:hover { color: var(--primary); }
.top-bar .left span { margin-right: 20px; }
.top-bar .right a { margin-left: 15px; }

/* ============ 头部导航 ============ */
.header { background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,0.08); position: sticky; top: 0; z-index: 100; }
.header .container { display: flex; align-items: center; justify-content: space-between; padding: 15px 0; }
.logo { display: flex; align-items: center; gap: 12px; }
.logo-icon { width: 45px; height: 45px; background: linear-gradient(135deg, var(--primary), var(--secondary)); border-radius: 10px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 22px; font-weight: bold; }
.logo-text h1 { font-size: 18px; color: var(--primary); font-weight: 700; }
.logo-text p { font-size: 11px; color: var(--text-lighter); margin-top: 2px; letter-spacing: 1px; }

.nav-main { display: flex; gap: 5px; }
.nav-main a { padding: 10px 18px; font-size: 15px; font-weight: 500; color: var(--text); border-radius: 6px; transition: all 0.2s; }
.nav-main a:hover, .nav-main a.active { color: var(--primary); background: #fff5f4; }

.header-right { display: flex; align-items: center; gap: 20px; }
.search-box { display: flex; border: 1px solid #ddd; border-radius: 20px; overflow: hidden; width: 220px; }
.search-box input { flex: 1; padding: 8px 14px; border: none; font-size: 13px; }
.search-box button { background: var(--primary); color: #fff; padding: 8px 14px; font-size: 14px; }

.cart-icon { position: relative; font-size: 22px; cursor: pointer; }
.cart-icon .badge { position: absolute; top: -8px; right: -10px; background: var(--primary); color: #fff; font-size: 11px; min-width: 18px; height: 18px; border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 5px; }

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

/* ============ 轮播图 ============ */
.banner { position: relative; height: 480px; overflow: hidden; border-radius: 12px; margin: 20px 0; }
.banner-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 0.6s; display: flex; align-items: center; padding: 0 60px; }
.banner-slide.active { opacity: 1; }
.banner-slide .slide-content { max-width: 500px; color: #fff; z-index: 2; }
.banner-slide h2 { font-size: 42px; margin-bottom: 16px; font-weight: 700; text-shadow: 0 2px 10px rgba(0,0,0,0.3); }
.banner-slide p { font-size: 16px; margin-bottom: 24px; opacity: 0.95; }
.banner-slide .btn-white { background: #fff; color: var(--primary); padding: 12px 32px; border-radius: 25px; font-weight: 600; font-size: 15px; display: inline-block; transition: transform 0.2s; }
.banner-slide .btn-white:hover { transform: translateY(-2px); }
.banner-dots { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; z-index: 3; }
.banner-dots span { width: 12px; height: 12px; border-radius: 50%; background: rgba(255,255,255,0.5); cursor: pointer; }
.banner-dots span.active { background: #fff; }

/* ============ 分类卡片 ============ */
.categories { display: grid; grid-template-columns: repeat(6, 1fr); gap: 15px; margin: 30px 0; }
.category-card { background: #fff; border-radius: 10px; padding: 20px 15px; text-align: center; transition: all 0.3s; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.category-card:hover { transform: translateY(-5px); box-shadow: 0 8px 20px rgba(0,0,0,0.1); }
.category-icon { width: 50px; height: 50px; margin: 0 auto 10px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 24px; color: #fff; }
.category-card h4 { font-size: 14px; color: var(--text); }

/* ============ 促销横幅 ============ */
.promo-banner { background: linear-gradient(135deg, #667eea, #764ba2); border-radius: 12px; padding: 40px; color: #fff; display: flex; justify-content: space-between; align-items: center; margin: 30px 0; }
.promo-banner h3 { font-size: 26px; margin-bottom: 8px; }
.promo-banner p { opacity: 0.9; }
.promo-banner .btn-outline { border: 2px solid #fff; color: #fff; padding: 10px 28px; border-radius: 25px; font-weight: 600; }
.promo-banner .btn-outline:hover { background: #fff; color: #667eea; }

/* ============ 区块标题 ============ */
.section-title { display: flex; justify-content: space-between; align-items: center; margin: 40px 0 20px; }
.section-title h3 { font-size: 22px; font-weight: 700; position: relative; padding-left: 15px; }
.section-title h3::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 4px; height: 22px; background: var(--primary); border-radius: 2px; }
.section-title .more { color: var(--text-lighter); font-size: 13px; }
.section-title .more:hover { color: var(--primary); }

/* ============ 商品网格 ============ */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.product-card { background: #fff; border-radius: 10px; overflow: hidden; transition: all 0.3s; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.product-card:hover { transform: translateY(-5px); box-shadow: 0 8px 25px rgba(0,0,0,0.12); }
.product-img { width: 100%; height: 220px; background: linear-gradient(135deg, #f5f7fa, #e4e8ec); display: flex; align-items: center; justify-content: center; font-size: 60px; position: relative; overflow: hidden; }
.product-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.product-tag { position: absolute; top: 12px; left: 12px; background: var(--primary); color: #fff; font-size: 11px; padding: 3px 10px; border-radius: 10px; font-weight: 600; z-index: 2; }
.product-info { padding: 15px; }
.product-name { font-size: 14px; font-weight: 500; color: var(--text); margin-bottom: 8px; line-height: 1.4; height: 40px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.product-desc { font-size: 12px; color: var(--text-lighter); margin-bottom: 10px; height: 18px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.product-bottom { display: flex; justify-content: space-between; align-items: center; }
.price { color: var(--primary); font-size: 18px; font-weight: 700; }
.price small { font-size: 12px; font-weight: normal; text-decoration: line-through; color: var(--text-lighter); margin-left: 6px; }
.add-cart-btn { background: var(--primary); color: #fff; padding: 6px 14px; border-radius: 18px; font-size: 12px; font-weight: 500; transition: background 0.2s; }
.add-cart-btn:hover { background: var(--primary-dark); }

/* ============ 特色服务 ============ */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin: 40px 0; }
.feature-item { background: #fff; border-radius: 10px; padding: 25px 20px; display: flex; gap: 15px; align-items: center; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.feature-icon { font-size: 32px; }
.feature-text h4 { font-size: 14px; margin-bottom: 4px; }
.feature-text p { font-size: 12px; color: var(--text-lighter); }

/* ============ 页脚 ============ */
.footer { background: #2c3e50; color: #bbb; padding: 50px 0 20px; margin-top: 50px; }
.footer .container { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 30px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.footer-brand h3 { color: #fff; font-size: 18px; margin-bottom: 15px; }
.footer-brand p { font-size: 13px; line-height: 1.8; margin-bottom: 15px; }
.footer-col h4 { color: #fff; font-size: 15px; margin-bottom: 18px; }
.footer-col li { margin-bottom: 10px; font-size: 13px; }
.footer-col a:hover { color: var(--primary-light); }
.footer-bottom { text-align: center; padding-top: 20px; font-size: 12px; color: #888; }

/* ============ 页面头 ============ */
.page-header { background: linear-gradient(135deg, #e74c3c, #c0392b); color: #fff; padding: 40px 0; margin-bottom: 30px; }
.page-header h2 { font-size: 28px; margin-bottom: 8px; }
.page-header p { opacity: 0.9; font-size: 14px; }
.breadcrumb { font-size: 13px; color: var(--text-lighter); margin-bottom: 20px; }
.breadcrumb a:hover { color: var(--primary); }

/* ============ 商品详情页 ============ */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; background: #fff; border-radius: 12px; padding: 30px; margin-bottom: 30px; }
.detail-gallery .main-img { width: 100%; height: 450px; background: linear-gradient(135deg, #f5f7fa, #e4e8ec); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 120px; position: relative; overflow: hidden; }
.detail-gallery .main-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.detail-gallery .thumbs { display: flex; gap: 10px; margin-top: 15px; }
.detail-gallery .thumb { width: 80px; height: 80px; border-radius: 8px; background: linear-gradient(135deg, #f5f7fa, #e4e8ec); display: flex; align-items: center; justify-content: center; font-size: 30px; cursor: pointer; border: 2px solid transparent; }
.detail-gallery .thumb.active { border-color: var(--primary); }

.detail-info h1 { font-size: 24px; margin-bottom: 15px; }
.detail-rating { display: flex; gap: 15px; font-size: 13px; color: var(--text-lighter); margin-bottom: 20px; }
.detail-rating .stars { color: var(--secondary); }
.detail-price-box { background: #fff8f8; border-radius: 10px; padding: 20px; margin-bottom: 20px; }
.detail-price .current { color: var(--primary); font-size: 32px; font-weight: 700; }
.detail-price .original { color: var(--text-lighter); text-decoration: line-through; margin-left: 12px; font-size: 16px; }
.detail-price .discount { background: var(--primary); color: #fff; font-size: 12px; padding: 3px 10px; border-radius: 12px; margin-left: 10px; }
.detail-meta { font-size: 13px; color: var(--text-light); line-height: 2; }
.detail-meta span { color: var(--text-lighter); width: 80px; display: inline-block; }

.option-group { margin: 20px 0; }
.option-group label { display: block; font-size: 13px; color: var(--text-light); margin-bottom: 10px; }
.option-group .options { display: flex; gap: 10px; flex-wrap: wrap; }
.option-group .opt-btn { padding: 8px 18px; border: 1px solid #ddd; border-radius: 6px; background: #fff; font-size: 13px; transition: all 0.2s; }
.option-group .opt-btn.active { border-color: var(--primary); color: var(--primary); background: #fff5f4; }

.quantity-selector { display: flex; align-items: center; gap: 0; border: 1px solid #ddd; border-radius: 6px; width: fit-content; }
.quantity-selector button { width: 40px; height: 38px; background: #f8f8f8; font-size: 16px; color: var(--text); }
.quantity-selector button:hover { background: #eee; }
.quantity-selector input { width: 50px; height: 38px; text-align: center; border: none; border-left: 1px solid #ddd; border-right: 1px solid #ddd; font-size: 14px; }

.detail-actions { display: flex; gap: 15px; margin-top: 30px; }
.btn-add-cart { background: var(--secondary); color: #fff; padding: 14px 35px; border-radius: 25px; font-weight: 600; font-size: 15px; transition: all 0.2s; flex: 1; }
.btn-add-cart:hover { background: #e67e22; }
.btn-buy-now { background: var(--primary); color: #fff; padding: 14px 35px; border-radius: 25px; font-weight: 600; font-size: 15px; transition: all 0.2s; flex: 1; }
.btn-buy-now:hover { background: var(--primary-dark); }

/* ============ 商品列表页 ============ */
.shop-layout { display: grid; grid-template-columns: 220px 1fr; gap: 25px; }
.sidebar { background: #fff; border-radius: 10px; padding: 20px; height: fit-content; }
.sidebar h4 { font-size: 15px; margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.filter-group { margin-bottom: 25px; }
.filter-group ul li { padding: 8px 0; font-size: 13px; color: var(--text-light); cursor: pointer; transition: color 0.2s; }
.filter-group ul li:hover, .filter-group ul li.active { color: var(--primary); }
.sort-bar { display: flex; justify-content: space-between; align-items: center; background: #fff; border-radius: 10px; padding: 15px 20px; margin-bottom: 20px; }
.sort-options { display: flex; gap: 15px; font-size: 13px; }
.sort-options span { padding: 5px 12px; border-radius: 4px; cursor: pointer; }
.sort-options span.active { background: var(--primary); color: #fff; }
.result-count { font-size: 13px; color: var(--text-lighter); }

/* ============ 购物车页 ============ */
.cart-page .section-title { margin-top: 0; }
.cart-table { background: #fff; border-radius: 10px; overflow: hidden; }
.cart-header { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 0.5fr; gap: 15px; padding: 15px 20px; background: #fafafa; font-size: 13px; color: var(--text-light); font-weight: 500; }
.cart-item { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 0.5fr; gap: 15px; padding: 20px; border-top: 1px solid var(--border); align-items: center; }
.cart-product { display: flex; gap: 15px; align-items: center; }
.cart-product .img { width: 80px; height: 80px; background: linear-gradient(135deg, #f5f7fa, #e4e8ec); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 36px; position: relative; overflow: hidden; }
.cart-product .img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cart-product .name { font-size: 14px; color: var(--text); }
.cart-item .price, .cart-item .subtotal { color: var(--primary); font-weight: 600; }
.cart-item .remove-btn { color: var(--text-lighter); cursor: pointer; font-size: 18px; transition: color 0.2s; }
.cart-item .remove-btn:hover { color: var(--primary); }

.cart-footer { display: flex; justify-content: space-between; align-items: center; background: #fff; border-radius: 10px; padding: 20px; margin-top: 20px; }
.cart-total { text-align: right; }
.cart-total p { font-size: 13px; color: var(--text-light); margin-bottom: 5px; }
.cart-total .amount { font-size: 28px; color: var(--primary); font-weight: 700; }
.btn-checkout { background: var(--primary); color: #fff; padding: 14px 50px; border-radius: 25px; font-weight: 600; font-size: 15px; }
.btn-checkout:hover { background: var(--primary-dark); }
.cart-empty { text-align: center; padding: 80px 20px; background: #fff; border-radius: 10px; }
.cart-empty .icon { font-size: 80px; margin-bottom: 20px; opacity: 0.5; }
.cart-empty p { color: var(--text-light); font-size: 15px; margin-bottom: 20px; }
.cart-empty .btn-shop { background: var(--primary); color: #fff; padding: 10px 30px; border-radius: 20px; display: inline-block; }

/* ============ 结算页 ============ */
.checkout-layout { display: grid; grid-template-columns: 1.5fr 1fr; gap: 25px; }
.checkout-card { background: #fff; border-radius: 10px; padding: 25px; margin-bottom: 20px; }
.checkout-card h3 { font-size: 16px; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.form-group { margin-bottom: 15px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-group label { display: block; font-size: 13px; color: var(--text-light); margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 10px 14px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; transition: border-color 0.2s; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--primary); }
.payment-method { display: flex; gap: 15px; }
.pay-option { flex: 1; border: 2px solid #ddd; border-radius: 10px; padding: 18px; text-align: center; cursor: pointer; transition: all 0.2s; }
.pay-option.active { border-color: var(--primary); background: #fff5f4; }
.pay-option .icon { font-size: 28px; margin-bottom: 8px; }
.pay-option span { font-size: 13px; font-weight: 500; }

.summary-item { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 12px; }
.summary-item .label { color: var(--text-light); }
.summary-total { display: flex; justify-content: space-between; font-size: 18px; font-weight: 700; color: var(--primary); padding-top: 15px; border-top: 1px solid var(--border); margin-top: 15px; }

/* ============ 成功页 ============ */
.success-page { text-align: center; padding: 60px 20px; }
.success-icon { width: 80px; height: 80px; border-radius: 50%; background: var(--success); color: #fff; font-size: 40px; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; }
.success-page h2 { font-size: 24px; margin-bottom: 10px; }
.success-page p { color: var(--text-light); margin-bottom: 30px; }

/* ============ 关于/联系页 ============ */
.about-content { background: #fff; border-radius: 10px; padding: 40px; }
.about-content h2 { font-size: 22px; margin-bottom: 20px; color: var(--primary); }
.about-content p { margin-bottom: 15px; line-height: 1.8; color: var(--text-light); }
.contact-info { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 30px; }
.contact-card { background: #fff; border-radius: 10px; padding: 25px; text-align: center; }
.contact-card .icon { font-size: 36px; margin-bottom: 10px; }
.contact-card h4 { font-size: 15px; margin-bottom: 8px; }
.contact-card p { font-size: 13px; color: var(--text-light); }

/* ============ 响应式 ============ */
@media (max-width: 992px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .categories { grid-template-columns: repeat(3, 1fr); }
  .product-detail { grid-template-columns: 1fr; }
  .checkout-layout { grid-template-columns: 1fr; }
  .shop-layout { grid-template-columns: 1fr; }
  .footer .container { grid-template-columns: repeat(2, 1fr); }
  .banner { height: 350px; }
  .banner-slide h2 { font-size: 28px; }
  .features { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-main { display: none; }
  .cart-header { display: none; }
  .cart-item { grid-template-columns: 1fr; gap: 10px; }
  .header-right .search-box { display: none; }
  .banner { height: 280px; }
  .contact-info { grid-template-columns: 1fr; }
}

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