/* 原物婚礼道具租赁 H5 完整样式 - 手机优先 */
/* ===== 丙·青简（2026-10-03 落地）：冷白 #f5f6f7 · 深墨顶栏 #1a1f24 · 墨青强调 #2f6f68 ===== */
:root {
  --primary: #1a1f24;
  --primary-light: #2a3038;
  --accent: #2f6f68;
  --success: #3e7c4f;
  --warn: #b26a1f;
  --bg: #f5f6f7;
  --text: #1a1f24;
  --gray: #8a919a;
  --line: #e3e6ea;
  --white: #fff;
  --shadow: none;
  --radius: 6px;
  --nav-h: 48px;
  --tab-h: 56px;
}

* { margin:0; padding:0; box-sizing:border-box; }
body {
  font-family: -apple-system,BlinkMacSystemFont,'PingFang SC','HarmonyOS Sans SC','Noto Sans SC','Microsoft YaHei',sans-serif;
  font-size: 14px; color: var(--text); background: var(--bg);
  max-width: 480px; margin: 0 auto; min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea, select { font: inherit; outline: none; }
a { color: var(--accent); text-decoration: none; }

/* 顶部导航 */
#navBar {
  position: sticky; top: 0; z-index: 100;
  background: var(--primary); color: #fff;
  height: var(--nav-h); display: flex; align-items: center;
  padding: 0 16px;
}
.nav-title { position:absolute; left:50%; transform:translateX(-50%); font-size:17px; font-weight:600; white-space:nowrap; }
.nav-left { font-size: 15px; cursor: pointer; z-index:1; }
.nav-right { z-index:1; }
.link-red { color: var(--accent); font-weight: 600; cursor: pointer; }

/* 主区域 */
main { padding-bottom: calc(var(--tab-h) + 20px); min-height: calc(100vh - var(--nav-h) - var(--tab-h)); }
.page { display: none; }
.page.active { display: block; }

/* TabBar */
#tabBar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  background: var(--white); display: flex;
  height: var(--tab-h); border-top: 1px solid var(--line); z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}
.tab-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; cursor: pointer;
  color: var(--gray); font-size: 10px;
}
.tab-item.active { color: var(--accent); }
.tab-icon { font-size: 22px; line-height: 1; }
.tab-label { margin-top: 3px; letter-spacing: .5px; }

/* 通用组件 */
.card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 10px 12px; padding: 16px;
}
.btn-primary {
  background: var(--accent);
  color: #fff; border: none; border-radius: var(--radius); padding: 10px 24px;
  font-size: 14px; font-weight: 600; cursor: pointer;
}
.btn-primary:active { opacity: 0.8; }
.btn-outline {
  background: #fff; color: var(--accent); border: 1px solid var(--accent);
  border-radius: var(--radius); padding: 8px 20px; font-size: 13px; cursor: pointer;
}
.btn-sm { padding: 6px 16px; font-size: 12px; }
.btn-block { display: block; width: calc(100% - 24px); margin: 16px 12px; }
.price { color: var(--accent); font-weight: 700; }
.price-lg { font-size: 22px; }
.flex-1 { flex: 1; }
.flex-center { display: flex; align-items: center; }
.text-gray { color: var(--gray); }

/* 搜索栏 */
.search-bar { padding: 10px 12px; background: var(--primary); position: sticky; top: var(--nav-h); z-index: 99; }
.search-box {
  background: rgba(255,255,255,0.94); border-radius: var(--radius);
  padding: 10px 16px; font-size: 13px; color: var(--gray);
}
.search-header {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; background: #eceff0;
}
.search-input-wrap {
  flex: 1; display: flex; align-items: center; gap: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 14px;
}
.search-input-wrap input { border: none; flex: 1; font-size: 14px; }

/* Banner */
.swiper-banner {
  height: 160px; overflow: hidden; position: relative;
  background: #e8e8e8;
}
.banner-item { display: none; width: 100%; height: 160px; text-align: center; }
.banner-item.active { display: block; }
.banner-item span {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.5); color: #fff; padding: 4px 16px; border-radius: 12px;
  font-size: 12px;
}

