/*
 * 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: 4px;
  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: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  pointer-events: none;
  transition: background-color .2s ease;
}
.sg-zoom-hint svg {
  display: block;
}
.sg-thumb:hover .sg-zoom-hint,
.sg-thumb:focus-visible .sg-zoom-hint {
  background: rgba(0, 0, 0, .8);
}
.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); }
}
/* 按钮样式与商品页 View in Room 的关闭钮一致：深色半透明正圆 + 白色符号 */
.sv-btn {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 40px;
  height: 40px;
  min-width: 40px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 26px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.sv-btn span {
  display: block;
  line-height: 1;
}
.sv-btn svg {
  display: block;
}
.sv-btn:hover,
.sv-btn:focus-visible {
  background: rgba(0, 0, 0, .8);
  outline: none;
}
.sv-btn:focus-visible {
  box-shadow: 0 0 0 2px #fff;
}
.sv-tools {
  position: absolute;
  top: 10px;
  right: 16px;
  display: flex;
  gap: 8px;
}
.sv-prev,
.sv-next {
  position: absolute;
  top: 50%;
  margin-top: -20px;
  font-size: 32px;
}
.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; }
  .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;
}
/* 「这幅画」角标：一行小标签，不遮挡画面（2026-10-15） */
.studio-proof-badge {
  position: absolute;
  left: 4px;
  top: 4px;
  max-width: calc(100% - 8px);
  padding: 1px 6px;
  border-radius: 3px;
  overflow: hidden;
  font-size: 11px;
  line-height: 1.5;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #fff;
  background: rgba(12, 40, 57, .85);
}
.studio-proof-item.is-this {
  box-shadow: 0 0 0 2px var(--sg-gold);
}
.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; }
  .studio-proof-badge { left: 2px; top: 2px; max-width: calc(100% - 4px); padding: 0 3px; font-size: 10px; }
}

/* ---------------- 2026-10-15：样品页网格改回商品分类页样式 ---------------- */
/* 外层沿用分类页的 mix / grid-list / product-item 标记与样式；这里只统一图片框：
   正方形浅底框，整幅画 contain 进去（不裁切），各行高度一致、浮动布局不错位。 */
.sg-listing .product .product-image .image .sg-thumb {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 0;
  background: #f4f4f4;
}
@supports not (aspect-ratio: 1 / 1) {
  .sg-listing .product .product-image .image .sg-thumb { height: 0; padding-bottom: 100%; }
}
.sg-listing .product .product-image .image .sg-thumb img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
}
.sg-listing .product-info .sg-date {
  font-size: 13px;
  color: var(--sg-muted);
}
/* 卡片底部不再放单独的下单链接：标题本身就是链接（名画 → 商品页，定制 → 定制页），
   用箭头和悬停变色提示可以点。 */
.sg-listing .sg-name-link a {
  color: inherit;
  text-decoration: none;
}
.sg-listing .sg-name-link a::after {
  content: '\00a0\203A';
  color: var(--sg-accent);
  font-weight: 700;
}
.sg-listing .sg-name-link a:hover,
.sg-listing .sg-name-link a:focus-visible {
  color: var(--sg-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------------- 2026-10-15：与站点现有组件统一 ----------------
   标题区用分类页 .category-info，筛选与分页用分类页分页的 .btn.btn-dark-blue（当前项 .btn-trans），
   这里只覆盖之前自定义的卡片外观：去掉大圆角、米色描边与胶囊形，圆角跟随站点（bootstrap .btn 4px）。 */
/* 背景、内边距交还给站点的 .category-info；标题套用分类页 h2.category-title 的字号与大写（本页是 h1） */
.sg-page .category-info.sg-hero {
  background: #f2f2f2;
  padding: 20px;
  border: 0;
  border-radius: 0;
}
/* 带上 #centercontent-wrapper：站点 templatecss.css 有 #centercontent-wrapper h1 { color:#666 }，类选择器压不过 ID */
#centercontent-wrapper .sg-page .sg-hero h1.category-title,
.sg-page .sg-hero h1.category-title {
  float: none;
  margin: 0 0 10px;
  font-family: inherit;
  font-size: 2em;
  font-weight: 700;
  line-height: 1.2;
  color: #379adc;
  text-shadow: 1px 2px 2px #ccc;
  text-transform: uppercase;
}
.sg-page .sg-hero .category-description {
  font-size: 14px;
  line-height: 22px;
}
