/* ========================================
   京微曦健康管理 H5版（审核用）- 样式
   移动端布局 + 桌面浏览器限宽居中（响应式）
   ======================================== */

:root {
    --primary: #e4393c;
    --primary-dark: #c1272a;
    --orange: #ff8c1a;
    --text-dark: #333;
    --text-gray: #666;
    --text-light: #999;
    --border: #eee;
    --bg-light: #f5f5f5;
    --radius: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
    color: var(--text-dark);
    background: #f7f7f7;
    line-height: 1.6;
    font-size: 14px;
}
a { text-decoration: none; color: inherit; cursor: pointer; }
button { cursor: pointer; border: none; outline: none; font-family: inherit; }
input { outline: none; font-family: inherit; }
img { max-width: 100%; display: block; }

/* ====== 顶部导航 ====== */
.top-bar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.top-bar .container {
    display: flex; align-items: center; height: 50px; padding: 0 14px;
}
.logo { font-size: 18px; font-weight: 800; color: var(--primary); white-space: nowrap; }
.nav { display: flex; gap: 18px; margin-left: auto; font-size: 13px; }
.nav a { color: var(--text-gray); }
.nav a.active { color: var(--primary); font-weight: 600; }

/* ====== 轮播 ====== */
.banner-section { padding: 12px 12px 0; }
.banner-slider { border-radius: 10px; overflow: hidden; background: var(--bg-light); }
.banner-slider img { width: 100%; height: 150px; object-fit: cover; }

/* ====== 分类 ====== */
.category-nav {
    display: flex; gap: 10px; overflow-x: auto; padding: 14px 12px;
    white-space: nowrap; -webkit-overflow-scrolling: touch;
}
.category-nav::-webkit-scrollbar { display: none; }
.cat-item {
    flex-shrink: 0; padding: 6px 16px; background: #fff; border: 1px solid var(--border);
    border-radius: 16px; font-size: 13px; color: var(--text-gray);
}
.cat-item:active { background: var(--bg-light); }

