﻿* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0; height: 100%; overflow: hidden; background: #000;
  font-family: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: #fff; -webkit-font-smoothing: antialiased;
}
body { position: fixed; inset: 0; }
img { display: block; }
button { font-family: inherit; border: 0; background: none; color: inherit; cursor: pointer; }
input { font-family: inherit; }

/* ---------------- 视频流 ---------------- */
.feed {
  position: absolute; inset: 0;
  overflow-y: auto; overflow-x: hidden;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  background: #000;
}
.feed::-webkit-scrollbar { display: none; }

.video-card {
  position: relative;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: hidden;
  background: #0a0a0a;
}
.video-card video {
  width: 100%; height: 100%; object-fit: cover; display: block;
  background: #0a0a0a;
}
.video-shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(0,0,0,.45) 0%, rgba(0,0,0,0) 22%),
    linear-gradient(to top, rgba(0,0,0,.82) 0%, rgba(0,0,0,.35) 26%, rgba(0,0,0,0) 52%);
}
.video-badge {
  position: absolute; top: 96px; left: 16px;
  padding: 3px 9px; border-radius: 4px; font-size: 11px;
  background: rgba(255,44,85,.9); letter-spacing: .5px;
}

/* ---------------- 右侧操作栏 ---------------- */
.rail {
  position: absolute; right: 10px; bottom: 120px;
  display: flex; flex-direction: column; align-items: center; gap: 18px; z-index: 3;
}
.rail-avatar {
  width: 46px; height: 46px; border-radius: 50%; border: 2px solid #fff;
  background: linear-gradient(135deg,#3b82f6,#8b5cf6);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; overflow: hidden;
}
.rail-avatar img { width: 100%; height: 100%; object-fit: cover; }
.rail-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-width: 44px; padding: 2px;
}
.rail-btn .ico { font-size: 25px; line-height: 1; filter: drop-shadow(0 1px 3px rgba(0,0,0,.5)); }
.rail-btn em { font-size: 11px; font-style: normal; color: #fff; opacity: .95; }
.rail-btn.on .ico { color: #ff2c55; }
.rail-btn:active { transform: scale(.92); }

/* ---------------- 底部信息 ---------------- */
.info {
  position: absolute; left: 14px; right: 78px; bottom: 86px; z-index: 3;
}
.shop-line { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; }
.shop-name { font-size: 14px; font-weight: 600; letter-spacing: .2px; }
.shop-score { font-size: 10px; padding: 1px 5px; border-radius: 3px; background: rgba(255,255,255,.18); }
.video-title {
  font-size: 13.5px; line-height: 1.55; margin-bottom: 11px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  text-shadow: 0 1px 4px rgba(0,0,0,.5);
}
.prod-card {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 12px 7px 7px; border-radius: 12px;
  background: rgba(22,22,24,.72); backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.12); max-width: 100%;
}
.prod-card img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex: none; background: #222; }
.prod-card .p-meta { min-width: 0; }
.prod-card .p-name {
  font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 168px;
}
.prod-card .p-price { font-size: 15px; font-weight: 800; color: #ff5c7a; margin-top: 2px; }
.prod-card .p-price small { font-size: 10px; font-weight: 600; margin-right: 1px; }
.prod-card .p-go {
  margin-left: 4px; flex: none; padding: 5px 11px; border-radius: 16px;
  background: #ff2c55; font-size: 12px; font-weight: 700;
}
.prod-more { font-size: 12px; opacity: .85; margin-top: 6px; display: block; }

/* ---------------- 顶部 / 底部导航 ---------------- */
.topbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 6;
  padding: calc(env(safe-area-inset-top) + 8px) 14px 22px;
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(to bottom, rgba(0,0,0,.55), rgba(0,0,0,0));
  pointer-events: none;
}
.tabs { display: flex; gap: 20px; pointer-events: auto; }
.tab {
  font-size: 15.5px; color: rgba(255,255,255,.62); padding: 4px 0; position: relative; font-weight: 500;
}
.tab.active { color: #fff; font-weight: 700; font-size: 16.5px; }
.tab.active::after {
  content: ""; position: absolute; left: 50%; bottom: -3px; width: 16px; height: 3px;
  border-radius: 2px; background: #ff2c55; transform: translateX(-50%);
}
.admin-entry { font-size: 11px; color: rgba(255,255,255,.7); pointer-events: auto; text-decoration: none; padding: 4px 8px; border: 1px solid rgba(255,255,255,.25); border-radius: 20px; }

.bottombar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 6;
  display: flex; align-items: center; justify-content: space-around;
  padding: 8px 0 calc(env(safe-area-inset-bottom) + 8px);
  background: linear-gradient(to top, rgba(0,0,0,.92), rgba(0,0,0,.55) 60%, rgba(0,0,0,0));
}
.nav-item { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 60px; position: relative; opacity: .6; }
.nav-item .ico { font-size: 18px; line-height: 1; }
.nav-item em { font-size: 10px; font-style: normal; }
.nav-item.active { opacity: 1; }
.nav-item.active .ico { color: #ff2c55; }
.badge {
  position: absolute; top: -3px; right: 8px; min-width: 15px; height: 15px; line-height: 15px;
  background: #ff2c55; border-radius: 8px; font-size: 9px; text-align: center; font-style: normal;
  padding: 0 3px; display: none;
}
.badge.show { display: block; }

/* ---------------- 弹层 ---------------- */
.sheet-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 20;
  opacity: 0; pointer-events: none; transition: opacity .22s;
}
.sheet-mask.show { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21;
  background: #fff; color: #16181d;
  border-radius: 18px 18px 0 0;
  transform: translateY(102%); transition: transform .28s cubic-bezier(.22,.61,.36,1);
  max-height: 82vh; display: flex; flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
}
.sheet.show { transform: translateY(0); }
.sheet-head { padding: 16px 16px 12px; border-bottom: 1px solid #eef0f4; }
.goods-line { display: flex; align-items: center; gap: 12px; }
.goods-img { width: 76px; height: 76px; border-radius: 10px; object-fit: cover; background: #f2f4f8; }
.goods-meta { flex: 1; }
.goods-price { font-size: 26px; font-weight: 800; color: #ff2c55; line-height: 1.1; }
.goods-price small { font-size: 14px; font-weight: 700; }
.goods-stock { font-size: 11.5px; color: #8b93a1; margin-top: 4px; }
.sheet-close { font-size: 24px; color: #b9c0cc; line-height: 1; align-self: flex-start; padding: 0 2px; }
.goods-name { font-size: 14.5px; font-weight: 600; margin-top: 10px; line-height: 1.5; }
.sheet-body { padding: 14px 16px; overflow-y: auto; }
.sheet-title { padding: 16px; font-size: 15px; font-weight: 700; border-bottom: 1px solid #eef0f4; text-align: center; }
.sheet-foot { display: flex; gap: 10px; padding: 10px 16px 14px; border-top: 1px solid #eef0f4; }

.spec-block { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.spec-chip {
  padding: 7px 15px; border-radius: 20px; background: #f4f6fa; font-size: 13px; color: #3d4552;
  border: 1px solid transparent;
}
.spec-chip.on { background: #fff0f3; border-color: #ff2c55; color: #ff2c55; font-weight: 600; }
.spec-label { width: 100%; font-size: 12px; color: #8b93a1; margin-bottom: 2px; }

.qty-row { display: flex; align-items: center; justify-content: space-between; font-size: 13.5px; color: #4a5361; }
.stepper { display: flex; align-items: center; border: 1px solid #e4e8ef; border-radius: 8px; overflow: hidden; }
.stepper button { width: 34px; height: 32px; font-size: 17px; color: #4a5361; background: #f7f9fc; }
.stepper input { width: 46px; height: 32px; text-align: center; border: 0; font-size: 14px; outline: none; }

.btn {
  flex: 1; height: 44px; border-radius: 22px; font-size: 14.5px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.btn.primary { background: #ff2c55; color: #fff; }
.btn.primary:active { background: #e02148; }
.btn.ghost { background: #f2f4f8; color: #3d4552; }
.btn.small { flex: none; height: 32px; padding: 0 16px; font-size: 12.5px; background: #ff2c55; color: #fff; border-radius: 16px; }
.btn.full { width: 100%; margin-top: 16px; }

/* 评论 */
.comment-sheet { height: 70vh; }
.comment-list { flex: 1; overflow-y: auto; padding: 6px 16px; }
.comment-item { display: flex; gap: 10px; padding: 11px 0; border-bottom: 1px solid #f2f4f8; }
.c-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg,#3b82f6,#8b5cf6); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
}
.c-body .c-name { font-size: 12px; color: #8b93a1; margin-bottom: 2px; }
.c-body .c-text { font-size: 14px; color: #23262d; line-height: 1.5; }
.comment-input { display: flex; gap: 8px; padding: 10px 14px 14px; border-top: 1px solid #eef0f4; }
.comment-input input { flex: 1; height: 40px; border-radius: 20px; border: 0; background: #f4f6fa; padding: 0 16px; font-size: 14px; outline: none; }
.comment-input button { padding: 0 18px; border-radius: 20px; background: #ff2c55; color: #fff; font-size: 13.5px; font-weight: 600; }

/* 表单 */
.field { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f2f4f8; }
.field span { width: 68px; font-size: 13px; color: #8b93a1; flex: none; }
.field input { flex: 1; border: 0; outline: none; font-size: 14px; color: #23262d; background: none; }
.pay-line { display: flex; justify-content: space-between; align-items: center; padding-top: 16px; font-size: 13.5px; }
.pay-line b { font-size: 21px; color: #ff2c55; font-weight: 800; }

/* 页面 */
.page {
  position: fixed; inset: 0; z-index: 15; background: #f6f7f9;
  transform: translateY(100%); transition: transform .26s ease;
  display: flex; flex-direction: column;
}
.page.show { transform: translateY(0); }
.page-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 8px) 14px 10px;
  background: #fff; border-bottom: 1px solid #eceef3;
}
.page-head h1 { font-size: 16px; margin: 0; color: #16181d; font-weight: 600; }
.back { font-size: 26px; line-height: 1; color: #16181d; width: 32px; text-align: left; }
.page-head span { width: 32px; }
.page-body { flex: 1; overflow-y: auto; padding: 12px; }
.page-foot {
  display: flex; align-items: center; gap: 14px; padding: 10px 16px calc(env(safe-area-inset-bottom) + 10px);
  background: #fff; border-top: 1px solid #eceef3;
}
.sum { flex: 1; font-size: 13px; color: #6b7280; }
.sum b { font-size: 19px; color: #ff2c55; font-weight: 800; }
.page-foot .btn { flex: none; width: 118px; }

/* 购物车项 */
.cart-item {
  display: flex; gap: 11px; background: #fff; border-radius: 12px; padding: 11px; margin-bottom: 10px;
}
.cart-item img { width: 74px; height: 74px; border-radius: 8px; object-fit: cover; background: #f2f4f8; }
.ci-body { flex: 1; min-width: 0; }
.ci-name { font-size: 13.5px; color: #16181d; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ci-shop { font-size: 11px; color: #9aa1ae; margin-top: 3px; }
.ci-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.ci-price { font-size: 16px; font-weight: 800; color: #ff2c55; }
.ci-price small { font-size: 10px; }
.ci-ops { display: flex; align-items: center; gap: 10px; }
.ci-ops .stepper button { width: 26px; height: 26px; font-size: 14px; }
.ci-ops .stepper input { width: 34px; height: 26px; font-size: 13px; }
.ci-del { font-size: 12px; color: #9aa1ae; }

/* 订单 */
.order-card { background: #fff; border-radius: 12px; padding: 13px; margin-bottom: 11px; }
.order-top { display: flex; justify-content: space-between; align-items: center; padding-bottom: 9px; border-bottom: 1px solid #f2f4f8; }
.order-no { font-size: 11.5px; color: #9aa1ae; }
.order-status { font-size: 12.5px; font-weight: 700; color: #ff2c55; }
.order-item { display: flex; gap: 10px; padding: 10px 0; }
.order-item img { width: 56px; height: 56px; border-radius: 7px; object-fit: cover; background: #f2f4f8; }
.oi-name { font-size: 13px; color: #23262d; line-height: 1.4; }
.oi-spec { font-size: 11px; color: #9aa1ae; margin-top: 2px; }
.oi-price { font-size: 12.5px; color: #6b7280; margin-top: 4px; }
.order-foot { display: flex; justify-content: space-between; align-items: center; padding-top: 9px; border-top: 1px solid #f2f4f8; }
.order-amount { font-size: 13px; color: #4a5361; }
.order-amount b { font-size: 17px; color: #ff2c55; font-weight: 800; }
.order-actions { display: flex; gap: 8px; }
.mini-btn { padding: 6px 14px; border-radius: 15px; font-size: 12.5px; border: 1px solid #e4e8ef; color: #4a5361; background: #fff; }
.mini-btn.primary { background: #ff2c55; border-color: #ff2c55; color: #fff; font-weight: 600; }

/* 我的 */
.me-card { display: flex; align-items: center; gap: 13px; background: #fff; border-radius: 14px; padding: 17px; }
.me-avatar {
  width: 52px; height: 52px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg,#3b82f6,#8b5cf6); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 19px; font-weight: 700;
}
.me-info { flex: 1; }
.me-name { font-size: 16px; font-weight: 700; color: #16181d; }
.me-sub { font-size: 12px; color: #9aa1ae; margin-top: 3px; }
.me-grid { display: flex; gap: 10px; margin-top: 12px; }
.me-cell { flex: 1; background: #fff; border-radius: 12px; padding: 15px 13px; text-decoration: none; color: inherit; }
.me-cell b { display: block; font-size: 14px; color: #16181d; }
.me-cell span { font-size: 11px; color: #9aa1ae; }
.me-tip { background: #fff; border-radius: 12px; padding: 14px 16px; margin-top: 12px; font-size: 12px; color: #8b93a1; line-height: 1.9; }
.me-tip p { margin: 0; }
.me-tip p:first-child { color: #16181d; font-weight: 600; margin-bottom: 3px; }

/* 登录 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 40;
  display: flex; align-items: center; justify-content: center; padding: 28px;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.modal-mask.show { opacity: 1; pointer-events: auto; }
.modal { width: 100%; max-width: 340px; background: #fff; border-radius: 16px; padding: 22px 20px; color: #16181d; }
.modal h2 { margin: 0 0 6px; font-size: 18px; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-actions .btn { height: 42px; }

/* toast */
.toast {
  position: fixed; left: 50%; top: 46%; transform: translate(-50%,-50%) scale(.9);
  background: rgba(0,0,0,.82); color: #fff; font-size: 13.5px; padding: 11px 20px;
  border-radius: 10px; z-index: 60; opacity: 0; pointer-events: none; transition: all .2s;
  max-width: 78vw; text-align: center; line-height: 1.5;
}
.toast.show { opacity: 1; transform: translate(-50%,-50%) scale(1); }

.empty { text-align: center; padding: 50px 20px; color: #9aa1ae; font-size: 13px; }
.loading { text-align: center; padding: 40px 0; color: rgba(255,255,255,.55); font-size: 13px; }