/* ============================================================
   核橙设计 — Design System
   Colors: bg #F6F4EE / surface #FFF / subtle #ECE8DD / line rgba(0,0,0,.06)
   Text: primary #141414 / secondary #707070 / tertiary #A0A0A0
   Radius: 8 (xs) / 12 (sm) / 16 (md) / 20 (lg) / 999 (pill)
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #F6F4EE;
  --surface: #FFFFFF;
  --subtle: #ECE8DD;
  --line: rgba(0,0,0,.07);
  --line-strong: rgba(0,0,0,.14);
  --text: #141414;
  --text-2: #707070;
  --text-3: #A0A0A0;
  --accent: #141414;
  --zoom: 0.9;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* 整体视觉缩放 — 相当于浏览器 90% 缩放 */
  zoom: var(--zoom);
}
/* Purchase screens should match the browser's real viewport scale. */
body.purchase-mode { zoom: 1; }

/* ===== 窄顶工具条（仅创作页） ===== */
.utility-bar {
  background: #ECE7DA;
  border-bottom: 1px solid #DDD6C2;
  font-size: 12px;
  position: relative; z-index: 50;
}
.utility-bar-inner {
  max-width: 1800px;
  margin: 0 auto;
  padding: 8px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #6E6655;
  line-height: 1;
}
.utility-bar-left, .utility-bar-right {
  display: flex;
  align-items: center;
  gap: 18px;
}
.utility-logo {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: #1F1B14;
  cursor: pointer;
}
.utility-logo:hover { opacity: 0.7; }
.utility-logo-mark {
  width: 18px; height: 18px; border-radius: 4px;
  background: #1A1A1A; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 500;
}
.utility-item {
  cursor: pointer;
  transition: color .15s;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.utility-item:hover { color: #1F1B14; }
.utility-dot {
  width: 6px; height: 6px; border-radius: 50%; background: #B89A5E;
  display: inline-block;
}
.utility-divider {
  width: 1px; height: 10px; background: #C9BDA2;
}

/* 创作页：用窄顶栏替代大 nav，调整内容区高度 */
body.creation-mode .nav { display: none; }
body.checkout-mode .utility-bar { display: none !important; }
body.checkout-mode .nav { position: static; background: var(--bg); border-bottom: 1px solid var(--line); }
body.checkout-mode .nav-links,
body.checkout-mode .search-mock,
body.checkout-mode .nav-right .icon-btn { display: none !important; }
body.checkout-mode .nav-inner { max-width: 1400px; padding-top: 14px; padding-bottom: 14px; }
body.checkout-mode .nav-right { margin-left: auto; }
body.creation-mode .page-chat {
  /* 补偿 body zoom：视口高 - 窄顶栏视觉高 (33px*zoom)，再除 zoom 得到布局高度 */
  height: calc((100vh - 33px * var(--zoom)) / var(--zoom)) !important;
}

/* ===== 顶部导航 ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(246,244,238,.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 0.5px solid var(--line);
}
.nav-inner {
  max-width: 1800px;
  margin: 0 auto;
  padding: 16px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-mark {
  width: 24px; height: 24px;
  background: var(--accent);
  border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  color: white; font-size: 13px; font-weight: 500;
}
.logo-sub { color: var(--text-3); font-size: 11px; font-weight: 400; letter-spacing: 0.5px; }
.nav-links { display: flex; gap: 32px; font-size: 14px; color: var(--text-2); }
.nav-link {
  border: 0; padding: 4px 0; background: transparent; color: inherit;
  font: inherit; cursor: pointer; transition: color .2s;
}
.nav-link:hover, .nav-link.active { color: var(--text); font-weight: 500; }
.nav-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px; }
.nav-right { display: flex; align-items: center; gap: 14px; }
.language-switch {
  min-width: 38px; height: 30px; padding: 0 10px;
  border: 1px solid currentColor; border-radius: 999px;
  background: transparent; color: inherit;
  font: 700 11px/1 Arial, sans-serif; letter-spacing: .08em;
  cursor: pointer;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}
.language-switch:hover { background: #1f1b14; color: #fff; transform: translateY(-1px); }
.search-mock {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; background: var(--subtle); border-radius: 999px;
  font-size: 13px; color: var(--text-3); min-width: 240px;
}
.search-mock:focus-within { box-shadow: 0 0 0 2px rgba(31,27,20,.14); }
.search-mock input,
.home-search input {
  width: 100%; min-width: 0; border: 0; outline: 0; background: transparent;
  color: var(--text); font: inherit;
}
.search-mock input::placeholder,
.home-search input::placeholder { color: var(--text-3); opacity: 1; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--subtle); display: flex; align-items: center; justify-content: center;
  cursor: pointer; position: relative; font-size: 13px; font-weight: 500;
  color: var(--text);
  transition: background .15s;
}
.icon-btn:hover { background: #DFDACB; }
.auth-nav-button { border: 0; font-family: inherit; }
.utility-credit {
  min-height: 24px; padding: 3px 9px; border: 1px solid #cfc4aa;
  border-radius: 999px; background: #f8f5ec; color: #5f543e;
  display: inline-flex; align-items: center; gap: 5px;
  font: inherit; font-size: 11px; cursor: pointer;
}
.utility-credit[hidden] { display: none; }
.utility-credit strong { color: #1f1b14; }
.utility-credit:hover { border-color: #9f8c65; }
.cart-badge {
  position: absolute; top: -2px; right: -2px;
  background: var(--accent); color: white;
  font-size: 10px; min-width: 16px; height: 16px;
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

/* ===== Login wall and account access ===== */
.auth-wall {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px; overflow: hidden; overscroll-behavior: none;
  background: rgba(24, 22, 18, .28);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.auth-wall[hidden] { display: none; }
.auth-card {
  position: relative; flex: 0 0 auto;
  width: min(430px, 100%); overflow: visible;
  padding: 34px; border: 1px solid rgba(0,0,0,.08); border-radius: 24px;
  background: #fff; box-shadow: 0 28px 80px rgba(26,23,18,.18);
}
.auth-close {
  position: absolute; top: 18px; right: 18px; width: 34px; height: 34px;
  border: 0; border-radius: 50%; background: #f1efe8; color: var(--text-2);
  font: 20px/1 inherit; cursor: pointer;
}
.auth-close:hover { background: #e7e3d8; color: var(--text); }
.auth-close[hidden] { display: none; }
.auth-brand { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 600; }
.auth-brand .logo-mark { width: 25px; height: 25px; font-size: 13px; }
.auth-kicker { margin-top: 28px; color: #6c7d70; font-size: 10px; font-weight: 700; letter-spacing: 2px; }
.auth-card h2 { margin-top: 7px; font-size: 28px; line-height: 1.25; letter-spacing: -.6px; }
.auth-intro { margin-top: 10px; color: var(--text-2); font-size: 13px; line-height: 1.7; }
.auth-google {
  width: 100%; min-height: 48px; margin-top: 22px; padding: 0 16px;
  display: flex; align-items: center; justify-content: center; gap: 11px;
  border: 1px solid #d8dce2; border-radius: 11px; background: #fff;
  color: #202124; font: 500 14px/1.2 inherit; cursor: pointer;
  box-shadow: 0 1px 2px rgba(60,64,67,.08);
}
.auth-google:hover { background: #f8faff; border-color: #c9d3e5; }
.auth-google[hidden] { display: none; }
.auth-google-mark { color: #4285f4; font: 700 18px/1 Arial, sans-serif; }
.auth-divider { margin: 17px 0; display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 11px; }
.auth-divider::before, .auth-divider::after { content: ''; height: 1px; flex: 1; background: var(--line); }
.auth-divider[hidden] { display: none; }
.auth-tabs {
  margin-top: 24px; padding: 4px; display: grid; grid-template-columns: 1fr 1fr;
  border-radius: 12px; background: #f1efe8;
}
.auth-card.google-enabled .auth-tabs { margin-top: 0; }
.auth-tab {
  min-height: 38px; border: 0; border-radius: 9px; background: transparent;
  color: var(--text-2); font: inherit; font-size: 13px; cursor: pointer;
}
.auth-tab.active { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 1px 6px rgba(0,0,0,.06); }
.auth-form { margin-top: 18px; display: grid; gap: 14px; }
.auth-field { display: grid; gap: 7px; color: var(--text-2); font-size: 12px; }
.auth-field[hidden] { display: none; }
.auth-field input {
  width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--line-strong);
  border-radius: 11px; outline: none; background: #fbfaf7; color: var(--text); font: inherit; font-size: 15px;
}
.auth-field input:focus { border-color: #244d3e; box-shadow: 0 0 0 3px rgba(36,77,62,.1); }
.auth-error { min-height: 19px; color: #a14938; font-size: 12px; line-height: 1.55; }
.auth-submit { width: 100%; min-height: 50px; border: 0; border-radius: 12px; font: inherit; }
.auth-submit:disabled { opacity: .55; cursor: wait; }
.auth-benefit { margin-top: 15px; padding: 11px 13px; border-radius: 10px; background: #eff5f0; color: #3f6553; font-size: 11px; line-height: 1.6; }
.auth-browser-back { margin-top: 12px; color: var(--text-3); text-align: center; font-size: 11px; }
body.auth-wall-open { overflow: hidden; }

@media (max-width: 600px) {
  .auth-wall {
    padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  }
  .auth-card { padding: 28px 24px; border-radius: 22px; }
  .auth-kicker { margin-top: 22px; }
  .auth-card h2 { font-size: 26px; }
  .auth-intro { margin-top: 8px; line-height: 1.55; }
  .auth-google { margin-top: 18px; }
  .auth-divider { margin: 14px 0; }
  .auth-form { margin-top: 16px; gap: 12px; }
  .auth-field input { min-height: 46px; }
  .auth-browser-back { display: none; }
}

@media (max-height: 760px) {
  .auth-card { padding: 22px 24px; }
  .auth-kicker { margin-top: 16px; }
  .auth-intro { display: none; }
  .auth-google { margin-top: 14px; }
  .auth-divider { margin: 12px 0; }
  .auth-form { margin-top: 14px; gap: 10px; }
  .auth-benefit { margin-top: 10px; padding: 8px 11px; }
}

@media (max-height: 680px) {
  .auth-card { padding: 18px 22px; }
  .auth-kicker { display: none; }
  .auth-card h2 { margin-top: 14px; font-size: 24px; }
  .auth-google { min-height: 42px; margin-top: 12px; }
  .auth-divider { margin: 9px 0; }
  .auth-tabs { padding: 3px; }
  .auth-tab { min-height: 34px; }
  .auth-form { margin-top: 11px; gap: 8px; }
  .auth-field { gap: 4px; }
  .auth-field input { min-height: 40px; }
  .auth-error { min-height: 14px; line-height: 1.2; }
  .auth-submit { min-height: 44px; }
  .auth-benefit { display: none; }
}

/* ===== 页面容器 ===== */
.page { max-width: 1800px; margin: 0 auto; padding: 40px 48px 64px; display: none; }
.page.active { display: block; }

/* ===== 主页 ===== */
.hero { margin-bottom: 36px; }
.hero h1 {
  font-size: 32px; font-weight: 500; letter-spacing: -0.6px;
  margin-bottom: 8px; line-height: 1.2; text-wrap: balance;
}
.hero p { color: var(--text-2); font-size: 15px; }
.home-search {
  display: none; align-items: center; gap: 10px; margin-bottom: 18px;
  padding: 12px 15px; background: var(--subtle); border-radius: 12px;
  color: var(--text-3); font-size: 15px;
}
.home-search:focus-within { box-shadow: 0 0 0 2px rgba(31,27,20,.14); }
.discovery-controls { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.tab-chips { display: flex; gap: 8px; margin-bottom: 32px; flex-wrap: wrap; }
.chip {
  border: 0; font-family: inherit;
  padding: 8px 16px; border-radius: 999px; font-size: 13px;
  cursor: pointer; transition: all .15s;
  color: var(--text-2); background: transparent;
}
.chip:hover { background: var(--subtle); color: var(--text); }
.chip.active { background: var(--accent); color: white; }
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.template-result-count { padding-top: 8px; color: var(--text-3); font-size: 12px; white-space: nowrap; }

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}
.template-card { color: inherit; text-decoration: none; cursor: pointer; transition: transform .25s ease; }
.template-card:hover { transform: translateY(-3px); }
.template-card:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 12px; }
.template-cover {
  aspect-ratio: 3/4; border-radius: 12px; overflow: hidden;
  position: relative; background: var(--subtle);
}
.template-cover svg { width: 100%; height: 100%; display: block; }
.template-card-visuals { position: absolute; inset: 0; overflow: hidden; }
.template-ready-shirt {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%; display: block; object-fit: cover;
  transition: opacity .28s ease, transform .4s cubic-bezier(.2,.75,.2,1);
}
.template-card-artwork-layer {
  position: absolute; inset: 0; z-index: 1; display: grid; place-items: center;
  opacity: 0; transform: translateY(18px) scale(.985);
  background: #E8EFEA; pointer-events: none;
  transition: opacity .24s ease, transform .36s cubic-bezier(.2,.75,.2,1);
}
.template-ready-artwork { width: 100%; height: 100%; display: block; object-fit: contain; padding: 8%; background: #E8EFEA; }
.template-ready-generated { width: 100%; height: 100%; padding: 8%; background: #E8EFEA; }
.template-ready-generated > svg,
.template-ready-generated > .layout-preview { width: 100%; height: 100%; border-radius: 8px; }
.template-composed-print {
  position: absolute; z-index: 1; left: 27%; top: 27%; width: 46%; height: 49%;
  overflow: hidden; background: #F3F0E9;
  transition: opacity .2s ease, transform .4s cubic-bezier(.2,.75,.2,1);
}
.template-composed-print .template-ready-artwork,
.template-composed-print .template-ready-generated { padding: 3%; background: #F3F0E9; }
.template-card-visuals-artwork-only .template-card-artwork-layer { opacity: 1; transform: none; }
.template-artwork-label { opacity: 0; }
.template-card-visuals-artwork-only ~ .template-mockup-label { opacity: 0; }
.template-card-visuals-artwork-only ~ .template-artwork-label { opacity: 1; }
.example-effect-overlay {
  position: absolute; top: 12px; right: 12px; z-index: 3;
  padding: 6px 10px; border: 1px solid rgba(255,255,255,.64); border-radius: 999px;
  background: rgba(20,23,21,.76); color: #fff; backdrop-filter: blur(10px);
  font-size: 10px; font-weight: 650; letter-spacing: .11em;
  box-shadow: 0 4px 14px rgba(0,0,0,.14);
}
.template-hover-action {
  position: absolute; left: 14px; right: 14px; bottom: 14px; z-index: 3;
  min-height: 46px; padding: 0 16px; border-radius: 12px;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(255,255,255,.96); color: #171717; box-shadow: 0 10px 28px rgba(0,0,0,.18);
  font-size: 13px; font-weight: 650;
  opacity: 0; transform: translateY(16px); transition: opacity .24s ease, transform .28s cubic-bezier(.2,.75,.2,1);
}
@media (hover: hover) and (pointer: fine) {
  .template-card:hover .template-card-visuals:not(.template-card-visuals-artwork-only) .template-ready-shirt,
  .template-card:focus-visible .template-card-visuals:not(.template-card-visuals-artwork-only) .template-ready-shirt {
    opacity: 0; transform: scale(1.025) translateY(-6px);
  }
  .template-card:hover .template-composed-print,
  .template-card:focus-visible .template-composed-print { opacity: 0; transform: translateY(-6px); }
  .template-card:hover .template-card-visuals:not(.template-card-visuals-artwork-only) .template-card-artwork-layer,
  .template-card:focus-visible .template-card-visuals:not(.template-card-visuals-artwork-only) .template-card-artwork-layer {
    opacity: 1; transform: translateY(0) scale(1);
  }
  .template-card:hover .template-card-visuals:not(.template-card-visuals-artwork-only) ~ .template-mockup-label,
  .template-card:focus-visible .template-card-visuals:not(.template-card-visuals-artwork-only) ~ .template-mockup-label { opacity: 0; }
  .template-card:hover .template-card-visuals:not(.template-card-visuals-artwork-only) ~ .template-artwork-label,
  .template-card:focus-visible .template-card-visuals:not(.template-card-visuals-artwork-only) ~ .template-artwork-label { opacity: 1; }
  .template-card:hover .template-hover-action,
  .template-card:focus-visible .template-hover-action { opacity: 1; transform: translateY(0); }
}
.template-badge {
  position: absolute; top: 12px; left: 12px;
  padding: 5px 10px; background: rgba(255,255,255,.92);
  backdrop-filter: blur(6px);
  border-radius: 999px; font-size: 11px; font-weight: 500;
  letter-spacing: 0.2px;
}
.template-meta { padding: 14px 4px 4px; }
.template-name { font-size: 15px; font-weight: 500; margin-bottom: 4px; letter-spacing: -0.1px; }
.template-stats { font-size: 12px; color: var(--text-3); }
.template-empty {
  min-height: 280px; border: 1px dashed #D9D2C5; border-radius: 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; text-align: center; color: var(--text-2);
}
.template-empty[hidden] { display: none; }
.template-empty strong { color: var(--text); font-size: 18px; }
.template-empty button {
  margin-top: 10px; border: 1px solid #C9C1B3; border-radius: 999px;
  padding: 9px 16px; background: #fff; color: var(--text); cursor: pointer;
}

.section-divider { margin: 64px 0 24px; display: flex; align-items: center; justify-content: space-between; }
.section-title { font-size: 20px; font-weight: 500; letter-spacing: -0.3px; }
.section-link { border: 0; padding: 4px; background: transparent; font: inherit; font-size: 13px; color: var(--text-2); cursor: pointer; }
.section-link:hover { color: var(--text); }

.work-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 18px; }
.work-card { color: inherit; text-decoration: none; cursor: pointer; transition: transform .25s ease; }
.work-card:hover { transform: translateY(-2px); }
.work-card:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 12px; }
.work-cover {
  aspect-ratio: 1; border-radius: 12px; overflow: hidden;
  background: var(--subtle); position: relative;
}
.work-cover svg { width: 100%; height: 100%; }
.work-meta { padding: 10px 2px; display: flex; justify-content: space-between; font-size: 12px; }
.work-author { color: var(--text-2); }
.work-likes { color: var(--text-3); display: flex; gap: 4px; align-items: center; }

.about-section {
  margin-top: 72px; padding: 38px 42px; border-radius: 18px;
  background: #1F2E29; color: #F8F5ED;
  display: grid; grid-template-columns: minmax(260px, 1.2fr) minmax(280px, 1fr) auto;
  align-items: end; gap: 36px;
}
.about-kicker { display: block; margin-bottom: 12px; color: #A7BDB2; font-size: 11px; letter-spacing: .16em; }
.about-section h2 { max-width: 620px; font-size: 27px; line-height: 1.25; font-weight: 500; }
.about-section p { color: #D6DED9; font-size: 14px; line-height: 1.8; }
.about-section a { color: #fff; font-size: 13px; text-underline-offset: 4px; white-space: nowrap; }

/* ===== 模板详情页 ===== */
.template-detail {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 64px; margin-bottom: 64px; align-items: start;
}
.detail-main-img {
  aspect-ratio: 1; background: var(--subtle); border-radius: 16px;
  overflow: hidden; margin-bottom: 12px; position: relative;
}
.detail-example-overlay { top: auto; right: 16px; bottom: 16px; font-size: 11px; padding: 7px 12px; }
.detail-main-img svg { width: 100%; height: 100%; }
.detail-thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.detail-thumb {
  aspect-ratio: 1; background: var(--subtle); border-radius: 10px;
  overflow: hidden; cursor: pointer; border: 1.5px solid transparent;
  transition: border-color .15s;
}
.detail-thumb.active { border-color: var(--accent); }
.detail-thumb svg { width: 100%; height: 100%; }

/* ── 艺术家身份小标签（签约 / 热门签约） ────────────────────── */
.artist-badge {
  display: inline-flex; align-items: center; gap: 3px;
  vertical-align: middle;
  padding: 2px 7px 2px 5px; border-radius: 999px;
  font-size: 10.5px; font-weight: 500; letter-spacing: 0;
  line-height: 1; margin-left: 6px;
}
.artist-badge-icon { font-size: 10px; line-height: 1; }
.artist-badge-hot {
  background: #E13B3B;
  color: #fff;
}
.artist-badge-signed {
  background: #C81E1E;
  color: #fff;
}

/* ── 风格参考弹窗里的艺术家行 ────────────────────────────── */
.style-ref-modal-artist {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; margin: 14px 0 6px;
  background: #FBF9F4; border: 1px solid #ECE7DA; border-radius: 12px;
  cursor: pointer; transition: border-color .15s, transform .12s;
}
.style-ref-modal-artist:hover { border-color: #C9BDA2; transform: translateY(-1px); }
.style-ref-modal-artist-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: #1A1A1A; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 500; flex-shrink: 0;
}
.style-ref-modal-artist-info { flex: 1; min-width: 0; }
.style-ref-modal-artist-name {
  font-size: 13.5px; font-weight: 600; color: #1F1B14; line-height: 1.3;
  display: flex; align-items: center; flex-wrap: wrap;
}
.style-ref-modal-artist-meta {
  font-size: 11px; color: #8A7F6C; margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.style-ref-modal-artist-arrow {
  font-size: 18px; color: #B89A5E; flex-shrink: 0;
}

/* ── 艺术家条 ─────────────────────────────────────────────── */
.detail-artist {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; margin-bottom: 20px;
  background: #FBF9F4; border: 1px solid #ECE7DA; border-radius: 12px;
  cursor: pointer; transition: border-color .15s, transform .12s;
}
.detail-artist:hover { border-color: #C9BDA2; transform: translateY(-1px); }
.detail-artist-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: #1A1A1A; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 500; flex-shrink: 0;
  letter-spacing: -0.2px;
}
.detail-artist-info { flex: 1; min-width: 0; }
.detail-artist-name {
  font-size: 14px; font-weight: 600; color: #1F1B14; line-height: 1.3;
  display: flex; align-items: center; flex-wrap: wrap;
}
.detail-artist-meta {
  font-size: 11.5px; color: #8A7F6C; margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.detail-artist-arrow {
  font-size: 12px; color: #B89A5E; flex-shrink: 0;
  padding-left: 8px; white-space: nowrap;
}

/* ── 作品介绍 / 怎么用 section ──────────────────────────────── */
.detail-section { margin-top: 26px; }
.detail-section-title {
  font-size: 12px; font-weight: 600; color: #8A7F6C;
  letter-spacing: 0.12em; text-transform: uppercase;
  margin-bottom: 10px;
}
.detail-section-body {
  font-size: 14px; color: #2A241B; line-height: 1.8;
}
.detail-howto {
  margin: 0; padding-left: 0; list-style: none;
  counter-reset: howto;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px;
}
.detail-howto li {
  position: relative; min-height: 116px; padding: 42px 14px 14px;
  border: 1px solid #E7E0D3; border-radius: 13px; background: #FBF9F4;
  font-size: 14px; color: #2A241B; line-height: 1.5;
  counter-increment: howto;
}
.detail-howto li::before {
  content: counter(howto);
  position: absolute; left: 14px; top: 14px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #1A1A1A; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600;
}

/* ── 艺术家弹窗 ───────────────────────────────────────────── */
.artist-modal {
  position: fixed; inset: 0; z-index: 1100;
  background: rgba(20,18,14,0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; backdrop-filter: blur(6px);
}
.artist-modal-inner {
  position: relative;
  background: #FBF8F1; border-radius: 16px;
  max-width: 480px; width: 100%; max-height: 88vh;
  padding: 32px 28px 24px;
  overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0,0,0,0.35);
}
.artist-modal-close {
  position: absolute; top: 12px; right: 14px;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(0,0,0,0.04);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 18px; color: #555;
  transition: background .15s;
}
.artist-modal-close:hover { background: rgba(0,0,0,0.08); }
.artist-modal-header {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center;
}
.artist-modal-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: #1A1A1A; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 500;
}
.artist-modal-name {
  font-size: 19px; font-weight: 600; color: #1F1B14; margin-top: 6px;
  display: flex; align-items: center; flex-wrap: wrap; justify-content: center;
}
.artist-modal-handle {
  font-size: 12px; color: #8A7F6C;
}
.artist-modal-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; padding: 18px 0; margin: 18px 0 16px;
  border-top: 1px solid #ECE7DA; border-bottom: 1px solid #ECE7DA;
}
.artist-modal-stat { text-align: center; }
.artist-modal-stat-num {
  font-size: 16px; font-weight: 600; color: #1F1B14;
}
.artist-modal-stat-label {
  font-size: 11px; color: #A0937D; margin-top: 2px;
}
.artist-modal-bio {
  font-size: 13px; color: #4A4538; line-height: 1.75;
  text-align: justify; margin-bottom: 22px;
}
.artist-modal-section-title {
  font-size: 12px; color: #8A7F6C; letter-spacing: 0.06em;
  text-transform: uppercase; font-weight: 600; margin-bottom: 10px;
}
.artist-modal-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}
.artist-modal-card {
  cursor: pointer; border-radius: 10px; overflow: hidden;
  border: 1px solid #ECE7DA; background: #fff;
  transition: border-color .15s, transform .12s;
}
.artist-modal-card:hover { border-color: #C9BDA2; transform: translateY(-2px); }
.artist-modal-card-img {
  width: 100%; aspect-ratio: 1; object-fit: cover; display: block;
  background: #ECE8DD;
}
.artist-modal-card-name {
  padding: 8px 10px; font-size: 12px; color: #2A241B;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.detail-tags { display: flex; gap: 6px; margin-bottom: 14px; }
.detail-tag {
  padding: 4px 10px; background: var(--subtle); border-radius: 999px;
  font-size: 11px; color: var(--text-2);
}
.detail-title { font-size: 28px; font-weight: 500; letter-spacing: -0.5px; margin-bottom: 10px; line-height: 1.25; }
.detail-desc { font-size: 14px; color: var(--text-2); line-height: 1.7; margin-bottom: 24px; }

.detail-stats {
  display: flex; gap: 32px; padding: 20px 0;
  border-top: 0.5px solid var(--line);
  border-bottom: 0.5px solid var(--line);
  margin-bottom: 24px;
}
.stat-num { font-size: 20px; font-weight: 500; letter-spacing: -0.3px; }
.stat-label { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.input-hint {
  background: var(--subtle); border-radius: 12px; padding: 16px 18px;
  margin-bottom: 24px;
}
.input-hint-label { font-size: 12px; color: var(--text-3); margin-bottom: 6px; }
.input-hint-content { font-size: 14px; display: flex; align-items: center; gap: 8px; }

.btn-primary {
  background: var(--accent); color: white; padding: 14px 22px;
  border-radius: 10px; text-align: center; font-size: 14px;
  font-weight: 500; cursor: pointer; transition: all .15s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  border: none; width: 100%;
  letter-spacing: 0.2px;
}
.btn-primary:hover { background: #000; }
.btn-primary:active { transform: scale(0.985); }

.btn-secondary {
  background: transparent; color: var(--text); padding: 13px 22px;
  border-radius: 10px; text-align: center; font-size: 13px;
  cursor: pointer; border: 0.5px solid var(--line-strong);
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: background .15s;
}
.btn-secondary:hover { background: var(--subtle); }

.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }

.creations-section { margin-bottom: 48px; }
.creations-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px;
}
.creations-hint { font-size: 13px; color: var(--text-3); margin-bottom: 18px; }

.reviews { background: var(--surface); border-radius: 16px; padding: 28px; border: 0.5px solid var(--line); }
.review-card {
  padding: 16px 0;
  border-bottom: 0.5px solid var(--line);
}
.review-card:last-child { border-bottom: none; padding-bottom: 0; }
.review-card:first-child { padding-top: 0; }
.review-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
  font-size: 13px;
}
.review-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--subtle); display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 500;
}
.review-name { font-weight: 500; }
.review-stars { color: #D4A015; font-size: 12px; }
.review-time { color: var(--text-3); font-size: 12px; }
.review-text { font-size: 14px; color: var(--text-2); line-height: 1.65; }
.review-empty {
  padding: 24px; border: 1px dashed #D8D1C3; border-radius: 14px; background: #FBFAF7;
  display: flex; flex-direction: column; gap: 6px;
}
.review-empty strong { font-size: 14px; }
.review-empty span { font-size: 12px; line-height: 1.65; color: var(--text-2); }

/* ============================================================
   创作页 · 对话流形态 (refined)
   ============================================================ */
.page-chat {
  --floating-chat-left: 32px;
  --floating-chat-width: 380px;
  --floating-chat-gap: 18px;
  --canvas-right-edge: 32px;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  /* 补偿 body zoom：布局高度 = 视觉高度 / zoom */
  height: calc((100vh - 68px * var(--zoom)) / var(--zoom));
  flex-direction: column;
  overflow: hidden;
}
.page-chat.active { display: flex !important; }

/* 双栏布局 */
.chat-layout {
  display: block; position: relative;
  flex: 1;
  min-height: 0;
}

/* 左侧对话栏 */
.chat-panel {
  position: absolute; z-index: 48;
  left: var(--floating-chat-left); top: 20px; bottom: 24px;
  width: var(--floating-chat-width);
  background: #FCFBF8; border-radius: 16px;
  display: flex; flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(221,216,205,.72);
  box-shadow: 0 10px 30px rgba(49,43,34,.035);
}

/* ── chat-panel 顶部 header（模板缩略图 + 模板名 + 折叠） ───── */
.chat-panel-header {
  display: flex; align-items: center; gap: 10px;
  min-height: 62px; padding: 10px 12px;
  border-bottom: 1px solid rgba(228,223,212,.82);
  background: rgba(255,255,255,.62);
  flex-shrink: 0;
}
.chat-collapse-btn {
  width: 34px; height: 34px; flex: 0 0 34px; padding: 0; border: 0; border-radius: 10px;
  display: grid; place-items: center; background: #F3F1EB; color: var(--text-2); cursor: pointer;
  transition: background .15s ease, color .15s ease, transform .2s ease;
}
.chat-collapse-btn:hover { background: #E9E5DC; color: var(--text); }
body.chat-panel-collapsed .page-chat { --floating-chat-width: 64px; }
body.chat-panel-collapsed .chat-panel-header { height: 100%; padding: 12px; flex-direction: column; border: 0; }
body.chat-panel-collapsed .chat-panel-tmpl,
body.chat-panel-collapsed .chat-stream,
body.chat-panel-collapsed .chat-input-area { display: none !important; }
body.chat-panel-collapsed .chat-collapse-btn { margin-top: auto; transform: rotate(180deg); }
.chat-panel-tmpl {
  display: flex; align-items: center; gap: 10px;
  flex: 1; min-width: 0;
  cursor: pointer; padding: 4px 8px 4px 4px; border-radius: 10px;
  transition: background .15s;
}
.chat-panel-tmpl:hover { background: rgba(0,0,0,0.04); }
.chat-panel-thumb {
  width: 36px; height: 36px; border-radius: 7px; object-fit: cover;
  border: 1.5px solid #E0DACC; flex-shrink: 0; display: block;
}
.chat-panel-tmpl-text { min-width: 0; flex: 1; }
.chat-panel-title {
  font-size: 14px; font-weight: 500; letter-spacing: -0.1px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chat-panel-sub {
  font-size: 11.5px; color: var(--text-3); margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── 对话流顶部的"淘宝链接卡片"式风格参考 ─────────────────────── */
.chat-ref-card {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px;
  background: #FCFAF5;
  border: 1px solid #E8E1D0;
  border-radius: 14px;
  cursor: pointer;
  transition: border-color .15s, transform .12s, box-shadow .15s;
}
.chat-ref-card:hover {
  border-color: #C9BDA2;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(140,120,80,0.08);
}
.chat-ref-card-thumb {
  width: 64px; height: 64px; border-radius: 10px; object-fit: cover;
  flex-shrink: 0; border: 1px solid #E0DACC;
}
.chat-ref-card-info {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 3px;
}
.chat-ref-card-tag {
  font-size: 10px; color: #B89A5E; letter-spacing: .08em;
  text-transform: uppercase; font-weight: 600;
}
.chat-ref-card-title {
  font-size: 14px; color: #2A241B; font-weight: 600; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chat-ref-card-caption {
  font-size: 12px; color: #8A7F6C; line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chat-ref-card-arrow {
  font-size: 12px; color: #B89A5E; flex-shrink: 0;
  white-space: nowrap; padding-left: 8px;
}

/* ── 风格参考详情弹窗 ───────────────────────────────────────── */
.style-ref-modal {
  position: fixed; inset: 0; z-index: 1100;
  background: rgba(20,18,14,0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; backdrop-filter: blur(6px);
}
.style-ref-modal-inner {
  position: relative;
  background: #FBF8F1;
  border-radius: 16px;
  max-width: 880px; width: 100%; max-height: 88vh;
  display: grid; grid-template-columns: 1.1fr 1fr;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,0.35);
}
.style-ref-modal-close {
  position: absolute; top: 12px; right: 14px; z-index: 2;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,0.9);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 18px; color: #333;
  transition: background .15s;
}
.style-ref-modal-close:hover { background: #fff; }
.style-ref-modal-imgwrap {
  background: #E8E2D2;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.style-ref-modal-img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.style-ref-modal-body {
  padding: 32px 28px;
  display: flex; flex-direction: column; gap: 14px;
  overflow-y: auto;
}
.style-ref-modal-tag {
  font-size: 11px; color: #B89A5E; letter-spacing: .1em;
  text-transform: uppercase; font-weight: 600;
}
.style-ref-modal-title {
  font-size: 22px; font-weight: 600; color: #1F1B14;
  line-height: 1.3;
}
.style-ref-modal-desc {
  font-size: 13px; color: #5A5448; line-height: 1.7;
}
.style-ref-modal-meta {
  margin-top: 6px;
  border-top: 1px solid #E8E1D0; padding-top: 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.style-ref-modal-meta-item {
  display: flex; gap: 12px; font-size: 12px;
}
.style-ref-modal-meta-key {
  color: #A0937D; min-width: 56px;
}
.style-ref-modal-meta-val {
  color: #2A241B; flex: 1;
}
@media (max-width: 700px) {
  .style-ref-modal-inner { grid-template-columns: 1fr; max-height: 92vh; }
  .style-ref-modal-imgwrap { aspect-ratio: 4 / 3; }
}

.chat-stream {
  flex: 1; overflow-y: auto;
  padding: 20px 18px 18px;
  display: flex; flex-direction: column; gap: 15px;
  scroll-behavior: smooth;
}
.chat-stream::-webkit-scrollbar { width: 6px; }
.chat-stream::-webkit-scrollbar-thumb { background: #D5D0C2; border-radius: 3px; }
.chat-stream::-webkit-scrollbar-track { background: transparent; }

.msg { display: flex; gap: 9px; max-width: 100%; }
.msg-ai { align-self: flex-start; }
.msg-user { align-self: flex-end; flex-direction: row-reverse; }

.msg-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 500; flex-shrink: 0;
  letter-spacing: 0.3px;
}
.msg-ai .msg-avatar { background: var(--accent); color: white; }
.msg-user .msg-avatar { background: var(--subtle); color: var(--text); }

.msg-bubble {
  max-width: min(292px, calc(100% - 38px));
  padding: 11px 14px;
  border-radius: 15px;
  font-size: 13.5px; line-height: 1.58;
}
.msg-ai .msg-bubble { background: #F0EEE8; color: var(--text); border-bottom-left-radius: 6px; }
.msg-user .msg-bubble { background: var(--accent); color: white; border-bottom-right-radius: 6px; }

.msg-bubble.has-image { padding: 6px; max-width: 240px; }
.msg-image {
  width: 220px; aspect-ratio: 1; border-radius: 12px; overflow: hidden;
  background: var(--subtle);
}
.msg-image svg, .msg-image img { width: 100%; height: 100%; display: block; object-fit: cover; }
.msg-caption { font-size: 12px; padding: 8px 6px 4px; opacity: 0.75; }
.msg-bubble.has-image.image-reference {
  display: flex; align-items: center; gap: 10px;
  width: auto; max-width: 280px; padding: 6px 12px 6px 6px;
}
.msg-bubble.image-reference .msg-image {
  width: 48px; height: 48px; aspect-ratio: auto; flex: 0 0 auto;
  border-radius: 10px;
}
.msg-bubble.image-reference .msg-caption {
  padding: 0; line-height: 1.45;
}

.msg-bubble.generated {
  background: var(--bg);
  padding: 8px;
}
.msg-actions {
  display: flex; gap: 6px; padding: 8px 4px 2px;
  font-size: 12px; color: var(--text-2);
}
.msg-action {
  cursor: pointer; padding: 5px 10px; border-radius: 8px;
  background: var(--surface);
  display: flex; align-items: center; gap: 4px;
  transition: all .15s;
}
.msg-action:hover { background: white; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.msg-action.primary { background: var(--accent); color: white; }
.msg-action.primary:hover { background: #000; box-shadow: none; }

.msg-typing { display: flex; gap: 5px; padding: 6px 2px; }
.msg-typing span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--text-3);
  animation: typing 1.2s infinite;
}
.msg-typing span:nth-child(2) { animation-delay: .15s; }
.msg-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes typing {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

/* 输入区 */
.chat-input-area {
  padding: 12px 16px 14px;
  background: linear-gradient(180deg, rgba(252,251,248,.74), #FCFBF8 24%);
  border-top: 1px solid rgba(228,223,212,.72);
}
.chat-ai-reference {
  display: flex; align-items: center;
  margin-bottom: 10px;
}
.chat-ai-reference:empty { display: none; }
.ai-image-ref-thumb {
  width: 48px; height: 48px; border-radius: 10px;
  overflow: hidden; position: relative; flex: 0 0 auto;
  background: var(--subtle);
  border: 2px solid #8B5CF6;
  box-shadow: 0 2px 8px rgba(139,92,246,.2);
}
.ai-image-ref-thumb img {
  width: 100%; height: 100%; display: block; object-fit: cover;
}
.ai-image-ref-remove {
  position: absolute; top: 2px; right: 2px;
  width: 15px; height: 15px; border: 0; border-radius: 50%;
  padding: 0; background: rgba(0,0,0,.72); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font: 11px/1 Arial, sans-serif; cursor: pointer;
}
.chat-attachments {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.chat-attachments:empty { display: none; }
.chat-attachment {
  width: 56px; height: 56px; border-radius: 10px;
  overflow: hidden; position: relative;
  background: var(--subtle);
}
.chat-attachment svg, .chat-attachment img { width: 100%; height: 100%; object-fit: cover; }
.chat-attachment-x {
  position: absolute; top: 3px; right: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: rgba(0,0,0,0.7); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; cursor: pointer;
}

.chat-input-row {
  display: flex; align-items: center; gap: 8px;
  min-height: 58px; background: #F4F2EC; border-radius: 16px;
  padding: 8px 8px 8px 10px;
  border: 1px solid #E4E0D6;
  transition: all .15s;
}
.chat-input-row:focus-within {
  border-color: #AFA79A;
  background: #FAF9F5;
  box-shadow: 0 0 0 3px rgba(92,84,70,.06);
}
.chat-input-tools { display: flex; gap: 4px; padding: 0; }
.chat-tool-btn {
  width: 36px; height: 36px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-2);
  transition: all .15s;
}
.chat-tool-btn:hover { background: rgba(0,0,0,0.06); color: var(--text); }

.chat-input {
  flex: 1; border: none; background: transparent;
  font-family: inherit; font-size: 14px; color: var(--text);
  resize: none; outline: none; line-height: 1.55;
  min-height: 38px; padding: 8px 0;
  max-height: 140px;
}
.chat-input::placeholder { color: var(--text-3); }
.chat-send {
  width: 40px; height: 40px; border-radius: 50%;
  padding: 0; border: 0; font: inherit;
  background: var(--accent); color: white;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  transition: all .15s;
}
.chat-send:hover { background: #000; }
.chat-send.disabled { background: #D5D0C2; cursor: not-allowed; }
.chat-send.awaiting-next-step,
#mobile-image-ai-submit.awaiting-next-step {
  animation: next-step-pulse 1.45s ease-in-out infinite;
}
@keyframes next-step-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(20,111,87,.34), 0 4px 12px rgba(20,111,87,.14); transform: scale(1); }
  50% { box-shadow: 0 0 0 9px rgba(20,111,87,0), 0 7px 20px rgba(20,111,87,.22); transform: scale(1.055); }
}

.chat-hint {
  display: flex; gap: 7px; flex-wrap: nowrap; margin-top: 10px;
  overflow-x: auto; padding: 1px 0 2px; scrollbar-width: none;
}
.chat-hint::-webkit-scrollbar { display: none; }
.hint-pill {
  flex: 0 0 auto; padding: 7px 11px; background: rgba(255,255,255,.7);
  border: 1px solid #E4E0D7;
  border-radius: 999px; font-size: 11.5px;
  color: var(--text-2); cursor: pointer;
  transition: all .15s;
}
.hint-pill:hover { background: var(--bg); color: var(--text); border-color: var(--line-strong); }

/* 右侧画布栏 */
.canvas-panel {
  position: absolute; inset: 0; z-index: 0;
  background: #F7F6F2; border-radius: 0;
  display: block;
  overflow: hidden;
  min-width: 0;
}

.canvas-panel-header {
  position: absolute; inset: 20px 0 auto 0; z-index: 32;
  height: 40px; min-height: 40px;
  padding: 0 var(--canvas-right-edge) 0 calc(var(--floating-chat-left) + var(--floating-chat-width) + var(--floating-chat-gap) + 12px);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; color: var(--text-3);
  border: 0; background: transparent;
  gap: 12px;
}
.canvas-panel-header-left {
  display: flex; align-items: center; gap: 12px; min-width: 0;
}
.canvas-panel-header-right {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0; position: relative;
  padding-left: 18px;
}
.canvas-panel-header-right::before {
  content: ''; position: absolute; left: -14px; top: -6px; bottom: -6px; width: 34px;
  background: linear-gradient(90deg, rgba(247,246,242,0), rgba(247,246,242,.94) 76%); pointer-events: none;
}
.canvas-panel-header button {
  height: 40px; min-height: 40px; padding: 0 14px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  box-sizing: border-box; font-family: inherit; font-size: 13px; line-height: 1;
}
.canvas-panel-link {
  border: 1px solid rgba(208,203,193,.86); background: rgba(255,255,255,.88);
  font: inherit; font-size: 13px; color: var(--text-2); cursor: pointer; transition: all .15s;
  white-space: nowrap;
}
.canvas-panel-link:hover { color: var(--text); border-color: var(--line-strong); background: #FBFAF7; }
.canvas-panel-header-right .canvas-preview-btn,
.canvas-panel-header-right .canvas-panel-link { width: 96px; }
.canvas-panel-finish {
  width: auto !important;
  height: 40px !important;
  min-height: 40px !important;
  padding: 0 20px !important;
  font-size: 13px !important;
  margin: 0 !important;
  color: #fff !important;
  background: #20A86B !important;
  border-color: #20A86B !important;
  box-shadow: 0 0 0 1px rgba(32,168,107,.16), 0 0 16px rgba(32,168,107,.48);
  animation: finish-green-glow 2s ease-in-out infinite;
}

.canvas-workspace {
  position: absolute; inset: 0; min-height: 0;
  display: flex; overflow: hidden;
  background: transparent;
}

/* ── Printful 商品竖栏 ───────────────────────────────────── */
.product-rail {
  width: 320px; min-height: 0;
  display: none; flex-direction: column;
  background: #FBFAF6;
  border: 1px solid #DED8CC;
}
.desktop-product-picker-trigger {
  min-height: 34px; padding: 0 11px; border: 1px solid #DED8CC; border-radius: 9px;
  display: inline-flex; align-items: center; gap: 7px; background: #fff; color: var(--text);
  font-family: inherit; font-size: 11px; font-weight: 600; line-height: 1; cursor: pointer; white-space: nowrap;
}
.desktop-product-picker-trigger:hover { background: #F5F3EE; border-color: #B9B0A1; }
body:not(.mobile-flow).mobile-product-picker-open .product-rail {
  display: flex; position: absolute; z-index: 54; top: 70px;
  left: calc(var(--floating-chat-left) + var(--floating-chat-width) + var(--floating-chat-gap) + 12px);
  width: min(360px, calc(100% - 24px)); height: min(620px, calc(100% - 82px));
  border-radius: 16px; overflow: hidden; box-shadow: 0 18px 54px rgba(24,21,16,.22);
}
body:not(.mobile-flow).mobile-product-picker-open .mobile-product-picker-backdrop {
  display: block; position: absolute; inset: 0; z-index: 40; border: 0; background: rgba(20,19,17,.18);
}
body:not(.mobile-flow).mobile-product-picker-open .mobile-product-picker-close {
  width: 36px; height: 36px; border: 0; border-radius: 50%; background: #EFECE5;
  display: grid; place-items: center; color: var(--text); font: 20px/1 sans-serif; cursor: pointer;
}
body:not(.mobile-flow).mobile-product-picker-open .product-list { max-height: 45%; }
.product-rail-head {
  padding: 16px 14px 12px;
  display: flex; align-items: flex-start; justify-content: space-between;
  flex: none;
}
.product-rail-head-actions { display: flex; align-items: center; gap: 10px; }
.mobile-product-picker-close { display: none; }
.product-rail-title { font-size: 13px; font-weight: 600; color: var(--text); }
.product-rail-sub { font-size: 10px; color: var(--text-3); margin-top: 2px; }
.product-api-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #CEC7B8; margin-top: 5px;
  box-shadow: 0 0 0 3px rgba(206,199,184,.2);
}
.product-api-dot.online { background: #39A875; box-shadow: 0 0 0 3px rgba(57,168,117,.15); }
.product-list {
  padding: 0 10px 12px;
  display: flex; flex-direction: column; gap: 7px;
  max-height: 43%; overflow-y: auto; flex: none;
}
.product-list::-webkit-scrollbar, .product-config::-webkit-scrollbar { width: 4px; }
.product-list::-webkit-scrollbar-thumb, .product-config::-webkit-scrollbar-thumb {
  background: #D5D0C2; border-radius: 3px;
}
.product-list-loading {
  padding: 18px 6px; min-height: 52px;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  font-size: 11px; line-height: 1.5; color: var(--text-3); text-align: center;
}
.mini-spinner {
  width: 12px; height: 12px; border: 1.5px solid #D8D1C3;
  border-top-color: #575044; border-radius: 50%; animation: spin .8s linear infinite;
}
.product-list-error {
  padding: 14px 10px; border-radius: 10px; background: #FFF1EE;
  display: flex; flex-direction: column; gap: 5px;
  color: #9B3E32; font-size: 10px; line-height: 1.45;
}
.product-list-error strong { font-size: 11px; }
.product-list-error button {
  align-self: flex-start; border: 0; background: transparent; color: #9B3E32;
  font: inherit; text-decoration: underline; cursor: pointer; padding: 3px 0 0;
}
.product-card {
  width: 100%; border: 1px solid transparent; border-radius: 11px;
  padding: 6px; background: transparent; color: inherit; font-family: inherit;
  display: flex; align-items: center; gap: 9px; text-align: left;
  cursor: pointer; position: relative; transition: .15s ease;
}
.product-card:hover { background: #F1EEE6; }
.product-card.active { background: #fff; border-color: #DCD5C7; box-shadow: 0 2px 8px rgba(45,35,20,.06); }
.product-card-thumb {
  width: 50px; height: 50px; border-radius: 8px; overflow: hidden;
  background: #EEEAE1; display: flex; align-items: center; justify-content: center;
  flex: none;
}
.product-card-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.product-card-placeholder { color: #A99E8B; font-size: 18px; }
.product-card-copy { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.product-card-copy strong {
  font-size: 11.5px; font-weight: 550; line-height: 1.3;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.product-card-copy small { font-size: 9.5px; color: var(--text-3); margin-top: 3px; }
.product-card-check {
  position: absolute; right: 5px; top: 5px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #171717; color: #fff; font-size: 9px;
  align-items: center; justify-content: center; display: none;
}
.product-card.active .product-card-check { display: flex; }
.product-config {
  flex: 1; min-height: 0; overflow-y: auto;
  border-top: 1px solid #ECE7DA; padding: 14px;
}
.product-config-empty { font-size: 10.5px; color: var(--text-3); line-height: 1.6; }
.product-config-title { font-size: 13px; font-weight: 600; line-height: 1.35; }
.product-config-caption {
  font-size: 9.5px; color: var(--text-3); line-height: 1.4; margin: 3px 0 13px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.product-config-group { margin-bottom: 13px; }
.product-config-label { font-size: 9.5px; color: var(--text-3); margin-bottom: 6px; }
.product-config-value { font-size: 9.5px; color: var(--text-2); margin-top: 5px; }
.product-color-list, .product-option-list { display: flex; gap: 5px; flex-wrap: wrap; }
.product-color {
  width: 22px; height: 22px; padding: 3px; border-radius: 50%;
  border: 1px solid transparent; background: transparent; cursor: pointer;
}
.product-color i { width: 100%; height: 100%; border-radius: 50%; display: block; border: 1px solid rgba(0,0,0,.12); }
.product-color.active { border-color: #151515; }
.product-option {
  min-width: 30px; height: 25px; border-radius: 7px; padding: 0 8px;
  border: 1px solid #DED8CD; background: #fff; color: var(--text-2);
  font-family: inherit; font-size: 9.5px; cursor: pointer;
}
.product-option:hover { border-color: #999083; color: var(--text); }
.product-option.active { background: #171717; border-color: #171717; color: #fff; }
.product-option.disabled { opacity: .3; cursor: not-allowed; }
.product-print-spec {
  padding: 10px; border-radius: 9px; background: #F0EDE5;
  display: flex; flex-direction: column; gap: 2px; margin-top: 4px;
}
.product-print-spec span, .product-print-spec small { font-size: 9px; color: var(--text-3); }
.product-print-spec strong { font-size: 11px; font-weight: 600; }
.product-config-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 7px;
  margin-top: 12px;
}
.product-cost { display: flex; flex-direction: column; }
.product-cost strong { font-size: 14px; font-weight: 600; }
.product-cost span { font-size: 8.5px; color: var(--text-3); }
.product-mockup-btn {
  border: 0; border-radius: 8px; background: #171717; color: #fff;
  padding: 8px 9px; font-family: inherit; font-size: 10px; cursor: pointer; white-space: nowrap;
}
.product-mockup-btn:hover { background: #000; }
.product-mockup-btn:disabled { opacity: .4; cursor: default; }
.product-stock-warning { margin-top: 8px; font-size: 9px; color: #C34A3C; }

.canvas-stage {
  flex: 1; min-width: 0;
  position: relative;
  overflow: hidden;
  background-color: #F7F6F2;
  background-image: radial-gradient(circle, rgba(118, 111, 98, .28) 1.1px, transparent 1.2px);
  background-size: 20px 20px;
  background-position: 0 0;
}

/* Fabric 的 canvas-container 填满 stage */
.canvas-stage .canvas-container {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  z-index: 2;
}

/* 空状态：绝对居中，有图时隐藏 */
.canvas-empty {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  text-align: center; color: var(--text-3);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  max-width: 280px;
  pointer-events: none;
}
.canvas-empty-icon { color: #C9C3B2; }
.canvas-empty-text { font-size: 15px; color: var(--text-2); font-weight: 500; letter-spacing: -0.1px; }
.canvas-empty-hint { font-size: 13px; line-height: 1.6; }
.canvas-stage.has-image .canvas-empty { display: none; }
.canvas-stage.has-image #canvas-zoom-tools { display: flex !important; }

/* ── 右侧创作工具条 ──────────────────────────────────────── */
.canvas-tools {
  position: absolute; right: var(--canvas-right-edge); top: 70px; z-index: 10;
  display: flex; flex-direction: column; gap: 2px;
  background: var(--surface); border-radius: 10px;
  border: 0.5px solid var(--line);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  padding: 4px;
}
.canvas-tool {
  width: 36px; height: 36px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2); cursor: pointer;
  transition: all .12s;
}
.canvas-tool:hover { background: var(--subtle); color: var(--text); }
.canvas-tool-sep {
  height: 1px; background: var(--line); margin: 3px 6px;
}

/* ── 浮动操作栏（选中对象上方） ──────────────────────────── */
.canvas-float-toolbar {
  position: absolute; z-index: 20;
  display: flex; gap: 1px;
  background: #1A1A1A; border-radius: 8px;
  padding: 4px;
  box-shadow: 0 4px 14px rgba(0,0,0,.2);
  transform: translateX(-50%);
  pointer-events: auto;
}
.canvas-float-toolbar::after {
  content: ''; position: absolute;
  left: 50%; bottom: -5px; transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid #1A1A1A;
}
.float-btn {
  min-width: 30px; height: 28px; border-radius: 5px;
  padding: 0 6px;
  display: flex; align-items: center; justify-content: center; gap: 4px;
  color: rgba(255,255,255,.85); cursor: pointer;
  transition: background .12s;
}
.float-btn:hover { background: rgba(255,255,255,.15); color: #fff; }
.float-btn-delete:hover { background: #E13B3B; color: #fff; }
.float-btn-ai {
  background: linear-gradient(135deg, #8B5CF6, #EC4899);
  color: #fff;
}
.float-btn-ai:hover { background: linear-gradient(135deg, #9D6FF7, #F365A8); color: #fff; }
.float-btn-ai-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.05em;
}
.float-btn-tool {
  background: linear-gradient(135deg, #0F766E, #14B8A6);
  color: #fff;
}
.float-btn-tool:hover { background: linear-gradient(135deg, #0D9488, #2DD4BF); color: #fff; }
.float-btn-tool-label { font-size: 11px; font-weight: 600; white-space: nowrap; }
.float-btn-sep {
  width: 1px; height: 18px; background: rgba(255,255,255,.18); margin: 0 2px;
  align-self: center;
}

/* ── 后台模板的消费侧变体与锁定编辑 ─────────────────────── */
.detail-layout-variants { margin-top: 22px; }
.layout-variant-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.layout-variant-card {
  border: 1px solid var(--line); border-radius: 11px; padding: 7px;
  background: #fff; cursor: pointer; text-align: left; transition: .15s ease;
}
.layout-variant-card:hover { border-color: #8C8170; transform: translateY(-1px); }
.layout-variant-card.active { border-color: #171717; box-shadow: 0 0 0 1px #171717; }
.layout-variant-name { display: block; font-size: 11px; margin-top: 6px; color: var(--text-2); }
.layout-preview { position: relative; width: 100%; aspect-ratio: 5 / 6; overflow: hidden; border-radius: 7px; container-type: inline-size; }
.layout-preview.large { height: 100%; width: 100%; aspect-ratio: auto; border-radius: 0; }
.layout-preview-photo {
  position: absolute; display: block;
  background: linear-gradient(135deg, rgba(255,255,255,.72), rgba(50,50,50,.18));
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.10);
}
.layout-preview-ref { object-fit: contain; }
.layout-preview-text { position: absolute; display: block; border-radius: 10px; opacity: .82; min-height: 2px; }
.layout-preview-copy {
  position: absolute; display: block; white-space: normal; letter-spacing: -.02em;
  z-index: 2; pointer-events: none;
}
.creation-layout-controls {
  display: flex; align-items: center; gap: 8px; min-height: 54px;
  padding: 8px 14px; border-bottom: 1px solid var(--line); background: #FBFAF7;
  position: absolute; z-index: 31; left: 0; right: 0; top: 58px;
}
.creation-layout-controls::after {
  content: ''; position: sticky; right: -14px; width: 28px; height: 38px; flex: 0 0 28px;
  margin-left: -28px; background: linear-gradient(90deg, transparent, #FBFAF7 82%); pointer-events: none;
}
.creation-layout-variants { display: flex; gap: 6px; }
.creation-layout-variant {
  border: 1px solid var(--line); background: #fff; border-radius: 8px;
  padding: 6px 9px; font-size: 11px; cursor: pointer; color: var(--text-2);
}
.creation-layout-variant.active { border-color: #171717; background: #171717; color: #fff; }
.layout-upload-btn {
  border: 1px solid #171717; background: #fff; color: #171717; border-radius: 8px;
  padding: 7px 10px; font-size: 11px; cursor: pointer; white-space: nowrap;
}
.creation-layout-texts { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; }
.layout-text-input {
  min-width: 90px; max-width: 180px; flex: 1; height: 30px; border: 1px solid var(--line);
  border-radius: 7px; background: #fff; padding: 0 8px; font: inherit; font-size: 11px;
}
.layout-lock-hint { font-size: 10px; color: var(--text-3); white-space: nowrap; }
body.locked-layout-mode #canvas-tools { display: none !important; }
body.locked-layout-mode .float-layout-hidden { display: none !important; }
body.image-only-ai-template .float-btn-sep { display: none !important; }
/* Product-ready compositions lock copy and placement, not the artwork's AI
   workflow. Only templates explicitly marked image-only keep the input for
   image generation / retouching; generic automatic layouts retain old UI. */
body.auto-layout-template:not(.image-only-ai-template) .chat-input-area,
body.auto-layout-template .chat-hint { display: none; }
@media (max-width: 900px) {
  .creation-layout-controls { align-items: flex-start; flex-wrap: wrap; }
  .creation-layout-texts { flex-basis: 100%; order: 4; }
  .layout-lock-hint { margin-left: auto; }
}

/* ── 图片小工具入口与悬浮处理器 ─────────────────────────── */
.chat-image-tool-reference { margin-bottom: 10px; }
.chat-image-tool-reference:empty { display: none; }
.chat-image-tool-card {
  width: 100%; border: 1px solid #B8E2DC; border-radius: 12px;
  background: linear-gradient(135deg, #F3FBF9, #ECF8F6);
  padding: 9px 10px; display: flex; align-items: center; gap: 10px;
  cursor: pointer; color: var(--text); text-align: left;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.chat-image-tool-card:hover {
  border-color: #5CC8BB; box-shadow: 0 4px 12px rgba(15,118,110,.10);
  transform: translateY(-1px);
}
.chat-image-tool-thumb {
  width: 42px; height: 42px; border-radius: 9px; object-fit: cover;
  flex: 0 0 auto; border: 1px solid rgba(15,118,110,.18);
}
.chat-image-tool-info { min-width: 0; flex: 1; }
.chat-image-tool-title { display: block; font-size: 12px; font-weight: 600; margin-bottom: 2px; }
.chat-image-tool-meta { display: block; font-size: 11px; color: #52736F; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-image-tool-open { font-size: 16px; color: #0F766E; }

.image-tool-modal {
  position: fixed; inset: 0; z-index: 1200;
  background: rgba(16,18,17,.42); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.image-tool-dialog {
  width: min(880px, 94vw); height: min(720px, 92vh);
  background: #fff; border-radius: 18px; overflow: hidden;
  box-shadow: 0 24px 70px rgba(0,0,0,.24); display: flex; flex-direction: column;
}
.image-tool-header {
  display: flex; align-items: center; padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.image-tool-title { font-size: 18px; font-weight: 650; }
.image-tool-subtitle { margin-top: 3px; font-size: 12px; color: var(--text-3); }
.image-tool-close {
  margin-left: auto; width: 32px; height: 32px; border: 0; border-radius: 50%;
  background: var(--subtle); color: var(--text-2); cursor: pointer; font-size: 20px;
}
.image-tool-layout { display: grid; grid-template-columns: 210px 1fr; min-height: 0; flex: 1; overflow: hidden; }
.image-tool-modal.single-tool .image-tool-layout { grid-template-columns: 1fr; }
.image-tool-modal.single-tool .image-tool-list { display: none; }
.image-tool-list { padding: 14px; border-right: 1px solid var(--line); background: #FBFAF7; overflow-y: auto; }
.image-tool-list-item {
  width: 100%; display: flex; gap: 10px; align-items: center; padding: 10px;
  border: 1px solid transparent; border-radius: 10px; background: transparent;
  cursor: pointer; text-align: left; color: var(--text);
}
.image-tool-list-item:hover { background: #F0F7F5; }
.image-tool-list-item.active { background: #E7F5F2; border-color: #A9DCD5; }
.image-tool-list-icon {
  width: 32px; height: 32px; border-radius: 8px; background: #D8F1ED;
  color: #0F766E; display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.image-tool-list-name { display: block; font-size: 13px; font-weight: 600; }
.image-tool-list-desc { display: block; font-size: 10px; color: var(--text-3); margin-top: 2px; line-height: 1.35; }
.image-tool-workspace { padding: 20px; overflow-y: auto; background: #fff; }
.image-tool-preview-wrap {
  height: 280px; border-radius: 14px; background-color: #F0EFEA;
  background-image: linear-gradient(45deg,#E4E2DC 25%,transparent 25%),linear-gradient(-45deg,#E4E2DC 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#E4E2DC 75%),linear-gradient(-45deg,transparent 75%,#E4E2DC 75%);
  background-size: 20px 20px; background-position: 0 0,0 10px,10px -10px,-10px 0;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.image-tool-preview { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.image-tool-controls { margin-top: 18px; }
.image-tool-control { display: grid; grid-template-columns: 74px 1fr 44px; gap: 10px; align-items: center; margin-bottom: 13px; }
.image-tool-control label { font-size: 12px; color: var(--text-2); }
.image-tool-control input[type="range"] { width: 100%; accent-color: #0F766E; }
.image-tool-control output { font-size: 11px; color: var(--text-3); text-align: right; font-variant-numeric: tabular-nums; }
.image-tool-footer {
  display: flex; align-items: center; gap: 8px; padding: 14px 20px;
  border-top: 1px solid var(--line); background: #FBFAF7;
}
.image-tool-footer-spacer { flex: 1; }
.image-tool-btn {
  height: 36px; padding: 0 16px; border-radius: 9px; border: 1px solid var(--line);
  font: inherit; font-size: 12px; cursor: pointer;
}
.image-tool-btn.secondary { background: #fff; color: var(--text-2); }
.image-tool-btn.primary { border-color: #0F766E; background: #0F766E; color: #fff; }
.image-tool-btn.primary:disabled { opacity: .55; cursor: wait; }
.image-tool-modal.awaiting-upload .image-tool-footer > .image-tool-btn:first-child,
.image-tool-modal.awaiting-upload #image-tool-apply { display: none; }
.image-tool-upload-state {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 18px 14px 4px; text-align: center;
}
.image-tool-upload-state strong { font-size: 15px; color: var(--text-1); }
.image-tool-upload-state span { max-width: 360px; font-size: 12px; line-height: 1.55; color: var(--text-3); }
.image-tool-upload-state button {
  min-width: 150px; min-height: 46px; margin-top: 8px; padding: 0 22px;
  border: 0; border-radius: 23px; background: #0F766E; color: #fff;
  font-size: 14px; font-weight: 650; cursor: pointer;
  box-shadow: 0 8px 24px rgba(15,118,110,.22);
}
.image-tool-upload-state button:hover { background: #0B655E; }
.camera-tool-preview-wrap { background-color: #D9DAD6; }
.camera-tool-preview-canvas {
  display: block; width: auto; height: 100%; max-width: 100%;
  aspect-ratio: 10 / 7; object-fit: contain; touch-action: none; cursor: grab;
}
.camera-tool-preview-canvas.dragging { cursor: grabbing; }
.camera-tool-hint {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
  padding: 11px 13px; border-radius: 11px; background: #EDF8F5; color: #245A51;
}
.camera-tool-hint strong { flex: 0 0 auto; font-size: 12px; }
.camera-tool-hint span { font-size: 11px; line-height: 1.45; color: #52736D; }
.camera-tool-tone-row { display: grid; grid-template-columns: 74px 1fr; gap: 10px; align-items: center; margin-top: 5px; }
.camera-tool-tone-row > span { font-size: 12px; color: var(--text-2); }
.camera-tool-tones { display: flex; gap: 8px; flex-wrap: wrap; }
.camera-tool-tones button {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--text-2);
  font-family: inherit; font-size: 11px; font-weight: 500; line-height: 1; cursor: pointer;
}
.camera-tool-tones button.active { border-color: #0F766E; color: #0F5F58; box-shadow: 0 0 0 2px rgba(15,118,110,.10); }
.camera-tool-tones i { width: 15px; height: 15px; border-radius: 50%; border: 1px solid rgba(0,0,0,.18); background: #171918; }
.camera-tool-tones [data-camera-tone="silver"] i { background: #B7B7B3; }
.camera-tool-tones [data-camera-tone="cream"] i { background: #DDD5C7; }
.grain-tool-preview-wrap { background-color: #071713; }
.grain-tool-preview-canvas {
  display: block; width: auto; height: 100%; max-width: 100%;
  aspect-ratio: 1; object-fit: contain;
}
.grain-lab-hint {
  display: flex; align-items: center; gap: 9px; margin-bottom: 15px;
  padding: 10px 12px; border: 1px solid #C7E850; border-radius: 10px;
  background: #F5FFD5; color: #183127;
}
.grain-lab-hint::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #8EB600; box-shadow: 0 0 0 4px rgba(142,182,0,.12); }
.grain-lab-hint strong { font-size: 12px; }
.grain-lab-hint span { font-size: 11px; color: #63745F; }
.grain-lab-section-label {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px; font-size: 12px; font-weight: 650;
}
.grain-lab-section-label span { color: var(--text-3); font-size: 10px; font-weight: 500; }
.grain-lab-effects { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.grain-lab-effects button {
  min-width: 0; padding: 5px 5px 8px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--text-2); font-family: inherit; font-size: 10px; cursor: pointer;
}
.grain-lab-effects button:hover { border-color: #AAB58A; }
.grain-lab-effects button.active { border-color: #A5C62E; box-shadow: 0 0 0 2px rgba(165,198,46,.17); color: #30420C; }
.grain-effect-swatch {
  display: flex; align-items: center; justify-content: center; height: 48px; margin-bottom: 6px;
  overflow: hidden; border-radius: 7px; background-color: #0D5A78; color: #D8FF62;
  font-style: normal; font-size: 19px; font-weight: 800;
}
.grain-effect-stipple { background-image: radial-gradient(circle, #F6EBCF 1.5px, transparent 2px); background-size: 8px 8px; }
.grain-effect-halftone { background-color: #E7F0D5; background-image: radial-gradient(circle, #0D5A78 3px, transparent 3.5px); background-size: 10px 10px; color: transparent; }
.grain-effect-ripple { background: repeating-linear-gradient(-7deg,#0D5A78 0 5px,#56B3C6 5px 8px,#D1F3D9 8px 10px); color: #fff; }
.grain-effect-poster { background: linear-gradient(135deg,#FF675A 0 33%,#D8FF62 33% 66%,#0D5A78 66%); color: #071713; }
.grain-effect-emoji { background: #174D64; font-size: 23px; }
.grain-lab-sliders .image-tool-control { margin-bottom: 10px; }
.grain-density-row.is-hidden { display: none; }
.grain-lab-toggle {
  display: flex; align-items: center; gap: 10px; margin-top: 8px; padding: 11px 12px;
  border-radius: 10px; background: #F5F4EF; cursor: pointer;
}
.grain-lab-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.grain-lab-toggle > i {
  position: relative; width: 34px; height: 20px; flex: 0 0 auto; border-radius: 10px;
  background: #C9C9C4; transition: background .15s;
}
.grain-lab-toggle > i::after {
  content: ''; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.18); transition: transform .15s;
}
.grain-lab-toggle input:checked + i { background: #92B719; }
.grain-lab-toggle input:checked + i::after { transform: translateX(14px); }
.grain-lab-toggle span { display: flex; flex-direction: column; gap: 2px; }
.grain-lab-toggle strong { font-size: 11px; font-weight: 650; }
.grain-lab-toggle small { font-size: 9.5px; color: var(--text-3); }
.punch-tool-preview-wrap { background: #1B1D1C; }
.punch-tool-preview-canvas {
  display: block; width: auto; height: 100%; max-width: 100%;
  aspect-ratio: 5 / 6; object-fit: contain; touch-action: none; cursor: grab;
}
.punch-tool-preview-canvas.dragging { cursor: grabbing; }
.punch-tool-hint {
  display: flex; align-items: center; gap: 9px; margin-bottom: 14px;
  padding: 10px 12px; border-radius: 10px; background: #F3E8D0; color: #3E2B17;
}
.punch-tool-hint::before {
  content: '↔'; display: flex; align-items: center; justify-content: center;
  width: 25px; height: 25px; flex: 0 0 auto; border-radius: 50%;
  background: #A66F24; color: #fff; font-size: 13px; font-weight: 700;
}
.punch-tool-hint strong { font-size: 12px; white-space: nowrap; }
.punch-tool-hint span { font-size: 10.5px; line-height: 1.4; color: #76604A; }
.punch-tool-heading {
  display: flex; align-items: center; justify-content: space-between;
  margin: 12px 0 7px; font-size: 12px; font-weight: 650;
}
.punch-tool-heading small { color: var(--text-3); font-size: 10px; font-weight: 500; }
.punch-tool-heading button {
  border: 0; background: transparent; color: #8B5B1E; font-family: inherit; font-size: 10.5px; cursor: pointer;
}
.punch-layouts { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 7px; }
.punch-layouts button {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 37px; border: 1px solid var(--line); border-radius: 9px;
  background: #fff; color: var(--text-2); font-family: inherit; font-size: 10px; cursor: pointer;
}
.punch-layouts button i { font-style: normal; font-size: 16px; line-height: 1; }
.punch-layouts button.active { border-color: #A66F24; color: #704611; box-shadow: 0 0 0 2px rgba(166,111,36,.12); }
.punch-shapes { display: grid; grid-template-columns: repeat(8, minmax(0,1fr)); gap: 5px; }
.punch-shapes button {
  height: 36px; min-width: 0; padding: 0; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: #5B554B; font-size: 17px; cursor: pointer;
}
.punch-shapes button.active { border-color: #A66F24; background: #F3E8D0; color: #704611; }
.punch-sliders { margin-top: 13px; }
.punch-sliders .image-tool-control { margin-bottom: 9px; }
.punch-sliders input[type="range"] { accent-color: #A66F24; }
.punch-paper-row { display: grid; grid-template-columns: 74px 1fr; gap: 10px; align-items: center; margin-top: 8px; }
.punch-paper-row > span { font-size: 12px; color: var(--text-2); }
.punch-paper-row > div { display: flex; flex-wrap: wrap; gap: 7px; }
.punch-paper-row button {
  width: 25px; height: 25px; padding: 3px; border: 1px solid transparent; border-radius: 50%;
  background: transparent; cursor: pointer;
}
.punch-paper-row button::before {
  content: ''; display: block; width: 100%; height: 100%; border-radius: 50%;
  background: var(--paper); border: 1px solid rgba(0,0,0,.12);
}
.punch-paper-row button.active { border-color: #171717; }
@media (max-width: 700px) {
  .image-tool-modal { padding: 10px; }
  .image-tool-layout { grid-template-columns: 1fr; }
  .image-tool-list { display: flex; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .image-tool-list-item { min-width: 170px; }
  .image-tool-preview-wrap { height: 220px; }
  .camera-tool-hint { align-items: flex-start; flex-direction: column; gap: 3px; }
  .grain-lab-hint { align-items: flex-start; flex-wrap: wrap; }
  .grain-lab-effects { gap: 5px; }
  .grain-effect-swatch { height: 42px; }
  .punch-tool-hint { align-items: flex-start; }
  .punch-layouts { gap: 5px; }
  .punch-layouts button { flex-direction: column; gap: 2px; min-height: 48px; }
  .punch-shapes { gap: 4px; }
  .punch-shapes button { height: 34px; font-size: 15px; }
}

/* ── 顶部属性栏 ──────────────────────────────────────────── */
.canvas-prop-bar {
  position: absolute; left: 50%; top: 12px; z-index: 15;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 6px;
  background: var(--surface); border-radius: 10px;
  border: 0.5px solid var(--line);
  box-shadow: 0 4px 14px rgba(0,0,0,.1);
  padding: 6px 10px;
  max-width: calc(100% - 120px);
  flex-wrap: wrap;
}
.prop-group {
  display: flex; align-items: center; gap: 4px;
  padding: 0 4px;
}
.prop-group + .prop-group {
  border-left: 1px solid var(--line); padding-left: 8px;
}
.prop-label {
  font-size: 11px; color: var(--text-3); margin-right: 2px;
}
.prop-btn {
  min-width: 26px; height: 26px; padding: 0 6px;
  border-radius: 5px; border: none; background: transparent;
  color: var(--text-2); cursor: pointer; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  transition: all .12s; font-family: inherit;
}
.prop-btn:hover { background: var(--subtle); color: var(--text); }
.prop-btn.active { background: #1A1A1A; color: #fff; }
.prop-btn-bold { font-weight: 700; }
.prop-btn-italic { font-style: italic; }
.prop-btn-underline { text-decoration: underline; }
.prop-select {
  height: 26px; padding: 0 22px 0 8px; border-radius: 5px;
  border: 1px solid var(--line); background: var(--surface);
  font-size: 12px; color: var(--text); cursor: pointer;
  font-family: inherit;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='1,1 5,5 9,1' fill='none' stroke='%23707070' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 7px center;
}
.prop-num {
  font-size: 12px; color: var(--text); min-width: 26px; text-align: center;
}
/* 效果 chip（一键文字效果） */
.effect-chip {
  height: 26px; padding: 0 10px;
  border-radius: 13px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text-2);
  font-size: 12px; cursor: pointer; font-family: inherit;
  transition: all .12s; white-space: nowrap;
}
.effect-chip:hover { border-color: #1A1A1A; color: var(--text); }
.effect-chip.active {
  background: #1A1A1A; color: #fff; border-color: #1A1A1A;
}
.prop-group-effects { gap: 3px; }

.color-swatch {
  width: 22px; height: 22px; border-radius: 50%; cursor: pointer;
  border: 1.5px solid #DDD; box-sizing: border-box;
  transition: transform .12s;
}
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.active { border-color: #1A1A1A; border-width: 2px; }
.color-swatch-white { border-color: #C9C2B0; }

/* 缩放工具（左下角） */
.canvas-zoom-tools {
  position: absolute;
  left: calc(var(--floating-chat-left) + var(--floating-chat-width) + var(--floating-chat-gap) + 14px);
  bottom: 50px; z-index: 10;
  display: flex; flex-direction: column; gap: 2px;
  background: var(--surface); border-radius: 10px;
  border: 0.5px solid var(--line);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.canvas-zoom-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: var(--text-2); cursor: pointer;
  transition: all .15s; line-height: 1;
  user-select: none;
}
.canvas-zoom-btn:hover { background: var(--bg); color: var(--text); }
.canvas-zoom-btn:not(:last-child) { border-bottom: 0.5px solid var(--line); }
.canvas-zoom-value { font-size: 10px; font-variant-numeric: tabular-nums; }

.canvas-image-pulse {
  position: absolute; z-index: 6; pointer-events: none; border-radius: 0;
  border: 2px solid rgba(38,151,112,.78);
  animation: canvas-image-arrival 1.05s cubic-bezier(.2,.72,.2,1) both;
}
@keyframes canvas-image-arrival {
  0% { opacity: 0; transform: scale(.975); box-shadow: 0 0 0 0 rgba(38,151,112,.3); }
  32% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.025); box-shadow: 0 0 0 15px rgba(38,151,112,0); }
}
@media (prefers-reduced-motion: reduce) {
  .canvas-image-pulse,
  .chat-send.awaiting-next-step,
  #mobile-image-ai-submit.awaiting-next-step { animation: none; }
  .chat-send.awaiting-next-step,
  #mobile-image-ai-submit.awaiting-next-step { box-shadow: 0 0 0 4px rgba(20,111,87,.22); }
}

/* 版本缩略图（替代旧 footer） */
.canvas-versions-bar {
  position: absolute; z-index: 20;
  left: calc(var(--floating-chat-left) + var(--floating-chat-width) + var(--floating-chat-gap) + 28px);
  right: var(--canvas-right-edge); bottom: 20px;
  padding: 0; border: 0; pointer-events: none;
}
.canvas-versions-bar:has(.canvas-versions:empty) { display: none; }
.canvas-versions {
  display: flex; gap: 10px; align-items: center;
  overflow-x: auto; pointer-events: auto;
}
.canvas-panel:has(.canvas-version) .canvas-zoom-tools { bottom: 106px; }
.canvas-versions::-webkit-scrollbar { height: 4px; }
.canvas-versions::-webkit-scrollbar-thumb { background: #D5D0C2; border-radius: 2px; }
.canvas-version {
  width: 56px; height: 56px; border-radius: 10px;
  overflow: hidden; cursor: pointer; flex-shrink: 0;
  border: 1.5px solid transparent;
  transition: border-color .15s;
  background: var(--subtle);
}
.canvas-version.active { border-color: var(--accent); }
.canvas-version svg, .canvas-version img { width: 100%; height: 100%; object-fit: cover; }

.spinner {
  width: 28px; height: 28px; border: 2.5px solid var(--subtle);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 完成页 ===== */
.finish-header { margin-bottom: 32px; }
.finish-title {
  font-size: 28px; font-weight: 500; letter-spacing: -0.5px;
  margin-bottom: 6px; line-height: 1.25;
}
.finish-sub { font-size: 15px; color: var(--text-2); }

.finish-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 440px;
  gap: 48px; align-items: start;
}
.finish-preview-wrap {
  background: var(--surface); border-radius: 20px; padding: 32px;
  border: 0.5px solid var(--line);
}
.finish-preview {
  aspect-ratio: 1; background: var(--bg); border-radius: 16px;
  overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.finish-preview svg, .finish-preview img { width: 100%; height: 100%; display: block; object-fit: cover; }
.finish-tote-wrap {
  position: relative;
  height: 100%;
  aspect-ratio: 1086/1448;
}
.finish-tote-bag {
  width: 100% !important; height: 100% !important;
  display: block; object-fit: contain;
}
.finish-tote-design {
  position: absolute;
  left: 27% !important; top: 41% !important;
  width: 47% !important; height: 47% !important;
  object-fit: contain !important;
  border-radius: 2px;
}
.finish-preview.compare {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px;
  background: var(--bg);
}
.finish-preview.compare > div {
  border-radius: 10px; overflow: hidden; background: var(--surface);
  position: relative;
}
.finish-preview.compare svg, .finish-preview.compare img { width: 100%; height: 100%; }
.compare-label {
  position: absolute; bottom: 10px; left: 10px;
  background: rgba(0,0,0,0.72); color: white;
  padding: 4px 10px; border-radius: 999px; font-size: 11px;
  letter-spacing: 0.3px;
}

.finish-view-toggle {
  display: flex; gap: 4px; margin-top: 16px;
  background: var(--surface); padding: 4px; border-radius: 12px;
  border: 0.5px solid var(--line);
}
.finish-view-btn {
  flex: 1; padding: 10px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  font-size: 13px; color: var(--text-2); cursor: pointer;
  transition: all .15s;
}
.finish-view-btn:hover { color: var(--text); }
.finish-view-btn.active { background: var(--accent); color: white; }

.finish-actions-col { display: flex; flex-direction: column; gap: 14px; }
.finish-info-card {
  background: var(--surface); border-radius: 16px; padding: 24px;
  border: 0.5px solid var(--line);
}
.finish-template-tag {
  display: inline-block; padding: 5px 12px;
  background: var(--subtle); border-radius: 999px;
  font-size: 11px; color: var(--text-2); letter-spacing: 0.2px;
  margin-bottom: 14px;
}
.finish-title-input {
  width: 100%; border: none; outline: none;
  font-size: 20px; font-weight: 500; padding: 4px 0;
  background: transparent; font-family: inherit; color: var(--text);
  margin-bottom: 12px;
  border-bottom: 0.5px solid transparent;
  transition: border-color .15s;
  letter-spacing: -0.2px;
}
.finish-title-input:focus { border-bottom-color: var(--line-strong); }
.finish-title-input::placeholder { color: var(--text-3); }
.finish-desc-input {
  width: 100%; border: none; outline: none;
  font-size: 14px; color: var(--text);
  background: var(--bg); border-radius: 10px;
  padding: 12px 14px; resize: none; font-family: inherit;
  line-height: 1.55;
}
.finish-desc-input::placeholder { color: var(--text-3); }

.finish-action-card {
  background: var(--surface); border-radius: 16px; padding: 20px 24px;
  border: 0.5px solid var(--line);
}
.finish-action-card.primary-action {
  background: var(--accent); color: white; border-color: var(--accent);
}
.finish-action-card.primary-action .finish-action-sub { color: rgba(255,255,255,.7); }
.finish-action-card.primary-action .btn-primary {
  background: white; color: var(--accent);
}
.finish-action-card.primary-action .btn-primary:hover { background: #F0F0F0; }
.finish-action-card.secondary-card { background: transparent; }
.finish-action-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.finish-action-title { font-size: 15px; font-weight: 500; margin-bottom: 4px; letter-spacing: -0.1px; }
.finish-action-sub { font-size: 13px; color: var(--text-2); }

.finish-meta-row {
  display: flex; align-items: center; gap: 8px;
  padding: 16px 4px 0;
  font-size: 13px; color: var(--text-3);
}
.finish-meta-link {
  color: var(--text); cursor: pointer;
}
.finish-meta-link:hover { text-decoration: underline; text-decoration-color: var(--line-strong); }

/* ===== 作品详情 ===== */
.work-detail { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 64px; align-items: start; }
.work-detail-img {
  aspect-ratio: 1; background: var(--subtle); border-radius: 16px;
  overflow: hidden;
}
.work-detail-img svg { width: 100%; height: 100%; }
.work-detail-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 12px; }
.work-detail-thumb {
  aspect-ratio: 1; background: var(--subtle); border-radius: 10px;
  overflow: hidden; cursor: pointer; border: 1.5px solid transparent;
}
.work-detail-thumb.active { border-color: var(--accent); }
.work-detail-thumb svg { width: 100%; height: 100%; }

.creator-row {
  display: flex; align-items: center; gap: 12px; margin-bottom: 18px;
  padding-bottom: 18px; border-bottom: 0.5px solid var(--line);
}
.creator-avatar {
  width: 38px; height: 38px; border-radius: 50%; background: var(--subtle);
  display: flex; align-items: center; justify-content: center; font-weight: 500; font-size: 14px;
}
.creator-info { flex: 1; }
.creator-name { font-size: 14px; font-weight: 500; }
.creator-meta { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.creator-template-link { color: var(--text); cursor: pointer; text-decoration: underline; text-decoration-color: var(--line-strong); }

.work-title { font-size: 26px; font-weight: 500; letter-spacing: -0.4px; margin-bottom: 8px; line-height: 1.25; }
.work-desc { font-size: 14px; color: var(--text-2); line-height: 1.65; margin-bottom: 20px; }
.work-actions { display: flex; gap: 16px; margin-bottom: 24px; }
.work-action {
  display: flex; align-items: center; gap: 6px; font-size: 13px;
  color: var(--text-2); cursor: pointer; transition: color .15s;
}
.work-action:hover { color: var(--text); }

.price-block {
  background: var(--surface); border-radius: 16px; padding: 22px; margin-bottom: 16px;
  border: 0.5px solid var(--line);
}
.price-main { font-size: 30px; font-weight: 500; letter-spacing: -0.5px; margin-bottom: 6px; }
.price-note { font-size: 13px; color: var(--text-3); margin-bottom: 18px; }
.spec-row { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.spec-chip {
  padding: 8px 14px; border-radius: 8px; font-size: 13px;
  background: var(--bg); border: 1px solid var(--accent); cursor: pointer; font-weight: 500;
}
.spec-chip.muted { border-color: var(--line); color: var(--text-3); background: transparent; }

/* ===== 下单页 ===== */
.checkout-layout { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 48px; }
.checkout-section {
  background: var(--surface); border-radius: 16px; padding: 28px;
  margin-bottom: 16px; border: 0.5px solid var(--line);
}
.checkout-section h3 { font-size: 16px; font-weight: 500; margin-bottom: 18px; letter-spacing: -0.1px; }

.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.form-row input, .form-row select {
  width: 100%; padding: 11px 14px; font-size: 14px; color: var(--text);
  border: 0.5px solid var(--line-strong); border-radius: 8px;
  background: var(--bg); font-family: inherit; outline: none;
  transition: border-color .15s;
}
.form-row input:focus { border-color: var(--accent); }

.payment-options { display: flex; flex-direction: column; gap: 10px; }
.payment-option {
  padding: 16px; border: 0.5px solid var(--line-strong); border-radius: 10px;
  display: flex; align-items: center; gap: 14px; cursor: pointer;
  background: var(--bg); transition: all .15s;
}
.payment-option:hover { background: var(--surface); }
.payment-option.selected { border-color: var(--accent); background: var(--surface); border-width: 1.5px; }
.payment-radio {
  width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid var(--text-3); flex-shrink: 0; position: relative;
}
.payment-option.selected .payment-radio { border-color: var(--accent); }
.payment-option.selected .payment-radio::after {
  content: ''; position: absolute; inset: 3px;
  background: var(--accent); border-radius: 50%;
}
.payment-label { font-size: 14px; font-weight: 500; }
.payment-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.checkout-summary {
  background: var(--surface); border-radius: 16px; padding: 28px;
  border: 0.5px solid var(--line);
  position: sticky; top: 88px; align-self: start;
}
.summary-item {
  display: flex; gap: 14px; padding-bottom: 18px;
  border-bottom: 0.5px solid var(--line); margin-bottom: 18px;
}
.summary-thumb {
  width: 68px; height: 68px; border-radius: 10px; background: var(--subtle); overflow: hidden; flex-shrink: 0;
}
.summary-thumb svg, .summary-thumb img { width: 100%; height: 100%; object-fit: cover; }
.summary-name { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.summary-spec { font-size: 12px; color: var(--text-3); }
.summary-price { font-size: 14px; font-weight: 500; margin-top: 6px; }

.summary-line {
  display: flex; justify-content: space-between; font-size: 13px;
  color: var(--text-2); margin-bottom: 10px;
}
.summary-line.discount { color: #0F7A55; }
.summary-line.total {
  margin-top: 14px; padding-top: 14px;
  border-top: 0.5px solid var(--line);
  color: var(--text); font-size: 18px; font-weight: 500;
  letter-spacing: -0.2px;
}

.points-toggle {
  background: var(--bg); border-radius: 10px; padding: 14px;
  margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between;
}
.points-info { font-size: 13px; }
.points-num { font-weight: 500; color: var(--text); }
.points-sub { color: var(--text-3); font-size: 12px; margin-top: 2px; }
.toggle {
  width: 38px; height: 22px; background: var(--accent);
  border-radius: 11px; position: relative; cursor: pointer;
  transition: background .2s;
}
.toggle::after {
  content: ''; position: absolute; top: 2px; right: 2px;
  width: 18px; height: 18px; background: white; border-radius: 50%;
  transition: all .2s;
}
.toggle.off { background: #D5D0C2; }
.toggle.off::after { right: auto; left: 2px; }

.checkout-form-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px;
}
.checkout-form-wide { grid-column: 1 / -1; }
.shipping-quote-box { display: flex; flex-direction: column; gap: 12px; }
.shipping-quote-state { font-size: 13px; color: var(--text-2); line-height: 1.55; }
.shipping-quote-box select {
  width: 100%; padding: 12px 14px; border: .5px solid var(--line-strong); border-radius: 9px;
  background: var(--bg); color: var(--text); font: inherit; font-size: 13px;
}
.shipping-quote-box select:disabled { color: var(--text-3); cursor: not-allowed; }
.checkout-quote-btn { align-self: flex-start; border: 0; font: inherit; cursor: pointer; }
.checkout-quote-btn:disabled { opacity: .55; cursor: wait; }
.checkout-manual-payment { cursor: default; }
.checkout-manual-payment .payment-sub { max-width: 580px; line-height: 1.6; }
.checkout-order-error {
  display: none; margin-top: 14px; padding: 11px 13px; border-radius: 9px;
  background: #FCE8E6; color: #9B2C26; font-size: 12px; line-height: 1.55;
}
.checkout-order-error.show { display: block; }
#checkout-submit-btn { width: 100%; }
#checkout-submit-btn:disabled { opacity: .58; cursor: wait; }
.checkout-thumb-empty {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  color: var(--text-3); font-size: 11px;
}

.order-empty {
  padding: 54px 20px; border: .5px dashed var(--line-strong); border-radius: 14px;
  color: var(--text-3); text-align: center; font-size: 13px; line-height: 1.7;
}
.order-load-error button { margin-left: 8px; border: 0; background: none; color: var(--accent); cursor: pointer; }
.order-history-card {
  width: 100%; color: inherit; font: inherit; text-align: left; cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.order-history-card:hover { transform: translateY(-1px); border-color: var(--line-strong); box-shadow: 0 8px 24px rgba(25,22,16,.06); }
.order-history-card > span { display: block; }
.order-history-thumb { display: flex !important; align-items: center; justify-content: center; color: var(--text-3); font-size: 11px; }
.order-card-error { display: block; margin-top: 5px; color: #9B2C26; font-size: 11px; }
.history-status.complete { background: #E1F5EE; color: #0F6E56; }
.history-status.shipping { background: #E6F0FF; color: #245C9E; }
.history-status.problem { background: #FCE8E6; color: #9B2C26; }

.order-detail-modal {
  display: none; position: fixed; inset: 0; z-index: 500; padding: 32px;
  align-items: center; justify-content: center; background: rgba(20,18,15,.48); backdrop-filter: blur(7px);
}
.order-detail-modal.open { display: flex; }
.order-detail-panel {
  width: min(900px, 100%); max-height: min(820px, calc(100vh - 64px)); overflow: auto;
  position: relative; padding: 34px; border-radius: 20px; background: var(--surface);
  box-shadow: 0 28px 80px rgba(0,0,0,.24);
}
.order-detail-close {
  position: absolute; top: 18px; right: 18px; width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: var(--bg); color: var(--text); font: 24px/1 inherit; cursor: pointer;
}
.order-detail-kicker { color: var(--text-3); font-size: 12px; letter-spacing: .4px; }
.order-detail-panel h2 { margin: 7px 50px 10px 0; font-size: 25px; font-weight: 550; }
.order-detail-panel h3 { margin: 0 0 14px; font-size: 14px; font-weight: 600; }
.order-detail-status { display: inline-flex; padding: 6px 11px; border-radius: 999px; background: #FAEEDA; color: #854F0B; font-size: 12px; }
.order-detail-status.complete { background: #E1F5EE; color: #0F6E56; }
.order-detail-status.shipping { background: #E6F0FF; color: #245C9E; }
.order-detail-status.problem { background: #FCE8E6; color: #9B2C26; }
.order-detail-alert { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: #FCE8E6; color: #9B2C26; font-size: 12px; }
.order-detail-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(260px, .85fr); gap: 32px; margin-top: 28px; }
.order-timeline { padding-left: 4px; }
.order-timeline-row { display: grid; grid-template-columns: 18px 1fr; gap: 10px; min-height: 57px; position: relative; }
.order-timeline-row::before { content: ''; position: absolute; left: 5px; top: 13px; bottom: -2px; width: 1px; background: var(--line); }
.order-timeline-row:last-child::before { display: none; }
.order-timeline-row i { width: 11px; height: 11px; margin-top: 3px; border-radius: 50%; background: #C8C1B3; position: relative; z-index: 1; }
.order-timeline-row.current i { background: #0F7A55; box-shadow: 0 0 0 5px rgba(15,122,85,.11); }
.order-timeline-row strong, .order-timeline-row span { display: block; }
.order-timeline-row strong { font-size: 13px; font-weight: 520; }
.order-timeline-row span { margin-top: 4px; color: var(--text-3); font-size: 11px; }
.order-detail-side { padding: 20px; border-radius: 14px; background: var(--bg); }
.order-detail-side dl, .order-detail-side dd { margin: 0; }
.order-detail-side dl > div { display: grid; grid-template-columns: 58px 1fr; gap: 12px; padding: 9px 0; border-bottom: .5px solid var(--line); }
.order-detail-side dl > div:last-child { border-bottom: 0; }
.order-detail-side dt { color: var(--text-3); font-size: 11px; }
.order-detail-side dd { color: var(--text-2); font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.order-shipments { margin-top: 24px; padding-top: 22px; border-top: .5px solid var(--line); }
.order-shipment-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 14px; padding: 12px 0; font-size: 12px; }
.order-shipment-row + .order-shipment-row { border-top: .5px solid var(--line); }
.order-shipment-row a { color: var(--accent); text-decoration: none; }

@media (max-width: 768px) {
  .checkout-layout { grid-template-columns: 1fr; gap: 14px; }
  .checkout-summary { position: static; padding: 20px; }
  .checkout-section { padding: 20px; }
  .checkout-form-grid { grid-template-columns: 1fr; }
  .checkout-form-wide { grid-column: auto; }
  .order-history-card { align-items: flex-start; }
  .history-status { flex: 0 0 auto; }
  .order-detail-modal { padding: 0; align-items: flex-end; }
  .order-detail-panel { width: 100%; max-height: 92vh; padding: 26px 18px calc(24px + env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0; }
  .order-detail-grid { grid-template-columns: 1fr; gap: 20px; }
  .order-shipment-row { grid-template-columns: 1fr; gap: 5px; }
}

/* ===== 履约控制台 ===== */
.orders-admin-body {
  min-height: 100vh;
  margin: 0;
  color: #191919;
  background: #f3f1eb;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.orders-admin-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 48px 0 80px; }
.orders-admin-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; margin-bottom: 28px; }
.orders-admin-header-actions { display: flex; align-items: center; gap: 12px; }
.orders-admin-header h1 { margin: 4px 0 8px; font-size: clamp(30px, 5vw, 52px); line-height: 1; }
.orders-admin-header p { margin: 0; color: #6c6a64; }
.orders-admin-kicker { color: #7559ff !important; font-size: 12px; font-weight: 800; letter-spacing: .18em; }
.orders-admin-login { max-width: 650px; padding: 24px; background: #fff; border: 1px solid #e2ded5; border-radius: 22px; box-shadow: 0 14px 40px rgba(29, 25, 18, .06); }
.orders-admin-login label { display: block; margin-bottom: 10px; font-size: 13px; font-weight: 800; }
.orders-admin-login p { margin: 10px 0 0; color: #88847b; font-size: 12px; }
.orders-admin-token-row { display: flex; gap: 10px; }
.orders-admin-token-row input { flex: 1; min-width: 0; padding: 13px 15px; border: 1px solid #d9d5cb; border-radius: 13px; font: inherit; }
.orders-admin-token-row button,
.orders-admin-toolbar button,
.orders-admin-submit { padding: 11px 15px; border: 0; border-radius: 12px; color: #fff; background: #191919; font: inherit; font-weight: 750; cursor: pointer; }
.orders-admin-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; padding: 14px 16px; background: #fff; border: 1px solid #e2ded5; border-radius: 16px; }
.orders-admin-toolbar strong { margin-right: 12px; }
.orders-admin-toolbar span { color: #8b877d; font-size: 12px; }
.orders-admin-actions { display: flex; gap: 8px; }
.orders-admin-toolbar button { padding: 9px 12px; color: #393733; background: #efede7; font-size: 13px; }
.orders-admin-notice { margin: 0 0 16px; padding: 13px 15px; color: #513fc6; background: #eeeaff; border: 1px solid #dcd5ff; border-radius: 12px; }
.orders-admin-notice.error { color: #a32334; background: #fff0f2; border-color: #ffd1d7; }
.orders-admin-notice.success { color: #18673f; background: #ecfff5; border-color: #c2efd8; }
.orders-admin-list { display: grid; gap: 14px; }
.orders-admin-empty { padding: 60px 20px; color: #88847b; background: #fff; border: 1px dashed #d4d0c6; border-radius: 22px; text-align: center; }
.orders-admin-card { display: grid; grid-template-columns: 150px 1fr; gap: 20px; padding: 18px; background: #fff; border: 1px solid #e2ded5; border-radius: 22px; box-shadow: 0 8px 24px rgba(29, 25, 18, .04); }
.orders-admin-preview { display: grid; min-height: 150px; overflow: hidden; place-items: center; color: #aaa59c; background: #f4f2ed; border-radius: 14px; font-size: 10px; }
.orders-admin-preview img { width: 100%; height: 100%; max-height: 180px; object-fit: contain; }
.orders-admin-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.orders-admin-card-head h2 { margin: 2px 0 4px; font-size: 18px; }
.orders-admin-card-head p { margin: 0; color: #98948b; font-size: 12px; }
.orders-admin-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 18px; margin: 18px 0; }
.orders-admin-grid div { min-width: 0; }
.orders-admin-grid span { display: block; margin-bottom: 3px; color: #959188; font-size: 11px; }
.orders-admin-grid strong { display: block; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.orders-admin-address { margin: 0; color: #66625a; font-size: 13px; }
.orders-admin-error { margin: 10px 0 0; padding: 9px 11px; color: #a32334; background: #fff0f2; border-radius: 10px; font-size: 12px; }
.orders-admin-card-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 16px; padding-top: 14px; border-top: 1px solid #eeeae2; color: #8a867d; font-size: 12px; }
.orders-admin-submit { color: #102d1f; background: #72f0a5; box-shadow: 0 0 22px rgba(72, 223, 133, .28); }
@media (max-width: 720px) {
  .orders-admin-shell { width: min(100% - 24px, 1180px); padding-top: 24px; }
  .orders-admin-header, .orders-admin-toolbar, .orders-admin-card-actions { align-items: stretch; flex-direction: column; }
  .orders-admin-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .orders-admin-card { grid-template-columns: 82px 1fr; gap: 12px; padding: 12px; }
  .orders-admin-preview { min-height: 82px; }
  .orders-admin-grid { grid-template-columns: 1fr 1fr; }
  .orders-admin-token-row { flex-direction: column; }
}

/* ===== 个人主页 ===== */
.profile-header {
  background: var(--surface); border-radius: 16px; padding: 32px;
  border: 0.5px solid var(--line); margin-bottom: 16px;
  display: flex; align-items: center; gap: 24px;
}
.profile-avatar {
  width: 80px; height: 80px; border-radius: 50%; background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 26px; font-weight: 500;
}
.profile-info { flex: 1; }
.profile-name { font-size: 20px; font-weight: 500; margin-bottom: 4px; letter-spacing: -0.2px; }
.profile-bio { font-size: 14px; color: var(--text-2); margin-bottom: 12px; }
.profile-stats { display: flex; gap: 28px; font-size: 13px; color: var(--text-3); }
.profile-stats strong { color: var(--text); font-weight: 500; font-size: 15px; margin-right: 4px; }

.points-card {
  background: var(--accent);
  color: white; border-radius: 16px; padding: 26px;
  margin-bottom: 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.points-label { font-size: 13px; opacity: 0.65; margin-bottom: 6px; letter-spacing: 0.3px; }
.points-amount { font-size: 36px; font-weight: 500; letter-spacing: -0.8px; line-height: 1; }
.points-detail { font-size: 13px; opacity: 0.75; margin-top: 8px; }
.points-redeem {
  background: white; color: var(--accent); padding: 11px 20px;
  border-radius: 10px; font-size: 13px; font-weight: 500; cursor: pointer;
}

.profile-tabs {
  display: flex; gap: 4px; margin-bottom: 20px;
  border-bottom: 0.5px solid var(--line);
}
.profile-tab {
  padding: 12px 18px; font-size: 14px; color: var(--text-2);
  cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -0.5px;
  transition: color .15s;
}
.profile-tab:hover { color: var(--text); }
.profile-tab.active { color: var(--text); font-weight: 500; border-bottom-color: var(--text); }

.history-list { display: flex; flex-direction: column; gap: 12px; }
.history-card {
  background: var(--surface); border-radius: 12px; padding: 18px;
  border: 0.5px solid var(--line);
  display: flex; gap: 16px; align-items: center;
}
.history-thumb {
  width: 72px; height: 72px; border-radius: 10px; background: var(--subtle);
  overflow: hidden; flex-shrink: 0;
}
.history-thumb svg, .history-thumb img { width: 100%; height: 100%; object-fit: cover; }
.history-info { flex: 1; }
.history-title { font-size: 15px; font-weight: 500; margin-bottom: 4px; }
.history-meta { font-size: 12px; color: var(--text-3); }
.history-status {
  font-size: 12px; padding: 5px 12px; border-radius: 999px;
  background: #E1F5EE; color: #0F6E56;
}
.history-status.pending { background: #FAEEDA; color: #854F0B; }
.history-action { color: var(--text-2); font-size: 13px; cursor: pointer; }
.history-action:hover { color: var(--text); }

.publish-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.publish-card {
  background: var(--surface); border-radius: 12px; overflow: hidden;
  border: 0.5px solid var(--line); cursor: pointer;
  transition: transform .25s ease;
}
.publish-card:hover { transform: translateY(-2px); }
.publish-img { aspect-ratio: 1; background: var(--subtle); }
.publish-img svg, .publish-img img { width: 100%; height: 100%; object-fit: cover; }
.publish-info { padding: 12px; }
.publish-stats {
  display: flex; gap: 14px; font-size: 12px; color: var(--text-3);
  margin-top: 4px;
}
.publish-earnings {
  font-size: 12px; color: #0F7A55; font-weight: 500; margin-top: 4px;
}

/* ===== Toast ===== */
.toast {
  position: fixed; top: 88px; left: 50%; transform: translateX(-50%);
  background: rgba(20,20,20,0.92); color: white; padding: 12px 22px;
  border-radius: 10px; font-size: 13px; z-index: 200;
  opacity: 0; transition: opacity .3s; pointer-events: none;
  backdrop-filter: blur(8px);
}
.toast.show { opacity: 1; }
.toast.creating {
  max-width: min(520px, calc(100vw - 32px)); padding: 12px 18px 12px 14px;
  display: flex; align-items: center; gap: 10px;
  background: rgba(27,39,35,.94); border: 1px solid rgba(133,220,185,.24);
  box-shadow: 0 12px 36px rgba(20,31,27,.20); color: #F5FFF9;
}
.toast.creating::before {
  content: ''; width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%;
  background: #72D9AC; box-shadow: 0 0 0 5px rgba(114,217,172,.13);
  animation: creating-toast-pulse 1.35s ease-in-out infinite;
}
@keyframes creating-toast-pulse {
  0%, 100% { transform: scale(.85); opacity: .72; }
  50% { transform: scale(1.12); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .toast.creating::before { animation: none; }
}

/* ===== Footer ===== */
.i { font-style: normal; display: inline-block; }

/* ── 帆布包预览按钮 & modal ────────────────────────────────────── */
.canvas-preview-btn {
  padding: 6px 13px; border-radius: 8px;
  font-size: 12px; color: var(--text-2);
  border: 0.5px solid var(--line-strong);
  cursor: pointer; transition: all .15s;
  display: flex; align-items: center; gap: 5px;
  white-space: nowrap; background: transparent; font-family: inherit;
}
.canvas-preview-btn { background: rgba(255,255,255,.82); }
.canvas-preview-btn:hover { background: #fff; color: var(--text); }

.tote-modal-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0.42);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(8px);
}
.tote-modal-inner {
  background: var(--surface); border-radius: 20px;
  padding: 36px 40px 28px; position: relative;
  box-shadow: 0 24px 64px rgba(0,0,0,0.18);
  display: flex; flex-direction: column; align-items: center; gap: 20px;
}
.finish-preview-dialog-title { margin: 0; font-size: 20px; font-weight: 650; letter-spacing: -.3px; }
.tote-modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--subtle); display: flex; align-items: center; justify-content: center;
  padding: 0; border: 0; font: inherit; font-size: 18px; line-height: 1; cursor: pointer; color: var(--text-2);
  transition: all .15s;
}
.tote-modal-close:hover { background: var(--bg); color: var(--text); }
.tote-bag-preview-wrap { position: relative; width: min(640px, 72vw); height: min(640px, 72vh); }
.tote-modal-inner.confirmation-mode .tote-bag-preview-wrap { height: min(520px, 54vh); }
.product-preview-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: contain; display: block;
}
.product-preview-design {
  position: absolute; display: none; object-fit: fill;
  pointer-events: none;
}
.tote-bag-preview-img { width: 100%; height: 100%; display: block; }
.tote-print-zone {
  position: absolute;
  left: 27%; top: 41%; width: 47%; height: 47%;
  border: 1.5px dashed rgba(120, 110, 95, 0.5);
  border-radius: 3px;
  pointer-events: none;
}
.tote-bag-design-img {
  position: absolute;
  left: 27%; top: 41%; width: 47%; height: 47%;
  object-fit: contain;
  border-radius: 2px;
}
.tote-modal-note { font-size: 12px; color: var(--text-3); letter-spacing: 0.3px; }
.finish-preview-confirmation { width: min(520px, 100%); display: grid; gap: 12px; }
.finish-preview-confirmation[hidden] { display: none; }
.finish-preview-processing { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 22px; color: var(--text-2); font-size: 12px; }
.finish-preview-processing-dot { width: 8px; height: 8px; border-radius: 50%; background: #4FB88C; box-shadow: 0 0 0 5px rgba(79,184,140,.12); animation: creating-toast-pulse 1.35s ease-in-out infinite; }
.finish-preview-processing.ready .finish-preview-processing-dot { animation: none; background: #277454; }
.finish-preview-processing.error { color: #A24A3C; }
.finish-preview-processing.error .finish-preview-processing-dot { animation: none; background: #C56554; box-shadow: 0 0 0 5px rgba(197,101,84,.12); }
.finish-preview-complete { width: 100%; min-height: 48px; border: 0; border-radius: 12px; font: inherit; }
.finish-preview-complete:disabled { cursor: wait; background: #E3E6E0; color: #747A73; box-shadow: none; }

/* ── Printful 选品 / 印刷规格（嵌在深色 primary-action 卡片内）────────────── */
.pf-loading, .pf-error { font-size: 13px; color: rgba(255,255,255,.6); padding: 6px 0; }
.pf-error { color: #FFB4A8; }

.pf-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.pf-tab {
  flex: 1; text-align: center; padding: 7px 0; border-radius: 9px;
  font-size: 13px; cursor: pointer;
  background: rgba(255,255,255,.1); color: rgba(255,255,255,.75);
  transition: background .15s, color .15s;
}
.pf-tab:hover { background: rgba(255,255,255,.18); color: #fff; }
.pf-tab.active { background: #fff; color: var(--accent); font-weight: 500; }

.pf-row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.pf-label {
  flex: none; width: 40px; padding-top: 5px;
  font-size: 12px; color: rgba(255,255,255,.55);
}
.pf-opts { display: flex; flex-wrap: wrap; gap: 6px; max-height: 108px; overflow-y: auto; }
.pf-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 7px; font-size: 12px; cursor: pointer;
  background: rgba(255,255,255,.1); color: rgba(255,255,255,.8);
  border: 0.5px solid transparent; transition: background .15s;
}
.pf-chip:hover { background: rgba(255,255,255,.2); }
.pf-chip.active { background: #fff; color: var(--accent); font-weight: 500; }
.pf-chip i {
  width: 11px; height: 11px; border-radius: 50%; flex: none;
  border: 0.5px solid rgba(0,0,0,.25);
}

.pf-spec {
  font-size: 12px; color: rgba(255,255,255,.5);
  padding: 10px 0 0; border-top: 0.5px solid rgba(255,255,255,.12); margin-top: 12px;
}
.pf-oos { color: #FFB4A8; }

.pf-buy {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 12px;
}
.pf-price { font-size: 20px; font-weight: 500; letter-spacing: -0.3px; }
.pf-price-note { display: block; font-size: 11px; font-weight: 400; color: rgba(255,255,255,.45); }
.pf-mockup-btn { width: auto !important; padding: 9px 16px !important; font-size: 12px !important; }
.pf-mockup-btn:disabled { opacity: .55; cursor: default; }

.pf-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; gap: 8px; text-align: center;
  font-size: 14px; color: var(--text-2);
}
.pf-placeholder span { font-size: 12px; color: var(--text-3); }

/* 完成页确认商品，并在进入下单前选择最终尺码。 */
.pf-finish-product { display: flex; align-items: center; gap: 11px; }
.pf-finish-thumb {
  width: 54px; height: 54px; flex: none; border-radius: 9px; overflow: hidden;
  display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.12);
}
.pf-finish-thumb img { width: 100%; height: 100%; object-fit: contain; }
.pf-finish-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pf-finish-copy strong { font-size: 13px; }
.pf-finish-copy small { font-size: 10.5px; color: rgba(255,255,255,.68); margin-top: 2px; }
.pf-finish-copy em { font-size: 9px; color: rgba(255,255,255,.4); font-style: normal; margin-top: 3px; }
.pf-finish-price { font-size: 15px; font-weight: 600; }
.pf-finish-empty { font-size: 12px; color: rgba(255,255,255,.65); }
.pf-purchase-size { margin-top: 15px; }
.pf-purchase-label { margin-bottom: 7px; font-size: 11px; color: rgba(255,255,255,.68); }
.pf-purchase-options { display: flex; flex-wrap: wrap; gap: 6px; }
.pf-purchase-option {
  min-width: 38px; height: 32px; padding: 0 10px; border-radius: 9px;
  border: 1px solid rgba(255,255,255,.28); background: transparent; color: #fff;
  font-family: inherit; font-size: 11px; font-weight: 500; line-height: 1; cursor: pointer;
}
.pf-purchase-option:hover { border-color: rgba(255,255,255,.72); }
.pf-purchase-option.active { border-color: #fff; background: #fff; color: var(--accent); }
.pf-purchase-option.disabled { opacity: .28; cursor: not-allowed; }
.pf-purchase-price {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-top: 14px; padding-top: 13px; border-top: 1px solid rgba(255,255,255,.16);
}
.pf-purchase-price span { font-size: 11px; color: rgba(255,255,255,.68); }
.pf-purchase-price strong { font-size: 18px; font-weight: 600; }
.finish-mockup-btn { margin-top: 6px; padding: 10px 16px; font-size: 12px; }

#checkout-size-picker:not(:empty) {
  padding-bottom: 18px; margin-bottom: 18px; border-bottom: .5px solid var(--line);
}
.pf-purchase-size-checkout { margin-top: 0; }
.pf-purchase-size-checkout .pf-purchase-label { color: var(--text-2); }
.pf-purchase-size-checkout .pf-purchase-option {
  border-color: var(--line-strong); background: var(--surface); color: var(--text-2);
}
.pf-purchase-size-checkout .pf-purchase-option:hover { border-color: var(--text-2); color: var(--text); }
.pf-purchase-size-checkout .pf-purchase-option.active { border-color: var(--accent); background: var(--accent); color: #fff; }

@media (max-width: 1180px) {
  .page-chat {
    --floating-chat-left: 18px;
    --floating-chat-width: 360px;
    --canvas-right-edge: 18px;
  }
  .product-rail { width: 176px; flex-basis: 176px; }
  .product-card-thumb { width: 42px; height: 42px; }
  .product-card-copy small { display: none; }
}

/* ===== 手机独立创作流程 ===== */
.mobile-creation-bar,
.mobile-media-dock,
.mobile-upload-fab,
.mobile-ai-hint,
.mobile-product-picker-trigger,
.mobile-product-picker-backdrop,
.mobile-details-backdrop { display: none; }
.mobile-exit-backdrop { display: none; }

@media (max-width: 768px) {
  :root { --zoom: 1; }
  body { zoom: 1; font-size: 15px; }
  .nav-inner { padding: 12px 16px; }
  .nav-links, .search-mock, .logo-sub { display: none; }
  .nav-right { gap: 8px; }
  .page { padding: 24px 16px 48px; }
  .hero { padding: 32px 0 26px; }
  .hero h1 { font-size: clamp(28px, 9vw, 42px); }
  .hero p { font-size: 14px; }
  .home-search { display: flex; }
  .discovery-controls { display: block; }
  .tab-chips { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 6px; }
  .chip { flex: 0 0 auto; min-height: 40px; display: flex; align-items: center; }
  .template-result-count { display: none; }
  .template-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .template-meta { padding-top: 10px; }
  .template-name { font-size: 14px; }
  .work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .section-divider { margin-top: 42px; }
  .about-section { margin-top: 52px; padding: 28px 24px; grid-template-columns: 1fr; gap: 18px; }
  .about-section h2 { font-size: 23px; }
  .template-detail, .work-detail, .finish-layout, .checkout-layout { grid-template-columns: 1fr; gap: 24px; }
  .detail-thumbs { overflow-x: auto; display: flex; }
  .detail-thumb { width: 68px; flex: 0 0 68px; }
  .checkout-section, .checkout-summary { padding: 20px; }
  .checkout-summary { position: static; }
  .form-row input, .form-row select { min-height: 46px; font-size: 16px; }
  .payment-option { min-height: 54px; }
  .btn-primary { min-height: 46px; }
  .tote-modal-inner { width: calc(100vw - 20px); padding: 42px 12px 18px; border-radius: 16px; }
  .tote-bag-preview-wrap { width: 100%; height: min(72vh, calc(100vw - 44px)); }
}

body.mobile-flow.creation-mode {
  overflow: hidden;
  overscroll-behavior: none;
}
body.mobile-flow.creation-mode .nav,
body.mobile-flow.creation-mode .utility-bar { display: none !important; }
body.mobile-flow.creation-mode .page-chat {
  /* 以手机真实可视区域为壳：地址栏展开/收起时，顶栏和画布一起移动。 */
  display: flex !important; flex-direction: column;
  position: fixed;
  top: var(--mobile-vv-top, 0px); left: 0; right: 0;
  width: 100%; height: var(--mobile-vv-height, 100dvh) !important;
  min-height: 0;
  padding: 0 !important; margin: 0 !important;
  max-width: none !important;
  background: #F5F3EE;
  overflow: hidden;
  --canvas-right-edge: 12px;
}
body.mobile-flow .mobile-creation-bar {
  --mobile-creation-bar-height: calc(58px + env(safe-area-inset-top));
  min-height: var(--mobile-creation-bar-height);
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  position: relative; z-index: 70; flex: 0 0 auto;
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
body.mobile-flow .mobile-template-details-btn { max-width: calc(100% - 140px); }
.mobile-text-btn,
.mobile-done-btn {
  border: 0; font: inherit; cursor: pointer;
  min-height: 40px; border-radius: 12px;
}
.mobile-template-details-btn {
  min-width: 0; max-width: 100%; min-height: 40px; padding: 0 10px 0 12px;
  display: flex; align-items: center; gap: 7px; border: 0; border-radius: 12px;
  background: #F1EFE8; color: var(--text); box-shadow: 0 3px 10px rgba(40,34,25,.12);
  font: inherit; cursor: pointer;
}
.mobile-template-details-btn:active { transform: translateY(1px); box-shadow: 0 1px 5px rgba(40,34,25,.12); }
.mobile-creation-title {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 14px; font-weight: 600;
}
.mobile-auth-credit {
  position: absolute; right: 12px; min-height: 34px; padding: 0 10px;
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid #d6cebc; border-radius: 999px; background: #fffaf0;
  color: #5f543e; font: inherit; font-size: 11px; cursor: pointer;
}
.mobile-auth-credit[hidden] { display: none; }
.mobile-template-details-btn svg { flex: 0 0 auto; }
.mobile-template-details-btn:focus-visible,
.mobile-product-picker-trigger:focus-visible,
.mobile-ai-hint-close:focus-visible { outline: 2px solid #5850D6; outline-offset: 2px; }
.mobile-creation-actions { display: flex; align-items: center; gap: 6px; }
.mobile-text-btn { padding: 0 11px; background: transparent; color: var(--text-2); font-size: 13px; }
.mobile-done-btn {
  padding: 0 15px; background: #20A86B; color: #fff; font-size: 13px; font-weight: 600;
  box-shadow: 0 0 0 1px rgba(32,168,107,.16), 0 0 16px rgba(32,168,107,.48);
  animation: finish-green-glow 2s ease-in-out infinite;
}

body.mobile-flow .chat-layout {
  display: block; flex: 1 1 auto; min-height: 0; height: auto;
  padding: 0; margin: 0;
}
body.mobile-flow .chat-panel { display: none; }
body.mobile-flow .canvas-panel {
  height: 100%; border-radius: 0; border: 0; background: #F5F3EE;
}
body.mobile-flow .canvas-panel-header,
body.mobile-flow .product-rail,
body.mobile-flow .canvas-tools,
body.mobile-flow .canvas-zoom-tools { display: none !important; }
/* 桌面端的缩放控件不进入手机创作流程。ID 选择器用于覆盖有图时的桌面显示规则。 */
body.mobile-flow .canvas-stage.has-image #canvas-zoom-tools { display: none !important; }
body.mobile-flow .creation-layout-controls {
  max-height: 104px; overflow-x: auto; overflow-y: hidden;
  top: 0; flex-wrap: nowrap; padding: 9px 12px; gap: 8px;
}
body.mobile-flow .creation-layout-variants,
body.mobile-flow .creation-layout-texts { flex-wrap: nowrap; }
body.mobile-flow .canvas-workspace { flex: 1; min-height: 0; position: relative; }
body.mobile-flow .canvas-stage {
  width: 100%; height: 100%;
  touch-action: none; overscroll-behavior: none;
}
body.mobile-flow .canvas-stage .upper-canvas { touch-action: none; }
body.mobile-flow .mobile-product-picker-trigger {
  display: flex; position: absolute; top: 12px; left: 12px; z-index: 36;
  align-items: center; justify-content: center; gap: 7px; min-height: 48px; padding: 0 16px;
  border: 1px solid rgba(23,23,23,.10); border-radius: 12px;
  background: rgba(255,255,255,.96); color: #171717; box-shadow: 0 5px 16px rgba(0,0,0,.13);
  font: 600 13px/1 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  cursor: pointer;
}
body.mobile-flow.mobile-product-picker-open .mobile-product-picker-trigger {
  background: #171717; border-color: #171717; color: #fff;
}
body.mobile-flow .mobile-product-picker-backdrop { display: none; }
body.mobile-flow.mobile-product-picker-open .mobile-product-picker-backdrop {
  display: block; position: absolute; inset: 0; z-index: 28; border: 0;
  background: rgba(20,19,17,.14); cursor: default;
}
body.mobile-flow.mobile-product-picker-open .product-rail {
  display: flex !important; position: absolute; top: 50%; left: 50%; z-index: 40;
  width: min(430px, calc(100% - 24px)); height: min(680px, calc(100% - 30px)); max-height: calc(100% - 30px);
  transform: translate(-50%, -50%);
  border: 1px solid rgba(23,23,23,.10); border-radius: 16px; overflow: hidden;
  background: rgba(251,250,246,.98); box-shadow: 0 14px 34px rgba(21,19,15,.19);
}
body.mobile-flow.mobile-product-picker-open .product-rail-head { padding: 12px 12px 9px; }
body.mobile-flow.mobile-product-picker-open .product-rail-head-actions .product-api-dot { margin-top: 0; }
body.mobile-flow.mobile-product-picker-open .product-list {
  flex: 0 1 46%; min-height: 0; max-height: 46%; padding: 0 10px 10px; gap: 9px;
}
body.mobile-flow.mobile-product-picker-open .product-config { padding: 10px 12px 12px; }
body.mobile-flow.mobile-product-picker-open .mobile-product-picker-close {
  width: 44px; height: 44px; border: 0; border-radius: 50%; background: #F1EFE8; color: var(--text);
  display: flex; align-items: center; justify-content: center; font: 20px/1 -apple-system, BlinkMacSystemFont, sans-serif;
  cursor: pointer;
}
body.mobile-flow.mobile-product-picker-open .product-card { min-height: 72px; padding: 8px; gap: 11px; }
body.mobile-flow.mobile-product-picker-open .product-card-thumb { width: 58px; height: 58px; }
body.mobile-flow.mobile-product-picker-open .product-card-copy strong { font-size: 14px; }
body.mobile-flow.mobile-product-picker-open .product-card-copy small { display: block; font-size: 11px; }
body.mobile-flow.mobile-product-picker-open .product-config-title { font-size: 15px; }
body.mobile-flow.mobile-product-picker-open .product-config-label,
body.mobile-flow.mobile-product-picker-open .product-config-value { font-size: 12px; }
body.mobile-flow.mobile-product-picker-open .product-color { width: 38px; height: 38px; padding: 4px; }
body.mobile-flow.mobile-product-picker-open .product-option { min-width: 44px; height: 42px; padding: 0 12px; font-size: 12px; }
body.mobile-flow.mobile-product-picker-open .product-mockup-btn { min-height: 46px; padding: 0 15px; font-size: 13px; }
body.mobile-flow.mobile-product-picker-open .mobile-media-dock { visibility: hidden; pointer-events: none; }
body.mobile-flow .canvas-empty-hint::after { content: '，或点击右下角 +'; }
body.mobile-flow .canvas-float-toolbar {
  max-width: calc(100vw - 24px); overflow-x: auto; overflow-y: hidden;
}
body.mobile-flow:not(.mobile-edit-open) .canvas-float-toolbar,
body.mobile-flow:not(.mobile-edit-open) .canvas-prop-bar { display: none !important; }
/* “编辑”直接复用桌面端 canvas 工具栏，保持两端工具能力一致。 */
body.mobile-flow.mobile-edit-open:not(.locked-layout-mode) .canvas-tools {
  display: flex !important;
  z-index: 34; top: 12px;
  padding: 6px;
}
body.mobile-flow.mobile-edit-open .canvas-tool { width: 48px; height: 48px; }
body.mobile-flow .float-btn { min-width: 46px; height: 44px; padding: 0 10px; }
body.mobile-flow .canvas-prop-bar {
  left: 8px; right: 8px; top: auto; bottom: calc(82px + env(safe-area-inset-bottom));
  transform: none; max-width: none; flex-wrap: nowrap; overflow-x: auto;
  padding: 9px 10px; gap: 8px;
}
body.mobile-flow .canvas-prop-bar .prop-btn { min-width: 44px; height: 44px; padding: 0 11px; font-size: 15px; }
body.mobile-flow .canvas-prop-bar .prop-select { height: 44px; padding-left: 12px; font-size: 14px; }
body.mobile-flow .canvas-prop-bar .effect-chip { height: 44px; padding: 0 14px; border-radius: 22px; font-size: 13px; }
body.mobile-flow .canvas-prop-bar .color-swatch { width: 34px; height: 34px; }
body.mobile-flow .canvas-prop-bar .prop-label,
body.mobile-flow .canvas-prop-bar .prop-num { font-size: 13px; }
body.mobile-flow .creation-layout-variant,
body.mobile-flow .layout-upload-btn { min-height: 44px; padding: 0 14px; font-size: 13px; }
body.mobile-flow .layout-text-input { height: 44px; font-size: 14px; }
body.mobile-flow .canvas-versions-bar {
  position: absolute; z-index: 12;
  left: 10px; right: 166px; bottom: calc(10px + env(safe-area-inset-bottom));
  padding: 4px; border: 0; pointer-events: none;
}
body.mobile-flow .canvas-versions { pointer-events: auto; }
body.mobile-flow .canvas-version { width: 48px; height: 48px; background: rgba(255,255,255,.92); }
body.mobile-flow .mobile-media-dock {
  display: flex; flex-direction: column; align-items: flex-end; gap: 9px;
  /* 作为创作页 visual-viewport 壳的子元素，避免浏览器底栏遮住上传操作。 */
  position: absolute; z-index: 50;
  left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
  pointer-events: none;
}
body.mobile-flow .mobile-ai-hint {
  display: block; align-self: flex-start;
  width: min(100%, 344px); pointer-events: auto;
  animation: mobile-ai-hint-in .22s ease both;
}
body.mobile-flow .mobile-ai-hint.is-hidden,
body.mobile-flow .mobile-media-dock.has-content .mobile-ai-hint:not(.is-error):not(.is-busy) { display: none; }
body.mobile-flow .mobile-ai-hint-bubble {
  position: relative; width: 100%; padding: 10px 12px;
  border: 1px solid rgba(23,23,23,.05); border-radius: 14px;
  background: rgba(241,239,232,.97); color: #242321;
  box-shadow: 0 8px 28px rgba(22,21,18,.10);
}
body.mobile-flow .mobile-ai-hint.is-error .mobile-ai-hint-bubble {
  background: #FFF0ED; border-color: rgba(181,64,44,.14); color: #8B3629;
}
body.mobile-flow .mobile-ai-hint-copy {
  margin: 0; white-space: pre-line; font: 13px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
body.mobile-flow .mobile-ai-hint-close {
  /* 关闭按钮浮在右上角，不为它额外留出一列文字空间。 */
  position: absolute; top: 3px; right: 3px; width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; background: transparent; color: currentColor;
  font: 19px/1 -apple-system, BlinkMacSystemFont, sans-serif; cursor: pointer;
}
body.mobile-flow .mobile-ai-hint-retry {
  min-height: 46px; margin-top: 11px; padding: 0 16px; border: 1px solid currentColor;
  border-radius: 10px; background: transparent; color: inherit;
  font: 600 12px/1 -apple-system, BlinkMacSystemFont, sans-serif; cursor: pointer;
}

/* 手机端不显示桌面聊天栏，因此图片 AI 输入作为独立的、只绑定当前图片的底部抽屉。 */
.mobile-image-ai-backdrop { display: none; }
body.mobile-flow .mobile-image-ai-backdrop {
  display: flex; position: fixed; inset: 0; z-index: 1280;
  align-items: flex-end; justify-content: center;
  padding: 18px 12px 12px; background: rgba(15,15,15,.42);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .2s ease, visibility .2s ease;
}
body.mobile-flow .mobile-image-ai-backdrop.open {
  opacity: 1; visibility: visible; pointer-events: auto;
}
body.mobile-flow .mobile-image-ai-sheet {
  width: min(100%, 500px); max-height: calc(var(--mobile-vv-height, 100dvh) - 24px);
  overflow-y: auto; overscroll-behavior: contain;
  padding: 17px 16px calc(16px + env(safe-area-inset-bottom));
  border-radius: 22px; background: #fff; color: var(--text);
  box-shadow: 0 20px 60px rgba(0,0,0,.28);
  transform: translateY(22px); transition: transform .2s ease;
}
body.mobile-flow .mobile-image-ai-backdrop.open .mobile-image-ai-sheet { transform: translateY(0); }
body.mobile-flow .mobile-image-ai-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
}
body.mobile-flow .mobile-image-ai-head strong { display: block; font-size: 17px; line-height: 1.25; }
body.mobile-flow .mobile-image-ai-head span {
  display: block; margin-top: 4px; color: var(--text-3); font-size: 12px; line-height: 1.45;
}
body.mobile-flow .mobile-image-ai-head button {
  width: 40px; height: 40px; margin: -6px -6px 0 0; border: 0; border-radius: 50%;
  background: transparent; color: var(--text-2); font: 23px/1 -apple-system, BlinkMacSystemFont, sans-serif;
  cursor: pointer;
}
body.mobile-flow .mobile-image-ai-reference {
  display: none; align-items: center; gap: 10px; margin-top: 14px; padding: 8px;
  border-radius: 13px; background: #F5F3EE;
}
body.mobile-flow .mobile-image-ai-reference.has-image { display: flex; }
body.mobile-flow .mobile-image-ai-reference img {
  width: 46px; height: 46px; flex: 0 0 46px; border-radius: 9px; object-fit: cover; background: #E5E2DA;
}
body.mobile-flow .mobile-image-ai-reference span { min-width: 0; color: var(--text-2); font-size: 12px; line-height: 1.45; }
body.mobile-flow .mobile-image-ai-label {
  display: block; margin: 15px 0 7px; color: var(--text-2); font-size: 12px; font-weight: 600;
}
body.mobile-flow .mobile-image-ai-sheet textarea {
  width: 100%; min-height: 82px; resize: none; box-sizing: border-box; padding: 11px 12px;
  border: 1px solid var(--line); border-radius: 13px; outline: 0; background: #FBFAF7;
  color: var(--text); font: 14px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
body.mobile-flow .mobile-image-ai-sheet textarea:focus { border-color: #5850D6; box-shadow: 0 0 0 3px rgba(88,80,214,.12); }
body.mobile-flow .mobile-image-ai-submit {
  width: 100%; min-height: 52px; margin-top: 12px; border: 0; border-radius: 13px;
  background: #171717; color: #fff; font: 650 15px/1 -apple-system, BlinkMacSystemFont, sans-serif; cursor: pointer;
}
body.mobile-flow .mobile-image-ai-submit:disabled { opacity: .48; cursor: wait; }
@keyframes mobile-ai-hint-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
body.mobile-flow .mobile-image-tray {
  display: none; min-width: 0; height: 62px; flex: 1 1 auto;
  flex-direction: row; align-items: center; gap: 9px;
  overflow-x: auto; overflow-y: hidden; margin-left: -34px; padding: 5px 7px 5px 29px;
  pointer-events: auto; scrollbar-width: none; position: relative; z-index: 1;
}
body.mobile-flow .mobile-action-row {
  width: 100%; display: flex; align-items: center; justify-content: flex-end; gap: 7px;
  pointer-events: none;
}
body.mobile-flow .mobile-media-dock.has-content .mobile-action-row {
  display: flex; align-items: center; justify-content: flex-start; gap: 8px;
}
body.mobile-flow .mobile-post-actions { display: none; flex: 0 0 auto; align-items: center; pointer-events: auto; }
body.mobile-flow .mobile-media-dock.has-content .mobile-post-actions {
  display: flex; margin-left: auto; gap: 6px;
}
body.mobile-flow .mobile-post-actions button {
  width: 54px; height: 54px; flex: 0 0 54px; padding: 5px 4px; border: 1px solid rgba(23,23,23,.12);
  border-radius: 50%; background: rgba(255,255,255,.94); color: #171717;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  box-shadow: 0 5px 18px rgba(0,0,0,.12); font: inherit; cursor: pointer;
}
body.mobile-flow .mobile-post-actions button.active { color: #fff; background: #5850D6; border-color: #5850D6; }
body.mobile-flow .mobile-post-actions button:nth-child(3) {
  color: #fff; background: #20A86B; border-color: #20A86B;
  box-shadow: 0 0 0 1px rgba(32,168,107,.16), 0 0 16px rgba(32,168,107,.52);
  animation: finish-green-glow 2s ease-in-out infinite;
}
body.mobile-flow .mobile-post-actions b { font-size: 11px; line-height: 1; opacity: .55; }
body.mobile-flow .mobile-post-actions span { font-size: 14px; line-height: 1.1; font-weight: 650; }
body.mobile-flow .mobile-image-tray::-webkit-scrollbar { display: none; }
body.mobile-flow .mobile-image-tray.has-images { display: flex; }
body.mobile-flow .mobile-image-thumb {
  position: relative; width: 52px; height: 52px; flex: 0 0 52px;
  padding: 2px; border: 2px solid rgba(255,255,255,.94); border-radius: 50%;
  overflow: visible; background: #fff; cursor: pointer;
  box-shadow: 0 3px 12px rgba(0,0,0,.17);
}
body.mobile-flow .mobile-image-thumb.active { border-color: #171717; transform: scale(1.06); }
body.mobile-flow .mobile-image-thumb img { width: 100%; height: 100%; display: block; object-fit: cover; border-radius: 50%; }
body.mobile-flow .mobile-image-thumb span {
  position: absolute; right: -5px; top: -5px; min-width: 17px; height: 17px;
  padding: 0 4px; border-radius: 9px; background: #171717; color: #fff;
  font: 10px/17px -apple-system, BlinkMacSystemFont, sans-serif; text-align: center;
}
body.mobile-flow .mobile-upload-fab {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; width: auto; min-width: 154px; height: 58px; padding: 0 18px;
  border: 0; border-radius: 29px;
  background: #171717; color: #fff; cursor: pointer;
  box-shadow: 0 8px 28px rgba(0,0,0,.28);
  pointer-events: auto; white-space: nowrap; font: 600 13px/1 -apple-system, BlinkMacSystemFont, sans-serif;
  flex: 0 0 auto; position: relative; z-index: 2;
}
body.mobile-flow .mobile-media-dock.has-content .mobile-upload-fab {
  min-width: 120px; padding: 0 15px;
}

@keyframes finish-green-glow {
  0%, 100% { box-shadow: 0 0 0 1px rgba(32,168,107,.14), 0 0 12px rgba(32,168,107,.38); }
  50% { box-shadow: 0 0 0 2px rgba(32,168,107,.22), 0 0 21px rgba(32,168,107,.64); }
}

@media (max-width: 380px) {
  body.mobile-flow .mobile-media-dock { left: 10px; right: 10px; }
  body.mobile-flow .mobile-media-dock.has-content .mobile-action-row { gap: 5px; }
  body.mobile-flow .mobile-post-actions { gap: 4px; }
  body.mobile-flow .mobile-post-actions button { width: 50px; height: 50px; flex-basis: 50px; }
  body.mobile-flow .mobile-post-actions span { font-size: 12px; }
  body.mobile-flow .mobile-media-dock.has-content .mobile-upload-fab {
    min-width: 104px; height: 54px; padding: 0 12px;
  }
  body.mobile-flow .mobile-image-tray { height: 56px; margin-left: -31px; padding-left: 27px; gap: 7px; }
  body.mobile-flow .mobile-image-thumb { width: 48px; height: 48px; flex-basis: 48px; }
}

body.mobile-flow .mobile-details-backdrop {
  display: block; position: fixed; inset: 0; z-index: 1100;
  background: rgba(16,16,16,.38); opacity: 0; visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
}
body.mobile-flow .mobile-details-backdrop.open { opacity: 1; visibility: visible; }
.mobile-details-drawer {
  width: min(88vw, 390px); height: 100%; background: #fff;
  transform: translateX(-102%); transition: transform .24s ease;
  display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top);
  box-shadow: 18px 0 50px rgba(0,0,0,.18);
}
.mobile-details-backdrop.open .mobile-details-drawer { transform: translateX(0); }
.mobile-details-head {
  height: 56px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--line); flex: 0 0 auto;
}
.mobile-details-head button {
  width: 38px; height: 38px; border: 0; border-radius: 50%;
  background: var(--subtle); color: var(--text); font-size: 22px;
}
.mobile-details-scroll { overflow-y: auto; padding: 16px 16px calc(28px + env(safe-area-inset-bottom)); }
.mobile-details-cover { width: 100%; aspect-ratio: 1; border-radius: 16px; object-fit: cover; background: var(--subtle); }
.mobile-details-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 10px; }
.mobile-details-tags span { padding: 5px 9px; border-radius: 999px; background: var(--subtle); color: var(--text-2); font-size: 11px; }
.mobile-details-scroll h2 { font-size: 24px; line-height: 1.25; }
.mobile-details-desc { margin-top: 8px; color: var(--text-2); font-size: 14px; line-height: 1.7; }
.mobile-details-section { margin-top: 26px; }
.mobile-details-section h3 { font-size: 14px; margin-bottom: 10px; }
.mobile-details-section p,
.mobile-details-section li { color: var(--text-2); font-size: 14px; line-height: 1.7; }
.mobile-details-section ol { padding-left: 20px; }
#mobile-details-howto {
  padding: 2px 0 8px; list-style: none; counter-reset: mobile-howto;
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(210px, 82%); gap: 10px;
  overflow-x: auto; overscroll-behavior-inline: contain; scroll-snap-type: x proximity;
  mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 24px), transparent 100%);
}
#mobile-details-howto li {
  min-height: 112px; padding: 38px 14px 14px; position: relative; scroll-snap-align: start;
  border: 1px solid var(--line); border-radius: 13px; background: #F8F6F1; counter-increment: mobile-howto;
}
#mobile-details-howto li::before {
  content: counter(mobile-howto); position: absolute; top: 12px; left: 14px;
  width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%;
  background: #171717; color: #fff; font-size: 10px; font-weight: 700;
}
.mobile-review { padding: 13px 0; border-top: 1px solid var(--line); }
.mobile-review strong { font-size: 12px; }
.mobile-review p { margin-top: 5px; }
.mobile-creator-card {
  margin-top: 18px; padding: 14px; border-radius: 15px; background: #F5F3EE;
  align-items: flex-start; gap: 11px; cursor: pointer;
  border: 1px solid transparent; transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.mobile-creator-card:hover { border-color: #D8D1C3; box-shadow: 0 7px 20px rgba(24,21,16,.08); }
.mobile-creator-card:active { transform: scale(.985); }
.mobile-creator-card:focus-visible { outline: 2px solid #5850D6; outline-offset: 2px; }
.mobile-creator-avatar {
  width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700;
}
.mobile-creator-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.mobile-creator-copy strong { font-size: 14px; display: flex; align-items: center; flex-wrap: wrap; }
.mobile-creator-copy > span { margin-top: 2px; color: var(--text-3); font-size: 10px; }
.mobile-creator-copy p { margin-top: 8px; color: var(--text-2); font-size: 12px; line-height: 1.6; }
.mobile-creator-arrow { flex: 0 0 auto; align-self: center; color: #9B8C73; font-size: 24px; line-height: 1; }

body.mobile-flow .mobile-exit-backdrop {
  display: flex; position: fixed; inset: 0; z-index: 1300; padding: 20px;
  align-items: flex-end; justify-content: center; background: rgba(15,15,15,.42);
  opacity: 0; visibility: hidden;
}
body.mobile-flow .mobile-exit-backdrop.open { opacity: 1; visibility: visible; }
.mobile-exit-dialog {
  width: min(100%, 390px); padding: 22px 18px calc(14px + env(safe-area-inset-bottom));
  border-radius: 22px; background: #fff; box-shadow: 0 20px 60px rgba(0,0,0,.25);
  transform: translateY(16px); transition: transform .2s ease;
}
.mobile-exit-backdrop.open .mobile-exit-dialog { transform: translateY(0); }
.mobile-exit-dialog h3 { font-size: 19px; }
.mobile-exit-dialog p { margin: 7px 0 18px; color: var(--text-2); font-size: 13px; line-height: 1.55; }
.mobile-exit-dialog button {
  width: 100%; min-height: 46px; margin-top: 8px; border: 0; border-radius: 13px;
  font: 600 14px/1 -apple-system, BlinkMacSystemFont, sans-serif; cursor: pointer;
}
.mobile-exit-save { background: #171717; color: #fff; }
.mobile-exit-discard { background: #F1EFE8; color: #171717; }
.mobile-exit-cancel { background: transparent; color: var(--text-2); }

/* 模板小工具在手机上作为独立全屏步骤打开。 */
body.mobile-flow .image-tool-modal { padding: 0; align-items: stretch; background: #fff; }
body.mobile-flow .image-tool-dialog {
  width: 100%; height: 100dvh; max-width: none; max-height: none;
  border-radius: 0; box-shadow: none;
}
body.mobile-flow .image-tool-header { padding: calc(12px + env(safe-area-inset-top)) 16px 12px; }
body.mobile-flow .image-tool-close { width: 44px; height: 44px; }
body.mobile-flow .image-tool-subtitle { display: none; }
body.mobile-flow .image-tool-layout { display: block; overflow-y: auto; }
body.mobile-flow .image-tool-workspace { padding: 14px 16px 24px; overflow: visible; }
body.mobile-flow .image-tool-preview-wrap { height: min(42dvh, 360px); }
body.mobile-flow .image-tool-control { grid-template-columns: 58px 1fr 42px; min-height: 42px; }
body.mobile-flow .image-tool-footer { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
body.mobile-flow .image-tool-btn { min-height: 52px; padding: 0 18px; font-size: 14px; }
body.mobile-flow .image-tool-list-item { min-height: 56px; }
body.mobile-flow .mobile-exit-dialog button { min-height: 52px; font-size: 15px; }

@media (orientation: landscape) and (max-height: 600px) {
  body.mobile-flow .mobile-creation-bar {
    --mobile-creation-bar-height: calc(50px + env(safe-area-inset-top));
    min-height: var(--mobile-creation-bar-height);
    padding-top: calc(5px + env(safe-area-inset-top)); padding-bottom: 5px;
  }
  body.mobile-flow .mobile-upload-fab { min-width: 132px; height: 52px; padding: 0 14px; }
  body.mobile-flow .mobile-media-dock.has-content .mobile-upload-fab { min-width: 110px; }
  body.mobile-flow .mobile-post-actions button { height: 52px; }
  body.mobile-flow .image-tool-layout { display: grid; grid-template-columns: 1fr 1fr; }
  body.mobile-flow .image-tool-preview-wrap { height: calc(100dvh - 150px); }
}

/* Creation confirmation and checkout share one readable purchase flow. */
.checkout-minimal-nav {
  min-height: 72px; margin: -12px 0 22px; padding-bottom: 18px;
  display: flex; justify-content: flex-end; align-items: center;
  border-bottom: 1px solid var(--line);
}
.checkout-security { justify-self: end; display: flex; align-items: center; gap: 9px; color: #406653; }
.checkout-security > span:first-child { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: #E8F1EA; }
.checkout-security strong, .checkout-security small { display: block; white-space: nowrap; }
.checkout-security strong { font-size: 11px; }
.checkout-security small { margin-top: 2px; color: var(--text-3); font-size: 9px; font-weight: 400; }
.purchase-heading { display: flex; justify-content: space-between; align-items: center; gap: 28px; margin: 26px 0 32px; }
.purchase-eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 2px; color: #6c7d70; margin-bottom: 10px; }
.purchase-heading h1 { font-size: clamp(25px, 3vw, 34px); font-weight: 600; line-height: 1.3; letter-spacing: -1px; }
.purchase-heading p { margin-top: 10px; font-size: 14px; color: var(--text-2); }
.purchase-steps { list-style: none; display: flex; align-items: center; gap: 22px; flex-shrink: 0; }
.purchase-steps li { display: flex; align-items: center; gap: 7px; color: var(--text-2); font-size: 12px; white-space: nowrap; }
.purchase-steps b { display: grid; place-items: center; border-radius: 50%; width: 26px; height: 26px; background: var(--subtle); font-size: 12px; font-weight: 500; }
.purchase-steps .active { color: var(--text); font-weight: 600; }
.purchase-steps .active b { color: #fff; background: #244d3e; }
.purchase-steps .done b { color: #244d3e; background: #e3eee7; }
#page-finish { max-width: 1260px; padding-top: 16px; }
#page-finish .purchase-heading { margin-top: 8px; margin-bottom: 24px; }
#page-finish .finish-mobile-steps { display: none; }
#page-finish .finish-layout { grid-template-columns: minmax(0, 1fr) minmax(330px, 390px); gap: 32px; }
.finish-art-column { min-width: 0; }
#page-finish .finish-preview-wrap { padding: 20px; border-radius: 20px; background: #eae7e0; border: 1px solid #dedbd3; }
#page-finish .finish-preview { aspect-ratio: auto; height: clamp(430px, 65vh, 690px); background: transparent; position: relative; }
#page-finish .finish-preview img { width: 100%; height: 100%; object-fit: contain; padding: 0; }
.purchase-preview-open { width: 100%; height: 100%; border: 0; padding: 0; border-radius: 12px; background: transparent; cursor: zoom-in; position: relative; overflow: hidden; font: inherit; }
.purchase-preview-open:focus-visible { outline: 3px solid #406653; outline-offset: 4px; }
.purchase-preview-zoom { position: absolute; right: 0; bottom: 0; display: flex; align-items: center; gap: 7px; padding: 10px 14px; border: 1px solid #fff9; border-radius: 999px; background: #fffffff0; color: #31453a; font-size: 12px; white-space: nowrap; box-shadow: 0 2px 12px #00000006; }
#page-finish .purchase-preview-zoom svg { width: 16px; height: 16px; flex: none; }
.purchase-preview-open:hover .purchase-preview-zoom { background: #fff; border-color: #40665366; }
#page-finish .finish-view-toggle { margin-top: 12px; }
#page-finish .finish-view-btn { min-height: 46px; border: 0; background: transparent; font: inherit; font-size: 14px; }
#page-finish .finish-view-btn.active { background: #244d3e; color: #fff; }
.purchase-preview-caption { color: var(--text-2); font-size: 12px; line-height: 1.7; margin: 12px 2px 22px; min-height: 21px; }
.purchase-render-action { position: absolute; inset: auto 10px 10px; border-radius: 13px; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: rgba(255,255,255,.95); box-shadow: 0 3px 20px #0000000a; }
.purchase-render-action span { font-size: 12px; color: var(--text-2); }
.purchase-render-action button { flex-shrink: 0; min-height: 44px; margin: 0; }
.purchase-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.purchase-section-heading h2 { font-size: 16px; font-weight: 600; line-height: 1.4; }
.purchase-section-heading > span { color: var(--text-2); font-size: 12px; }
.purchase-check-card { background: #fff; padding: 22px; border: 1px solid var(--line); border-radius: 16px; }
.purchase-check { display: flex; gap: 12px; align-items: flex-start; margin-top: 17px; }
.purchase-check-icon { flex-shrink: 0; width: 23px; height: 23px; border-radius: 50%; display: grid; place-items: center; color: #276043; background: #e8f1ea; font-size: 12px; font-weight: 600; }
.purchase-check strong { display: block; font-size: 13px; font-weight: 600; }
.purchase-check p, .purchase-muted { margin-top: 4px; color: var(--text-2); font-size: 12px; line-height: 1.8; }
.purchase-check.warning .purchase-check-icon { background: #fbefda; color: #966117; }
.purchase-reviews { margin-top: 22px; padding: 4px 2px 16px; }
.purchase-reviews .purchase-section-heading { margin-bottom: 8px; }
#page-finish .finish-actions-col {
  position: static; align-self: start;
  height: fit-content; gap: 0;
}
#page-finish .finish-actions-col.is-fixed {
  position: fixed; z-index: 60;
  top: var(--finish-sidebar-top); left: var(--finish-sidebar-left);
  width: var(--finish-sidebar-width);
}
#page-finish .finish-sidebar-steps {
  width: 100%; margin: 0 0 24px; padding: 0;
  justify-content: space-between; gap: 6px;
}
.purchase-product-card { padding: 26px; border-radius: 18px; border: 1px solid var(--line); box-shadow: 0 8px 30px #00000003; }
.purchase-product-card .finish-template-tag { font-size: 12px; margin: -5px 0 20px; color: var(--text-2); }
.purchase-product-card .pf-finish-thumb { width: 64px; height: 72px; background: #f5f4f0; border-radius: 10px; }
.purchase-product-card .pf-finish-copy strong { font-size: 17px; }
.purchase-product-card .pf-finish-copy small { font-size: 13px; color: var(--text-2); margin-top: 5px; }
.purchase-product-card .pf-finish-empty { color: var(--text-2); }
#page-finish .pf-purchase-size { margin-top: 26px; }
#page-finish .pf-purchase-label, #page-checkout .pf-purchase-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--text); margin-bottom: 10px; }
#page-finish .pf-purchase-options, #page-checkout .pf-purchase-options { gap: 8px; }
#page-finish .pf-purchase-option, #page-checkout .pf-purchase-option { min-width: 48px; height: 46px; padding: 0 12px; border: 1px solid var(--line-strong); background: #fff; color: var(--text); font-size: 14px; border-radius: 10px; }
#page-finish .pf-purchase-option:hover, #page-checkout .pf-purchase-option:hover { border-color: #244d3e; }
#page-finish .pf-purchase-option.active, #page-checkout .pf-purchase-option.active { color: #fff; border-color: #244d3e; background: #244d3e; }
#page-finish .pf-purchase-option.disabled, #page-checkout .pf-purchase-option.disabled { color: #a1a19b; background: #f4f3f0; opacity: .65; text-decoration: line-through; cursor: not-allowed; }
.purchase-one-size { color: var(--text-2); font-size: 13px; margin: 22px 0; }
.purchase-product-card .pf-purchase-price { border-color: var(--line); margin-top: 24px; padding-top: 22px; }
.purchase-product-card .pf-purchase-price span { font-size: 13px; color: var(--text-2); }
.purchase-product-card .pf-purchase-price strong { font-size: 28px; font-weight: 600; }
.purchase-price-note { margin-top: 6px; font-size: 12px; color: var(--text-2); }
.purchase-next-wrap { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 22px; }
.purchase-next-wrap .purchase-continue {
  width: 100%; min-height: 52px; padding: 12px 18px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 14px; line-height: 1.35; border-radius: 12px;
  background: #244d3e; color: #fff;
}
.purchase-continue-label { min-width: 0; }
.purchase-continue-arrow { flex: none; font-size: 16px; line-height: 1; }
.purchase-continue-arrow[hidden] { display: none; }
.purchase-next-wrap .purchase-continue:disabled { background: #e7e8e2; color: #7b8077; cursor: not-allowed; box-shadow: none; }
.purchase-next-wrap p { font-size: 12px; line-height: 1.8; color: var(--text-2); text-align: center; margin-top: 10px; }
.purchase-text-button { padding: 6px 0; border: 0; background: transparent; cursor: pointer; font: inherit; font-size: 12px; color: #406653; text-underline-offset: 4px; }
.purchase-text-button:hover { text-decoration: underline; }
#page-checkout .checkout-layout { gap: 32px; grid-template-columns: minmax(0, 1fr) 390px; align-items: start; }
#page-checkout .checkout-section { border-radius: 16px; }
.purchase-section-number { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: #eff2ec; color: #406653; font-size: 11px; margin-right: 10px; }
#page-checkout .form-row input, #page-checkout .form-row select { min-height: 48px; font-size: 15px; }
#page-checkout [aria-invalid="true"] { border-color: #be6b4b; outline: 2px solid #be6b4b20; }
#page-checkout .checkout-summary { border-radius: 18px; padding: 26px; min-width: 0; }
#page-checkout .summary-item { align-items: center; gap: 16px; }
#page-checkout .summary-thumb { width: 120px; height: 144px; flex-shrink: 0; background: #efeee8; border-radius: 12px; padding: 5px; overflow: hidden; }
.checkout-thumb-open { position: relative; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 9px; overflow: hidden; background: transparent; cursor: zoom-in; }
.checkout-thumb-open img { display: block; width: 100%; height: 100%; object-fit: contain; image-rendering: auto; }
.checkout-thumb-open span { position: absolute; right: 5px; bottom: 5px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: #244d3e; background: #fffffff0; box-shadow: 0 2px 8px #0002; font-size: 13px; }
.checkout-thumb-open:focus-visible { outline: 3px solid #406653; outline-offset: 2px; }
#page-checkout .summary-name { font-size: 17px; }
#page-checkout .summary-spec { line-height: 1.8; font-size: 12px; }
.checkout-spec-status { font-size: 12px; color: #406653; margin: -4px 0 24px; }
.checkout-action-hint { color: var(--text-2); font-size: 12px; line-height: 1.7; margin-top: 18px; text-align: center; }
#checkout-submit-btn { background: #244d3e; color: #fff; min-height: 52px; border-radius: 12px; }
#checkout-submit-btn:disabled { cursor: not-allowed; background: #e7e8e2; color: #7b8077; opacity: 1; }
.purchase-size-dialog { position: fixed; inset: 0; margin: auto; width: min(640px, calc(100% - 32px)); max-height: 85dvh; border: 0; border-radius: 20px; padding: 26px; box-shadow: 0 20px 100px #0003; overflow: auto; color: var(--text); }
.purchase-size-dialog::backdrop { background: #18251b66; backdrop-filter: blur(4px); }
.purchase-dialog-close { width: 44px; height: 44px; border: 0; border-radius: 50%; cursor: pointer; font: inherit; font-size: 26px; background: #f2f1ec; }
.purchase-guide-note { color: var(--text-2); font-size: 13px; line-height: 1.8; margin: 16px 0; white-space: pre-line; }
.purchase-size-table { overflow-x: auto; }
.purchase-size-table table { width: 100%; border-collapse: collapse; font-size: 13px; }
.purchase-size-table th, .purchase-size-table td { border-bottom: 1px solid var(--line); padding: 12px; text-align: left; white-space: nowrap; }
.purchase-size-table thead { background: #f5f4ef; }
.purchase-checkout-size summary { display: flex; justify-content: space-between; align-items: center; min-height: 44px; font-size: 13px; cursor: pointer; }
.purchase-checkout-size summary span { color: #406653; font-size: 12px; }
.purchase-checkout-size[open] summary { margin-bottom: 12px; }
.shipping-quote-box select:disabled { display: none; }
@media (max-width: 1000px) {
  .purchase-heading { align-items: flex-start; flex-direction: column; gap: 20px; }
  #page-finish .finish-layout { gap: 24px; grid-template-columns: minmax(0, 1fr) 330px; }
  #page-checkout .checkout-layout { grid-template-columns: minmax(0, 1fr) 330px; gap: 24px; }
}
@media (min-width: 761px) and (max-height: 720px) {
  #page-finish .finish-sidebar-steps { margin-bottom: 16px; }
  #page-finish .purchase-product-card { padding: 20px 22px; }
  #page-finish .purchase-product-card .purchase-section-heading { margin-bottom: 14px; }
  #page-finish .purchase-product-card .finish-template-tag { margin-bottom: 14px; }
  #page-finish .purchase-one-size { margin: 16px 0; }
  #page-finish .purchase-product-card .pf-purchase-price { margin-top: 18px; padding-top: 18px; }
  #page-finish .purchase-next-wrap { margin-top: 16px; padding-top: 16px; }
  #page-finish .purchase-next-wrap .purchase-continue { min-height: 48px; }
  #page-finish .purchase-next-wrap p { margin-top: 7px; line-height: 1.5; }
}
@media (max-width: 760px) {
  .checkout-minimal-nav {
    margin: -6px 0 18px; padding-bottom: 14px;
  }
  .checkout-security { width: 100%; padding: 10px 12px; border-radius: 12px; background: #F0F4F0; }
  .checkout-security strong, .checkout-security small { white-space: normal; }
  .purchase-heading { margin: 18px 0 24px; }
  .purchase-heading h1 { font-size: 25px; }
  .purchase-heading p { font-size: 13px; }
  .purchase-steps { width: 100%; justify-content: space-between; gap: 10px; }
  .purchase-steps li { font-size: 11px; gap: 5px; }
  .purchase-steps b { width: 23px; height: 23px; }
  #page-finish .finish-mobile-steps { display: flex; }
  #page-finish .finish-sidebar-steps { display: none; }
  #page-finish .finish-layout, #page-checkout .checkout-layout { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  #page-finish .finish-art-column { display: contents; }
  #page-finish .finish-preview-wrap { padding: 16px; grid-row: 1; }
  #page-finish .finish-preview { height: clamp(340px, 55dvh, 510px); }
  #page-finish .finish-view-toggle { grid-row: 2; margin: -10px 0 0; }
  #page-finish .purchase-preview-caption { grid-row: 3; margin: -10px 2px 0; }
  #page-finish .finish-actions-col { position: static; grid-row: 4; }
  #page-finish .purchase-check-card { grid-row: 5; }
  #page-finish .purchase-reviews { grid-row: 6; margin: 0; }
  .purchase-product-card { padding: 22px; }
  #page-checkout .checkout-summary { position: static; padding: 22px; }
  #page-checkout .summary-thumb { width: 112px; height: 134px; }
  #page-checkout .checkout-form-grid { grid-template-columns: 1fr; }
  #page-checkout .checkout-form-wide { grid-column: auto; }
  #page-checkout .form-row input, #page-checkout .form-row select { font-size: 16px; }
  .purchase-render-action { flex-direction: column; text-align: center; gap: 8px; }
  .purchase-size-dialog { padding: 20px; }
}

/* Full-size product photos, kept separate from the editable/print canvas. */
.product-image-viewer { position: fixed; inset: 0; margin: auto; width: min(1440px, calc(100vw - 48px)); height: calc(100dvh - 48px); max-width: 100vw; max-height: 100dvh; padding: 0; border: 1px solid #fff8; border-radius: 20px; background: #faf9f6; color: var(--text); overflow: hidden; box-shadow: 0 24px 100px #0004; }
.product-image-viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.product-image-viewer::backdrop { background: #131a17a6; backdrop-filter: blur(8px); }
.product-viewer-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 24px; border-bottom: 1px solid var(--line); }
.product-viewer-header strong { font-size: 17px; font-weight: 600; }
.product-viewer-header p { margin-top: 2px; font-size: 12px; color: var(--text-2); }
.product-viewer-close { width: 44px; height: 44px; flex-shrink: 0; border: 0; border-radius: 50%; background: #ecebe5; font: inherit; font-size: 28px; cursor: pointer; }
.product-viewer-stage { min-width: 0; min-height: 0; position: relative; overflow: hidden; background: radial-gradient(ellipse at 50% 42%, #f5f3ed, #e5e1d8); touch-action: none; overscroll-behavior: contain; user-select: none; -webkit-user-select: none; cursor: zoom-in; }
.product-viewer-stage:focus-visible { outline: 2px solid #406653; outline-offset: -3px; }
.product-viewer-stage.zoomed { cursor: grab; }
.product-viewer-stage.dragging.zoomed { cursor: grabbing; }
#product-viewer-image { position: absolute; left: 50%; top: 50%; max-width: none; max-height: none; object-fit: contain; pointer-events: none; transform-origin: center; will-change: transform; -webkit-user-drag: none; }
.product-viewer-message { position: absolute; inset: 0; display: grid; place-items: center; font-size: 14px; color: var(--text-2); pointer-events: none; }
.product-viewer-message[hidden] { display: none; }
.product-viewer-footer { padding: 12px 24px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; background: #faf9f6; }
.product-viewer-thumbs { display: flex; gap: 8px; }
.product-viewer-thumb { width: 48px; height: 54px; padding: 3px; border: 1px solid var(--line-strong); border-radius: 8px; background: #eae7e0; cursor: pointer; }
.product-viewer-thumb[aria-pressed="true"] { border: 2px solid #244d3e; }
.product-viewer-thumb img { width: 100%; height: 100%; object-fit: contain; }
.product-viewer-tools { display: flex; align-items: center; gap: 6px; }
.product-viewer-tools button { width: 44px; height: 44px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; font: inherit; font-size: 23px; cursor: pointer; color: var(--text); }
.product-viewer-tools button:disabled { opacity: .35; cursor: default; }
.product-viewer-tools output { min-width: 48px; text-align: center; font-size: 12px; font-variant-numeric: tabular-nums; }
.product-viewer-tools .product-viewer-fit { width: auto; padding: 0 14px; font-size: 12px; margin-left: 6px; }
.product-viewer-help { justify-self: end; color: var(--text-2); font-size: 11px; line-height: 1.7; text-align: right; }
.product-viewer-help span + span { display: none; }
@media (pointer: coarse) {
  .product-viewer-help span:first-child { display: none; }
  .product-viewer-help span + span { display: inline; }
}
@media (max-width: 760px) {
  .product-image-viewer { width: 100vw; height: 100dvh; border: 0; border-radius: 0; }
  .product-viewer-header { padding: calc(12px + env(safe-area-inset-top)) 16px 12px; }
  .product-viewer-footer { grid-template-columns: 1fr; justify-items: center; gap: 10px; padding: 12px 12px calc(14px + env(safe-area-inset-bottom)); }
  .product-viewer-thumbs:empty { display: none; }
  .product-viewer-thumbs { grid-row: 2; }
  .product-viewer-tools { grid-row: 1; }
  .product-viewer-help { justify-self: center; text-align: center; }
  .product-viewer-help span:first-child { display: none; }
  .product-viewer-help span + span { display: inline; }
}