/* ====== 商品网格 ====== */
.section { padding: 6px 12px 16px; }
.section-title {
    font-size: 16px; font-weight: 700; color: var(--text-dark);
    padding: 12px 0; display: flex; align-items: center;
}
.section-title::before {
    content: ''; width: 4px; height: 16px; background: var(--primary);
    border-radius: 2px; margin-right: 8px;
}
.goods-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.goods-card {
    background: #fff; border-radius: var(--radius); overflow: hidden;
    border: 1px solid var(--border); position: relative;
}
.goods-card .img-wrap { aspect-ratio: 1; overflow: hidden; background: var(--bg-light); }
.goods-card .img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.goods-card .info { padding: 10px; }
.goods-card .name {
    font-size: 13px; color: var(--text-dark); line-height: 1.4; height: 37px;
    overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.goods-card .price-row { display: flex; align-items: baseline; justify-content: space-between; margin-top: 8px; }
.goods-card .price { color: var(--primary); font-size: 17px; font-weight: 700; }
.goods-card .price::before { content: '¥'; font-size: 12px; font-weight: 400; }
.goods-card .original-price { color: var(--text-light); font-size: 11px; text-decoration: line-through; }
.goods-card .sales-info { font-size: 11px; color: var(--text-light); margin-top: 4px; }

/* 自营/第三方标签 */
.self-tag {
    display: inline-block; font-size: 11px; color: #fff; background: var(--primary);
    padding: 1px 7px; border-radius: 3px; margin-top: 6px; letter-spacing: 1px;
}
.third-tag {
    display: inline-block; font-size: 11px; color: #fff; background: var(--orange);
    padding: 1px 7px; border-radius: 3px; letter-spacing: 1px;
}

/* ====== 店铺卡片 ====== */
.shop-grid { display: flex; flex-direction: column; gap: 10px; }
.shop-card {
    display: flex; gap: 12px; background: #fff; border: 1px solid var(--border);
    border-radius: var(--radius); padding: 12px;
}
.shop-card-logo { width: 56px; height: 56px; border-radius: 8px; overflow: hidden; background: var(--bg-light); flex-shrink: 0; }
.shop-card-logo img { width: 100%; height: 100%; object-fit: cover; }
.shop-card-info { flex: 1; min-width: 0; }
.shop-card-name { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.shop-card-intro { font-size: 12px; color: var(--text-gray); margin-top: 4px; line-height: 1.4; }
.shop-card-count { font-size: 11px; color: var(--text-light); margin-top: 4px; }

/* ====== 店铺主页 ====== */
.shop-header { display: flex; gap: 12px; padding: 16px 12px; background: #fff; border-bottom: 1px solid var(--border); }
.shop-logo { width: 64px; height: 64px; border-radius: 10px; overflow: hidden; background: var(--bg-light); flex-shrink: 0; }
.shop-logo img { width: 100%; height: 100%; object-fit: cover; }
.shop-name { font-size: 18px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.shop-intro { font-size: 12px; color: var(--text-gray); margin-top: 4px; }
.shop-info { background: #fff; border-radius: var(--radius); padding: 14px 16px; margin: 12px; }
.shop-info h3 { font-size: 15px; margin-bottom: 12px; padding-left: 8px; border-left: 4px solid var(--primary); }
.shop-info dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 13px; }
.shop-info dt { color: var(--text-light); }
.shop-info dd { color: var(--text-dark); word-break: break-all; }

/* ====== 详情页 ====== */
.detail-gallery { width: 100%; aspect-ratio: 1; background: var(--bg-light); }
.detail-gallery img { width: 100%; height: 100%; object-fit: contain; }
.detail-info { background: #fff; padding: 14px 16px; }
.detail-info h1 { font-size: 18px; line-height: 1.5; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.price-box {
    background: linear-gradient(135deg, #fff5f5, #fff); padding: 12px 14px;
    border-radius: 8px; border-left: 4px solid var(--primary); margin: 10px 0;
}
.price-box .current { font-size: 24px; font-weight: 700; color: var(--primary); }
.price-box .current::before { content: '¥'; font-size: 15px; font-weight: 400; }
.price-box .market { color: var(--text-light); text-decoration: line-through; margin-left: 10px; font-size: 13px; }
.detail-meta { display: flex; gap: 18px; color: var(--text-gray); font-size: 13px; padding: 10px 0; border-top: 1px solid var(--border); }
.desc-section { background: #fff; margin-top: 10px; padding: 14px 16px; }
.desc-section h3 { font-size: 15px; padding-left: 8px; border-left: 4px solid var(--primary); margin-bottom: 10px; }
.desc-content { line-height: 1.8; color: var(--text-gray); font-size: 13px; }
.shop-info-inline { background: var(--bg-light); border-radius: 8px; padding: 12px 14px; margin-top: 12px; }
.shop-info-inline h4 { font-size: 14px; margin-bottom: 10px; }
.shop-info-inline dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 12px; }
.shop-info-inline dt { color: var(--text-light); }
.shop-info-inline dd { color: var(--text-dark); }

/* ====== 面包屑 ====== */
.breadcrumb { padding: 12px; font-size: 12px; color: var(--text-gray); background: #fff; }
.breadcrumb a { color: var(--text-gray); }

/* ====== toast ====== */
.toast {
    position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
    background: rgba(0,0,0,.75); color: #fff; padding: 10px 20px;
    border-radius: 6px; font-size: 14px; z-index: 9999; display: none;
    max-width: 80%; text-align: center;
}
.toast.show { display: block; }

/* ====== loading / 空状态 ====== */
.loading, .empty { text-align: center; padding: 40px 0; color: var(--text-light); font-size: 13px; }

/* ====== 底部 ====== */
.footer { background: #fff; margin-top: 16px; padding: 20px 12px 30px; text-align: center; }
.footer-links { font-size: 12px; color: var(--text-gray); margin-bottom: 10px; line-height: 1.8; }
.footer-links .sep { margin: 0 6px; color: var(--border); }
.footer p { font-size: 12px; color: var(--text-light); }
.footer .icp-beian a { color: var(--text-light); }

/* ====== 桌面响应式：限宽居中，允许完整浏览 ====== */
@media (min-width: 768px) {
    body { max-width: 750px; margin: 0 auto; box-shadow: 0 0 20px rgba(0,0,0,.08); }
    .top-bar .container { max-width: 750px; margin: 0 auto; }
}

/* ====== 操作按钮 ====== */
.action-bar { display: flex; gap: 12px; margin-top: 16px; padding: 16px 0; border-top: 1px solid var(--border); }
.btn-cart, .btn-buy { flex: 1; height: 44px; border-radius: 22px; font-size: 15px; }
.btn-cart { background: #ff9800; color: #fff; }
.btn-buy { background: var(--primary); color: #fff; }

/* ====== 购物车 ====== */
.cart-item { display: flex; gap: 12px; background: #fff; padding: 12px; border-radius: var(--radius); margin-bottom: 10px; }
.cart-item .img { width: 80px; height: 80px; border-radius: 6px; overflow: hidden; background: var(--bg-light); flex-shrink: 0; }
.cart-item .img img { width: 100%; height: 100%; object-fit: cover; }
.cart-item .info { flex: 1; min-width: 0; }
.cart-item .name { font-size: 13px; line-height: 1.4; height: 37px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cart-item .shop { font-size: 11px; margin-top: 4px; }
.cart-item .bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.cart-item .price { color: var(--primary); font-size: 16px; font-weight: 700; }
.cart-item .price::before { content: '¥'; font-size: 12px; }
.num-ctrl { display: inline-flex; align-items: center; border: 1px solid #ddd; border-radius: 6px; overflow: hidden; }
.num-ctrl button { width: 28px; height: 28px; background: #f5f5f5; font-size: 15px; color: var(--text-gray); }
.num-ctrl input { width: 40px; height: 28px; text-align: center; border: none; border-left: 1px solid #ddd; border-right: 1px solid #ddd; font-size: 13px; }
.cart-del { color: var(--text-light); font-size: 12px; }

/* ====== 结算 ====== */
.settle-bar { position: sticky; bottom: 0; background: #fff; padding: 12px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.settle-total { font-size: 14px; }
.settle-total b { color: var(--primary); font-size: 18px; }
.settle-total b::before { content: '¥'; font-size: 13px; }
.settle-btn { background: var(--primary); color: #fff; padding: 10px 28px; border-radius: 22px; font-size: 15px; }
.address-item { background: #fff; padding: 14px 16px; margin: 12px; border-radius: var(--radius); }
.address-item .name { font-weight: 700; font-size: 14px; }
.address-item .detail { font-size: 12px; color: var(--text-gray); margin-top: 4px; line-height: 1.6; }
.goods-list-card { background: #fff; margin: 12px; border-radius: var(--radius); padding: 12px; }
.goods-list-card .g-item { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--bg-light); }
.goods-list-card .g-item:last-child { border-bottom: none; }
.goods-list-card .g-img { width: 60px; height: 60px; border-radius: 6px; overflow: hidden; background: var(--bg-light); flex-shrink: 0; }
.goods-list-card .g-img img { width: 100%; height: 100%; object-fit: cover; }
.goods-list-card .g-info { flex: 1; min-width: 0; }
.goods-list-card .g-name { font-size: 13px; line-height: 1.4; }
.goods-list-card .g-price { font-size: 13px; color: var(--primary); margin-top: 4px; }

/* ====== 订单 ====== */
.order-item { background: #fff; padding: 14px 16px; margin: 12px; border-radius: var(--radius); }
.order-item .head { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-gray); margin-bottom: 10px; }
.order-item .goods { font-size: 13px; margin-bottom: 8px; line-height: 1.6; }
.order-item .total { text-align: right; font-size: 13px; margin-bottom: 10px; }
.order-item .total b { color: var(--primary); font-size: 16px; }
.order-item .total b::before { content: '¥'; font-size: 12px; }
.order-item .actions { display: flex; justify-content: flex-end; gap: 10px; }
.btn-pay { background: var(--primary); color: #fff; padding: 8px 20px; border-radius: 18px; font-size: 13px; }
.status-tag { font-size: 12px; color: var(--orange); }
