/* ===== Printoria — US-market design system =====
   American e-commerce aesthetic: warm off-white, bold display type,
   generous whitespace, soft shadows, vivid violet + amber accents   */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --brand: #6c47ff; --brand-dark: #5533e0; --amber: #ffb020; --coral: #ff5d5d;
  --bg: #fdfaf6; --card: #ffffff; --ink: #232035; --muted: #6f6c7e;
  --border: #ece7df; --green: #0d9f6e;
  --shadow: 0 2px 10px rgba(35,32,53,.05), 0 10px 30px rgba(35,32,53,.06);
  --shadow-lg: 0 12px 40px rgba(35,32,53,.12);
  --radius: 18px;
}
body { font-family: "Inter", -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.6; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3 { letter-spacing: -0.02em; line-height: 1.15; }

/* Top bar */
.topbar { background: rgba(255,255,255,.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.topbar-inner { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; gap: 26px; padding: 14px 24px; }
.logo { font-size: 22px; font-weight: 800; color: var(--ink); display: flex; align-items: center; gap: 7px; }
.logo em { color: var(--brand); font-style: normal; }
.nav { display: flex; gap: 20px; flex: 1; flex-wrap: wrap; align-items: center; }
.nav a { color: var(--muted); font-size: 14px; font-weight: 500; }
.nav a:hover { color: var(--brand); }

/* "More" dropdown in nav */
.nav-more { position: relative; display: inline-block; }
.nav-more-btn { user-select: none; }
.nav-dropdown { display: none; position: absolute; top: calc(100% + 10px); left: 50%;
  transform: translateX(-50%); min-width: 190px; background: #fff; border-radius: 14px;
  box-shadow: var(--shadow-lg); padding: 8px; z-index: 60; border: 1px solid var(--border); }
.nav-dropdown a { display: block; padding: 9px 14px; border-radius: 9px; font-size: 14px;
  color: var(--ink); font-weight: 500; white-space: nowrap; }
.nav-dropdown a:hover { background: #f3edff; color: var(--brand); }
.nav-more:hover .nav-dropdown, .nav-more:focus-within .nav-dropdown { display: block; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.announce { background: var(--ink); color: #fff; text-align: center; font-size: 13px; padding: 8px 12px; font-weight: 500; }

/* Buttons */
.btn { display: inline-block; padding: 12px 26px; border-radius: 999px; border: none;
  font-size: 15px; font-weight: 700; background: var(--brand); color: #fff; transition: .15s; }
.btn:hover { background: var(--brand-dark); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(108,71,255,.35); }
.btn-outline { background: #fff; color: var(--ink); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); box-shadow: none; }
.btn-amber { background: var(--amber); color: #3d2b00; }
.btn-amber:hover { background: #f5a300; box-shadow: 0 6px 18px rgba(255,176,32,.4); }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-danger { background: var(--coral); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

/* Layout */
.container { max-width: 1240px; margin: 0 auto; padding: 24px 24px; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card-pad { padding: 24px; }
.section-title { font-size: 30px; font-weight: 800; margin: 44px 0 6px; }
.section-sub { color: var(--muted); margin-bottom: 20px; }
.muted { color: var(--muted); font-size: 14px; }
.price { color: var(--ink); font-weight: 800; font-size: 18px; }
.strike { text-decoration: line-through; color: var(--muted); font-weight: 400; font-size: 14px; margin-left: 6px; }
.tag { display: inline-block; background: #fff4d6; color: #8a5a00; font-size: 12px;
  padding: 3px 10px; border-radius: 999px; font-weight: 700; }
.tag-red { background: #ffe5e5; color: var(--coral); }
.tag-green { background: #d9f5e9; color: var(--green); }
.tag-purple { background: #efe9ff; color: var(--brand); }

/* ===== HERO — AI creation front and center ===== */
.hero { background: radial-gradient(1200px 500px at 80% -10%, #efe9ff 0%, transparent 60%),
  linear-gradient(160deg, #fff 30%, #f6f1ff 100%);
  border-radius: 28px; padding: 64px 56px; margin-top: 24px; position: relative; overflow: hidden; }
.hero h1 { font-size: 52px; font-weight: 800; max-width: 640px; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero .lead { color: var(--muted); font-size: 18px; margin: 18px 0 28px; max-width: 560px; }
.hero-badges { display: flex; gap: 18px; margin-top: 26px; flex-wrap: wrap; }
.hero-badge { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; font-weight: 600; }

/* AI Studio (homepage centerpiece) */
.studio { background: var(--ink); color: #fff; border-radius: 28px; padding: 48px;
  margin-top: 24px; position: relative; overflow: hidden; }
.studio::before { content: ''; position: absolute; inset: 0;
  background: radial-gradient(700px 300px at 15% 0%, rgba(108,71,255,.35), transparent 60%); pointer-events: none; }
.studio h2 { font-size: 36px; font-weight: 800; position: relative; }
.studio h2 em { color: var(--amber); font-style: normal; }
.studio .sub { color: #b8b3c9; margin: 10px 0 24px; position: relative; }
.studio-inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 36px; position: relative; }
.studio-inner > div { min-width: 0; } /* 允许 grid 轨道收缩：防止横滑内容（风格/作品条）撑爆兄弟列 */
@media (max-width: 900px) { .studio-inner { grid-template-columns: 1fr; } }
.prompt-box { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.prompt-input { flex: 1; min-width: 240px; padding: 16px 20px; border-radius: 14px; border: 2px solid #3a3650;
  background: #2c2844; color: #fff; font-size: 16px; }
.prompt-input::placeholder { color: #8a86a3; }
.prompt-input:focus { outline: none; border-color: var(--brand); }
.style-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.style-chip { padding: 8px 16px; border-radius: 999px; background: rgba(255,255,255,.08);
  cursor: pointer; font-size: 13px; font-weight: 600; border: 1.5px solid transparent; color: #d9d5e8; }
.style-chip.active { border-color: var(--amber); background: rgba(255,176,32,.18); color: var(--amber); }
.studio-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin-top: 18px; }
.ai-thumb { border-radius: 12px; overflow: hidden; cursor: pointer; border: 3px solid transparent; transition: .15s; }
.ai-thumb:hover { transform: scale(1.03); }
.ai-thumb.active { border-color: var(--amber); }
.ai-thumb img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.studio-preview { background: rgba(255,255,255,.06); border-radius: 20px; padding: 24px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; min-height: 380px; }
.spin { display: inline-block; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Reference photo upload */
.ref-btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px;
  border-radius: 999px; border: 1.5px dashed #6a6584; color: #d9d5e8; font-size: 14px;
  font-weight: 600; cursor: pointer; transition: .15s; }
.ref-btn:hover { border-color: var(--amber); color: var(--amber); }
.ref-thumb { position: relative; display: inline-block; }
.ref-thumb img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover;
  border: 2px solid var(--amber); }
.ref-thumb button { position: absolute; top: -8px; right: -8px; width: 20px; height: 20px;
  border-radius: 50%; border: none; background: var(--coral); color: #fff; font-size: 12px;
  line-height: 1; font-weight: 700; }

/* Mockup */
.mockup-wrap { width: 100%; max-width: 380px; }
.mockup-wrap svg { width: 100%; height: auto; }

/* 照片级产品 mockup（真实产品图 + AI 图 multiply 融合） */
.photo-mockup { position: relative; width: 100%; }
.mock-photo { width: 100%; display: block; border-radius: 10px; }
.mock-art { position: absolute; object-fit: cover; mix-blend-mode: multiply; opacity: .96; }
.mock-empty { position: absolute; display: flex; align-items: center; justify-content: center;
  border: 2px dashed #6c47ff; border-radius: 6px; background: rgba(108,71,255,.07);
  color: #6c47ff; font-size: 13px; font-weight: 700; text-align: center; line-height: 1.4; }

/* 生成进度浮层 */
.gen-progress { position: fixed; bottom: 28px; right: 28px; z-index: 200; width: 320px;
  background: var(--ink); color: #fff; border-radius: 16px; padding: 18px 20px;
  box-shadow: 0 16px 48px rgba(0,0,0,.35); }
.gen-title { font-weight: 700; font-size: 15px; margin-bottom: 10px; }
.gen-bar { height: 8px; border-radius: 999px; background: rgba(255,255,255,.15); overflow: hidden; }
.gen-bar-fill { height: 100%; width: 40%; border-radius: 999px;
  background: linear-gradient(90deg, var(--amber), #ffd97a);
  animation: genslide 1.4s ease-in-out infinite; }
@keyframes genslide { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }
.gen-sub { margin-top: 10px; font-size: 12px; color: #b8b3c9; }
.gen-sub b { color: var(--amber); }
.gen-cancel { margin-top: 12px; width: 100%; padding: 8px 0; border-radius: 999px;
  border: 1.5px solid rgba(255,255,255,.25); background: transparent; color: #ff8a8a;
  font-size: 13px; font-weight: 700; transition: .15s; }
.gen-cancel:hover { background: rgba(255,93,93,.15); border-color: var(--coral); color: #ffb1b1; }

/* 图片点击放大 Lightbox（fit ⇄ 100% 原尺寸 + 拖拽平移） */
.zoomable { cursor: zoom-in; }
.lightbox { position: fixed; inset: 0; z-index: 300; background: rgba(20,16,35,.9);
  display: flex; flex-direction: column; padding: 20px; }
.lightbox-stage { flex: 1; width: 100%; display: flex; align-items: center; justify-content: center;
  overflow: hidden; cursor: zoom-in; }
.lb-actual .lightbox-stage, .lb-actual .lightbox-content { cursor: grab; }
.lightbox-stage.panning, .lightbox-stage.panning .lightbox-content { cursor: grabbing; }
.lightbox-content { width: min(92vw, 860px); transition: width .18s ease; }
.lb-actual .lightbox-content { transition: none; }
.lightbox-content .photo-mockup, .lightbox-content svg { width: 100%; height: auto; }
.lightbox-content .mock-photo { border-radius: 14px; }
.lightbox-content img.lb-img { width: 100%; height: auto; object-fit: contain;
  border-radius: 12px; margin: 0 auto; }
.lightbox-hint { text-align: center; color: #b8b3c9; font-size: 12px; padding-top: 12px; }
.lb-close { color: #fff; font-weight: 700; cursor: pointer; padding: 2px 8px; border-radius: 6px; }
.lb-close:hover { background: rgba(255,255,255,.15); }

/* Get Inspired 画廊：互动图标悬浮产品图右侧（抖音式）/ 筛选 / 评论抽屉 */
.g-card .g-visual { position: relative; padding: 10px 10px 0; }
.g-card .g-visual .photo-mockup .mock-photo { border-radius: 10px; }
.g-rail-float { position: absolute; right: 20px; bottom: 22px; display: flex; flex-direction: column;
  gap: 18px; z-index: 3; }
.g-ic { display: flex; flex-direction: column; align-items: center; cursor: pointer; }
.g-ic svg { width: 32px; height: 32px; fill: #fff;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.45)); transition: transform .12s ease; }
.g-ic:hover svg { transform: scale(1.12); }
.g-ic:active svg { transform: scale(1.25); }
.g-ic b { font-size: 12px; font-weight: 600; margin-top: 3px; color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.55); }
.g-ic.on-like svg { fill: #fe2c55; }   /* 抖音红 */
.g-ic.on-fav svg { fill: #face15; }    /* 收藏黄 */
.g-filter { display: flex; gap: 8px; flex-wrap: wrap; }
.g-chip { padding: 7px 14px; border-radius: 999px; border: 1.5px solid var(--border);
  background: #fff; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; }
.g-chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.g-chip:hover { border-color: var(--brand); color: var(--brand); }
.g-chip.active:hover { color: #fff; }

/* 评论抽屉（抖音式右侧滑出） */
#commentDrawer { position: fixed; inset: 0; z-index: 400; }
.cm-backdrop { position: absolute; inset: 0; background: rgba(20,16,35,.5); }
.cm-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(420px, 92vw);
  background: #fff; display: flex; flex-direction: column; box-shadow: -12px 0 40px rgba(0,0,0,.2);
  animation: cmslide .22s ease; }
@keyframes cmslide { from { transform: translateX(60px); opacity: 0; } to { transform: none; opacity: 1; } }
.cm-head { display: flex; justify-content: space-between; align-items: center;
  padding: 16px 18px; border-bottom: 1px solid var(--border); font-size: 16px; }
.cm-close { cursor: pointer; font-size: 18px; color: var(--muted); padding: 4px 8px; }
.cm-close:hover { color: var(--ink); }
.cm-list { flex: 1; overflow-y: auto; padding: 8px 0; }
.cm-item { display: flex; gap: 10px; padding: 10px 18px; }
.cm-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; flex-shrink: 0; }
.cm-author { font-size: 13px; font-weight: 700; }
.cm-author .muted { font-weight: 400; font-size: 12px; }
.cm-text { font-size: 14px; margin-top: 2px; line-height: 1.45; }
.cm-input { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--border); }
.cm-input input { flex: 1; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: 999px; font-size: 14px; }

/* 后台印花区域框选器 */
.area-picker { position: relative; display: inline-block; max-width: 440px;
  cursor: crosshair; user-select: none; border-radius: 10px; overflow: hidden; }
.area-picker img { width: 100%; display: block; pointer-events: none; }
.area-box { display: none; position: absolute; border: 2px dashed #6c47ff;
  background: rgba(108,71,255,.15); pointer-events: none; }

/* Category cards */
.cat-card { text-align: center; padding: 22px 12px 18px; cursor: pointer; transition: .18s; }
.cat-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.cat-icon { font-size: 42px; margin-bottom: 6px; }
.cat-name { font-weight: 700; font-size: 15px; }

/* Product cards */
.prod-card { cursor: pointer; transition: .18s; display: flex; flex-direction: column; }
.prod-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.prod-visual { background: linear-gradient(160deg, #f8f4ff, #fff8ec); padding: 18px;
  display: flex; align-items: center; justify-content: center; position: relative; }
.prod-visual svg { width: 150px; height: 150px; }
.prod-body { padding: 16px 18px 18px; flex: 1; display: flex; flex-direction: column; gap: 5px; }
.prod-name { font-weight: 700; font-size: 15px; }
.prod-meta { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 6px; }

/* Product detail */
.detail-wrap { display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; margin-top: 24px; align-items: start; }
@media (max-width: 860px) { .detail-wrap { grid-template-columns: 1fr; } }
.detail-mockup { background: linear-gradient(160deg, #f8f4ff, #fff8ec); border-radius: 24px;
  padding: 36px 24px 20px; text-align: center; position: sticky; top: 90px; }
.print-area-note { font-size: 13px; color: var(--muted); margin-top: 8px; }
.print-area-note b { color: var(--brand); }
/* 画幅不匹配提示 */
.aspect-hint { margin-top: 10px; padding: 10px 14px; border-radius: 10px; background: #fff7e8;
  border: 1.5px solid #ffd97a; color: #7a5b12; font-size: 13px; line-height: 1.5; }
.aspect-hint a { color: var(--brand); font-weight: 700; }
.opt-group { margin: 16px 0; }
.opt-label { font-weight: 700; margin-bottom: 8px; font-size: 14px; }
.opt-values { display: flex; gap: 8px; flex-wrap: wrap; }
.opt-val { padding: 8px 18px; border: 1.5px solid var(--border); border-radius: 999px;
  cursor: pointer; font-size: 14px; background: #fff; font-weight: 500; }
.opt-val.active { border-color: var(--brand); color: var(--brand); background: #f3edff; font-weight: 700; }

/* Forms */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field input, .field select, .field textarea { width: 100%; padding: 12px 16px;
  border: 1.5px solid var(--border); border-radius: 12px; font-size: 15px; font-family: inherit; background: #fff; color: var(--ink); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; background: #faf8f4; }

/* Steps */
.steps { display: flex; gap: 0; margin: 20px 0; flex-wrap: wrap; }
.step { flex: 1; min-width: 110px; text-align: center; position: relative; padding-top: 32px; font-size: 13px; color: var(--muted); }
.step::before { content: attr(data-n); position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 28px; height: 28px; border-radius: 50%; background: var(--border); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.step.done { color: var(--brand); font-weight: 700; }
.step.done::before { background: var(--brand); }

/* Misc */
.toast { position: fixed; top: 74px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 26px; border-radius: 999px;
  z-index: 100; font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg); }
.empty { text-align: center; padding: 70px 20px; color: var(--muted); }
.empty-icon { font-size: 56px; margin-bottom: 10px; }
.footer { background: var(--ink); color: #b8b3c9; margin-top: 60px; padding: 44px 24px;
  text-align: center; font-size: 14px; }
.footer b { color: #fff; }
.stat-card { padding: 22px; }
.stat-num { font-size: 30px; font-weight: 800; color: var(--brand); }
.stat-label { color: var(--muted); font-size: 13px; }
.proof-strip { display: flex; justify-content: space-around; gap: 16px; flex-wrap: wrap;
  padding: 28px 20px; margin-top: 44px; }
.proof-item { text-align: center; }
.proof-num { font-size: 30px; font-weight: 800; }
.proof-label { color: var(--muted); font-size: 13px; }

/* Admin (unchanged layout, keep CN-friendly) */
.admin-layout { display: flex; min-height: 100vh; }
.admin-side { width: 210px; background: #232035; color: #c9c5dd; padding: 20px 0; flex-shrink: 0; }
.admin-side .logo { color: #fff; padding: 0 20px 20px; }
.admin-side a { display: block; padding: 11px 20px; font-size: 14px; cursor: pointer; }
.admin-side a:hover, .admin-side a.active { background: rgba(255,255,255,.08); color: #fff; }
.admin-main { flex: 1; padding: 28px; overflow-x: auto; }

/* 导航搜索框 */
.nav-search { display: inline-flex; align-items: center; margin-left: auto; margin-right: auto; background: #f3f1ec;
  border-radius: 999px; padding: 3px 6px 3px 14px; }
.nav-search input { border: none; background: transparent; outline: none; font-size: 13px; width: 200px; }
.nav-search button { border: none; background: transparent; cursor: pointer; font-size: 14px; padding: 2px 6px; }
@media (max-width: 900px) { .nav-search input { width: 120px; } }

/* 第二层类目条（桌面端） */
.catbar { border-top: 1px solid var(--border); background: rgba(250,248,243,.85); }
.catbar-inner { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; gap: 20px;
  padding: 8px 24px; font-size: 14px; }
.catbar-inner a { color: var(--ink); text-decoration: none; font-weight: 600; white-space: nowrap; }
.catbar-inner a:hover { color: var(--brand); }
.catbar-inner .cat-sep { color: var(--border); }
.catbar-inner .cat-hot { color: #b8540f; }

/* 账户下拉（👤 我的 ▾） */
.acct-more { position: relative; display: inline-block; }
.acct-menu { display: none; position: absolute; top: calc(100% + 8px); right: 0; min-width: 170px;
  background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); padding: 8px; z-index: 60;
  border: 1px solid var(--border); }
.acct-menu a, .acct-menu button { display: block; width: 100%; text-align: left; padding: 9px 14px;
  border-radius: 9px; font-size: 14px; color: var(--ink); font-weight: 500; white-space: nowrap;
  border: none; background: none; cursor: pointer; text-decoration: none; }
.acct-menu a:hover, .acct-menu button:hover { background: #f3edff; color: var(--brand); }
.acct-more:hover .acct-menu, .acct-more:focus-within .acct-menu { display: block; }

/* ===== 移动端适配增强（<768px 手机） ===== */
@media (max-width: 768px) {
  .container { padding: 0 12px; }
  .topbar { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
  .topbar nav { order: 3; width: 100%; overflow-x: auto; white-space: nowrap; padding-bottom: 4px; }
  .topbar-actions { flex-wrap: wrap; gap: 6px; }
  .hero-title { font-size: 30px !important; }
  .section-title { font-size: 24px; }
  .card-pad { padding: 16px; }
  table { font-size: 13px; }
  th, td { padding: 8px 6px; }
  /* 评论抽屉全屏 */
  .cm-panel { width: 100% !important; max-width: 100% !important; }
  /* 步骤条缩小 */
  .steps { font-size: 11px; }
  /* 灯箱留白收窄 */
  .lightbox-content { width: 96vw !important; }
  /* 订单详情/结算双栏已在 560px 断点收拢，此处补充间距 */
  .grid { gap: 12px; }
  /* 产品页大按钮全宽 */
  .detail-side .btn { font-size: 15px; }
  /* 后台侧栏可横滚 */
  .admin-side { width: 150px; }
  .admin-main { padding: 16px; }
}
@media (max-width: 480px) {
  .hero-title { font-size: 26px !important; }
  .btn { padding: 10px 16px; font-size: 14px; }
  .topbar .logo { font-size: 16px; } /* 极窄屏压缩 logo，保住搜索框 */
}

/* ============================================================
   移动端全新交互（≤768px）：单行顶栏 + 汉堡抽屉 + 底部TabBar
   + Hero创作区紧凑流 + Sparkle抖音沉浸流 + 评论底部抽屉
   ============================================================ */
.ham-btn { display: none; }
#tabbar { display: none; }

@media (max-width: 768px) {
  /* ---- 顶栏：单行，只留 logo + 搜索框（EN/USD/购物车/☰ 全部收走，功能在抽屉和底部Tab） ---- */
  .announce { display: none !important; } /* 手机端隐藏公告条，空间让给信息流 */
  .topbar { flex-wrap: nowrap; align-items: center; gap: 8px; }
  .topbar .logo { font-size: 19px; white-space: nowrap; }
  .topbar nav { display: none !important; } /* 类目进抽屉 */
  .topbar-actions { display: none !important; } /* 整个右侧操作区隐藏（select 漏网导致撑爆的根因） */
  .nav-search { display: inline-flex !important; flex: 1; margin: 0; min-width: 0; } /* 搜索框上顶栏 */
  .nav-search input { width: 100%; }

  /* ---- 底部 TabBar ---- */
  body { padding-bottom: 64px; }
  #tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
    background: #fff; border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  #tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    font-size: 10px; color: var(--muted); text-decoration: none; padding: 2px 0; }
  #tabbar a span { font-size: 20px; line-height: 1; position: relative; }
  #tabbar a.active { color: var(--brand); font-weight: 700; }
  .tab-badge { position: absolute; top: -5px; right: -12px; background: var(--coral, #e17055); color: #fff;
    font-size: 9px; font-style: normal; border-radius: 999px; padding: 1px 5px; font-weight: 700; }

  /* ---- 汉堡抽屉（右侧滑出） ---- */
  .md-backdrop { position: fixed; inset: 0; background: rgba(20,16,35,.45); z-index: 98; }
  .md-panel { position: fixed; top: 0; right: 0; bottom: 0; width: 78%; max-width: 320px; background: #fff;
    z-index: 99; overflow-y: auto; padding: 18px 0 30px; box-shadow: -8px 0 30px rgba(0,0,0,.15);
    animation: slideIn .22s ease; }
  @keyframes slideIn { from { transform: translateX(40px); opacity: .5; } }
  .md-head { display: flex; justify-content: space-between; align-items: center; padding: 0 20px 12px;
    border-bottom: 1px solid var(--border); font-size: 17px; }
  .md-user { padding: 12px 20px; font-size: 14px; color: var(--muted); }
  .md-sec { padding: 14px 20px 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em;
    text-transform: uppercase; color: var(--muted); }
  .md-panel a { display: block; padding: 11px 20px; font-size: 15px; color: var(--ink); text-decoration: none; }
  .md-panel a:active { background: #f6f2ea; }

  /* ---- Hero 创作区：紧凑纵排流 ---- */
  .studio h2 { font-size: 27px !important; line-height: 1.25; }
  .studio .sub { font-size: 13px; }
  .style-chips { flex-wrap: nowrap !important; overflow-x: auto; -webkit-overflow-scrolling: touch;
    padding-bottom: 6px; scrollbar-width: none; }
  .style-chips::-webkit-scrollbar { display: none; }
  .style-chip { flex-shrink: 0; font-size: 12px !important; padding: 7px 13px !important; }
  /* 一体输入条：左📷 中输入 右Generate */
  .prompt-box { position: relative; }
  .prompt-box .prompt-input { padding-left: 44px !important; padding-right: 108px !important;
    height: 50px; border-radius: 999px !important; }
  .prompt-box #studioBtn, .prompt-box #genBtn { position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
    border-radius: 999px; padding: 9px 16px; font-size: 13px; white-space: nowrap; }
  .cam-in-input { display: block; position: absolute; left: 8px; top: 50%; transform: translateY(-50%);
    border: none; background: transparent; font-size: 19px; cursor: pointer; z-index: 2; padding: 4px 6px; }
  /* 上传行在移动端折叠成提示小字（已传图时显示缩略图） */
  .ref-upload-row { margin-top: 8px !important; gap: 8px !important; }
  .ref-upload-row .ref-btn { font-size: 12px; padding: 7px 12px; }
  .ref-upload-row > span { font-size: 11px !important; }
  /* 信任徽章横滑 */
  .hero-badges { flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; gap: 8px !important; }
  .hero-badges::-webkit-scrollbar { display: none; }
  .hero-badge { flex-shrink: 0; font-size: 11px !important; }
  /* 商品/类目卡：双列 */
  .grid-4 { grid-template-columns: repeat(2, 1fr) !important; }
  .grid-3 { grid-template-columns: repeat(2, 1fr) !important; }

  /* ---- Sparkle 抖音沉浸流 ---- */
  .feed { height: calc(100dvh - 56px - 64px); overflow-y: auto; scroll-snap-type: y mandatory;
    background: #14101f; margin: 0 -12px; }
  .feed-item { position: relative; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; overflow: hidden; }
  .feed-media, .feed-media .photo-mockup, .feed-media > img { position: absolute; inset: 0; width: 100%; height: 100%; }
  .feed-media .photo-mockup .mock-photo { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
  /* 成品图：完整显示不裁切（contain），深色背景衬底——抖音对非全屏内容的标准做法 */
  .feed-media > img { object-fit: contain; }
  .feed-media > img.feed-final { object-fit: contain; border-radius: 0; }
  .feed-scrim { position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,.25) 0%, transparent 22%, transparent 55%, rgba(10,6,20,.82) 100%); }
  .feed-rail { position: absolute; right: 16px; bottom: 140px; display: flex; flex-direction: column; gap: 20px; z-index: 3; }
  .feed-rail .g-ic { background: rgba(0,0,0,.3); backdrop-filter: blur(4px); border-radius: 50%;
    width: 48px; height: 58px; justify-content: center; padding-top: 6px; border-radius: 24px; }
  .feed-rail .g-ic svg { width: 30px; height: 30px; filter: drop-shadow(0 1px 4px rgba(0,0,0,.8)); }
  .feed-rail .g-ic b { text-shadow: 0 1px 4px rgba(0,0,0,.9); }
  .feed-info { position: absolute; left: 14px; right: 84px; bottom: 18px; z-index: 3; color: #fff; }
  .feed-author { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
  .feed-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff;
    display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; }
  .feed-prod { font-size: 15px; font-weight: 800; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
  .feed-prompt { font-size: 13px; opacity: .92; margin: 4px 0 10px; text-shadow: 0 1px 3px rgba(0,0,0,.5);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .feed-cta { background: var(--amber, #f5a623); color: #3a2c00; border: none; border-radius: 999px;
    padding: 9px 18px; font-size: 13px; font-weight: 700; cursor: pointer; }
  /* 顶部悬浮筛选胶囊 */
  .feed-wrap { position: relative; }
  .feed-filter { position: absolute; top: 10px; left: 0; right: 0; z-index: 5; display: flex;
    justify-content: center; gap: 8px; pointer-events: none; }
  .feed-chip { pointer-events: auto; padding: 6px 14px; border-radius: 999px; border: none;
    background: rgba(0,0,0,.35); color: #fff; font-size: 12px; font-weight: 600; backdrop-filter: blur(6px); }
  .feed-chip.active { background: rgba(255,255,255,.92); color: #232035; }

  /* ---- 评论改底部半屏抽屉（抖音手势） ---- */
  .cm-panel { top: auto !important; bottom: 0; left: 0; right: 0; width: 100% !important; max-width: 100% !important;
    height: 62dvh; border-radius: 18px 18px 0 0; animation: sheetUp .22s ease; }
  @keyframes sheetUp { from { transform: translateY(60px); opacity: .5; } }
}
/* 桌面端隐藏输入条相机按钮 */
.cam-in-input { display: none; }

/* 作品历史：View all 卡 + 删除键 + 移动端横滑 */
.ai-thumb.view-all { display: flex; align-items: center; justify-content: center; text-align: center;
  background: rgba(255,255,255,.08); color: #b8b3c9; font-size: 13px; font-weight: 700; cursor: pointer;
  border: 1.5px dashed rgba(255,255,255,.25); line-height: 1.5; }
.ai-thumb.view-all:hover { color: #fff; border-color: var(--amber); }

/* 作品轮播翻页箭头 */
.rc-wrap { position: relative; margin-top: 18px; }
.rc-wrap .studio-results { margin-top: 0; }
.rc-body { position: relative; }  /* 箭头定位基准：只含网格本体，不含页码 */
.rc-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
  width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(20,18,40,.82); color: #fff; font-size: 22px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,.35); transition: .15s; }
.rc-arrow:hover:not(:disabled) { background: var(--amber); color: #3d2b00; transform: translateY(-50%) scale(1.1); }
.rc-arrow:disabled { opacity: .28; cursor: default; }
.rc-arrow.rc-l { left: -14px; }
.rc-arrow.rc-r { right: -14px; }
.rc-page { text-align: center; font-size: 12px; color: #8a86a3; margin-top: 10px; letter-spacing: 1px; }
@media (max-width: 768px) { .rc-arrow, .rc-page { display: none; } }

/* 画廊提示词 → 详情页超链接 */
.insp-link { font-size: 13px; color: var(--ink); text-decoration: none; display: block; }
.insp-link:hover { color: var(--amber); text-decoration: underline; }

/* 风格选择器：桌面端分页网格（列数内联控制）+ 箭头；移动端单行横滑 */
.sc-pager .style-grid { display: grid; gap: 12px; margin-top: 16px; justify-content: center; }  /* 网格内容在两箭头间水平居中 */
.sc-pager { margin-top: 0; }
@media (max-width: 768px) { .sc-pager { display: none; } }
@media (min-width: 769px) { .sc-mobile-only { display: none; } }

/* 语言/货币切换下拉 */
.lc-sel { padding: 7px 10px; border-radius: 10px; border: 1.5px solid var(--border); background: #fff;
  font-size: 13px; font-weight: 600; color: var(--ink); cursor: pointer; }
.lc-sel:focus { outline: none; border-color: var(--amber); }
.design-card { position: relative; }
.thumb-del { position: absolute; top: 8px; right: 8px; z-index: 2; width: 26px; height: 26px;
  border-radius: 50%; border: none; background: rgba(0,0,0,.55); color: #fff; font-size: 15px;
  cursor: pointer; opacity: 0; transition: opacity .15s; line-height: 1; }
.design-card:hover .thumb-del { opacity: 1; }
@media (hover: none) { .thumb-del { opacity: .9; } } /* 触屏常显 */
@media (max-width: 768px) {
  .studio-results { display: flex !important; overflow-x: auto; gap: 10px; padding-bottom: 6px;
    -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .studio-results::-webkit-scrollbar { display: none; }
  .studio-results .ai-thumb { flex: 0 0 96px; width: 96px; height: 96px; }
}

/* 风格缩略图卡 */
.style-card { position: relative; display: inline-flex; flex-direction: column; align-items: center;
  gap: 6px; cursor: pointer; flex-shrink: 0; width: 96px;
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; } /* 移动端长按交给自定义预览，屏蔽 iOS 呼出菜单 */
.style-card img { width: 96px; height: 96px; object-fit: cover; border-radius: 14px;
  border: 2.5px solid transparent; transition: border-color .15s, transform .15s; display: block;
  -webkit-user-drag: none; pointer-events: none; } /* 长按/拖拽不触发图片原生行为，事件由卡片代理 */
.style-card b { font-size: 11px; font-weight: 600; color: inherit; text-align: center; line-height: 1.2;
  max-width: 96px; }
.studio .style-card b { color: #d5d0e4; }
.style-card:hover img { transform: translateY(-2px); }
.style-card.active img { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(245,166,35,.25); }
.style-card .sc-check { position: absolute; top: -4px; right: -4px; width: 22px; height: 22px;
  border-radius: 50%; background: var(--amber); color: #3a2c00; font-style: normal; font-size: 13px;
  font-weight: 800; display: none; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.style-card.active .sc-check { display: inline-flex; }
@media (max-width: 768px) {
  .style-card, .style-card img { width: 76px; }
  .style-card img { height: 76px; border-radius: 12px; }
  .style-card b { max-width: 76px; font-size: 10px; }
}

/* 风格卡 hover 放大预览（仅桌面，触屏无 hover 不触发） */
.sc-zoom { display: none; position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%);
  width: 220px; height: 220px; background-size: cover; background-position: center; border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,.35); border: 3px solid #fff; z-index: 50; pointer-events: none; }
.sc-zoom::after { content: ''; position: absolute; bottom: -9px; left: 50%; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: #fff; }
@media (hover: hover) {
  .style-card:hover .sc-zoom { display: block; animation: zoomIn .12s ease; }
}
@keyframes zoomIn { from { transform: translateX(-50%) scale(.85); opacity: 0; } }

/* 风格放大预览：fixed 悬浮层（JS 定位，不被任何容器裁剪） */
.style-zoom-float { position: fixed; width: 360px; height: 360px; background-size: cover; background-position: center;
  border-radius: 16px; border: 3px solid #fff; box-shadow: 0 12px 40px rgba(0,0,0,.35); z-index: 999;
  pointer-events: none; animation: zoomIn .12s ease; }

/* 背景二选一切换 */
.bg-toggle { display: flex; gap: 8px; margin-top: 12px; }
.bg-pill { padding: 7px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 600; cursor: pointer;
  border: 1.5px solid rgba(255,255,255,.25); color: #b8b3c9; transition: all .15s; user-select: none; }
.bg-pill:hover { border-color: var(--amber); color: #fff; }
.bg-pill.active { background: var(--amber); border-color: var(--amber); color: #3a2c00; }
.detail-side .bg-pill, .studio:not(.dark) .bg-pill { border-color: var(--border); color: var(--muted); }
.detail-side .bg-pill.active, .studio:not(.dark) .bg-pill.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* 背景选项卡（比风格卡略小，横向并排） */
.bg-toggle { display: flex; gap: 12px; margin: 12px 0 14px; }
.bg-card, .bg-card img { width: 96px; }
.bg-card img { height: 64px; border-radius: 10px; }
.bg-card b { max-width: none; white-space: nowrap; font-size: 11px; }
@media (max-width: 768px) {
  .bg-card, .bg-card img { width: 84px; }
  .bg-card img { height: 56px; }
  .bg-card b { font-size: 10px; }
}

/* 选择区块小标签 */
.pick-label { font-size: 12px; font-weight: 700; color: var(--muted); margin: 12px 0 6px; letter-spacing: .02em; }
.studio .pick-label { color: #b8b3c9; }

/* 旗舰模型提示 */
.pro-hint { font-size: 12px; color: var(--amber); margin: 8px 0 0; font-weight: 600; }
