/*
 * Samples 实拍库样式：samples 页（.sg-*）、大图查看器（.sv-*）、商品页「画室实拍」（.studio-proof*）。
 * 各站逐字节一致；配色只在下面 :root 变量里，站点要换色就在自己的主题 CSS 里覆盖这些变量。
 * 文件名不以 style 开头，不会被 Zen Cart 全站自动加载，由 samples_viewer_assets() 显式引入。
 */
:root {
  --sg-ink: #182a35;
  --sg-muted: #5f6d76;
  --sg-accent: #1e71a9;
  --sg-accent-strong: #0c2839;
  --sg-gold: #b79463;
  --sg-cream: #f7f3ec;
  --sg-cream-line: #e2dbd0;
  --sg-frame: #efebe4;
}

/* ---------------- samples 页 ---------------- */
.sg-page {
  color: var(--sg-ink);
  margin: 0 0 32px;
}
.sg-hero {
  background: var(--sg-cream);
  border: 1px solid var(--sg-cream-line);
  border-radius: 8px;
  padding: 24px 28px;
  margin: 0 0 20px;
}
.sg-kicker {
  margin: 0 0 4px;
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--sg-gold);
  font-weight: 700;
}
.sg-title {
  margin: 0 0 10px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 30px;
  line-height: 1.2;
  font-weight: 400;
  color: var(--sg-accent-strong);
  text-transform: none;
}
.sg-intro {
  margin: 0;
  max-width: 760px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--sg-ink);
}
.sg-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
  color: var(--sg-ink);
}
.sg-points li {
  position: relative;
  padding-left: 22px;
}
.sg-points li:before {
  content: '';
  position: absolute;
  left: 2px;
  top: 4px;
  width: 11px;
  height: 6px;
  border-left: 2px solid var(--sg-gold);
  border-bottom: 2px solid var(--sg-gold);
  transform: rotate(-45deg);
}

.sg-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}
.sg-filter,
.sg-filter:visited {
  display: inline-block;
  padding: 7px 14px;
  border: 1px solid var(--sg-cream-line);
  border-radius: 999px;
  background: #fff;
  font-size: 14px;
  line-height: 1.3;
  color: var(--sg-ink);
  text-decoration: none;
}
.sg-filter:hover,
.sg-filter:focus {
  border-color: var(--sg-accent);
  color: var(--sg-accent);
  text-decoration: none;
}
.sg-filter.is-active {
  background: var(--sg-accent-strong);
  border-color: var(--sg-accent-strong);
  color: #fff;
}
.sg-filter-count {
  opacity: .7;
}

.sg-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 768px) {
  .sg-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 18px; }
}
@media (min-width: 1200px) {
  .sg-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.sg-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0;
}
/* 画面不裁切：固定 4:5 画框，整幅画 contain 在浅底上 */
.sg-thumb {
  position: relative;
  display: block;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 6px;
  background: var(--sg-frame);
}
@supports not (aspect-ratio: 1 / 1) {
  .sg-thumb { height: 0; padding-bottom: 125%; }
}
.sg-thumb img {
  position: absolute;
  inset: 0;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
  transition: transform .3s ease;
}
.sg-thumb:hover img,
.sg-thumb:focus-visible img {
  transform: scale(1.03);
}
.sg-thumb.sg-rot-90 img { transform: rotate(90deg); }
.sg-thumb.sg-rot-180 img { transform: rotate(180deg); }
.sg-thumb.sg-rot-270 img { transform: rotate(270deg); }
.sg-zoom-hint {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(12, 40, 57, .72);
  color: #fff;
  font-size: 16px;
  line-height: 30px;
  text-align: center;
  opacity: 0;
  transition: opacity .2s ease;
}
.sg-thumb:hover .sg-zoom-hint,
.sg-thumb:focus-visible .sg-zoom-hint {
  opacity: 1;
}
.sg-badge {
  position: absolute;
  left: 8px;
  top: 8px;
  padding: 2px 8px;
  border-radius: 3px;
  background: var(--sg-gold);
  color: #fff;
  font-size: 12px;
  line-height: 1.5;
}
.sg-info {
  padding: 8px 2px 0;
  font-size: 14px;
  line-height: 1.4;
}
.sg-name,
.sg-name:visited {
  display: block;
  font-weight: 700;
  color: var(--sg-ink);
  text-decoration: none;
  overflow-wrap: anywhere;
}
a.sg-name:hover {
  color: var(--sg-accent);
  text-decoration: underline;
}
.sg-artist {
  display: block;
  color: var(--sg-muted);
  font-size: 13px;
}
.sg-cta,
.sg-cta:visited {
  display: inline-block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--sg-accent);
  text-decoration: none;
}
.sg-cta:hover,
.sg-cta:focus {
  text-decoration: underline;
}
.sg-empty {
  padding: 32px 0;
  color: var(--sg-muted);
}

