/* 萌卡商城 - 前台样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif; background: #f5f5f7; color: #333; }
a { color: #FF6B8A; text-decoration: none; }
a:hover { color: #e55a78; }

/* 顶部导航条（薄） */
.topbar { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,.92); backdrop-filter: blur(12px); border-bottom: 1px solid #eee; box-shadow: 0 1px 8px rgba(255,107,138,.08); }
.topbar-inner { max-width: 1100px; margin: 0 auto; padding: 0 16px; height: 56px; display: flex; align-items: center; justify-content: space-between; }
.topbar-logo { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.topbar-logo .logo-icon { width: 32px; height: 32px; border-radius: 10px; background: linear-gradient(135deg,#FF6B8A,#ff9eb5); display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.topbar-logo span { font-weight: 700; font-size: 17px; background: linear-gradient(135deg,#FF6B8A,#ff9eb5); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.topbar-nav { display: flex; gap: 6px; }
.topbar-nav a { display: inline-flex; align-items: center; padding: 6px 14px; border-radius: 20px; font-size: 13px; font-weight: 500; color: #666; background: #f5f5f7; transition: all .2s; }
.topbar-nav a:hover { background: #FF6B8A; color: #fff; }

/* 主内容区 */
.main-content { max-width: 1100px; margin: 0 auto; padding: 20px 16px; }

/* Banner */
.banner { background: linear-gradient(135deg,#FF6B8A,#ff9eb5); border-radius: 20px; padding: 32px 24px; margin-bottom: 20px; position: relative; overflow: hidden; box-shadow: 0 4px 24px rgba(255,107,138,.25); }
.banner::after { content: ''; position: absolute; right: -30px; top: -30px; width: 140px; height: 140px; border-radius: 50%; background: rgba(255,255,255,.12); }
.banner h1 { color: #fff; font-size: clamp(20px,4vw,28px); margin-bottom: 6px; position: relative; text-shadow: 0 2px 10px rgba(0,0,0,0.08); }
.banner p { color: rgba(255,255,255,.88); font-size: 14px; position: relative; }

/* 搜索框 */
.search-wrap { position: relative; margin-bottom: 14px; }
.search-wrap .search-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font-size: 16px; z-index: 1; }
.search-wrap input { width: 100%; padding: 12px 16px 12px 46px; border: 1px solid #ddd; border-radius: 50px; font-size: 14px; outline: none; transition: border-color .2s, box-shadow .2s; background: #fff; }
.search-wrap input:focus { border-color: #FF6B8A; box-shadow: 0 0 0 3px rgba(255,107,138,.12); }

/* 分类标签 */
.cat-bar { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 8px; margin-bottom: 20px; }
.cat-bar::-webkit-scrollbar { display: none; }
.cat-chip { display: inline-flex; align-items: center; padding: 7px 18px; border-radius: 50px; font-size: 13px; font-weight: 500; white-space: nowrap; flex-shrink: 0; background: #eee; color: #888; transition: all .2s; cursor: pointer; border: none; }
.cat-chip:hover { background: #FFE8EE; color: #FF6B8A; }
.cat-chip.active { background: #FF6B8A; color: #fff; box-shadow: 0 2px 8px rgba(255,107,138,.25); }

/* 区域标题 */
.section-title { font-size: 17px; font-weight: 600; color: #333; margin-bottom: 16px; }

/* 商品网格 */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.product-card { background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 2px 12px rgba(0,0,0,0.06); transition: all .3s; cursor: pointer; }
.product-card:hover { transform: translateY(-4px); box-shadow: 0 8px 25px rgba(255,107,138,0.15); }
.product-card .img-wrap { height: 140px; display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; background: linear-gradient(135deg, #FFF5F7, #FFE8EE); }
.product-card .img-wrap img { width: 100%; height: 100%; object-fit: contain; }
.product-card .img-wrap .no-img { font-size: 56px; line-height: 1; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.1)); }
.product-card .img-wrap::after { content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%; }
.product-card .img-wrap.cat-qq::after { background: linear-gradient(180deg, #4FACFE, #00C6FE); }
.product-card .img-wrap.cat-video::after { background: linear-gradient(180deg, #FFB870, #FF8E53); }
.product-card .img-wrap.cat-music::after { background: linear-gradient(180deg, #B070FF, #8A5BFF); }
.product-card .img-wrap.cat-game::after { background: linear-gradient(180deg, #70D8A8, #4FC28A); }
.product-card .img-wrap.cat-all::after { background: #FF6B8A; }
.product-card .discount-badge { position: absolute; top: 8px; right: 8px; background: linear-gradient(135deg, #FF4757, #FF6B8A); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 12px; box-shadow: 0 2px 6px rgba(255,71,87,0.3); z-index: 2; }
.product-card .info { padding: 16px; }
.product-card .name { font-size: 14px; font-weight: 600; color: #333; margin-bottom: 6px; line-height: 1.4; height: 2.8em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.product-card .desc { font-size: 12px; color: #999; margin-bottom: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-card .price-row { display: flex; align-items: center; justify-content: space-between; }
.product-card .price .now { font-size: 20px; font-weight: 700; color: #FF6B8A; }
.product-card .price .original { font-size: 13px; color: #bbb; text-decoration: line-through; font-weight: 400; margin-left: 6px; }
.product-card .sold { font-size: 12px; color: #999; }

/* 商品详情页 */
.product-detail { max-width: 800px; margin: 30px auto; background: #fff; border-radius: 16px; padding: 30px; box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.product-detail .detail-header { display: flex; gap: 30px; }
.product-detail .detail-img { width: 300px; height: 300px; border-radius: 12px; background: linear-gradient(135deg, #FFF5F7, #FFE8EE); display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
.product-detail .detail-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.product-detail .detail-img .no-img { font-size: 64px; color: #FF6B8A; }
.product-detail .detail-info { flex: 1; }
.product-detail h1 { font-size: 24px; color: #333; margin-bottom: 10px; }
.product-detail .detail-desc { color: #666; font-size: 14px; line-height: 1.8; margin-bottom: 15px; }
.product-detail .detail-price { font-size: 28px; font-weight: 700; color: #FF6B8A; margin: 15px 0; }
.product-detail .detail-price .original { font-size: 16px; color: #bbb; text-decoration: line-through; font-weight: 400; margin-left: 10px; }
.product-detail .detail-stock { color: #999; font-size: 13px; margin-bottom: 20px; }
.sold-out-msg { background: #fff8f9; border: 1px solid #ffd6e0; border-radius: 10px; padding: 14px 16px; font-size: 14px; color: #666; line-height: 1.6; margin: 16px 0; }
.sold-out-msg .icon { margin-right: 4px; }
.sold-out-msg .back-link { color: #FF6B8A; font-weight: 500; text-decoration: none; margin-left: 6px; }
.sold-out-msg .back-link:hover { text-decoration: underline; }
.product-detail .form-group { margin-bottom: 15px; }
.product-detail .form-group label { display: block; font-size: 13px; color: #666; margin-bottom: 5px; }
.product-detail .form-group input, .product-detail .form-group textarea, .product-detail .form-group select { width: 100%; padding: 10px 14px; border: 1px solid #ddd; border-radius: 10px; font-size: 14px; outline: none; transition: border .2s; }
.product-detail .form-group input:focus, .product-detail .form-group textarea:focus { border-color: #FF6B8A; }
.product-detail .qty-ctrl { display: flex; align-items: center; gap: 0; }
.product-detail .qty-ctrl button { width: 40px; height: 40px; border: 1px solid #ddd; background: #f9f9f9; font-size: 18px; cursor: pointer; color: #666; }
.product-detail .qty-ctrl button:first-child { border-radius: 10px 0 0 10px; }
.product-detail .qty-ctrl button:last-child { border-radius: 0 10px 10px 0; }
.product-detail .qty-ctrl input { width: 60px; height: 40px; text-align: center; border: 1px solid #ddd; border-left: none; border-right: none; font-size: 15px; outline: none; }
.btn-primary { background: linear-gradient(135deg, #FF6B8A, #FF8E9E); color: #fff; border: none; padding: 12px 30px; border-radius: 25px; font-size: 16px; font-weight: 600; cursor: pointer; transition: all .3s; display: inline-block; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(255,107,138,0.3); }
.btn-block { width: 100%; text-align: center; }
.coupon-row { display: flex; gap: 10px; }
.coupon-row input { flex: 1; }
.coupon-row button { padding: 10px 16px; border-radius: 10px; border: 1px solid #FF6B8A; background: #fff; color: #FF6B8A; cursor: pointer; flex-shrink: 0; }

/* 支付页面 */
.pay-page { max-width: 600px; margin: 30px auto; }
.pay-card { background: #fff; border-radius: 16px; padding: 30px; box-shadow: 0 2px 12px rgba(0,0,0,0.06); margin-bottom: 20px; }
.pay-card h2 { font-size: 18px; color: #333; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid #f0f0f0; }
.pay-info-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; }
.pay-info-row .label { color: #999; }
.pay-info-row .value { color: #333; font-weight: 500; }
.pay-total { font-size: 24px; font-weight: 700; color: #FF6B8A; text-align: center; margin: 20px 0; }
.pay-methods { display: flex; gap: 15px; margin: 20px 0; }
.pay-method { flex: 1; border: 2px solid #eee; border-radius: 12px; padding: 20px; text-align: center; cursor: pointer; transition: all .2s; }
.pay-method:hover, .pay-method.active { border-color: #FF6B8A; background: #FFF5F7; }
.pay-method .icon { font-size: 36px; margin-bottom: 8px; }
.pay-method .name { font-size: 14px; color: #333; font-weight: 500; }
.qr-wrap { text-align: center; margin: 20px 0; }
.qr-wrap img { width: 220px; height: 220px; border-radius: 12px; border: 1px solid #eee; }
.qr-wrap .hint { color: #FF6B8A; font-size: 13px; margin-top: 10px; }
.pay-tip { background: #FFF5F7; border: 1px solid #FFCDD5; border-radius: 10px; padding: 15px; font-size: 13px; color: #666; margin: 15px 0; }
.pay-tip strong { color: #FF6B8A; }

/* 订单查询 */
.query-page { max-width: 700px; margin: 30px auto; }
.query-card { background: #fff; border-radius: 16px; padding: 30px; box-shadow: 0 2px 12px rgba(0,0,0,0.06); margin-bottom: 20px; }
.query-card h2 { font-size: 18px; color: #333; margin-bottom: 20px; }
.query-card .form-group { margin-bottom: 15px; }
.query-card .form-group label { display: block; font-size: 13px; color: #666; margin-bottom: 5px; }
.query-card .form-group input { width: 100%; padding: 10px 14px; border: 1px solid #ddd; border-radius: 10px; font-size: 14px; outline: none; }
.query-result { margin-top: 20px; }
.order-item { background: #f9f9f9; border-radius: 12px; padding: 16px; margin-bottom: 12px; }
.order-item .row { display: flex; justify-content: space-between; font-size: 13px; color: #666; padding: 3px 0; }
.order-item .status-pending { color: #f39c12; }
.order-item .status-paid { color: #3498db; }
.order-item .status-delivered { color: #27ae60; }
.order-item .status-rejected { color: #e74c3c; }
.card-content { margin-top: 10px; padding: 12px; background: #fff; border: 1px solid #FFCDD5; border-radius: 8px; font-size: 13px; line-height: 1.6; color: #333; white-space: pre-wrap; }

/* 消息提示 */
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 15px; font-size: 13px; }
.alert-error { background: #FFF0F0; border: 1px solid #FFD0D0; color: #e74c3c; }
.alert-success { background: #F0FFF0; border: 1px solid #D0FFD0; color: #27ae60; }
.alert-info { background: #F0F8FF; border: 1px solid #D0E8FF; color: #3498db; }

/* Footer */
.footer { text-align: center; padding: 20px; color: #999; font-size: 12px; margin-top: 30px; }
.footer a { color: #FF6B8A; }

/* Empty state */
.empty-state { text-align: center; padding: 80px 20px; color: #999; background: #fff; border-radius: 16px; box-shadow: 0 2px 12px rgba(0,0,0,0.04); }
.empty-state .icon { font-size: 80px; margin-bottom: 18px; opacity: 0.6; }
.empty-state p { font-size: 15px; color: #666; margin-bottom: 4px; }
.empty-state .hint { font-size: 13px; color: #aaa; }

/* Responsive */
@media (max-width: 768px) {
    .main-content { padding: 16px 12px; }
    .product-detail .detail-header { flex-direction: column; }
    .product-detail .detail-img { width: 100%; height: 240px; }
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .banner { padding: 24px 20px; border-radius: 16px; }
    .banner h1 { font-size: 20px; }
    .banner p { font-size: 13px; }
    .cat-bar { margin-bottom: 14px; }
    .cat-chip { padding: 6px 14px; font-size: 12px; }
    .search-wrap input { padding: 10px 14px 10px 40px; font-size: 13px; }
    .product-card .info { padding: 12px; }
    .product-card .price .now { font-size: 17px; }
}
/* AJAX 商品列表切换 */
#productsArea{transition:opacity .2s;min-height:200px;}
