/* ===== 公共 H5 / PC 样式库（sqshop商城 H5 端） ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Microsoft YaHei", "PingFang SC", sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: #ff5000; text-decoration: none; }
img { display: block; max-width: 100%; }

/* 顶部导航栏 */
.h5-header {
    background: #ff5000;
    color: #fff;
    height: 48px;
    line-height: 48px;
    text-align: center;
    font-size: 17px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.h5-header .back {
    position: absolute;
    left: 12px;
    top: 0;
    font-size: 15px;
    color: #fff;
    text-decoration: none;
}
.h5-header .right {
    position: absolute;
    right: 12px;
    top: 0;
    font-size: 14px;
    color: #fff;
    text-decoration: none;
}

/* 内容容器 */
.h5-container { max-width: 800px; margin: 0 auto; padding: 12px; }

/* 卡片 */
.h5-card {
    background: #fff;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

/* 列表项 */
.h5-item {
    background: #fff;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.h5-item img {
    width: 84px; height: 84px;
    border-radius: 8px; object-fit: cover;
    background: #eee; flex-shrink: 0;
    margin-top: 0;
}
.h5-item .info { flex: 1; min-width: 0; }
.h5-item .name {
    font-size: 14px; font-weight: 600; line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    margin-top: 0;
}
.h5-item .sub { color: #999; font-size: 12px; margin-top: 4px; }
.h5-item .prod-list { margin-top: 6px; border-top: 1px dashed #eee; padding-top: 6px; }
.h5-item .prod-item { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; line-height: 1.6; gap: 8px; }
.h5-item .prod-name { color: #555; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.h5-item .prod-price { color: #ff5000; font-weight: 600; flex-shrink: 0; font-size: 12px; }
.h5-item .price { color: #ff5000; font-size: 16px; font-weight: bold; margin-top: 6px; }
.h5-item .price small { font-size: 12px; font-weight: normal; }
.h5-item .right { text-align: right; flex-shrink: 0; }

/* 可点击列表项 */
.h5-item-link { display: block; text-decoration: none; color: #333; transition: transform .05s; }
.h5-item-link:active { transform: scale(.995); }
.h5-item-link .h5-item { transition: background .15s; }
.h5-item-link:active .h5-item { background: #fafafa; }
.h5-item-link .arrow {
    font-size: 22px; color: #ccc; flex-shrink: 0; margin-left: 4px;
    transition: color .15s, transform .15s;
    align-self: center;
}
.h5-item-link:active .arrow { color: #ff5000; transform: translateX(2px); }

/* 按钮 */
.h5-btn {
    display: inline-block;
    background: #ff5000; color: #fff;
    border: none; border-radius: 22px;
    padding: 10px 22px; font-size: 15px; cursor: pointer;
    text-align: center; transition: opacity .2s;
}
.h5-btn:active { opacity: .85; }
.h5-btn.block { display: block; width: 100%; }
.h5-btn.ghost { background: #fff; color: #ff5000; border: 1px solid #ff5000; }
.h5-btn.gray { background: #ccc; }
.h5-btn.sm { padding: 6px 14px; font-size: 13px; border-radius: 16px; }

/* 九宫格/网格 */
.h5-grid { display: flex; flex-wrap: wrap; }
.h5-grid .cell {
    width: 25%; text-align: center; padding: 12px 4px; box-sizing: border-box;
}
.h5-grid .cell .ic { font-size: 26px; }
.h5-grid .cell .tx { font-size: 12px; color: #555; margin-top: 4px; }
.h5-grid.two .cell { width: 50%; }
.h5-grid.three .cell { width: 33.333%; }

/* 空状态 */
.h5-empty { text-align: center; padding: 60px 20px; color: #999; }
.h5-empty .icon { font-size: 48px; margin-bottom: 12px; }
.h5-empty a { display: inline-block; margin-top: 12px; }

/* 标签/徽标 */
.h5-tag {
    display: inline-block; background: #fff2ec; color: #ff5000;
    font-size: 12px; padding: 2px 8px; border-radius: 4px; margin-right: 6px;
}
.h5-badge {
    display: inline-block; background: #ff5000; color: #fff;
    font-size: 11px; border-radius: 10px; padding: 1px 7px;
}

/* 表单 */
.h5-form .row {
    display: flex; align-items: center;
    background: #fff; padding: 12px 14px;
    border-bottom: 1px solid #f0f0f0;
}
.h5-form .row label { width: 84px; color: #666; font-size: 14px; flex-shrink: 0; }
.h5-form .row input, .h5-form .row select, .h5-form .row textarea {
    flex: 1; border: none; outline: none; font-size: 14px; background: transparent;
    font-family: inherit;
    height: 34px; line-height: 34px; min-width: 0;
}
.h5-form .row textarea { min-height: 60px; height: auto; line-height: 1.5; resize: vertical; }

/* 分段标签 */
.h5-tabs { display: flex; background: #fff; border-radius: 10px; overflow: hidden; margin-bottom: 12px; }
.h5-tabs a {
    flex: 1; text-align: center; padding: 12px 0; font-size: 14px;
    color: #666; text-decoration: none; border-bottom: 2px solid transparent;
}
.h5-tabs a.active { color: #ff5000; border-bottom-color: #ff5000; font-weight: 600; }

/* 金额大字 */
.h5-amount { font-size: 32px; font-weight: bold; color: #ff5000; }
.h5-amount small { font-size: 16px; }

/* 通用文字 */
.h5-muted { color: #999; font-size: 12px; }
.h5-center { text-align: center; }
.h5-mt { margin-top: 12px; }
.h5-mb { margin-bottom: 12px; }

/* 底部留白：需容纳全局底部导航(56px) + 安全区，避免内容被遮挡 */
.h5-bottom-gap { height: calc(76px + env(safe-area-inset-bottom, 0px)); }
/* 大号留白：用于底部有商品卡片/分页/推荐等内容、容易超出 76px 的页面 */
/* 留白 = 全局底部导航(56px) + 安全区 + 至少一张商品卡的高度(图片170px + 信息 ~80px + 外距 24px + 间距 10px = ~280px)，再加 80px 视觉缓冲 */
.h5-bottom-gap-lg { height: calc(420px + env(safe-area-inset-bottom, 0px)); }

/* 商品网格（两列） */
.h5-goods { display: flex; flex-wrap: wrap; gap: 10px; }
.h5-goods .g {
    width: calc(50% - 5px); background: #fff; border-radius: 10px; overflow: hidden;
}
.h5-goods .g img { width: 100%; height: 170px; object-fit: cover; background: #eee; }
.h5-goods .g .p { padding: 8px 10px; }
.h5-goods .g .n {
    font-size: 14px; line-height: 1.4; height: 39px; overflow: hidden;
}
.h5-goods .g .pr { color: #ff5000; font-weight: bold; font-size: 15px; margin-top: 4px; }

/* 弹层 */
.h5-mask {
    position: fixed; inset: 0; background: rgba(0,0,0,.5);
    display: none; align-items: flex-end; z-index: 200;
}
.h5-mask.show { display: flex; }
.h5-sheet {
    background: #fff; width: 100%; max-width: 800px; margin: 0 auto;
    border-radius: 14px 14px 0 0; padding: 16px; box-sizing: border-box;
}
.h5-sheet h3 { font-size: 16px; margin-bottom: 12px; text-align: center; }

/* 提示条 */
.h5-toast {
    position: fixed; left: 50%; top: 40%; transform: translate(-50%,-50%);
    background: rgba(0,0,0,.8); color: #fff; padding: 12px 20px; border-radius: 8px;
    font-size: 14px; z-index: 999; display: none; max-width: 80%; text-align: center;
}
.h5-toast.show { display: block; }