.sg-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin: 28px 0 0;
  font-size: 14px;
  color: var(--sg-muted);
}
.sg-pages {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.sg-pages a,
.sg-pages span {
  display: inline-block;
  min-width: 36px;
  padding: 7px 10px;
  border: 1px solid var(--sg-cream-line);
  border-radius: 4px;
  text-align: center;
  color: var(--sg-ink);
  text-decoration: none;
  background: #fff;
}
.sg-pages a:hover,
.sg-pages a:focus {
  border-color: var(--sg-accent);
  color: var(--sg-accent);
}
.sg-pages .is-current {
  background: var(--sg-accent-strong);
  border-color: var(--sg-accent-strong);
  color: #fff;
}
.sg-pages .is-gap {
  border-color: transparent;
  background: transparent;
}

.sg-commission {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  margin: 36px 0 0;
  padding: 22px 26px;
  border-radius: 8px;
  background: var(--sg-accent-strong);
  color: #fff;
}
.sg-commission h2 {
  margin: 0 0 4px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 22px;
  font-weight: 400;
  color: #fff;
  text-transform: none;
}
.sg-commission p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, .85);
}
.sg-commission-btn,
.sg-commission-btn:visited {
  display: inline-block;
  padding: 11px 22px;
  border-radius: 4px;
  background: var(--sg-gold);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.sg-commission-btn:hover,
.sg-commission-btn:focus {
  background: #a3814f;
  color: #fff;
  text-decoration: none;
}

@media (max-width: 767px) {
  .sg-hero { padding: 18px 16px; }
  .sg-title { font-size: 24px; }
  .sg-intro { font-size: 14px; }
  .sg-points { font-size: 13px; }
  .sg-info { font-size: 13px; }
  .sg-commission { padding: 18px 16px; }
}

/* ---------------- 大图查看器 ---------------- */
html.sv-lock,
html.sv-lock body {
  overflow: hidden;
}
.sv-root {
  position: fixed;
  inset: 0;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100000;
  background: rgba(10, 14, 18, .97);
  color: #fff;
  font-family: Roboto, Arial, sans-serif;
}
.sv-root[hidden] {
  display: none;
}
.sv-stage {
  position: absolute;
  top: 56px;
  left: 0;
  right: 0;
  bottom: 84px;
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
}
.sv-zoomed .sv-stage {
  overflow: auto;
  cursor: grab;
}
.sv-canvas {
  position: relative;
}
.sv-img {
  position: absolute;
  max-width: none;
  transform-origin: 50% 50%;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-select: none;
}
.sv-zoomed .sv-img {
  cursor: zoom-out;
}
.sv-spinner {
  display: none;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  border: 3px solid rgba(255, 255, 255, .25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: sv-spin .8s linear infinite;
}
.sv-loading .sv-spinner {
  display: block;
}
@keyframes sv-spin {
  to { transform: rotate(360deg); }
}
.sv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
.sv-btn:hover,
.sv-btn:focus-visible {
  background: rgba(255, 255, 255, .28);
  outline: none;
}
.sv-btn:focus-visible {
  box-shadow: 0 0 0 2px #fff;
}
.sv-tools {
  position: absolute;
  top: 6px;
  right: 8px;
  display: flex;
  gap: 8px;
}
.sv-prev,
.sv-next {
  position: absolute;
  top: 50%;
  margin-top: -22px;
  font-size: 36px;
}
.sv-prev { left: 10px; }
.sv-next { right: 10px; }
.sv-single .sv-prev,
.sv-single .sv-next {
  display: none;
}
.sv-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 84px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
  padding: 10px 18px;
  background: rgba(0, 0, 0, .35);
}
.sv-text {
  flex: 1 1 220px;
  min-width: 0;
}
.sv-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}
.sv-sub {
  font-size: 13px;
  color: rgba(255, 255, 255, .75);
}
.sv-cta,
.sv-cta:visited {
  display: inline-block;
  padding: 9px 16px;
  border-radius: 4px;
  background: var(--sg-gold);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.sv-cta:hover,
.sv-cta:focus {
  background: #a3814f;
  color: #fff;
  text-decoration: none;
}
.sv-count {
  font-size: 13px;
  color: rgba(255, 255, 255, .75);
  white-space: nowrap;
}
@media (max-width: 767px) {
  .sv-stage { top: 52px; bottom: 112px; }
  .sv-prev, .sv-next { top: auto; bottom: 124px; margin-top: 0; width: 40px; height: 40px; font-size: 30px; }
  .sv-bar { min-height: 112px; padding: 10px 14px; }
  .sv-title { font-size: 15px; }
}

/* ---------------- 商品页「画室实拍」 ---------------- */
.studio-proof {
  /* 父级 .scene-gallery-row 是具名区域 grid，不指定位置会被排进窄的缩略图列 */
  grid-column: 1 / -1;
  margin: 18px 0 8px;
  padding: 14px 16px 16px;
  background: var(--sg-cream);
  border: 1px solid var(--sg-cream-line);
  border-radius: 8px;
}
.studio-proof-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
}
.studio-proof-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 18px;
  color: var(--sg-accent-strong);
}
.studio-proof-all,
.studio-proof-all:visited {
  font-size: 14px;
  color: var(--sg-accent);
  text-decoration: underline;
}
.studio-proof-text {
  margin: 6px 0 12px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--sg-muted);
}
.studio-proof-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.studio-proof-item {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 4px;
  background: var(--sg-frame);
}
@supports not (aspect-ratio: 1 / 1) {
  .studio-proof-item { height: 0; padding-bottom: 100%; }
}
.studio-proof-item img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  transition: transform .25s ease;
}
.studio-proof-item:hover img,
.studio-proof-item:focus-visible img {
  transform: scale(1.05);
}
.studio-proof-item.sg-rot-90 img { transform: rotate(90deg); }
.studio-proof-item.sg-rot-180 img { transform: rotate(180deg); }
.studio-proof-item.sg-rot-270 img { transform: rotate(270deg); }
/* 第 5 张起只进查看器分组（可左右翻），不占格子 */
.studio-proof-item.studio-proof-more {
  display: none;
}
.studio-proof-badge {
  position: absolute;
  left: 4px;
  bottom: 4px;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 11px;
  line-height: 1.5;
  color: #fff;
  background: rgba(12, 40, 57, .85);
}
.studio-proof-home {
  display: none !important;
}
.studio-proof-slot {
  width: 100%;
}
@media (max-width: 991px) {
  /* 仅 JS 打上 pending 后才藏左栏原位，避免搬运前闪一帧；无 JS 则模块留在原位 */
  html.studio-proof-pending .scene-gallery-row > .studio-proof {
    display: none;
  }
  .studio-proof-slot .studio-proof {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 12px 0 8px;
    grid-column: auto;
  }
}
@media (max-width: 479px) {
  .studio-proof { padding: 12px; }
  .studio-proof-grid { gap: 6px; }
}
