/* 商城前台样式 */
:root {
    --primary: #6c5ce7;
    --primary-dark: #5a4bd1;
    --bg: #f5f6fa;
    --card: #fff;
    --text: #2d3436;
    --muted: #636e72;
    --border: #e1e4e8;
    --sale: #e74c3c;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; }

/* 顶部栏 */
.store-header { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.header-inner { display: flex; align-items: center; gap: 24px; padding: 12px 0; }
.logo { font-size: 20px; font-weight: 700; color: var(--primary); text-decoration: none; white-space: nowrap; }
.logo i { margin-right: 4px; }
.main-nav { display: flex; gap: 20px; }
.main-nav a { color: var(--text); text-decoration: none; font-size: 15px; font-weight: 500; transition: color .2s; }
.main-nav a:hover { color: var(--primary); }
.header-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.search-box form { display: flex; border: 1px solid var(--border); border-radius: 20px; overflow: hidden; }
.search-box input { border: none; padding: 6px 14px; outline: none; width: 200px; font-size: 14px; }
.search-box button { border: none; background: var(--primary); color: #fff; padding: 6px 12px; cursor: pointer; }
.icon-btn { position: relative; color: var(--text); font-size: 20px; text-decoration: none; padding: 4px 8px; }
.cart-badge { position: absolute; top: -2px; right: -4px; font-size: 10px; padding: 2px 6px; }
.login-btn { background: var(--primary); color: #fff !important; padding: 6px 16px; border-radius: 16px; text-decoration: none; font-size: 14px; }
.user-link { cursor: pointer; color: var(--text); text-decoration: none; font-size: 14px; }
.user-link i { margin-right: 4px; }

/* 主内容 */
.store-main { min-height: calc(100vh - 120px); padding: 20px 0; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* Banner 轮播 */
.store-banner { border-radius: 12px; overflow: hidden; margin-bottom: 24px; position: relative; height: 360px; }
.store-banner img { width: 100%; height: 100%; object-fit: cover; }
.banner-dots { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }
.banner-dots span { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.5); cursor: pointer; transition: all .3s; }
.banner-dots span.active { width: 28px; border-radius: 5px; background: #fff; }

/* 区块标题 */
.section-title { font-size: 22px; font-weight: 700; margin: 24px 0 16px; display: flex; align-items: center; gap: 8px; }
.section-title::before { content: ''; width: 4px; height: 22px; background: var(--primary); border-radius: 2px; }
.section-title .more { font-size: 13px; color: var(--muted); font-weight: normal; margin-left: auto; text-decoration: none; }

/* 商品网格 */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.product-card { background: var(--card); border-radius: 12px; overflow: hidden; transition: transform .2s, box-shadow .2s; cursor: pointer; border: 1px solid var(--border); }
.product-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,0.1); }
.product-card .img-wrap { width: 100%; height: 200px; background: #f0f0f0; overflow: hidden; }
.product-card img { width: 100%; height: 100%; object-fit: cover; }
.product-card .info { padding: 12px; }
.product-card .name { font-size: 14px; color: var(--text); margin: 0 0 6px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 40px; }
.product-card .subtitle { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.product-card .price { color: var(--sale); font-size: 18px; font-weight: 700; }
.product-card .price .old { color: var(--muted); font-size: 12px; text-decoration: line-through; margin-left: 6px; font-weight: normal; }
.product-card .sales { font-size: 12px; color: var(--muted); }
.product-card .tag { display: inline-block; background: #fff0f0; color: var(--sale); font-size: 11px; padding: 2px 6px; border-radius: 4px; margin-right: 4px; }

/* 商品详情 */
.detail-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; background: #fff; border-radius: 12px; padding: 24px; }
.detail-img { width: 100%; border-radius: 8px; background: #f0f0f0; }
.detail-name { font-size: 24px; font-weight: 700; margin: 0 0 8px; }
.detail-subtitle { color: var(--muted); font-size: 15px; margin-bottom: 16px; }
.detail-price-box { background: linear-gradient(135deg, #fff5f5, #fff); padding: 16px; border-radius: 8px; margin-bottom: 16px; }
.detail-price { color: var(--sale); font-size: 32px; font-weight: 700; }
.detail-price .unit { font-size: 16px; }
.detail-meta { display: flex; gap: 24px; margin-bottom: 16px; color: var(--muted); font-size: 14px; }
.sku-group { margin-bottom: 16px; }
.sku-label { font-weight: 600; margin-bottom: 8px; }
.sku-options { display: flex; gap: 8px; flex-wrap: wrap; }
.sku-opt { padding: 6px 16px; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; font-size: 14px; transition: all .2s; }
.sku-opt:hover { border-color: var(--primary); }
.sku-opt.active { border-color: var(--primary); background: var(--primary); color: #fff; }
.detail-actions { display: flex; gap: 12px; margin-top: 24px; }
.btn-cart, .btn-buy { padding: 12px 32px; border-radius: 24px; border: none; font-size: 16px; cursor: pointer; font-weight: 600; }
.btn-cart { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn-buy { background: var(--sale); color: #fff; }
.detail-desc { margin-top: 24px; background: #fff; border-radius: 12px; padding: 24px; }
.detail-desc img { max-width: 100%; }

/* 购物车 */
.cart-list { background: #fff; border-radius: 12px; overflow: hidden; }
.cart-item { display: flex; align-items: center; gap: 16px; padding: 16px; border-bottom: 1px solid var(--border); }
.cart-item:last-child { border-bottom: none; }
.cart-item img { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; }
.cart-item .name { flex: 1; font-size: 15px; }
.cart-item .price { color: var(--sale); font-weight: 600; width: 100px; }
.qty-control { display: flex; align-items: center; gap: 8px; }
.qty-control button { width: 28px; height: 28px; border: 1px solid var(--border); background: #fff; border-radius: 4px; cursor: pointer; }
.cart-summary { background: #fff; border-radius: 12px; padding: 20px; margin-top: 16px; display: flex; justify-content: space-between; align-items: center; }
.cart-total { font-size: 20px; }
.cart-total .amount { color: var(--sale); font-size: 28px; font-weight: 700; }
.btn-checkout { background: var(--sale); color: #fff; border: none; padding: 12px 40px; border-radius: 24px; font-size: 16px; cursor: pointer; font-weight: 600; }

/* 会员中心 */
.auth-box { max-width: 400px; margin: 40px auto; background: #fff; border-radius: 12px; padding: 32px; }
.auth-tabs { display: flex; margin-bottom: 24px; border-bottom: 1px solid var(--border); }
.auth-tab { flex: 1; text-align: center; padding: 12px; cursor: pointer; font-size: 16px; border-bottom: 2px solid transparent; }
.auth-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 14px; color: var(--muted); }
.form-group input { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; outline: none; }
.form-group input:focus { border-color: var(--primary); }
.btn-primary { width: 100%; padding: 12px; background: var(--primary); color: #fff; border: none; border-radius: 8px; font-size: 16px; cursor: pointer; font-weight: 600; }

/* 订单 */
.order-list { background: #fff; border-radius: 12px; overflow: hidden; }
.order-item { padding: 16px; border-bottom: 1px solid var(--border); }
.order-item:last-child { border-bottom: none; }
.order-head { display: flex; justify-content: space-between; margin-bottom: 12px; color: var(--muted); font-size: 13px; }
.order-product { display: flex; gap: 12px; align-items: center; }
.order-product img { width: 60px; height: 60px; object-fit: cover; border-radius: 6px; }
.order-status { padding: 4px 12px; border-radius: 12px; font-size: 12px; background: #e8f5e9; color: #2e7d32; }

/* 筛选栏 */
.filter-bar { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-tag { padding: 6px 16px; background: #fff; border: 1px solid var(--border); border-radius: 16px; cursor: pointer; font-size: 14px; }
.filter-tag.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 底部 */
.store-footer { background: #2d3436; color: #b2bec3; padding: 32px 0 16px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; margin-bottom: 24px; }
.footer-grid h5, .footer-grid h6 { color: #fff; margin-bottom: 12px; }
.footer-grid a { display: block; color: #b2bec3; text-decoration: none; font-size: 13px; margin-bottom: 6px; }
.copyright { text-align: center; font-size: 12px; border-top: 1px solid #636e72; padding-top: 16px; }

@media (max-width: 768px) {
    .main-nav { display: none; }
    .search-box input { width: 120px; }
    .detail-layout { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
}
