/* ============================================================
   H5 商城样式（移动端优先，零依赖，全部走主题变量）
   主题变量由 layout.php 内联注入（--brand / --brand-soft / --bg ...）
   ============================================================ */

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: #1f1d1b;
    font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    font-weight: 450;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    padding-bottom: calc(60px + env(safe-area-inset-bottom));
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; border: 0; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

/* ---------- 页面骨架 ---------- */
.page { max-width: 640px; margin: 0 auto; background: var(--bg); min-height: 100vh; position: relative; }

.appbar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 10px;
    height: 48px; padding: 0 14px;
    background: #fff; border-bottom: 1px solid #eef0f3;
    max-width: 640px; margin: 0 auto;
}
.appbar .back {
    width: 30px; height: 30px; display: grid; place-items: center;
    border-radius: 50%; background: #f4f5f7; font-size: 16px; color: #333; flex: none;
}
.appbar h1 { font-size: 16px; font-weight: 600; flex: 1; text-align: center; margin-right: 30px; }
.appbar .right { font-size: 13px; color: var(--brand); flex: none; margin-left: -30px; }

.section { margin: 10px 12px; background: #fff; border-radius: 14px; padding: 14px; box-shadow: 0 2px 10px rgba(16, 24, 40, .04); }
.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-title h2 { font-size: 15px; font-weight: 600; letter-spacing: .3px; }
.section-title .more { font-size: 12px; color: #9aa0a6; }

.muted { color: #9299a2; }
.small { font-size: 12px; }
.gap-8 { height: 8px; }
.flex { display: flex; align-items: center; gap: 8px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.text-brand { color: var(--brand); }

/* ---------- 商品卡片 ---------- */
.goods-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.goods-card {
    background: #fff; border-radius: 14px; overflow: hidden;
    box-shadow: 0 2px 10px rgba(16, 24, 40, .05); position: relative;
    display: flex; flex-direction: column;
}
.goods-card .thumb { width: 100%; aspect-ratio: 1 / 1; background: #f2f3f5; object-fit: cover; }
.goods-card .body { padding: 9px 10px 11px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.goods-card .name { font-size: 13.5px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.goods-card .price { color: var(--brand); font-size: 16px; font-weight: 700; letter-spacing: -.2px; }
.goods-card .price small { font-size: 11px; font-weight: 500; margin-right: 1px; }
.goods-card .meta { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: #98a0a8; }
.goods-card.is-dim { opacity: .62; }
.goods-card .ribbon {
    position: absolute; left: 0; top: 0; padding: 3px 9px 3px 8px;
    background: rgba(31, 29, 27, .72); color: #fff; font-size: 11px;
    border-bottom-right-radius: 10px; backdrop-filter: blur(2px);
}
.goods-card .ribbon.live { background: linear-gradient(135deg, var(--brand), var(--brand-dark)); }

/* 横向商品行（订单、店铺、结算页共用） */
.row-item { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid #f2f3f5; }
.row-item:last-child { border-bottom: 0; padding-bottom: 0; }
.row-item:first-child { padding-top: 0; }
.row-item .thumb { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; background: #f2f3f5; flex: none; }
.row-item .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.row-item .title { font-size: 13.5px; font-weight: 600; line-height: 1.4; }
.row-item .sub { font-size: 12px; color: #98a0a8; }
.row-item .right { text-align: right; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }

/* ---------- 价格 ---------- */
.money { color: var(--brand); font-weight: 700; }
.money::before { content: "¥"; font-size: .78em; margin-right: 1px; font-weight: 600; }
.money-line { display: flex; align-items: baseline; gap: 6px; }
.was { color: #b3b8be; text-decoration: line-through; font-size: 12px; }

/* ---------- 标签 / 徽标 ---------- */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 20px; font-size: 11px; background: #f2f4f7; color: #6b7280; }
.chip.brand { background: var(--brand-soft); color: var(--brand); }
.chip.ok { background: #eaf7ee; color: #2f8f5b; }
.chip.warn { background: #fff4e5; color: #b26a00; }
.chip.bad { background: #fdecea; color: #c0392b; }
.chip.muted { background: #f2f4f7; color: #9299a2; }

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 42px; padding: 0 20px; border-radius: 12px; border: 1px solid transparent;
    font-size: 14px; font-weight: 600; cursor: pointer; background: #f4f5f7; color: #333;
    transition: opacity .15s, transform .08s;
}
.btn:active { transform: scale(.985); }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: #fff; box-shadow: 0 6px 18px rgba(var(--brand-rgb), .25); }
.btn-ghost { background: #fff; border-color: #e3e6ea; color: #444; }
.btn-line { background: var(--brand-soft); color: var(--brand); }
.btn-block { display: flex; width: 100%; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 12.5px; border-radius: 9px; }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }

/* ---------- 表单 ---------- */
.form-item { display: flex; align-items: center; gap: 12px; min-height: 50px; border-bottom: 1px solid #f2f3f5; }
.form-item:last-child { border-bottom: 0; }
.form-item label { width: 92px; flex: none; color: #4b5259; font-size: 13.5px; }
.form-item input, .form-item select, .form-item textarea {
    flex: 1; border: 0; outline: none; background: transparent; font-size: 14px; min-width: 0; padding: 8px 0;
}
.form-item textarea { resize: vertical; min-height: 64px; }
.form-item .unit { color: #98a0a8; font-size: 13px; }
.form-block { padding: 12px 0; border-bottom: 1px solid #f2f3f5; }
.form-block > label { display: block; font-size: 13px; color: #4b5259; margin-bottom: 6px; }

/* ---------- 提示 ---------- */
.alert { margin: 10px 12px; padding: 10px 12px; border-radius: 10px; font-size: 13px; }
.alert-error { background: #fdecea; color: #a02a20; }
.alert-success { background: #eaf7ee; color: #256c47; }
.alert-info { background: #eef3fb; color: #24466f; }
.alert-warn { background: #fff7e6; color: #8a5a00; }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 48px 20px; color: #a6adb5; }
.empty .icon { font-size: 34px; opacity: .5; display: block; margin-bottom: 8px; }
.empty p { font-size: 13px; }

/* ---------- 底部标签栏 ---------- */
.tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    display: flex; background: rgba(255, 255, 255, .96);
    border-top: 1px solid #eef0f3; backdrop-filter: blur(12px);
    padding-bottom: env(safe-area-inset-bottom);
    max-width: 640px; margin: 0 auto;
}
.tabbar a {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; height: 56px; font-size: 10.5px; color: #9aa0a6;
}
.tabbar a.is-active { color: var(--brand); font-weight: 600; }
.tabbar svg { width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 1.7; }

/* ---------- 首页 ---------- */
.hero {
    padding: 18px 16px 26px;
    background: linear-gradient(150deg, var(--hero-1), var(--hero-2) 55%, var(--hero-3));
    color: #fff; border-bottom-left-radius: 20px; border-bottom-right-radius: 20px;
}
.hero .brand-line { display: flex; align-items: center; justify-content: space-between; }
.hero h1 { font-size: 19px; font-weight: 700; letter-spacing: 1px; }
.hero .slogan { font-size: 12px; opacity: .82; margin-top: 2px; }
.hero .stat-row { display: flex; gap: 18px; margin-top: 14px; }
.hero .stat-row div { font-size: 11px; opacity: .8; }
.hero .stat-row strong { display: block; font-size: 17px; font-weight: 700; opacity: 1; letter-spacing: .5px; }

.banner-scroll { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 12px 12px 4px; }
.banner-scroll::-webkit-scrollbar { display: none; }
.banner-scroll a { flex: 0 0 86%; scroll-snap-align: center; border-radius: 14px; overflow: hidden; }
.banner-scroll img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #f2f3f5; }

.nav-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 6px 4px 2px; text-align: center; }
.nav-grid a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px 0; font-size: 11.5px; color: #4b5259; }
.nav-grid .dot {
    width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center;
    background: var(--brand-soft); color: var(--brand); font-size: 14px; font-weight: 700;
}
.nav-grid img.dot { object-fit: cover; }

.cat-row { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 4px; }
.cat-row::-webkit-scrollbar { display: none; }
.cat-row a { flex: none; padding: 6px 14px; border-radius: 20px; background: #f4f5f7; font-size: 12.5px; color: #4b5259; }
.cat-row a.is-active { background: var(--brand); color: #fff; font-weight: 600; }

/* ---------- 场次 ---------- */
.area-block { margin-bottom: 14px; }
.area-head { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 10px; }
.area-head .title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; }
.area-head .time { font-size: 12px; color: #9299a2; }
.area-head .state { font-size: 11px; padding: 2px 9px; border-radius: 20px; }
.state-open { background: var(--brand-soft); color: var(--brand); }
.state-upcoming { background: #fff4e5; color: #b26a00; }
.state-ended { background: #f2f4f7; color: #9299a2; }

/* ---------- 详情页 ---------- */
.detail-gallery { width: 100%; aspect-ratio: 1 / 1; background: #f2f3f5; object-fit: cover; }
.detail-price { padding: 14px; background: #fff; }
.detail-price .big { font-size: 26px; font-weight: 700; color: var(--brand); letter-spacing: -.5px; }
.detail-price .big small { font-size: 14px; font-weight: 600; }
.detail-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; padding: 12px 14px; font-size: 12.5px; color: #5b6269; }
.detail-meta span { color: #98a0a8; margin-right: 4px; }
.detail-body { padding: 14px; }
.detail-body img { width: 100%; height: auto; border-radius: 8px; margin-bottom: 8px; }

.buy-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    display: flex; align-items: center; gap: 10px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    background: #fff; border-top: 1px solid #eef0f3; max-width: 640px; margin: 0 auto;
}
.buy-bar .sum { flex: 1; font-size: 12px; color: #6b7280; }
.buy-bar .sum strong { display: block; font-size: 18px; color: var(--brand); }
.buy-bar .btn { flex: none; min-width: 130px; }

/* ---------- 订单 ---------- */
.tabs { display: flex; gap: 4px; padding: 10px 12px 0; overflow-x: auto; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: none; padding: 7px 14px; border-radius: 20px; font-size: 13px; color: #5b6269; background: #fff; }
.tabs a.is-active { background: var(--brand); color: #fff; font-weight: 600; }

.order-card { background: #fff; border-radius: 14px; margin: 10px 12px; padding: 12px 14px; box-shadow: 0 2px 10px rgba(16, 24, 40, .04); }
.order-card .head { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: #98a0a8; margin-bottom: 10px; }
.order-card .foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed #eef0f3; }
.order-card .amount { font-size: 12px; color: #6b7280; margin-right: auto; }
.order-card .amount strong { font-size: 15px; color: var(--brand); }

/* ---------- 个人中心 ---------- */
.profile {
    padding: 20px 16px 62px;
    background: linear-gradient(150deg, var(--hero-1), var(--hero-2) 60%, var(--hero-3));
    color: #fff; border-bottom-left-radius: 22px; border-bottom-right-radius: 22px; position: relative;
}
.profile .who { display: flex; align-items: center; gap: 12px; }
.profile .avatar { width: 54px; height: 54px; border-radius: 50%; background: rgba(255, 255, 255, .22); display: grid; place-items: center; font-size: 20px; font-weight: 700; overflow: hidden; }
.profile .avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile .name { font-size: 17px; font-weight: 700; }
.profile .sub { font-size: 12px; opacity: .82; margin-top: 2px; }
.wallet-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: -46px 12px 0; position: relative; z-index: 2; }
.wallet-cards .card { background: #fff; border-radius: 14px; padding: 12px 10px; text-align: center; box-shadow: 0 6px 18px rgba(16, 24, 40, .08); }
.wallet-cards .card b { display: block; font-size: 17px; font-weight: 700; color: #1f1d1b; letter-spacing: -.3px; }
.wallet-cards .card span { font-size: 11.5px; color: #9299a2; }
.menu-list { background: #fff; border-radius: 14px; margin: 10px 12px; overflow: hidden; }
.menu-list a { display: flex; align-items: center; gap: 10px; padding: 14px; border-bottom: 1px solid #f4f5f7; font-size: 14px; }
.menu-list a:last-child { border-bottom: 0; }
.menu-list .ico { width: 28px; height: 28px; border-radius: 9px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-size: 13px; flex: none; }
.menu-list .arrow { margin-left: auto; color: #c8ccd1; font-size: 14px; }

/* ---------- 表格（详情、佣金等） ---------- */
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 8px 10px; font-size: 13px; }
.kv dt { color: #9299a2; }
.kv dd { margin: 0; color: #2b2825; word-break: break-all; }

.list-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 0; border-bottom: 1px solid #f4f5f7; font-size: 13px; }
.list-line:last-child { border-bottom: 0; }
.list-line .l { min-width: 0; }
.list-line .l b { font-weight: 600; }
.list-line .l span { display: block; color: #98a0a8; font-size: 11.5px; margin-top: 2px; }
.list-line .r { flex: none; text-align: right; font-weight: 600; }

.plus { color: #2f8f5b; }
.minus { color: #c0392b; }

/* ---------- 登录 / 注册 ---------- */
.auth-wrap { padding: 46px 22px; }
.auth-wrap h1 { font-size: 24px; font-weight: 700; letter-spacing: 1px; }
.auth-wrap .sub { color: #9299a2; font-size: 13px; margin: 6px 0 24px; }
.auth-field { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 12px; padding: 0 14px; height: 50px; margin-bottom: 12px; border: 1px solid #eef0f3; }
.auth-field input { flex: 1; border: 0; outline: none; background: transparent; font-size: 14.5px; }
.auth-field .prefix { color: #98a0a8; font-size: 13px; }
.auth-tip { font-size: 12px; color: #98a0a8; margin-top: 14px; line-height: 1.7; }

/* ---------- 转拍页 ---------- */
.quote-box { background: linear-gradient(150deg, var(--brand-soft), #fff); border: 1px solid rgba(var(--brand-rgb), .18); border-radius: 14px; padding: 14px; }
.quote-box .big { font-size: 26px; font-weight: 700; color: var(--brand); letter-spacing: -.5px; }
.quote-row { display: flex; justify-content: space-between; font-size: 12.5px; padding: 5px 0; color: #5b6269; }
.quote-row strong { color: #1f1d1b; }
.capbar { height: 8px; border-radius: 20px; background: #eef0f3; overflow: hidden; margin: 8px 0 4px; }
.capbar i { display: block; height: 100%; border-radius: 20px; background: var(--brand); }
.capbar i.green { background: #2f9f5b; }
.capbar i.yellow { background: #e0a100; }
.capbar i.orange { background: #e06a00; }
.capbar i.red { background: #c0392b; }

/* ---------- 分页 ---------- */
.pager { display: flex; justify-content: center; gap: 8px; padding: 16px 12px 8px; }
.pager a, .pager span { padding: 6px 13px; border-radius: 9px; background: #fff; font-size: 13px; color: #5b6269; border: 1px solid #eef0f3; }
.pager .is-cur { background: var(--brand); color: #fff; border-color: transparent; }
.pager .is-disabled { opacity: .45; }

/* ---------- 工具 ---------- */
.hr { height: 1px; background: #f2f3f5; margin: 12px 0; }
.center { text-align: center; }
.nowrap { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
