/* 图册展示样式：客户端页面与后台预览共用 */
:root {
  --bg: #FBF7F2;
  --primary: #B01E28;
  --text: #2C2422;
  --radius: 18px;
  --muted: #8A7C74;
  --line: rgba(44, 36, 34, .10);
}

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

body.viewer {
  margin: 0; padding: 0;
  background: #EFEAE3;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex; justify-content: center;
}

.album-root {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  width: 100%;
  max-width: 520px;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  overflow-x: hidden;
  box-shadow: 0 0 60px rgba(0, 0, 0, .07);
}

.album-page { padding-bottom: 8px; }

/* ---------- 区块通用 ---------- */
.blk { padding: 0 16px; }
.blk + .blk { margin-top: 26px; }

.sec-head { margin-bottom: 14px; }
.sec-title {
  margin: 0;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: .2px;
  line-height: 1.35;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sec-title::before {
  content: '';
  width: 4px; height: 20px;
  background: var(--primary);
  border-radius: 2px;
  flex: 0 0 auto;
}
.sec-desc {
  margin: 7px 0 0 14px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}
.para {
  font-size: 15px;
  line-height: 1.85;
  color: #4A3F3B;
  letter-spacing: .2px;
}

/* ---------- 顶部大图 ---------- */
.blk-hero { padding: 0; }
.hero { position: relative; overflow: hidden; display: flex; align-items: flex-end; }
.hero-bg { position: absolute; inset: 0; }
.hero-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-empty { background: linear-gradient(135deg, #3A2A28, #6B4B44); }
.hero-mask { position: absolute; inset: 0; }
.hero-inner { position: relative; padding: 26px 24px 30px; width: 100%; }
.hero-title {
  margin: 0;
  font-size: 33px;
  line-height: 1.22;
  font-weight: 900;
  color: #fff;
  letter-spacing: .5px;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .35);
}
.hero-sub {
  margin: 10px 0 0;
  font-size: 14px;
  color: rgba(255, 255, 255, .9);
  letter-spacing: .6px;
  text-shadow: 0 1px 10px rgba(0, 0, 0, .4);
}
.hero-btn {
  display: inline-block;
  margin-top: 16px;
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  border-radius: 999px;
  letter-spacing: .5px;
}

/* ---------- 产品网格 ---------- */
.grid { display: grid; gap: 12px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
/* 卡片图比例：--r-card 由 /shared/ratios.js 注入（唯一数据源），后方是兜底值 */
.card-pic { background: #F3EDE6; aspect-ratio: var(--r-card, 3 / 4); overflow: hidden; }
.thumb { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.card:active .thumb { transform: scale(1.03); }
.card-body { padding: 10px 11px 12px; position: relative; }
.card-name { font-size: 14px; font-weight: 700; line-height: 1.4; }
.card-desc { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.card-price { font-size: 15px; font-weight: 800; color: var(--primary); margin-top: 6px; }
.card-badge {
  position: absolute; top: 8px; right: 8px;
  font-size: 10px; font-weight: 700;
  color: #fff; background: var(--primary);
  padding: 2px 7px; border-radius: 999px;
}
.empty-hint {
  grid-column: 1 / -1;
  padding: 26px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

/* ---------- 横滑图 ---------- */
.swipe {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
}
.swipe::-webkit-scrollbar { display: none; }
.swipe-item {
  flex: 0 0 76%;
  scroll-snap-align: center;
  border-radius: var(--radius);
  overflow: hidden;
  background: #F3EDE6;
  aspect-ratio: var(--r-swipe, 3 / 4);
}
.swipe-img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- 视频 ---------- */
.video-wrap { border-radius: var(--radius); overflow: hidden; background: #000; }
.video-wrap video { width: 100%; display: block; max-height: 70vh; }

/* ---------- 数据 ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 8px; text-align: center;
}
.stat-num { font-size: 20px; font-weight: 900; color: var(--primary); letter-spacing: -.3px; }
.stat-label { font-size: 11px; color: var(--muted); margin-top: 5px; }

/* ---------- 名片 ---------- */
.contact-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  gap: 14px;
}
.ct-avatar { width: 58px; height: 58px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; background: #EADFD5; }
.ct-ph { background: linear-gradient(135deg, #E8D8CB, #D6C0AE); }
.ct-main { flex: 1; min-width: 0; }
.ct-name { font-size: 16px; font-weight: 800; }
.ct-title { font-size: 12px; color: var(--muted); margin-top: 3px; }
.ct-note { font-size: 12px; color: #5B4E48; margin-top: 8px; line-height: 1.6; }
.ct-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.ct-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 8px 14px;
  font-size: 13px; font-weight: 700;
  color: #fff; background: var(--primary);
  border: none; border-radius: 999px;
  text-decoration: none; cursor: pointer;
  font-family: inherit;
}
.ct-btn.ghost { background: transparent; color: var(--primary); border: 1px solid var(--primary); }

.divider { width: 100%; }

/* ---------- 滚动横幅（轮播） ---------- */
.blk-banner { padding: 0; }
.bnr {
  position: relative;
  overflow: hidden;
  background: #EADFD5;
}
.bnr-track {
  display: flex;
  height: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.bnr-track::-webkit-scrollbar { display: none; }
.bnr-slide {
  position: relative;
  flex: 0 0 100%;
  height: 100%;
  scroll-snap-align: center;
  display: block;
  text-decoration: none;
  color: inherit;
}
.bnr-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bnr-cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 34px 18px 26px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, .6));
  color: #fff;
  display: flex; flex-direction: column; gap: 4px;
}
.bnr-cap b { font-size: 18px; font-weight: 800; letter-spacing: .3px; text-shadow: 0 1px 8px rgba(0, 0, 0, .35); }
.bnr-cap span { font-size: 12px; opacity: .9; line-height: 1.5; }
.bnr-dots {
  position: absolute; left: 0; right: 0; bottom: 10px;
  display: flex; justify-content: center; gap: 5px;
}
.bnr-dots i {
  width: 5px; height: 5px; border-radius: 50%;
  background: rgba(255, 255, 255, .55);
  cursor: pointer; transition: width .2s, background .2s;
}
.bnr-dots i.on { width: 14px; border-radius: 3px; background: #fff; }

/* ---------- 滚动公告 ---------- */
.notice {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid var(--line);
  border-radius: 999px; padding: 7px 12px 7px 7px;
  overflow: hidden;
}
.nt-ico {
  flex: 0 0 auto;
  font-size: 11px; font-weight: 800; letter-spacing: .5px;
  color: #fff; background: var(--primary);
  border-radius: 999px; padding: 3px 9px;
}
.nt-view { flex: 1; overflow: hidden; }
.nt-run {
  display: flex; width: max-content; white-space: nowrap;
  animation-name: ntScroll;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
.notice:hover .nt-run { animation-play-state: paused; }
.nt-run span { padding-right: 60px; font-size: 12.5px; color: #5B4E48; letter-spacing: .2px; }
@keyframes ntScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- 流程步骤 ---------- */
.steps { list-style: none; margin: 0; padding: 0; }
.step { display: flex; gap: 12px; padding-bottom: 18px; position: relative; }
.step:last-child { padding-bottom: 0; }
.step::before {
  content: ''; position: absolute; left: 13px; top: 30px; bottom: 0;
  width: 1.5px; background: var(--line);
}
.step:last-child::before { display: none; }
.st-no {
  flex: 0 0 auto; width: 27px; height: 27px; border-radius: 50%;
  background: var(--primary); color: #fff;
  font-size: 13px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.st-main { flex: 1; min-width: 0; padding-top: 2px; }
.st-main b { font-size: 14.5px; font-weight: 800; line-height: 1.5; display: block; }
.st-main p { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.7; }

/* ---------- 客户评价 ---------- */
.reviews {
  display: flex; gap: 10px;
  overflow-x: auto; scroll-snap-type: x mandatory;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
}
.reviews::-webkit-scrollbar { display: none; }
.rv {
  flex: 0 0 76%; scroll-snap-align: center;
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 13px;
}
.rv-head { display: flex; gap: 9px; align-items: center; }
.rv-av { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.rv-ph {
  display: flex; align-items: center; justify-content: center;
  background: #EADFD5; color: #8A6A5C;
  font-size: 13px; font-weight: 800;
}
.rv-name { font-size: 13px; font-weight: 800; }
.rv-star { font-size: 11px; color: #E0A32E; letter-spacing: 1.5px; margin-top: 2px; }
.rv-text { margin: 9px 0 0; font-size: 12.5px; line-height: 1.75; color: #4A3F3B; }

/* ---------- 常见问题 ---------- */
.faqs { display: flex; flex-direction: column; gap: 8px; }
.faq {
  background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: 0 14px;
  overflow: hidden;
}
.faq summary {
  list-style: none; cursor: pointer;
  padding: 13px 0; font-size: 13.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq-ico {
  width: 8px; height: 8px; flex: 0 0 auto; margin-top: -3px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg);
  transition: transform .22s;
}
.faq[open] .faq-ico { transform: rotate(-135deg); margin-top: 2px; }
.faq-a {
  font-size: 12.5px; line-height: 1.78; color: #5B4E48;
  border-top: 1px dashed var(--line);
  padding: 11px 0 14px;
}

/* ---------- 活动倒计时 ---------- */
.cd {
  background: linear-gradient(150deg, #2C2422, #4A3630 58%, #6B4B44);
  color: #fff; text-align: center;
  border-radius: var(--radius);
  padding: 18px 14px 20px;
}
.cd-title { font-size: 14px; font-weight: 800; letter-spacing: .5px; }
.cd-nums { display: flex; justify-content: center; gap: 8px; margin-top: 13px; }
.cd-unit {
  min-width: 56px;
  background: rgba(255, 255, 255, .1);
  border-radius: 10px;
  padding: 8px 4px;
}
.cd-unit b {
  display: block; font-size: 20px; font-weight: 900;
  letter-spacing: -.5px; font-variant-numeric: tabular-nums;
}
.cd-unit span { font-size: 10px; color: rgba(255, 255, 255, .6); }
.cd-note { margin-top: 11px; font-size: 11.5px; color: rgba(255, 255, 255, .66); line-height: 1.6; }
.cd.is-over .cd-nums { opacity: .3; }
.cd.is-over .cd-title::after { content: ' · 已结束'; color: #F0C36B; }

/* ---------- 页脚 ---------- */
.album-footer {
  margin-top: 34px;
  padding: 26px 16px 40px;
  text-align: center;
  border-top: 1px solid var(--line);
}
.foot-brand { font-size: 12px; font-weight: 700; color: var(--primary); letter-spacing: 1px; }
.foot-owner { font-size: 12px; color: var(--text); margin-top: 6px; }
.foot-tip { font-size: 11px; color: var(--muted); margin-top: 6px; }

/* ---------- 底部浮动联系条 ---------- */
.float-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 520px);
  display: flex;
  gap: 10px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(251, 247, 242, .92);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  z-index: 20;
}
.float-bar .fb-btn {
  flex: 1;
  text-align: center;
  padding: 12px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
}
.fb-btn.main { background: var(--primary); color: #fff; }
.fb-btn.sub { background: #fff; color: var(--primary); border: 1px solid var(--primary); }

/* ---------- 店铺首页 ---------- */
.shop-head {
  padding: 34px 20px 26px;
  background: linear-gradient(160deg, #2C2422, #4A3630 55%, #6B4B44);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.shop-head::after {
  content: '';
  position: absolute; right: -40px; top: -40px;
  width: 180px; height: 180px; border-radius: 50%;
  background: rgba(176, 30, 40, .35);
}
.shop-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  object-fit: cover; background: rgba(255,255,255,.15);
  border: 2px solid rgba(255,255,255,.35);
}
.shop-name { font-size: 24px; font-weight: 900; margin: 14px 0 0; letter-spacing: .5px; }
.shop-title { font-size: 13px; color: rgba(255,255,255,.72); margin-top: 6px; }
.shop-slogan { font-size: 12px; color: rgba(255,255,255,.55); margin-top: 14px; letter-spacing: .5px; }
.shop-body { padding: 18px 16px 40px; }
.shop-sec-title { font-size: 13px; font-weight: 800; color: var(--muted); letter-spacing: 1px; margin: 4px 2px 12px; }

.album-card {
  display: flex; gap: 13px; align-items: center;
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px; margin-bottom: 12px;
  text-decoration: none; color: inherit;
}
.album-card:active { background: #FDFBF8; }
.ac-pic {
  width: 84px; height: 84px; border-radius: 12px;
  overflow: hidden; flex: 0 0 auto; background: #F3EDE6;
}
.ac-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ac-main { flex: 1; min-width: 0; }
.ac-title { font-size: 16px; font-weight: 800; }
.ac-sub { font-size: 12px; color: var(--muted); margin-top: 5px; }
.ac-meta { font-size: 11px; color: var(--muted); margin-top: 8px; }
.ac-go { color: var(--primary); font-size: 18px; font-weight: 700; }

.loading, .notfound {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--muted); padding: 40px; text-align: center;
  line-height: 1.8;
}

.copied-toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%);
  background: rgba(44, 36, 34, .9); color: #fff;
  padding: 9px 18px; border-radius: 999px; font-size: 13px;
  z-index: 99; animation: fadeInOut 1.6s ease;
}
@keyframes fadeInOut {
  0% { opacity: 0; transform: translateX(-50%) translateY(6px); }
  15% { opacity: 1; transform: translateX(-50%) translateY(0); }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

/* ---------- 桌面版（网页模式，固定 1200px） ---------- */
.album-root.album-desktop {
  max-width: 1200px;
}
body.viewer.album-desktop-page { padding: 24px 0 40px; }
.album-desktop .blk { padding: 0 40px; }
.album-desktop .blk + .blk { margin-top: 40px; }
.album-desktop .album-page { padding-bottom: 24px; }
.album-desktop .sec-head { margin-bottom: 22px; }
.album-desktop .sec-title { font-size: 30px; }
.album-desktop .sec-desc { font-size: 16px; margin-top: 8px; }
.album-desktop .hero-inner { padding: 48px 44px 56px; }
.album-desktop .hero-title { font-size: 52px; }
.album-desktop .hero-sub { font-size: 20px; margin-top: 12px; }
.album-desktop .hero-btn { font-size: 16px; padding: 13px 30px; }
/* 网格在宽容器下自动铺开，不按手机列数硬排 */
.album-desktop .grid { gap: 20px; }
.album-desktop .grid.cols-2, .album-desktop .grid.cols-3 {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.album-desktop .card-pic, .album-desktop .grid.cols-3 .card-pic { aspect-ratio: var(--r-card, 3 / 4); }
.album-desktop .card-body { padding: 14px 16px 16px; }
.album-desktop .card-name { font-size: 17px; }
.album-desktop .card-desc { font-size: 13.5px; }
.album-desktop .card-price { font-size: 18px; }
/* 横滑图集：桌面单张最大 300px，不铺满整行 */
.album-desktop .swipe { gap: 18px; }
.album-desktop .swipe-item {
  flex: 0 0 300px;
  max-width: 300px;
  aspect-ratio: var(--r-swipe, 3 / 4);
}
/* 浮动联系条：桌面改为右下角贴片 */
body.viewer.album-desktop-page .float-bar {
  left: auto; right: 28px; transform: none; width: auto;
  border-radius: 999px; padding: 10px 20px;
}

/* ---------- 产品网格：纯图片模式 ---------- */
.card-plain { border: none; background: transparent; overflow: visible; }
.card-plain .card-pic {
  border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 2px 10px rgba(44, 36, 34, .08);
}
.card-plain:hover .card-pic { box-shadow: 0 8px 24px rgba(44, 36, 34, .16); }
.card-plain .thumb { transition: transform .35s ease; }
.card-plain:hover .thumb { transform: scale(1.05); }

/* ---------- 图片集弹窗 ---------- */
.lb-mask {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(14, 11, 10, .93);
  display: flex; align-items: center; justify-content: center;
  animation: lbIn .18s ease;
}
@keyframes lbIn { from { opacity: 0 } to { opacity: 1 } }
.lb-stage { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 56px 68px 76px; }
.lb-img {
  max-width: 100%; max-height: 100%; object-fit: contain;
  border-radius: 8px; background: #1B1716;
  box-shadow: 0 12px 60px rgba(0, 0, 0, .5);
}
.lb-close {
  position: absolute; top: 16px; right: 16px; z-index: 2;
  width: 40px; height: 40px; border: none; border-radius: 50%;
  background: rgba(255, 255, 255, .14); color: #fff;
  font-size: 18px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.lb-close:hover { background: rgba(255, 255, 255, .26); }
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 46px; height: 46px; border: none; border-radius: 50%;
  background: rgba(255, 255, 255, .12); color: #fff;
  font-size: 30px; line-height: 1; cursor: pointer; padding-bottom: 4px;
}
.lb-nav:hover { background: rgba(255, 255, 255, .24); }
.lb-prev { left: 14px; }
.lb-next { right: 14px; }
.lb-foot {
  position: absolute; left: 0; right: 0; bottom: 20px; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: rgba(255, 255, 255, .82); font-size: 13px; text-align: center; padding: 0 20px;
}
.lb-name { font-weight: 600; }
.lb-count { font-size: 12px; opacity: .72; letter-spacing: .5px; }
@media (max-width: 700px) {
  .lb-stage { padding: 48px 12px 70px; }
  .lb-nav { width: 38px; height: 38px; font-size: 24px; }
  .lb-prev { left: 6px; } .lb-next { right: 6px; }
}

/* ---------- 图片集网格弹窗（整齐排列 + 下拉滚动） ---------- */
.lg-mask {
  position: fixed; inset: 0; z-index: 9998;
  background: rgba(14, 11, 10, .9);
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
  animation: lbIn .18s ease;
}
.lg-panel {
  width: min(760px, 100%);
  max-height: min(86vh, 920px);
  background: #fff; border-radius: 16px;
  overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 20px 80px rgba(0, 0, 0, .45);
}
.lg-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 16px; border-bottom: 1px solid var(--line); flex: 0 0 auto;
}
.lg-title { font-size: 15.5px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-close {
  width: 34px; height: 34px; flex: 0 0 auto;
  border: none; border-radius: 50%; background: #F3EDE6;
  font-size: 14px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.lg-close:hover { background: #E8DCD0; }
.lg-grid {
  overflow-y: auto; padding: 14px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  align-content: start;
}
.lg-cell { margin: 0; border-radius: 10px; overflow: hidden; background: #F3EDE6; cursor: zoom-in; }
.lg-cell img { width: 100%; aspect-ratio: var(--r-cell, 3 / 4); object-fit: cover; display: block; }
.lg-cell figcaption {
  font-size: 11.5px; padding: 6px 8px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
@media (min-width: 700px) {
  .lg-grid { grid-template-columns: repeat(4, 1fr); gap: 12px; }
}
