/* ---------- page chrome */
body:not(.admin) { display: flex; flex-direction: column; }
#main { outline: none; flex: 1 0 auto; min-height: 60vh; padding-bottom: 88px; }
body[data-page="studio"] #main { padding-bottom: 0; }
body[data-page="studio"] .site-footer { display: none; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 2000; padding: 8px 14px; border-radius: 10px; background: var(--black); color: #fff; text-decoration: none; }
.skip-link:focus { top: 12px; }
.boot { display: grid; place-items: center; min-height: 50vh; color: var(--label-3); }

.announcement { padding: 10px 0; font-size: 13px; text-align: center; background: var(--black); color: #f5f5f7; }
.announcement.is-warning { background: #ff9f0a; color: #1d1d1f; }

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(251, 251, 253, 0.78);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--hairline);
}
.header-row { display: flex; align-items: center; gap: 26px; height: 56px; }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; flex: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0, 0, 0, .18); }
.brand-name { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.brand-sub { font-size: 13px; font-weight: 500; color: var(--label-3); letter-spacing: 0; }
.main-nav { display: flex; gap: 2px; flex: 1; }
.nav-link { padding: 6px 12px; border-radius: 980px; font-size: 14px; color: var(--label-2); text-decoration: none; transition: color .2s, background-color .2s; }
.nav-link:hover { color: var(--label); }
.nav-link.is-active { color: var(--label); font-weight: 600; background: var(--fill-2); }
.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.burger { display: none; }

.credit-pill {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px 0 4px;
  border-radius: 980px; background: var(--fill-2); text-decoration: none; transition: background-color .2s;
}
.credit-pill:hover { background: var(--fill); }
.credit-pill .tile { width: 24px; height: 24px; border-radius: 50%; }
.credit-pill .tile svg { width: 14px; height: 14px; }
.credit-num { font-size: 14px; font-weight: 600; }
.credit-unit { font-size: 12px; color: var(--label-3); }

.user-menu { position: relative; }
.user-menu-btn { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--black); color: #fff; font-size: 13px; font-weight: 600; }
.user-menu-list {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 230px; padding: 6px;
  border-radius: 14px; background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border); box-shadow: var(--shadow-3); display: grid;
}
.user-menu-head { display: grid; padding: 10px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--separator); line-height: 1.45; }
.user-menu-list a, .user-menu-list button {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 9px;
  background: none; text-align: left; font-size: 14px; text-decoration: none; cursor: pointer;
}
.user-menu-list a:hover, .user-menu-list button:hover { background: var(--fill-2); }
.user-menu-list .tile { width: 24px; height: 24px; border-radius: 6px; }
.user-menu-list .tile svg { width: 14px; height: 14px; }
.mobile-drawer { display: none; }

.site-footer { padding: 36px 0 30px; border-top: 1px solid var(--hairline); background: var(--bg); font-size: 12.5px; color: var(--label-2); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 28px; }
.footer-name { font-size: 15px; font-weight: 600; color: var(--label); margin-bottom: 6px; }
.footer-brand p + p { margin-top: 4px; }
.footer-links { display: grid; gap: 7px; align-content: start; }
.footer-links a { color: var(--label-2); text-decoration: none; }
.footer-links a:hover { color: var(--label); text-decoration: underline; }
.footer-meta p + p { margin-top: 4px; }
.footer-meta a { color: inherit; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 48px 0 28px; }
.page-head h1 { font-size: 40px; letter-spacing: -0.035em; margin-bottom: 8px; }
.page-head p { max-width: 60ch; color: var(--label-2); font-size: 16px; }

/* ---------- home */
.hero { padding: 76px 0 40px; overflow: hidden; }
.hero-inner { display: grid; justify-items: center; text-align: center; }
.hero-badge { display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px 5px 5px; border-radius: 980px; font-size: 13px; font-weight: 500; color: var(--label-2); margin-bottom: 22px; }
.hero-badge .tile { width: 24px; height: 24px; border-radius: 50%; }
.hero-badge .tile svg { width: 13px; height: 13px; }
.hero-title { font-size: clamp(34px, 6.4vw, 76px); line-height: 1.06; letter-spacing: -0.045em; font-weight: 700; max-width: 14em; }
.hero-title span { display: inline-block; }
.hero-lead { margin-top: 20px; font-size: clamp(17px, 1.6vw, 21px); line-height: 1.55; color: var(--label-2); max-width: 34em; }
.hero-cta { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; justify-content: center; margin: 32px 0 14px; }
.hero-cta .link { font-size: 17px; }
.hero-note { font-size: 13px; color: var(--label-3); }

