/* ========== 全局样式 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Microsoft YaHei", "PingFang SC", sans-serif; color: #333; background: #fafafa; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

:root {
  --primary: #c8963e;
  --primary-dark: #a67828;
  --secondary: #e8b867;
  --text-dark: #2c2c2c;
  --text-gray: #888;
  --bg-light: #fafafa;
  --bg-white: #fff;
  --border: #eee;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-hover: 0 6px 24px rgba(0,0,0,0.12);
}

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

/* ========== 顶部导航 ========== */
.top-bar { background: #2c2c2c; color: #ccc; font-size: 13px; }
.top-bar .container { display: flex; justify-content: space-between; align-items: center; height: 36px; }
.top-bar a:hover { color: var(--primary); }
.top-bar .left span { margin-right: 20px; }
.top-bar .right a { margin-left: 18px; }

/* ========== 主导航 ========== */
.header { background: #fff; box-shadow: var(--shadow); position: sticky; top: 0; z-index: 100; }
.header .container { display: flex; align-items: center; height: 80px; }
.logo { display: flex; align-items: center; font-size: 22px; font-weight: bold; color: var(--primary); }
.logo-icon { width: 44px; height: 44px; background: linear-gradient(135deg, var(--primary), var(--secondary)); border-radius: 10px; margin-right: 12px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 20px; font-weight: bold; }
.nav { display: flex; margin-left: 60px; }
.nav li { position: relative; margin-right: 36px; }
.nav a { font-size: 15px; color: var(--text-dark); padding: 8px 0; display: block; transition: color .2s; }
.nav a:hover, .nav a.active { color: var(--primary); }
.nav a.active::after { content: ''; position: absolute; bottom: -26px; left: 0; right: 0; height: 3px; background: var(--primary); border-radius: 2px; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 20px; }
.search-box { display: flex; border: 1px solid var(--border); border-radius: 20px; overflow: hidden; }
.search-box input { border: none; padding: 8px 14px; width: 200px; outline: none; font-size: 13px; }
.search-box button { padding: 8px 14px; background: var(--primary); color: #fff; font-size: 13px; }
.cart-btn { position: relative; font-size: 14px; color: var(--text-dark); display: flex; align-items: center; gap: 6px; }
.cart-btn .cart-icon { font-size: 20px; }
.cart-btn .badge { position: absolute; top: -8px; right: -10px; background: #e74c3c; color: #fff; font-size: 11px; min-width: 18px; height: 18px; border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 5px; }

/* ========== 轮播Banner ========== */
.banner { position: relative; overflow: hidden; height: 480px; }
.banner-slides { display: flex; transition: transform .6s ease; height: 100%; }
.banner-slide { min-width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #fff; position: relative; }
.banner-slide::before { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,0.25); }
.banner-slide .container { position: relative; z-index: 2; text-align: center; }
.banner-slide h2 { font-size: 48px; font-weight: bold; margin-bottom: 16px; text-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.banner-slide p { font-size: 18px; margin-bottom: 28px; opacity: 0.95; }
.banner-slide .btn-outline { display: inline-block; padding: 12px 36px; border: 2px solid #fff; border-radius: 30px; color: #fff; font-size: 15px; transition: all .3s; }
.banner-slide .btn-outline:hover { background: #fff; color: var(--primary); }
.banner-dots { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; z-index: 5; }
.banner-dots span { width: 32px; height: 4px; background: rgba(255,255,255,0.5); border-radius: 2px; cursor: pointer; transition: all .3s; }
.banner-dots span.active { background: #fff; width: 48px; }

/* ========== 分类导航 ========== */
.section { padding: 48px 0; }
.section-title { text-align: center; margin-bottom: 32px; }
.section-title h3 { font-size: 26px; font-weight: bold; color: var(--text-dark); display: inline-block; position: relative; padding-bottom: 12px; }
.section-title h3::after { content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 50px; height: 3px; background: var(--primary); border-radius: 2px; }
.section-title p { color: var(--text-gray); font-size: 14px; margin-top: 8px; }

.categories { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; }
.category-card { background: #fff; border-radius: 10px; padding: 28px 16px; text-align: center; transition: all .3s; border: 1px solid var(--border); }
.category-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); border-color: var(--primary); }
.category-icon { width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 28px; }
.category-card h4 { font-size: 15px; color: var(--text-dark); margin-bottom: 6px; }
.category-card p { font-size: 12px; color: var(--text-gray); }

/* ========== 商品网格 ========== */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.product-card { background: #fff; border-radius: 10px; overflow: hidden; transition: all .3s; border: 1px solid var(--border); }
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: var(--primary); }
.product-img-wrap { position: relative; padding-top: 100%; background: #f5f5f5; overflow: hidden; }
.product-img-wrap img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.product-card:hover .product-img-wrap img { transform: scale(1.08); }
.product-tag { position: absolute; top: 12px; left: 12px; background: var(--primary); color: #fff; font-size: 11px; padding: 4px 10px; border-radius: 4px; }
.product-tag.sale { background: #e74c3c; }
.product-info { padding: 16px; }
.product-info h4 { font-size: 14px; color: var(--text-dark); margin-bottom: 8px; line-height: 1.4; height: 40px; overflow: hidden; }
.product-info .desc { font-size: 12px; color: var(--text-gray); margin-bottom: 12px; height: 18px; overflow: hidden; }
.product-bottom { display: flex; justify-content: space-between; align-items: center; }
.price { color: #e74c3c; font-size: 18px; font-weight: bold; }
.price .original { font-size: 12px; color: var(--text-gray); text-decoration: line-through; margin-left: 8px; font-weight: normal; }
.btn-cart { background: var(--primary); color: #fff; padding: 6px 14px; border-radius: 18px; font-size: 12px; transition: all .2s; }
.btn-cart:hover { background: var(--primary-dark); }

/* ========== 特色服务 ========== */
.features { background: #fff; border-radius: 10px; padding: 32px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-top: 20px; }
.feature-item { display: flex; align-items: center; gap: 14px; }
.feature-icon { width: 48px; height: 48px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--secondary)); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 22px; flex-shrink: 0; }
.feature-item h5 { font-size: 14px; margin-bottom: 4px; }
.feature-item p { font-size: 12px; color: var(--text-gray); }

/* ========== 页脚 ========== */
.footer { background: #2c2c2c; color: #aaa; padding: 48px 0 0; margin-top: 48px; }
.footer-top { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1.5fr; gap: 32px; padding-bottom: 32px; border-bottom: 1px solid #444; }
.footer-brand h4 { color: #fff; font-size: 18px; margin-bottom: 14px; }
.footer-brand p { font-size: 13px; line-height: 1.8; margin-bottom: 14px; }
.footer-col h5 { color: #fff; font-size: 15px; margin-bottom: 16px; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { font-size: 13px; color: #aaa; transition: color .2s; }
.footer-col a:hover { color: var(--primary); }
.contact-list li { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 12px; }
.footer-bottom { text-align: center; padding: 20px 0; font-size: 12px; color: #666; }

/* ========== 页面头部Banner ========== */
.page-banner { background: linear-gradient(135deg, #2c2c2c 0%, var(--primary-dark) 100%); color: #fff; padding: 60px 0; text-align: center; }
.page-banner h1 { font-size: 32px; margin-bottom: 10px; }
.page-banner .breadcrumb { font-size: 14px; opacity: 0.85; }
.page-banner .breadcrumb a:hover { color: var(--secondary); }

/* ========== 商品列表页 ========== */
.shop-layout { display: flex; gap: 24px; padding: 40px 0; }
.sidebar { width: 240px; flex-shrink: 0; }
.sidebar-box { background: #fff; border-radius: 10px; padding: 20px; margin-bottom: 20px; border: 1px solid var(--border); }
.sidebar-box h4 { font-size: 15px; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.filter-item { display: block; padding: 8px 0; font-size: 13px; color: var(--text-dark); cursor: pointer; transition: color .2s; }
.filter-item:hover, .filter-item.active { color: var(--primary); }
.filter-item .count { float: right; color: var(--text-gray); }
.price-range { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.price-range input { width: 70px; padding: 6px; border: 1px solid var(--border); border-radius: 4px; font-size: 13px; }
.price-range button { background: var(--primary); color: #fff; padding: 6px 14px; border-radius: 4px; font-size: 12px; }

.shop-main { flex: 1; }
.shop-toolbar { background: #fff; border-radius: 10px; padding: 14px 20px; margin-bottom: 20px; display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--border); }
.shop-toolbar .result { font-size: 13px; color: var(--text-gray); }
.shop-toolbar .sorts { display: flex; gap: 4px; }
.shop-toolbar .sorts button { padding: 6px 14px; font-size: 13px; color: var(--text-dark); border-radius: 4px; transition: all .2s; }
.shop-toolbar .sorts button.active { background: var(--primary); color: #fff; }

.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 32px; }
.pagination button { min-width: 36px; height: 36px; border-radius: 4px; border: 1px solid var(--border); font-size: 13px; color: var(--text-dark); transition: all .2s; }
.pagination button.active, .pagination button:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ========== 商品详情页 ========== */
.product-detail { padding: 40px 0; }
.detail-layout { display: flex; gap: 40px; background: #fff; border-radius: 10px; padding: 32px; border: 1px solid var(--border); }
.detail-gallery { width: 450px; flex-shrink: 0; }
.main-img { width: 100%; aspect-ratio: 1; background: #f5f5f5; border-radius: 10px; overflow: hidden; margin-bottom: 14px; }
.main-img img { width: 100%; height: 100%; object-fit: cover; }
.thumbnails { display: flex; gap: 10px; }
.thumb { width: 76px; height: 76px; border-radius: 6px; overflow: hidden; cursor: pointer; border: 2px solid transparent; transition: border-color .2s; }
.thumb.active { border-color: var(--primary); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }

.detail-info { flex: 1; }
.detail-info h1 { font-size: 22px; margin-bottom: 14px; line-height: 1.4; }
.detail-meta { display: flex; gap: 20px; margin-bottom: 20px; font-size: 13px; color: var(--text-gray); padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.detail-meta span { display: flex; align-items: center; gap: 4px; }
.detail-meta .stars { color: #f39c12; }

.detail-price-box { background: #fff9f0; border-radius: 8px; padding: 18px 20px; margin-bottom: 22px; }
.detail-price-box .row { display: flex; align-items: center; margin-bottom: 8px; }
.detail-price-box .label { width: 70px; color: var(--text-gray); font-size: 13px; }
.detail-price-box .price { font-size: 30px; color: #e74c3c; font-weight: bold; }
.detail-price-box .price .symbol { font-size: 16px; }
.detail-price-box .original { font-size: 14px; color: var(--text-gray); text-decoration: line-through; margin-left: 14px; }
.detail-price-box .promo { background: #e74c3c; color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 3px; margin-left: 14px; }

.spec-row { display: flex; align-items: flex-start; margin-bottom: 18px; }
.spec-row .label { width: 70px; color: var(--text-gray); font-size: 13px; padding-top: 6px; }
.spec-options { display: flex; gap: 8px; flex-wrap: wrap; }
.spec-opt { padding: 8px 18px; border: 1px solid var(--border); border-radius: 4px; font-size: 13px; cursor: pointer; transition: all .2s; background: #fff; }
.spec-opt:hover { border-color: var(--primary); color: var(--primary); }
.spec-opt.active { border-color: var(--primary); color: var(--primary); background: #fff8ec; }

.qty-control { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; width: 120px; }
.qty-control button { width: 38px; height: 38px; font-size: 16px; color: var(--text-dark); background: #fff; }
.qty-control input { flex: 1; text-align: center; border: none; height: 38px; outline: none; font-size: 14px; }

.detail-actions { display: flex; gap: 14px; margin-top: 28px; }
.btn-primary { flex: 1; padding: 14px; background: var(--primary); color: #fff; border-radius: 4px; font-size: 15px; font-weight: bold; transition: all .2s; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { padding: 14px 28px; background: #fff; color: var(--primary); border: 1px solid var(--primary); border-radius: 4px; font-size: 15px; font-weight: bold; transition: all .2s; }
.btn-secondary:hover { background: #fff8ec; }

.detail-tabs { margin-top: 40px; background: #fff; border-radius: 10px; border: 1px solid var(--border); }
.tab-headers { display: flex; border-bottom: 1px solid var(--border); }
.tab-headers button { padding: 16px 28px; font-size: 14px; color: var(--text-dark); border-bottom: 2px solid transparent; transition: all .2s; }
.tab-headers button.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: bold; }
.tab-content { padding: 28px; font-size: 14px; line-height: 1.8; color: #555; }
.tab-content.hidden { display: none; }
.tab-content p { margin-bottom: 12px; }
.tab-content ul { padding-left: 20px; list-style: disc; }
.tab-content li { margin-bottom: 8px; }

/* ========== 购物车页 ========== */
.cart-section { padding: 40px 0; }
.cart-table { width: 100%; background: #fff; border-radius: 10px; border: 1px solid var(--border); overflow: hidden; margin-bottom: 24px; }
.cart-table thead { background: #fafafa; }
.cart-table th { padding: 16px; font-size: 13px; color: var(--text-gray); font-weight: normal; text-align: left; border-bottom: 1px solid var(--border); }
.cart-table th.center { text-align: center; }
.cart-table th.right { text-align: right; }
.cart-table td { padding: 16px; font-size: 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.cart-table td.right { text-align: right; }
.cart-product { display: flex; gap: 14px; align-items: center; }
.cart-product img { width: 80px; height: 80px; object-fit: cover; border-radius: 6px; }
.cart-product .info h5 { font-size: 14px; margin-bottom: 4px; }
.cart-product .info p { font-size: 12px; color: var(--text-gray); }
.cart-price { color: #e74c3c; font-weight: bold; }
.cart-remove { color: var(--text-gray); font-size: 13px; transition: color .2s; }
.cart-remove:hover { color: #e74c3c; }

.cart-summary { background: #fff; border-radius: 10px; padding: 28px; border: 1px solid var(--border); max-width: 380px; margin-left: auto; }
.cart-summary h4 { font-size: 16px; margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.summary-row { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: 14px; }
.summary-row.total { padding-top: 14px; border-top: 1px solid var(--border); margin-top: 14px; font-size: 16px; font-weight: bold; }
.summary-row.total .value { color: #e74c3c; font-size: 22px; }
.checkout-btn { width: 100%; padding: 14px; background: var(--primary); color: #fff; border-radius: 4px; font-size: 15px; font-weight: bold; margin-top: 16px; transition: all .2s; }
.checkout-btn:hover { background: var(--primary-dark); }

.empty-cart { text-align: center; padding: 80px 20px; background: #fff; border-radius: 10px; border: 1px solid var(--border); }
.empty-cart .icon { font-size: 64px; margin-bottom: 16px; }
.empty-cart p { color: var(--text-gray); margin-bottom: 20px; }

/* ========== 结算页 ========== */
.checkout-section { padding: 40px 0; }
.checkout-layout { display: flex; gap: 24px; }
.checkout-main { flex: 1; }
.checkout-aside { width: 380px; flex-shrink: 0; }

.form-card { background: #fff; border-radius: 10px; padding: 28px; border: 1px solid var(--border); margin-bottom: 20px; }
.form-card h4 { font-size: 16px; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
.form-card h4 .step-num { width: 26px; height: 26px; background: var(--primary); color: #fff; border-radius: 50%; font-size: 13px; display: flex; align-items: center; justify-content: center; }

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-item label { display: block; font-size: 13px; color: var(--text-dark); margin-bottom: 6px; }
.form-item input, .form-item select, .form-item textarea { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; outline: none; transition: border-color .2s; font-family: inherit; }
.form-item input:focus, .form-item select:focus, .form-item textarea:focus { border-color: var(--primary); }
.form-item textarea { resize: vertical; min-height: 80px; }
.form-item.full { grid-column: 1 / -1; }

.payment-method { display: flex; gap: 12px; flex-wrap: wrap; }
.pay-option { flex: 1; min-width: 140px; padding: 16px; border: 2px solid var(--border); border-radius: 8px; text-align: center; cursor: pointer; transition: all .2s; }
.pay-option:hover { border-color: var(--primary); }
.pay-option.active { border-color: var(--primary); background: #fff8ec; }
.pay-option .icon { font-size: 28px; margin-bottom: 8px; }
.pay-option .name { font-size: 14px; font-weight: bold; }
.pay-option .desc { font-size: 11px; color: var(--text-gray); margin-top: 4px; }

/* ========== Toast 提示 ========== */
.toast { position: fixed; top: 100px; left: 50%; transform: translateX(-50%) translateY(-20px); background: #333; color: #fff; padding: 12px 28px; border-radius: 30px; font-size: 14px; z-index: 1000; opacity: 0; transition: all .3s; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: #27ae60; }
.toast.error { background: #e74c3c; }

/* ========== 模态框 ========== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 1000; opacity: 0; visibility: hidden; transition: all .3s; }
.modal-overlay.show { opacity: 1; visibility: visible; }
.modal { background: #fff; border-radius: 12px; padding: 36px; max-width: 420px; width: 90%; text-align: center; transform: scale(0.9); transition: transform .3s; }
.modal-overlay.show .modal { transform: scale(1); }
.modal .check-icon { width: 64px; height: 64px; background: #27ae60; color: #fff; font-size: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; }
.modal h3 { font-size: 20px; margin-bottom: 10px; }
.modal p { color: var(--text-gray); font-size: 14px; margin-bottom: 24px; }
.modal .btn-primary { width: 100%; }

/* ========== 响应式 ========== */
@media (max-width: 1024px) {
  .nav { margin-left: 30px; }
  .nav li { margin-right: 20px; }
  .categories { grid-template-columns: repeat(3, 1fr); }
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .features { grid-template-columns: repeat(2, 1fr); }
  .detail-layout { flex-direction: column; }
  .detail-gallery { width: 100%; }
  .checkout-layout { flex-direction: column; }
  .checkout-aside { width: 100%; }
}
@media (max-width: 768px) {
  .nav { display: none; }
  .categories { grid-template-columns: repeat(2, 1fr); }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .banner { height: 320px; }
  .banner-slide h2 { font-size: 28px; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .shop-layout { flex-direction: column; }
  .sidebar { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
}