/* 通知徽章 */
.badge-dot {
  display: inline-block; min-width: 18px; height: 18px; line-height: 18px;
  background: var(--warn); color: #fff; border-radius: 9px; font-size: 11px;
  text-align: center; padding: 0 5px; float: right; margin-right: 4px;
}

/* 分类导航（丙·青简：emoji 全部换成「首字 + 1px 细线框」） */
.cate-row {
  display: flex; overflow-x: auto; gap: 16px; padding: 16px 12px;
  background: #fff; margin: 0 12px; border: 1px solid var(--line); border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  margin-top: -12px; position: relative; z-index: 1;
  justify-content: flex-start;
}
.cate-chip {
  flex-shrink: 0; text-align: center; width: 56px;
  font-size: 11px; color: var(--gray); cursor: pointer;
}
.cate-chip .icon {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; margin: 0 auto 6px;
  border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 15px; font-weight: 500; color: var(--text);
  background: var(--bg); overflow: hidden;
}

/* 模式切换 */
.mode-tabs {
  display: flex; margin: 10px 12px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 4px;
}
.mode-tab {
  flex: 1; text-align: center; padding: 10px;
  font-size: 14px; border-radius: calc(var(--radius) - 2px); cursor: pointer;
  color: var(--gray); transition: all .2s;
}
.mode-tab.active { background: var(--accent); color: #fff; font-weight: 600; }

/* 商品卡片 */
.product-feed { padding: 0 12px; }
.product-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px;
  display: flex; padding: 12px; cursor: pointer;
}
.product-card .thumb {
  width: 120px; height: 120px; border-radius: calc(var(--radius) - 2px);
  object-fit: cover; flex-shrink: 0; margin-right: 12px;
  background: #eef0f0;
}
.product-card .info { flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
.product-card .name { font-size: 16px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card .merchant { font-size: 11px; color: var(--gray); }
.product-card .tags { display: flex; gap: 4px; margin: 4px 0; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 10px; }
.tag-red { border: 1px solid var(--accent); color: var(--accent); background: transparent; }
.tag-orange { border: 1px solid var(--warn); color: var(--warn); background: transparent; }
.tag-blue { border: 1px solid #5b8db8; color: #5b8db8; background: transparent; }
.hot-tags { padding: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.hot-tags .tag { font-size: 12px; padding: 6px 14px; background: #fff; border: 1px solid var(--line); color: var(--text); cursor: pointer; }

/* 分类页 */
.cate-layout { display: flex; height: calc(100vh - var(--nav-h) - var(--tab-h) - 20px); }
.cate-left {
  width: 90px; background: #eceff0; border-right: 1px solid var(--line); overflow-y: auto;
}
.cate-left .item {
  padding: 14px 6px; text-align: center; font-size: 13px; cursor: pointer; color: var(--gray);
}
.cate-left .item.active { background: #fff; color: var(--accent); font-weight: 600; border-left: 3px solid var(--accent); }
.cate-right { flex: 1; overflow-y: auto; padding: 8px; }
.sub-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.sub-chip { padding: 6px 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); font-size: 12px; cursor: pointer; color: var(--gray); }
.sub-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.cate-right .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cate-right .grid .card { margin: 0; padding: 8px; }
.cate-right .grid img { width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; border-radius: calc(var(--radius) - 2px); background: #eef0f0; }

/* 购物车 */
.cart-group { margin: 10px 12px; }
.cart-group .merchant-name { font-size: 13px; font-weight: 600; padding: 8px 0; }
.cart-item { display: flex; align-items: center; gap: 8px; padding: 10px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 6px; }
.cart-item input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
.cart-item .thumb { width: 80px; height: 80px; border-radius: calc(var(--radius) - 2px); object-fit: cover; background: #eef0f0; }
.cart-item .qty { display: flex; align-items: center; gap: 4px; }
.cart-item .qty button { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 16px; line-height: 1; cursor: pointer; }
.cart-item .qty span { width: 32px; text-align: center; }

/* 底部栏 */
.bottom-bar {
  position: fixed; bottom: var(--tab-h); left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  background: #fff; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; border-top: 1px solid var(--line); z-index: 50;
  gap: 8px;
}

/* 列表 */
.empty-page { text-align: center; padding: 80px 20px; color: var(--gray); }
.empty-icon { font-size: 64px; margin-bottom: 16px; }

/* 我的 */
.user-card {
  background: var(--primary);
  padding: 24px 16px; color: #fff; display: flex; align-items: center; gap: 12px;
}
.avatar { width: 60px; height: 60px; border-radius: 50%; background: rgba(255,255,255,0.14);
  display: flex; align-items: center; justify-content: center; font-size: 32px; }
.user-name { font-size: 18px; font-weight: 700; }
.user-role { font-size: 12px; opacity: 0.8; margin-top: 4px; }

/* 余额卡片 */
.balance-card {
  background: var(--white); margin: 10px 12px; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px;
}
.balance-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--line);
}
.balance-row:last-child { border-bottom: none; }

/* 会员徽章 */
.membership-badge {
  display: inline-block; padding: 4px 12px; border-radius: 4px;
  font-size: 12px; font-weight: 600;
}
.membership-badge.normal { background: #eceff0; color: var(--gray); }
.membership-badge.silver { background: #E8F4FD; color: #6B7B8D; }
.membership-badge.gold { background: #FFF7E6; color: #D48806; }
.membership-badge.diamond { background: #F0F5FF; color: #2F54EB; }

.row-title { display: flex; justify-content: space-between; font-weight: 600; margin-bottom: 12px; }
.order-icons { display: flex; justify-content: space-around; }
.oi { text-align: center; font-size: 11px; cursor: pointer; }
.oi span { font-size: 28px; display: block; margin-bottom: 2px; }
.menu-list { margin-top: 0; }
.menu-item { padding: 14px 0; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 14px; }
.menu-item:last-child { border-bottom: none; }
.link { color: var(--gray); font-size: 12px; font-weight: 400; cursor: pointer; }

/* 统计 */
.stats-row {
  display: flex; background: var(--primary);
  padding: 20px 12px; color: #fff; justify-content: space-around; text-align: center;
}
.stat .num { font-size: 28px; font-weight: 700; }
.stat { font-size: 12px; opacity: 0.9; }

/* 状态条 */
.status-banner { padding: 20px; text-align: center; color: #fff; background: var(--primary); }
.status-banner .label { font-size: 22px; font-weight: 700; }
.status-banner .desc { font-size: 12px; opacity: 0.8; margin-top: 4px; }

/* 订单卡片 */
.order-card {
  background: #fff; margin: 10px 12px; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px; cursor: pointer;
}
.order-card .header { display: flex; justify-content: space-between; margin-bottom: 8px; }
.order-card .item-row { display: flex; gap: 8px; align-items: center; padding: 4px 0; }
.order-card .item-row img { width: 60px; height: 60px; border-radius: 4px; object-fit: cover; background: #eef0f0; }
.order-card .footer { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }

/* 标签页滚动 */
.tabs-scroll { display: flex; overflow-x: auto; background: #fff; padding: 8px; gap: 4px; border-bottom: 1px solid #eee; }
.tab-btn {
  flex-shrink: 0; padding: 6px 16px; border-radius: 16px;
  font-size: 12px; cursor: pointer; border: none; background: #f0f0f0; color: #666;
}
.tab-btn.active { background: var(--primary); color: #fff; }

/* 表单 */
.form { background: #fff; margin: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.form-row { display: flex; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.form-row label { width: 80px; flex-shrink: 0; font-size: 14px; }
.form-row input, .form-row textarea, .form-row select { flex: 1; border: none; font-size: 14px; }
.form-row textarea { resize: vertical; min-height: 60px; }
.toolbar { display: flex; gap: 8px; padding: 10px 12px; align-items: center; }
.toolbar input { flex: 1; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; font-size: 13px; }

/* 图片上传 */
.img-grid { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 16px; }
.img-grid .img { width: 80px; height: 80px; border-radius: var(--radius); object-fit: cover; background: #eef0f0; }
.img-grid .img-add {
  width: 80px; height: 80px; border: 1px dashed var(--line); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center; font-size: 32px;
  color: var(--gray); cursor: pointer;
}

/* 弹窗 */
.modal-mask {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(26,31,36,0.5); z-index: 999;
  display: flex; align-items: center; justify-content: center;
}
.modal-box {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px;
  width: 85%; max-width: 400px; max-height: 70vh; overflow-y: auto;
}
.modal-box h3 { text-align: center; margin-bottom: 16px; font-size: 16px; }
.modal-box input, .modal-box select { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; font-size: 14px; }
.modal-box .btn-row { display: flex; gap: 10px; margin-top: 16px; }
.modal-box .btn-row button { flex: 1; }
.cart-modal-body .form-row { display: flex; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); justify-content: space-between; }

/* AI 试妆 */
.mu-cate-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.mu-cate-chip {
  flex-shrink: 0; padding: 4px 14px; border-radius: var(--radius);
  background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.7);
  font-size: 12px; cursor: pointer;
}
.mu-cate-chip.active { background: var(--accent); color: #fff; }
.mu-makeup-list { display: flex; gap: 10px; overflow-x: auto; padding: 10px 0; }
.mu-card { flex-shrink: 0; width: 100px; cursor: pointer; text-align: center; }
.mu-card-preview { width: 100px; height: 100px; border-radius: var(--radius); }
.mu-card-name { font-size: 12px; margin-top: 6px; color: rgba(255,255,255,0.9); }
.mu-card-cate { font-size: 10px; color: rgba(255,255,255,0.4); }
.cart-modal-body .form-row label { font-size: 14px; font-weight: 500; }
.cart-modal-body .form-row input[type=date] { width: auto; margin: 0; padding: 6px 10px; }

/* Toast */
.toast {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%);
  background: rgba(26,31,36,0.85); color: #fff; padding: 10px 24px;
  border-radius: var(--radius); font-size: 14px; z-index: 9999; pointer-events: none;
  opacity: 0; transition: opacity .2s;
}
.toast.show { opacity: 1; }

/* 详情轮播 */
.img-swiper {
  width: 100%; aspect-ratio: 1 / 1; height: auto; overflow-x: auto; display: flex;
  background: #0f1216; border-radius: 6px;
  scroll-snap-type: x mandatory;
}
.img-swiper img { width: 100%; height: 100%; object-fit: contain; flex-shrink: 0; scroll-snap-align: start; }
/* 分类页/列表里的商品缩略图：正方形宫格，不再压成横条 */
.grid-thumb { width: 100%; aspect-ratio: 1 / 1; height: auto; object-fit: cover; border-radius: 6px; background: #f0f1f2; display: block; }

/* 加载 */
.loading { text-align: center; padding: 20px; color: var(--gray); }

/* 页面动画 */
.page { animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* 地址卡片 */
.addr-card {
  background: #fff; margin: 6px 12px; padding: 14px; border: 1px solid var(--line);
  border-radius: var(--radius); cursor: pointer;
}

/* ===== 后台（电脑端 1280 两栏） ===== */
@media (min-width: 1280px) {
  body { max-width: none; }
  #navBar { width: 200px; height: 96px; position: fixed; left: 0; top: 0; flex-direction: column; align-items: flex-start; padding: 20px 16px; }
  .nav-title { position: static; transform: none; font-size: 15px; padding: 10px 0 0; line-height: 1.5; text-align: left; }
  .nav-left { display: none !important; }
  .nav-right { position: absolute; right: 16px; top: 64px; }
  /* 底部 tab 在电脑上竖过来当左栏导航：否则藏掉它，进了后台就回不去 */
  #tabBar {
    display: flex; flex-direction: column; align-items: stretch;
    left: 0; right: auto; bottom: auto; top: 96px; transform: none;
    width: 200px; max-width: none; height: calc(100vh - 96px);
    border-top: none; border-right: 1px solid var(--line); padding: 14px 0;
  }
  .tab-item { flex: none; flex-direction: row; align-items: center; justify-content: flex-start; gap: 14px; height: 46px; padding: 0 20px; font-size: 14px; }
  .tab-icon { font-size: 20px; }
  .tab-label { margin-top: 0; letter-spacing: 0; }
  main { max-width: none; margin-left: 200px; min-height: 100vh; padding: 24px 32px 40px; }
  .search-bar { position: static; }
  .page.active { display: block; }
  .cate-layout { height: calc(100vh - 120px); }
  .bottom-bar { max-width: calc(100vw - 200px); left: 200px; bottom: 0; transform: none; }
  .menu-item { line-height: 52px; padding: 0; }
  .order-card, .card, .form, .balance-card { max-width: none; }
}
@media (min-width: 900px) and (max-width: 1279px) {
  body { max-width: none; }
  main { padding: 0 24px calc(var(--tab-h) + 20px); }
}

/* ===== 大图查看（点商品图放大） ===== */
#lightbox { position: fixed; inset: 0; background: rgba(8,10,14,.95); display: none; align-items: center; justify-content: center; z-index: 9999; }
#lightbox img { max-width: 94vw; max-height: 80vh; object-fit: contain; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 54px; height: 76px; background: rgba(255,255,255,.08); color: #fff; border: none; font-size: 34px; line-height: 1; cursor: pointer; border-radius: 6px; }
.lb-nav:hover { background: rgba(255,255,255,.18); }
.lb-prev { left: 10px; }
.lb-next { right: 10px; }
.lb-bar { position: absolute; bottom: 16px; left: 0; right: 0; display: flex; gap: 14px; align-items: center; justify-content: center; color: #b9c0c7; font-size: 13px; }
.lb-close { background: none; border: 1px solid #4a5158; color: #d5dade; padding: 6px 16px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.img-swiper img { cursor: zoom-in; }
.no-img { width: 100%; aspect-ratio: 1 / 1; height: auto; display: flex; align-items: center; justify-content: center; color: #8a919a; background: #f0f1f2; }

/* ===== 电脑端商品详情：图占左列放大、信息靠右，不再被裁成一条 ===== */
@media (min-width: 1280px) {
  #page-product.active {
    display: grid;
    grid-template-columns: minmax(420px, 660px) minmax(320px, 440px);
    grid-auto-rows: min-content;
    align-content: start;
    justify-content: start;
    align-items: start;
    gap: 16px 36px;
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px 32px 110px;
  }
  #productImages { grid-column: 1; grid-row: 1 / span 3; height: auto; aspect-ratio: 1 / 1; background: #0f1216; border-radius: 6px; }
  #productImages img { object-fit: contain; }
  #productInfo { grid-column: 2; grid-row: 1; margin: 0; }
  #productTypeSelect { grid-column: 2; grid-row: 2; margin: 0; }
  #productDesc { grid-column: 2; grid-row: 3; margin: 0; max-height: 60vh; overflow: auto; }
  .no-img { background: #0f1216; color: #8a919a; }
}

/* ===== 电脑端尺寸收口（同一套页面，靠断点收窄，不另做一套） ===== */
@media (min-width: 1280px) {
  main { max-width: 1060px; margin: 0 auto; padding: 20px 24px 96px; }
  /* 首页商品流：一行三张卡片，不再一条通栏 */
  .product-feed { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; padding: 0 4px; }
  .product-feed .product-card { margin-bottom: 0; }
  /* 分类页宫格：小方格，一行 4~5 个 */
  .cate-right .grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
  .cate-layout { height: calc(100vh - 140px); }
  .cate-left { width: 120px; }
  /* 详情页：图 440 见方，信息栏 360 */
  #page-product.active { grid-template-columns: minmax(320px, 440px) minmax(280px, 360px); gap: 14px 28px; padding: 20px 24px 100px; }
  .search-bar, .mode-tabs, .card, .order-card { max-width: none; }
}

/* 备案号（后台填了才出现） */
.site-foot { display: none; padding: 20px 12px 28px; text-align: center; font-size: 12px; color: #9aa1a8; letter-spacing: .3px; }
.site-foot a { color: #9aa1a8; text-decoration: none; }
.site-foot .sep { color: #d5d8dc; }