.hero-stage { margin: 52px auto 0; width: min(980px, 100%); padding: 28px; border-radius: 32px; box-shadow: var(--shadow-2); }
.formula { display: grid; grid-template-columns: 1fr auto 1fr auto 1.15fr; align-items: center; gap: 18px; }
.formula-card { margin: 0; display: grid; gap: 10px; animation: rise .8s cubic-bezier(.2, .8, .25, 1) both; }
.formula-card:nth-of-type(2) { animation-delay: .1s; }
.formula-card:nth-of-type(3) { animation-delay: .2s; }
.formula-frame { position: relative; aspect-ratio: 3 / 4; border-radius: 20px; overflow: hidden; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 12px 30px rgba(0, 0, 0, .08); }
.formula-frame img { width: 100%; height: 100%; object-fit: contain; }
.formula-card.is-outfit .formula-frame { background: #ececee; }
.formula-card.is-outfit .formula-frame img { object-fit: cover; }
.formula-card.is-result .formula-frame img { object-fit: cover; }
.formula-card figcaption { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--label-2); }
.formula-card figcaption .tile { width: 22px; height: 22px; border-radius: 6px; }
.formula-card figcaption .tile svg { width: 13px; height: 13px; }
.formula-op { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-1); font-size: 20px; font-weight: 500; color: var(--label-3); }
.result-placeholder { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 12px; background: linear-gradient(160deg, #fbfbfd, #ececf0); color: var(--label-2); font-size: 14px; font-weight: 500; }
.hero-stage-foot { display: flex; justify-content: center; gap: 10px; margin-top: 22px; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

.section { padding-top: 96px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(30px, 3.4vw, 40px); letter-spacing: -0.035em; }
.section-head p { margin-top: 8px; color: var(--label-2); font-size: 16px; max-width: 46ch; }
.section-head .link { font-size: 15px; }

.bento { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.bento-card { display: grid; align-content: start; gap: 12px; padding: 26px; border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--shadow-1); }
.bento-card h3 { font-size: 19px; letter-spacing: -0.02em; }
.bento-card p { color: var(--label-2); font-size: 14.5px; }
.bento-card .bento-num { font-size: 44px; color: var(--label); font-weight: 700; letter-spacing: -0.04em; line-height: 1; margin-top: 4px; }
.bento-card.is-wide { grid-column: span 2; }
.bento-card.is-dark { background: var(--black); color: #f5f5f7; }
.bento-card.is-dark p { color: #a1a1a6; }

.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.step { display: grid; gap: 10px; align-content: start; padding: 24px; border-radius: var(--r-l); background: var(--surface); box-shadow: var(--shadow-1); }
.step-no { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--black); color: #fff; font-size: 14px; font-weight: 600; }
.step h3 { font-size: 17px; }
.step p { color: var(--label-2); font-size: 14px; }

.masonry { columns: 4 220px; column-gap: 14px; }
.masonry[data-cols="3"] { columns: 3 220px; }
.masonry[data-cols="2"] { columns: 2 220px; max-width: 760px; }
.masonry[data-cols="1"] { columns: 1; max-width: 380px; }
.masonry-item { position: relative; display: block; width: 100%; margin: 0 0 14px; padding: 0; border: 0; border-radius: 18px; overflow: hidden; background: #e8e8ed; cursor: zoom-in; break-inside: avoid; }
.masonry-item img { width: 100%; height: auto; object-fit: cover; transition: transform .5s cubic-bezier(.2, .8, .3, 1); }
.masonry-item:hover img { transform: scale(1.03); }
.masonry-badge { position: absolute; left: 10px; top: 10px; padding: 3px 10px; border-radius: 980px; background: rgba(255, 255, 255, .8); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); font-size: 12px; font-weight: 600; }
.masonry-author { position: absolute; left: 10px; right: 10px; bottom: 10px; padding: 6px 10px; border-radius: 10px; text-align: left; color: #fff; background: rgba(0, 0, 0, .35); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); opacity: 0; transition: opacity .25s; }
.masonry-item:hover .masonry-author, .masonry-item:focus-visible .masonry-author { opacity: 1; }

.price-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.price-card { display: grid; gap: 6px; align-content: start; padding: 28px; border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--shadow-1); }
.price-card.is-featured { background: var(--black); color: #f5f5f7; box-shadow: var(--shadow-2); }
.price-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.price-name { font-size: 17px; font-weight: 600; }
.price-badge { padding: 2px 10px; border-radius: 980px; background: #ff9f0a; color: #1d1d1f; font-size: 12px; font-weight: 600; }
.price-amount { font-size: 44px; font-weight: 700; letter-spacing: -0.04em; line-height: 1.1; margin-top: 10px; }
.price-amount small { font-size: 18px; font-weight: 600; margin-right: 2px; }
.price-credits { font-size: 15px; color: var(--label-2); }
.price-card.is-featured .price-credits, .price-card.is-featured .price-desc { color: #a1a1a6; }
.price-credits strong { color: var(--label); font-weight: 600; }
.price-card.is-featured .price-credits strong { color: #fff; }
.price-desc { font-size: 13.5px; color: var(--label-3); }
.price-list { list-style: none; margin: 14px 0 6px; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.price-list li { display: flex; align-items: center; gap: 8px; }
.price-list svg { width: 17px; height: 17px; color: var(--c-green); flex: none; }
.price-card .btn { margin-top: 12px; }
.price-card.is-featured .btn-primary { --btn-bg: #fff; --btn-fg: var(--black); }
.price-card.is-featured .btn-primary:hover { --btn-bg: #e8e8ed; }

.faq-list { display: grid; max-width: 820px; border-radius: var(--r-l); background: var(--surface); box-shadow: var(--shadow-1); padding: 4px 24px; }
.faq-item + .faq-item { border-top: 1px solid var(--separator); }
.faq-item summary { cursor: pointer; padding: 18px 0; font-weight: 600; font-size: 16px; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: ""; flex: none; width: 9px; height: 9px; border-right: 2px solid var(--label-3); border-bottom: 2px solid var(--label-3); transform: rotate(45deg) translateY(-3px); transition: transform .25s; }
.faq-item[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.faq-item p { padding: 0 0 18px; max-width: 68ch; color: var(--label-2); }

.cta-band { margin-top: 96px; padding: 56px; border-radius: 32px; background: var(--black); color: #f5f5f7; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.cta-band h2 { font-size: clamp(28px, 3.4vw, 40px); letter-spacing: -0.035em; }
.cta-band p { color: #a1a1a6; margin-top: 8px; }
.cta-band .btn-primary { --btn-bg: #fff; --btn-fg: var(--black); }
.cta-band .btn-primary:hover { --btn-bg: #e8e8ed; }

/* ---------- studio: control panel on the left, results canvas on the right */
.studio { min-height: calc(100vh - 56px); }
/* The studio is a full-width workspace; the header follows its edges. */
body[data-page="studio"] .header-row.wrap { width: calc(100% - 64px); }
.studio-shell { display: grid; grid-template-columns: 404px minmax(0, 1fr); gap: 0; height: calc(100vh - 56px); }
.studio-panel { position: relative; display: flex; flex-direction: column; min-height: 0; margin: 14px 0 14px 14px; border-radius: 24px; box-shadow: var(--shadow-2); overflow: hidden; }
.panel-scroll { flex: 1; min-height: 0; overflow: auto; padding: 18px 18px 8px; display: grid; gap: 18px; align-content: start; }
.panel-title { display: flex; align-items: center; justify-content: space-between; }
.panel-title h1 { font-size: 22px; letter-spacing: -0.03em; }
.studio-tabs { flex: 1; }
.studio-tabs a { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 0 10px; border-radius: 8px; color: var(--label); font-size: 14px; font-weight: 500; text-decoration: none; transition: background-color .2s, box-shadow .2s; }
.studio-tabs a[aria-pressed="true"] { background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 3px 1px rgba(0, 0, 0, .04); font-weight: 600; }
.realism-switch { align-items: flex-start; }
.realism-switch .switch-text { display: grid; gap: 1px; }
.realism-switch small { color: var(--label-3); font-size: 12px; font-weight: 400; line-height: 1.45; }
/* 绝对真实感, under 真实感增强 and lined up with its text. */
.realism-max { display: flex; align-items: flex-start; gap: 8px; margin-left: 54px; cursor: pointer; font-size: 14px; }
.realism-max input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--black); flex: none; }
.realism-max span { display: grid; gap: 1px; }
.realism-max strong { font-weight: 500; }
.realism-max small { color: var(--label-3); font-size: 12px; line-height: 1.45; }
.tier-size { margin-top: 8px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.panel-sec { display: grid; gap: 10px; }
.panel-sec-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.panel-sec-head .tile { width: 22px; height: 22px; border-radius: 6px; }
.panel-sec-head .tile svg { width: 13px; height: 13px; }
.panel-sec-head .aside { margin-left: auto; font-weight: 400; color: var(--label-3); font-size: 12px; }

.ref-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ref { display: grid; gap: 6px; min-width: 0; align-content: start; }
.ref-frame { position: relative; display: block; width: 100%; aspect-ratio: 3 / 4; padding: 0; border: 0; border-radius: 14px; overflow: hidden; background: #fff; cursor: pointer; box-shadow: 0 1px 2px rgba(0, 0, 0, .06), inset 0 0 0 1px var(--hairline); transition: transform .2s, box-shadow .2s; }
.ref-frame:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0, 0, 0, .1), inset 0 0 0 1px var(--hairline); }
.ref-frame img { width: 100%; height: 100%; object-fit: contain; }
.ref.is-outfit .ref-frame img, .ref.is-person .ref-frame img { object-fit: cover; }
.ref-empty { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 8px; border-radius: 14px; border: 1.5px dashed rgba(60, 60, 67, .22); background: rgba(255, 255, 255, .55); font-size: 12.5px; font-weight: 500; color: var(--label-2); }
.ref-frame:hover .ref-empty { border-color: rgba(60, 60, 67, .4); color: var(--label); }
.ref-label { display: flex; align-items: center; gap: 6px; min-width: 0; min-height: 18px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.ref-title { flex: none; }
.ref-label .code { min-width: 0; margin-left: auto; overflow: hidden; text-overflow: ellipsis; font-weight: 500; color: var(--label-3); font-size: 11.5px; }
.ref.is-scene .ref-frame img { object-fit: cover; }
/* 更多参考: scene and items, folded away until needed. */
.ref-more-wrap { display: grid; gap: 10px; }
.ref-more { display: flex; align-items: center; gap: 6px; width: 100%; min-height: 34px; padding: 0 12px; border: 0; border-radius: 10px; background: var(--fill-2); color: var(--label-2); font-size: 13px; font-weight: 500; text-align: left; cursor: pointer; transition: background-color .2s, color .2s; }
.ref-more:hover { background: var(--fill); color: var(--label); }
.ref-more svg { flex: none; transition: transform .2s; }
.ref-more[aria-expanded="true"] svg { transform: rotate(180deg); }
.ref-more-note { margin-left: auto; color: #0060df; font-size: 12px; }
.ref-tools { display: flex; gap: 4px; }
.ref-tools .btn { min-height: 26px; width: 26px; padding: 0; --btn-bg: rgba(255, 255, 255, .7); box-shadow: inset 0 0 0 1px var(--hairline); }
.ref-tools .btn:hover { --btn-bg: #fff; }
.ref-tools .btn svg { width: 14px; height: 14px; }
.ref-note { font-size: 11.5px; line-height: 1.4; color: #c93400; }
.ref-fee { font-size: 11.5px; line-height: 1.4; color: var(--label-2); }
.ref-rule { font-size: 12px; color: var(--label-3); line-height: 1.5; }

.ratio-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.ratio-opt { display: grid; justify-items: center; gap: 5px; padding: 8px 0 6px; border: 0; border-radius: 10px; background: var(--fill-2); cursor: pointer; font-size: 11.5px; font-weight: 500; color: var(--label-2); transition: background-color .2s; }
.ratio-opt:hover { background: var(--fill); }
.ratio-opt[aria-pressed="true"] { background: var(--black); color: #fff; }
.ratio-shape { display: block; border: 1.5px solid currentColor; border-radius: 3px; }
.panel-foot { padding: 14px 18px 16px; border-top: 1px solid var(--separator); background: rgba(255, 255, 255, .6); display: grid; gap: 8px; }
.btn-generate { min-height: 50px; font-size: 16px; font-weight: 600; border-radius: 14px; }
.btn-generate svg { width: 19px; height: 19px; color: #ffcc00; }
.action-reason { color: #c93400; font-size: 12.5px; font-weight: 500; text-align: center; }
.action-balance { color: var(--label-3); font-size: 12.5px; text-align: center; }
.board-link { justify-content: center; font-size: 13px; color: var(--label-2); }
.board-link svg { color: var(--c-teal); }

.studio-canvas { min-width: 0; overflow: auto; padding: 22px 26px 40px; }
.canvas-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.canvas-head h2 { font-size: 22px; letter-spacing: -0.03em; }
.feed { --card-w: 300px; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--card-w)), 1fr)); gap: 16px; }
.feed[data-size="s"] { --card-w: 210px; gap: 12px; }
.feed[data-size="l"] { --card-w: 460px; }
.feed > .empty { grid-column: 1 / -1; }
.canvas-tools, .works-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.canvas-head { flex-wrap: wrap; }
.size-seg { width: auto; flex: none; }
.size-seg button { min-width: 36px; }
.feed-empty { display: grid; justify-items: center; gap: 16px; padding: 80px 20px; text-align: center; }
.feed-empty-tiles { display: flex; align-items: center; gap: 10px; }
.feed-empty-tiles .plus { color: var(--label-4); font-size: 20px; }
.feed-empty h3 { font-size: 22px; letter-spacing: -0.03em; }
.feed-empty p { color: var(--label-2); max-width: 30em; }

/* generation card */
.gen { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 14px; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow-1); color: var(--label); }
.gen-head { display: flex; align-items: center; gap: 10px; height: 20px; overflow: hidden; font-size: 13px; white-space: nowrap; }
.gen-status { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.gen-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c-gray); }
.is-succeeded .gen-status::before { background: var(--c-green); }
.is-failed .gen-status::before { background: var(--c-red); }
.is-running .gen-status::before, .is-queued .gen-status::before { background: var(--c-blue); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.gen-time { color: var(--label-3); }
.gen-cost { margin-left: auto; color: var(--label-3); }
.gen-fav { display: inline-flex; color: var(--c-pink); }
.gen-fav svg path { fill: currentColor; }
.gen-meta { height: 18px; overflow: hidden; color: var(--label-2); font-size: 12.5px; line-height: 18px; white-space: nowrap; text-overflow: ellipsis; }
/* The picture box is always 3:4; images fill it (the viewer shows them whole). */
.gen-media { position: relative; aspect-ratio: 3 / 4; border-radius: 16px; overflow: hidden; background: #ececee; }
.gen-media > * { position: absolute; inset: 0; }
.gen-grid { display: grid; gap: 3px; }
.gen-grid.n-1 { grid-template: minmax(0, 1fr) / minmax(0, 1fr); }
.gen-grid.n-2 { grid-template: minmax(0, 1fr) / repeat(2, minmax(0, 1fr)); }
.gen-grid.n-3, .gen-grid.n-4 { grid-template: repeat(2, minmax(0, 1fr)) / repeat(2, minmax(0, 1fr)); }
.gen-grid.n-3 > .gen-shot:first-child { grid-row: span 2; }
.gen-shot { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: #ececee; }
.gen-shot-open { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.gen-shot img { width: 100%; height: 100%; object-fit: cover; object-position: center 22%; transition: transform .45s cubic-bezier(.2, .8, .3, 1); }
.gen-shot-open:hover img { transform: scale(1.025); }
.gen-shot-tools { position: absolute; right: 8px; top: 8px; display: flex; gap: 6px; opacity: 0; transition: opacity .2s; }
.gen-shot:hover .gen-shot-tools, .gen-shot:focus-within .gen-shot-tools { opacity: 1; }
.gen-shot-tools a, .gen-shot-tools span {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255, 255, 255, .78); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); color: var(--label);
}
.gen-shot-tools svg { width: 15px; height: 15px; }
.gen-count { position: absolute; left: 8px; bottom: 8px; padding: 2px 9px; border-radius: 980px; background: rgba(0, 0, 0, .45); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); color: #fff; font-size: 12px; pointer-events: none; }
.gen-wait { display: grid; place-items: center; align-content: center; gap: 12px; overflow: hidden;
  background: linear-gradient(110deg, #f0f0f2 30%, #fafafa 50%, #f0f0f2 70%); background-size: 220% 100%; animation: shimmer 1.6s linear infinite; color: var(--label-2); font-size: 13.5px; }
.gen-wait .progress { width: 60%; }
.gen-fail { display: grid; place-items: center; align-content: center; gap: 10px; padding: 18px; background: rgba(255, 59, 48, .06); font-size: 13.5px; text-align: center; }
.gen-fail p + p { margin-top: 2px; }
.gen-foot { display: grid; gap: 8px; margin-top: auto; }
.gen-refs { display: flex; align-items: center; gap: 6px; height: 40px; overflow: hidden; }
.gen-refs img { flex: none; width: 30px; height: 40px; object-fit: cover; border-radius: 6px; background: #fff; box-shadow: inset 0 0 0 1px var(--hairline); }
.ref-chip { flex: none; padding: 2px 9px; border-radius: 980px; background: var(--fill-2); font-size: 12px; color: var(--label-2); white-space: nowrap; }
.gen-prompt { height: 20px; overflow: hidden; color: var(--label-2); font-size: 13px; line-height: 20px; white-space: nowrap; text-overflow: ellipsis; }
.gen-actions { display: flex; align-items: center; justify-content: space-between; gap: 2px; height: 30px; overflow: hidden; }
.gen-actions .btn { min-height: 30px; padding: 0 9px; font-size: 13px; }
.gen-actions .btn svg { width: 15px; height: 15px; }
.gen-actions .btn[aria-pressed="true"] svg path { fill: currentColor; }
/* Labels beside the icons only on large cards; small and medium show icons with tooltips. */
.feed:not([data-size="l"]) .gen-actions .btn-label { display: none; }
.feed[data-size="s"] .gen { padding: 10px; gap: 8px; border-radius: 18px; }
.feed[data-size="s"] .gen-media { border-radius: 12px; }
.feed[data-size="s"] .gen-actions .btn { padding: 0 6px; }

/* person dialog */
.person-tips { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.person-tips li { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--label-2); }
.person-tips .tile { width: 24px; height: 24px; border-radius: 6px; }
.person-tips .tile svg { width: 14px; height: 14px; }
.consent { padding: 14px; border-radius: 14px; background: var(--fill-2); }
.person-recent { display: flex; gap: 10px; flex-wrap: wrap; }
.person-recent-item { position: relative; }
.person-recent-item > button:first-child { padding: 0; border: 2px solid transparent; border-radius: 12px; cursor: pointer; background: none; }
.person-recent-item > button:first-child:hover { border-color: var(--black); }
.person-recent-item img { width: 72px; height: 92px; object-fit: cover; border-radius: 10px; }
.person-recent-del { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--black); color: #fff; cursor: pointer; line-height: 1; }
.person-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 14px; }
.person-card { display: grid; align-content: start; gap: 8px; margin: 0; min-width: 0; }
.person-pick { display: block; width: 100%; padding: 0; border: 2px solid transparent; border-radius: 14px; overflow: hidden; background: var(--fill-2); cursor: pointer; }
.person-pick img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.person-pick:hover:not(:disabled), .person-pick:focus-visible { border-color: var(--c-blue); }
.person-card.is-off .person-pick { opacity: .55; cursor: not-allowed; }
.person-card figcaption { display: grid; gap: 6px; justify-items: start; }
.person-card-actions, .person-actions, .person-list-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.person-list-head { justify-content: space-between; }
.ref-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 6px; background: var(--fill-2); }
.ref-item { position: relative; min-height: 0; overflow: hidden; border-radius: 8px; }
.ref-item img { width: 100%; height: 100%; object-fit: contain; }
.ref-item-del { position: absolute; right: 1px; top: 1px; width: 22px; height: 22px; border: 0; border-radius: 50%; background: var(--black); color: #fff; cursor: pointer; }
.ref-item-add { min-height: 30px; border: 1px dashed var(--separator); border-radius: 8px; background: var(--surface); cursor: pointer; display: grid; place-items: center; }

/* board export */
.board-dialog { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 22px; }
.board-stage { display: grid; place-items: center; padding: 14px; border-radius: 18px; background: var(--fill-2); }
.board-canvas { width: 100%; height: auto; border-radius: 8px; box-shadow: var(--shadow-1); }
.board-side { display: grid; gap: 14px; align-content: start; }
.board-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- library */
.lib-tabs { display: flex; width: auto; max-width: 100%; flex-wrap: wrap; }
.lib-tabs button { flex: 1 0 auto; }
.lib-head-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* The library page: the types down the side, the browser beside them. */
.lib-layout { display: grid; grid-template-columns: 188px minmax(0, 1fr); gap: 40px; align-items: start; padding-top: 36px; }
.lib-side { position: sticky; top: 80px; display: grid; gap: 12px; }
.lib-side-title { padding: 0 10px; font-size: 21px; letter-spacing: -0.02em; }
.lib-types { display: grid; gap: 2px; }
.lib-type { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border: 0; border-radius: 10px; background: none;
  color: var(--label-2); font-size: 14px; font-weight: 500; text-align: left; white-space: nowrap; cursor: pointer; transition: background-color .15s, color .15s; }
.lib-type:hover { background: var(--fill-2); color: var(--label); }
.lib-type[aria-pressed="true"] { background: var(--surface); color: var(--label); font-weight: 600; box-shadow: 0 0 0 1px var(--hairline), var(--shadow-1); }
.lib-type svg { flex: none; }
.lib-type-name { flex: 1; }
.lib-type-count { font-size: 12px; font-weight: 400; color: var(--label-3); }
.lib-side-link { display: flex; align-items: center; gap: 10px; margin: 2px 10px 0; padding-top: 14px; border-top: 1px solid var(--hairline);
  color: var(--label-2); font-size: 14px; text-decoration: none; }
.lib-side-link:hover { color: var(--label); }
.lib-main { min-width: 0; }
.lib-main-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.lib-title { display: flex; align-items: baseline; gap: 10px; font-size: 30px; letter-spacing: -0.03em; }
.lib-title-count { font-size: 15px; font-weight: 500; letter-spacing: 0; color: var(--label-3); }
.lib-about { margin-top: 4px; max-width: 60ch; color: var(--label-2); font-size: 14.5px; }
.lib-generate { flex: none; margin-top: 4px; }

/* Filters, then the result count with the display tools. */
.lib-filters { display: grid; gap: 12px; margin-bottom: 16px; }
.lib-filter-row { display: flex; flex-wrap: wrap; gap: 10px; }
/* The menus sit in the search row; on phones they scroll sideways under it. */
.lib-selects { display: contents; }
.lib-selects > .select-btn { flex: 1 1 130px; width: auto; max-width: 200px; }
.lib-search { position: relative; display: block; flex: 3 1 280px; }
.lib-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--label-3); pointer-events: none; }
.lib-search .input { padding-left: 36px; padding-right: 40px; background: var(--fill-2); border-color: transparent; }
.lib-search .input:focus { background: #fff; }
.lib-kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 6px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--separator); color: var(--label-3); font: 500 12px/1 var(--font); pointer-events: none; }
.lib-search .input:focus ~ .lib-kbd, .lib-search .input:not(:placeholder-shown) ~ .lib-kbd { display: none; }
@media (hover: none) { .lib-kbd { display: none; } }
.lib-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px 18px; flex-wrap: wrap; min-height: 46px; margin-bottom: 14px;
  padding-top: 10px; border-top: 1px solid var(--hairline); }
.lib-summary { color: var(--label-2); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.lib-tools { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; }
.lib-view { grid-auto-columns: auto; }
.lib-view button { padding: 0 12px; }
.lib-switch { gap: 8px; font-size: 13px; color: var(--label-2); }
.lib-switch .switch-ui { width: 36px; height: 22px; }
.lib-switch .switch-ui::after { width: 18px; height: 18px; }
.lib-switch input:checked + .switch-ui::after { transform: translateX(14px); }
.lib-sort { display: flex; align-items: center; gap: 2px; font-size: 13px; color: var(--label-3); }
.lib-sort .select-btn { width: auto; min-height: 32px; padding: 0 8px 0 10px; border-color: transparent; background: transparent; font-size: 13px; font-weight: 500; }
.lib-sort .select-btn:hover { background: var(--fill-2); }

.lib-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); }
.mode-picker .lib-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.lib-grid.is-pose-groups { grid-template-columns: repeat(auto-fill, minmax(212px, 1fr)); gap: 18px; }
.mode-picker .lib-grid.is-pose-groups { grid-template-columns: repeat(auto-fill, minmax(188px, 1fr)); gap: 14px; }

/* A library card: the image (and a pose's angle strip) over category and
   code, name, tags and the action. Blue marks what the studio has now. */
.lib-card { position: relative; display: flex; flex-direction: column; min-width: 0; border-radius: 16px; background: var(--surface);
  box-shadow: 0 0 0 1px var(--hairline), var(--shadow-1); overflow: hidden; transition: box-shadow .2s; }
.lib-card:hover { box-shadow: 0 0 0 1px rgba(0, 0, 0, .13), var(--shadow-2); }
.lib-card.is-chosen { box-shadow: 0 0 0 2px #0071e3, var(--shadow-2); }
.lib-card.skeleton { aspect-ratio: 3 / 4.8; box-shadow: none; }
.is-pose-groups > .lib-card.skeleton { aspect-ratio: 3 / 5.2; }
.lib-card-stage { position: relative; display: grid; gap: 6px; padding: 8px 8px 0; }
.lib-card-main { position: relative; display: block; width: 100%; aspect-ratio: 3 / 4; padding: 0; border: 0; border-radius: 10px; background: #fff;
  overflow: hidden; cursor: zoom-in; }
.is-pose-groups .lib-card-main { aspect-ratio: 5 / 6; }
.mode-picker .lib-card-main { cursor: pointer; }
.lib-card-main img { width: 100%; height: 100%; object-fit: contain; -webkit-user-drag: none; }
.lib-card-main.is-depth { background: #000; }
.is-outfit .lib-card-main { background: #ececee; }
.is-outfit .lib-card-main img { object-fit: cover; }
/* Frames fit each type: scenes are landscape, items and hairstyles square, portraits 4:5. */
.is-scene .lib-card-main { aspect-ratio: 3 / 2; }
.is-item .lib-card-main, .is-hair .lib-card-main { aspect-ratio: 1 / 1; }
.is-face .lib-card-main { aspect-ratio: 4 / 5; }
.is-scene .lib-card-main img, .is-item .lib-card-main img, .is-face .lib-card-main img { object-fit: cover; }
.pose-angles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; padding: 3px; border-radius: 10px; background: var(--fill-2); }
.pose-angle { display: grid; justify-items: center; gap: 1px; min-width: 0; padding: 2px 2px 3px; border: 0; border-radius: 8px; background: transparent;
  color: var(--label-3); font-size: 10.5px; font-weight: 500; line-height: 1.3; cursor: pointer; transition: background-color .15s, color .15s; }
.pose-angle img, .pose-angle i { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 6px; background: #fff; -webkit-user-drag: none; }
.pose-angle i { background: var(--fill); }
.pose-angle > span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.pose-angle:hover { background: var(--surface); color: var(--label); }
.pose-angle[aria-pressed="true"] { background: var(--surface); color: #0071e3; box-shadow: inset 0 0 0 1.5px #0071e3; }
.lib-card-info { display: flex; flex-direction: column; gap: 5px; flex: 1; padding: 10px 12px 12px; }
.lib-card-line { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 12px; color: var(--label-3); }
.lib-card-line > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-card-line .num { flex: none; font-size: 11px; color: var(--label-4); }
.lib-card-name { font-size: 14px; font-weight: 600; line-height: 1.4; letter-spacing: -0.01em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lib-card-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.lib-tag { padding: 0 6px; border-radius: 5px; background: var(--fill-2); color: var(--label-2); font-size: 11.5px; line-height: 19px; white-space: nowrap; }
.lib-tag.is-green { background: rgba(52, 199, 89, .12); color: #248a3d; }
.lib-tag.is-fee { background: rgba(255, 149, 0, .14); color: #c93400; font-weight: 600; }
.lib-card-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 4px; }
.lib-card-now { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--label-3); }
.lib-card-use { --btn-bg: transparent; flex: none; gap: 4px; min-height: 28px; margin-left: auto; padding: 0 10px; box-shadow: inset 0 0 0 1px var(--separator); }
.lib-card-use svg { width: 14px; height: 14px; }
.lib-card-use:hover:not(:disabled) { --btn-bg: var(--black); --btn-fg: #fff; box-shadow: none; }
.lib-card-use.is-on { --btn-fg: #0071e3; box-shadow: inset 0 0 0 1px #0071e3; }
.lib-card-use.is-on:hover:not(:disabled) { --btn-bg: #0071e3; }
.lib-card .asset-flag { left: 14px; top: 14px; z-index: 1; }
.lib-card.is-disabled .lib-card-main { cursor: not-allowed; }
.lib-card.is-disabled .lib-card-main img { opacity: .4; }
.lib-card.is-locked .lib-card-main { background: var(--fill-2); cursor: pointer; }
.lib-card.is-locked .lib-card-main .asset-blur { object-fit: cover; filter: blur(10px) saturate(1.1); transform: scale(1.2); opacity: .75; }
.lib-card.is-locked .lib-card-name { color: var(--label-2); }
.lib-card.is-locked .pose-angle { cursor: default; }

/* 我的素材 cards. */
.asset-card { position: relative; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-1); overflow: hidden; transition: box-shadow .25s, transform .25s; min-height: 120px; }
.asset-card.skeleton { aspect-ratio: 3 / 4.3; box-shadow: none; }
.asset-card:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); }
.asset-hit { display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; }
.asset-img { aspect-ratio: 3 / 4; background: #fff; }
.is-outfit .asset-img { background: #ececee; }
.asset-img img { width: 100%; height: 100%; object-fit: contain; }
.is-outfit .asset-img img { object-fit: cover; }
.asset-info { padding: 10px 12px 12px; border-top: 1px solid var(--hairline); }
.asset-name { font-size: 13px; font-weight: 600; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.asset-meta { display: flex; gap: 8px; margin-top: 3px; font-size: 12px; color: var(--label-3); flex-wrap: wrap; }
.asset-card.is-disabled .asset-hit { cursor: not-allowed; }
.asset-card.is-disabled .asset-img img { opacity: .4; }
/* Locked: outside the free share until the account recharges. */
.asset-lock { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px;
  border-radius: 980px; background: rgba(29, 29, 31, .72); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); color: #fff; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.lib-lock-note { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; padding: 12px 14px; border-radius: 14px;
  background: var(--surface); box-shadow: 0 0 0 1px var(--hairline); font-size: 13.5px; color: var(--label-2); }
.lib-lock-note > span { flex: 1 1 260px; }
.lib-lock-note > svg { flex: none; color: var(--label); }
.unlock-prompt { text-align: center; }
.unlock-art { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto; border-radius: 18px; background: var(--black); color: #fff; }
.viewer-login { padding: 10px 12px; border-radius: 12px; background: var(--fill-2); color: var(--label-2); }
img.asset-blur, .asset-card img { -webkit-user-drag: none; }
.asset-flag { position: absolute; left: 8px; top: 8px; padding: 2px 9px; border-radius: 980px; background: rgba(29, 29, 31, .78); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); color: #fff; font-size: 11.5px; font-weight: 500; }
.lib-more-wrap { display: flex; justify-content: center; padding: 28px 0 0; }
.modal-picker { padding-bottom: 24px; }

/* lightbox */
.modal.modal-lightbox { width: min(1180px, 100%); padding: 0; overflow: hidden; }
.lightbox { display: grid; grid-template-columns: minmax(0, 1fr) 320px; height: min(820px, calc(100dvh - 40px)); min-height: 0; }
.lightbox-stage { position: relative; display: grid; place-items: center; min-width: 0; min-height: 0; overflow: hidden; background: #f0f0f2; padding: 20px; }
.lightbox-img { max-width: 100%; max-height: 100%; min-height: 0; object-fit: contain; border-radius: 12px; background: #fff; box-shadow: var(--shadow-2); }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .8); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--shadow-1); cursor: pointer; display: grid; place-items: center; }
.lightbox-nav.prev { left: 14px; }
.lightbox-nav.next { right: 14px; }
.lightbox-side { display: grid; align-content: start; min-height: 0; gap: 10px; padding: 56px 22px 22px; overflow-y: auto; overscroll-behavior: contain; }
.lightbox-close { position: absolute; right: 14px; top: 14px; z-index: 2; }
.viewer-aside { display: grid; gap: 12px; }
.viewer-code { font-size: 12px; font-weight: 600; color: var(--label-3); }
.viewer-title { font-size: 19px; font-weight: 700; line-height: 1.35; letter-spacing: -0.02em; }
.viewer-actions { display: grid; gap: 8px; margin-top: 8px; }
.viewer-sec { display: grid; gap: 8px; }
.viewer-sec-title { font-size: 13px; font-weight: 600; }
.upscale-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.upscale-btn { display: grid; grid-template-columns: 1fr auto; align-items: baseline; justify-items: start; gap: 4px 8px; min-height: 58px; padding: 10px 14px; border-radius: 14px; text-align: left; line-height: 1.2; }
.upscale-name { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.upscale-cost { justify-self: end; font-size: 13px; font-weight: 600; color: var(--label-2); }
.upscale-size { grid-column: 1 / -1; font-size: 12px; color: var(--label-3); }
.ref-block { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 10px; }
.ref-block-item { display: grid; align-content: start; gap: 5px; margin: 0; min-width: 0; font-size: 12px; color: var(--label-2); }
.ref-block-item img, .ref-block-empty { display: grid; place-items: center; width: 100%; aspect-ratio: 3 / 4; object-fit: contain; border-radius: 10px; background: var(--fill-2); }
.ref-block-empty { padding: 8px; text-align: center; }
.ref-preview { display: block; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: none; cursor: zoom-in; }
.viewer-aside, .my-detail-side { overflow-wrap: anywhere; min-width: 0; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }

/* zoom: full-screen original with wheel / pinch zoom and drag */
.lightbox-img { cursor: zoom-in; }
.zoom-root { position: fixed; inset: 0; z-index: 1200; background: #0c0c0e; outline: none; animation: fade-in .18s ease-out; }
.zoom-stage { position: absolute; inset: 0; overflow: hidden; cursor: grab; touch-action: none; }
.zoom-stage.is-dragging { cursor: grabbing; }
.zoom-img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; user-select: none; -webkit-user-drag: none; will-change: transform; }
.zoom-bar { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; align-items: center; gap: 2px; padding: 5px; border-radius: 980px; background: rgba(44, 44, 48, .86); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.zoom-btn { display: inline-grid; place-items: center; min-width: 36px; height: 36px; padding: 0 10px; border: 0; border-radius: 980px; background: transparent; color: #fff; font-size: 14px; font-weight: 500; text-decoration: none; cursor: pointer; }
.zoom-btn:hover { background: rgba(255, 255, 255, .14); }
.zoom-level { min-width: 52px; text-align: center; color: rgba(255, 255, 255, .78); font-size: 13px; }
.zoom-hint { position: absolute; left: 50%; top: 16px; transform: translateX(-50%); padding: 5px 14px; border-radius: 980px; background: rgba(44, 44, 48, .8); color: rgba(255, 255, 255, .78); font-size: 12.5px; white-space: nowrap; pointer-events: none; animation: zoom-hint 4.5s ease-in forwards; }
@keyframes zoom-hint { 0%, 75% { opacity: 1; } 100% { opacity: 0; } }

/* 素材创作: batch of different assets */
.chip svg { width: 13px; height: 13px; }
.batch-split { display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: center; gap: 8px; }
.batch-split-label { color: var(--label-2); font-size: 12.5px; }
.batch-groups { display: grid; gap: 10px; }
.batch-group { display: grid; gap: 8px; padding: 10px 12px; border-radius: 14px; background: var(--fill-2); }
.batch-group-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; }
.batch-rows { display: flex; flex-wrap: wrap; gap: 6px; }
.batch-row { display: inline-flex; align-items: center; gap: 2px; padding: 3px 3px 3px 10px; border-radius: 980px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--hairline); font-size: 12.5px; }
.batch-row.is-custom { background: rgba(0, 122, 255, .08); }
.batch-row button { display: grid; place-items: center; width: 20px; height: 20px; border: 0; border-radius: 50%; background: transparent; color: var(--label-3); font-size: 14px; line-height: 1; cursor: pointer; }
.batch-row button:hover { background: var(--fill); color: var(--label); }
.batch-add { display: flex; gap: 6px; }
.batch-add .input { min-height: 32px; padding: 5px 10px; background: var(--surface); font-size: 13px; }
.batch-add .btn { flex: none; }
.batch-admin { gap: 12px; }

/* ---------- works / explore */
.works-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.works-tabs { display: flex; width: auto; max-width: 100%; flex-wrap: wrap; }

/* ---------- asset badges, 我的素材, generator, job list */
.asset-meta .asset-owner { color: var(--label-2); }
.asset-meta .asset-price { color: var(--label); font-weight: 600; }
.asset-meta .asset-license { color: #248a3d; }
.asset-flag.is-mat { background: rgba(36, 138, 61, .88); }
.asset-flag.is-tape { background: rgba(201, 52, 0, .88); }
.asset-flag.is-pin { background: rgba(215, 0, 21, .88); }
.lib-grid > .empty { grid-column: 1 / -1; }
.lib-grid.is-loading { opacity: .55; transition: opacity .15s; }
.text-error { color: #d70015; }

.my-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 18px; }
.my-stats { display: flex; gap: 18px; flex-wrap: wrap; color: var(--label-2); }
.my-stats strong { color: var(--label); font-weight: 600; }
.my-detail { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.my-detail-media { display: grid; gap: 10px; }
.my-preview { width: 100%; max-height: 62vh; object-fit: contain; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 1px var(--hairline); }
.my-angles { display: flex; gap: 8px; flex-wrap: wrap; }
.my-angles button { display: grid; gap: 3px; justify-items: center; padding: 4px; border: 0; border-radius: 10px; background: none; font-size: 11.5px; color: var(--label-2); cursor: pointer; }
.my-angles img { width: 52px; height: 70px; object-fit: contain; border-radius: 8px; background: #fff; box-shadow: inset 0 0 0 1px var(--hairline); }
.my-angles button[aria-pressed="true"] { background: var(--fill); color: var(--label); font-weight: 600; }
.my-share { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.my-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 4px; }

.modal-agen { width: min(600px, 100%); }
.modal-agen .modal-foot { align-items: center; }
.agen-cost { flex: 1 1 auto; min-width: 0; margin-right: auto; color: var(--label-2); }
.agen .seg { max-width: 100%; }
.agen-ref { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; background: var(--fill-2); }
.agen-ref > .tile { width: 52px; height: 52px; border-radius: 12px; }
.agen-ref-img { width: 52px; height: 52px; object-fit: cover; border-radius: 10px; flex: none; }
.agen-ref-text { display: grid; gap: 6px; min-width: 0; }
.agen-ref-text p { color: var(--label-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agen-ref-actions { display: flex; gap: 6px; }
.agen-source { display: flex; gap: 14px; align-items: center; }
.agen-source img { width: 66px; height: 88px; object-fit: contain; border-radius: 10px; background: #fff; box-shadow: inset 0 0 0 1px var(--hairline); }
.agen-admin { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 4px; }
.agen-admin .select-btn { width: 160px; }

.ajobs { margin-bottom: 22px; }
.ajobs-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.ajobs-filters .seg { display: flex; width: auto; max-width: 100%; flex-wrap: wrap; }
.ajobs-summary { margin-bottom: 12px; }
.ajobs-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; background: var(--fill-2); color: var(--label-2); font-size: 13px; }
.ajobs-chip .spinner { width: 14px; height: 14px; }
.ajobs-chip-link { color: var(--c-blue); }
.ajobs-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.ajobs-head h2 { font-size: 17px; letter-spacing: -0.02em; }
.ajobs-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 10px; }
.ajob { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-1); min-width: 0; }
.ajob > .spinner { margin: 0 14px; color: var(--label-3); }
.ajob > .tile { margin: 0 8px; }
.ajob-results { flex: 0 0 100px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.ajob-results button { padding: 0; border: 0; border-radius: 8px; overflow: hidden; background: var(--fill-2); cursor: pointer; }
.ajob-results button:only-child { grid-column: 1 / -1; }
.ajob-results img { width: 100%; height: 72px; object-fit: contain; }
.ajob-results.is-scene img { height: 60px; }
.ajob-state { flex: 0 0 64px; display: grid; place-items: center; }
.ajob-thumbs { display: flex; gap: 4px; flex: none; }
.ajob-thumbs button { padding: 0; border: 0; border-radius: 8px; overflow: hidden; background: #fff; cursor: zoom-in; box-shadow: inset 0 0 0 1px var(--hairline); }
.ajob-thumbs img { width: 36px; height: 48px; object-fit: contain; }
.ajob-body { display: grid; gap: 2px; min-width: 0; }
.ajob-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; flex-wrap: wrap; }
.ajob-desc { font-size: 12.5px; color: var(--label-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ajob-error { font-size: 12.5px; color: #d70015; }
.ajob-meta { font-size: 12px; color: var(--label-3); }
.explore-grid { columns: 4 230px; }

/* ---------- pricing / pay */
.balance-line { margin-top: 12px; font-size: 15px; color: var(--label-2); display: flex; align-items: center; gap: 8px; }
.balance-line strong { font-size: 22px; color: var(--label); }
.pay-methods { margin: 26px 0 0; }
.pricing-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 16px; margin-top: 28px; align-items: start; }
.pricing-card { padding: 26px; display: grid; gap: 14px; align-content: start; border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--shadow-1); }
.pricing-card h2 { font-size: 19px; display: flex; align-items: center; gap: 10px; }
.redeem { display: flex; gap: 10px; }
.redeem-input { font-family: var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.cost-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.cost-table th, .cost-table td { padding: 11px 12px; border-bottom: 1px solid var(--separator); text-align: left; }
.cost-table thead th { color: var(--label-3); font-size: 12.5px; font-weight: 500; }
.cost-table tbody tr:last-child th, .cost-table tbody tr:last-child td { border-bottom: 0; }
.pay-box { max-width: 620px; padding: 28px; display: grid; gap: 22px; border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--shadow-1); }
.pay-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.pay-no { font-weight: 600; font-family: var(--mono); font-size: 13.5px; }
.pay-summary { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 16px; padding: 18px 0; border-block: 1px solid var(--separator); }
.pay-amount { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; }
.pay-pending { display: grid; justify-items: start; gap: 14px; }
.pay-qr { margin: 0; display: grid; gap: 8px; justify-items: center; padding: 18px; border-radius: 18px; background: var(--fill-2); }
.pay-qr img { background: #fff; border-radius: 10px; padding: 8px; }
.pay-done { display: grid; gap: 10px; justify-items: start; }
.pay-done .tile { margin-bottom: 4px; }
.pay-done-title { font-size: 44px; font-weight: 700; letter-spacing: -0.04em; line-height: 1; }
.pay-actions { display: flex; gap: 10px; margin-top: 6px; }

/* ---------- account */
.account-grid { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; align-items: start; }
.account-card { padding: 24px; display: grid; gap: 14px; align-content: start; border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--shadow-1); }
.account-wide { grid-column: 1 / -1; }
.account-col { display: grid; gap: 16px; align-content: start; min-width: 0; }
.account-col.is-side { position: sticky; top: 76px; }
.account-card h2 { font-size: 17px; display: flex; align-items: center; gap: 10px; }
.account-card h2 .tile { width: 26px; height: 26px; border-radius: 7px; }
.account-card h2 .tile svg { width: 15px; height: 15px; }
.account-balance { font-size: 15px; color: var(--label-2); }
.account-balance span { font-size: 52px; font-weight: 700; letter-spacing: -0.045em; line-height: 1; color: var(--label); margin-right: 4px; }
.account-card.is-credits { background: var(--black); color: #f5f5f7; box-shadow: var(--shadow-2); }
.account-card.is-credits .account-balance, .account-card.is-credits .small { color: #a1a1a6; }
.account-card.is-credits .account-balance span { color: #fff; }
.account-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: 80px 1fr; gap: 8px 12px; margin: 0; font-size: 14px; }
.kv dt { color: var(--label-3); }
.kv dd { margin: 0; }
.inline-form { display: flex; gap: 10px; align-items: flex-end; }
.inline-form .field { flex: 1; }
.copy-row { display: flex; gap: 10px; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th { text-align: left; font-weight: 500; color: var(--label-3); font-size: 12.5px; padding: 8px 10px; border-bottom: 1px solid var(--separator); white-space: nowrap; }
.data-table td { padding: 11px 10px; border-bottom: 1px solid var(--separator); vertical-align: top; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .right { text-align: right; }
.data-table .plus { color: #248a3d; font-weight: 600; }
.data-table .minus { color: var(--label-2); }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }

/* ---------- auth / legal */
.auth { display: grid; place-items: center; padding: 56px 16px 0; min-height: calc(100vh - 200px); }
.auth-card { width: min(420px, 100%); padding: 34px 32px 26px; display: grid; gap: 14px; border-radius: 28px; box-shadow: var(--shadow-2); }
.auth-logo { width: 52px; height: 52px; border-radius: 13px; box-shadow: 0 2px 6px rgba(0, 0, 0, .18); margin-bottom: 4px; }
.auth-card h1 { font-size: 28px; letter-spacing: -0.03em; }
.auth-sub { margin-top: -6px; color: var(--label-2); }
.auth-perks { margin: 0; padding: 12px 14px; list-style: none; display: grid; gap: 9px; border-radius: 16px; background: var(--fill-2); font-size: 13.5px; color: var(--label-2); }
.auth-perks li { display: flex; align-items: center; gap: 10px; }
.auth-perks .tile { width: 24px; height: 24px; border-radius: 6px; }
.auth-perks .tile svg { width: 14px; height: 14px; }
.auth-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 4px; font-size: 13.5px; }
.legal { margin-top: 44px; padding: 44px clamp(22px, 5vw, 60px); border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--shadow-1); }

/* ---------- responsive */
@media (max-width: 1100px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lightbox { grid-template-columns: 1fr; height: auto; max-height: calc(100dvh - 40px); overflow-y: auto; }
  .lightbox-stage { min-height: 200px; }
  .lightbox-img { max-height: 46dvh; }
  .lightbox-side { overflow: visible; padding-top: 18px; }
}
@media (max-width: 900px) {
  .studio-shell { grid-template-columns: 1fr; height: auto; }
  /* The settings run long here, so 生成 stays at the bottom of the screen. */
  .studio-panel { margin: 12px; overflow: visible; }
  .panel-scroll { overflow: visible; }
  .panel-foot { position: sticky; bottom: 0; z-index: 20; padding-bottom: calc(14px + env(safe-area-inset-bottom)); border-radius: 0 0 24px 24px;
    background: rgba(255, 255, 255, .9); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: 0 -8px 24px rgba(0, 0, 0, .06); }
  .studio-canvas { overflow: visible; padding: 10px 16px 40px; }
  .formula { grid-template-columns: 1fr 1fr; }
  .formula-op { display: none; }
  .formula-card.is-result { grid-column: 1 / -1; max-width: 340px; justify-self: center; width: 100%; }
  /* Library: the types become a scrolling row of pills above the browser. */
  .lib-layout { grid-template-columns: 1fr; gap: 16px; padding-top: 22px; }
  .lib-side { position: static; gap: 10px; }
  .lib-side-title { padding: 0; font-size: 28px; }
  .lib-types { display: flex; gap: 6px; margin: 0 -22px; padding: 2px 22px 4px; overflow-x: auto; scrollbar-width: none; }
  .lib-types::-webkit-scrollbar { display: none; }
  .lib-type { flex: none; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: 980px; background: var(--fill-2); }
  .lib-type[aria-pressed="true"] { background: var(--black); color: #fff; box-shadow: none; }
  .lib-type[aria-pressed="true"] svg, .lib-type[aria-pressed="true"] .lib-type-count { color: rgba(255, 255, 255, .72); }
  .lib-side-link { display: none; }
  .lib-title { font-size: 22px; }
  .lib-about { font-size: 13.5px; }
}
@media (max-width: 820px) {
  .main-nav, .hide-sm { display: none; }
  .burger { display: inline-flex; }
  .mobile-drawer:not([hidden]) { display: grid; padding: 6px 22px 14px; border-top: 1px solid var(--hairline); }
  .mobile-drawer .nav-link { padding: 12px 2px; border-radius: 0; border-bottom: 1px solid var(--separator); background: none; }
  .header-row { gap: 12px; }
  .brand-sub { display: none; }
  .lib-search { flex-basis: 100%; }
  .lib-selects > .select-btn { max-width: none; }
  .my-detail { grid-template-columns: 1fr; }
  .pricing-grid, .account-grid, .board-dialog { grid-template-columns: 1fr; }
  .account-col.is-side { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .page-head h1 { font-size: 32px; }
  .hero { padding-top: 48px; }
  .hero-stage { padding: 16px; border-radius: 24px; }
  .cta-band { padding: 36px 28px; }
  .ratio-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .bento, .steps { grid-template-columns: 1fr; }
  .bento-card.is-wide { grid-column: auto; }
  .pay-summary { grid-template-columns: 1fr 1fr; }
  .modal { padding: 20px 16px 16px; border-radius: 22px; }
  .gen-grid.n-1 { grid-template-columns: 1fr; }
  .lib-grid, .lib-grid.is-pose-groups, .mode-picker .lib-grid, .mode-picker .lib-grid.is-pose-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .lib-card-stage { padding: 6px 6px 0; }
  .pose-angles { gap: 2px; padding: 2px; }
  .pose-angle { padding: 2px; }
  .pose-angle > span { display: none; }
  .lib-card-info { padding: 8px 10px 10px; }
  .lib-card-name { font-size: 13px; }
  .lib-card-use { padding: 0 8px; }
  /* Library on phones: one line of heading, and the menus, series and tools
     each in one row (menus and series scroll sideways). */
  .lib-main-head { align-items: center; margin-bottom: 12px; }
  .lib-about { display: none; }
  .lib-title { font-size: 20px; }
  .lib-generate { margin-top: 0; }
  .lib-filters { gap: 10px; }
  .lib-selects, .lib-series { display: flex; flex-wrap: nowrap; gap: 8px; overflow-x: auto; scrollbar-width: none; }
  .lib-selects { flex: 0 0 100%; }
  .lib-selects::-webkit-scrollbar, .lib-series::-webkit-scrollbar { display: none; }
  /* Full bleed on the page, so a cut-off menu shows there is more. */
  .mode-page .lib-selects, .mode-page .lib-series { margin: 0 -22px; padding: 0 22px; }
  .mode-page .lib-selects { flex-basis: calc(100% + 44px); }
  .lib-selects > .select-btn { flex: none; width: auto; min-width: 112px; }
  .lib-series .chip { flex: none; }
  .lib-toolbar { gap: 6px 10px; }
  .lib-tools { gap: 10px; }
  .lib-sort > span, .lib-kbd { display: none; }
}
.account-library { display: flex; align-items: center; gap: 6px; color: var(--label-2); }
.pricing-unlock { margin-bottom: 18px; }

/* A pose's depth map in the library viewer. */
.viewer-depth { margin: 0; display: grid; grid-template-columns: 96px 1fr; gap: 10px; align-items: center; }
.viewer-depth img { width: 96px; aspect-ratio: 3 / 4; object-fit: contain; border-radius: 10px; background: #000; }

/* 深度图辅助 under the pose tile, and the hair tile (head crops). */
.ref-depth { display: flex; align-items: center; gap: 5px; min-height: 22px; font-size: 11.5px; font-weight: 500; color: var(--label-2); cursor: pointer; white-space: nowrap; }
.ref-depth input { width: 14px; height: 14px; margin: 0; accent-color: var(--black); flex: none; }
.ref.is-hair .ref-frame img { object-fit: cover; }
.realism-switch:has(input:disabled) { cursor: default; }
.realism-switch input:disabled + .switch-ui { opacity: .45; }
