/* YIXU beautify layer: mockup polish within DESIGN.md IA. Loads after shell/workspace/account. */

:root {
  --ref-shadow: 0 8px 24px rgba(26, 31, 43, .06);
}

[data-theme=dark] {
  --ref-shadow: 0 10px 28px rgba(0, 0, 0, .4);
}

/* —— Desktop header polish —— */
@media (min-width: 1024px) {
  body:not(.studio) .top,
  body.studio .top,
  body.scrolled #top {
    grid-template: "brand nav context search tools" 60px / auto auto auto minmax(180px, 1fr) auto;
    gap: clamp(12px, 1.6vw, 24px);
  }
  .shell-context {
    grid-area: context;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 34px;
    padding-left: 18px;
    border-left: 1px solid var(--line);
    color: var(--tx2);
    font-size: 13px;
    white-space: nowrap;
  }
  .shell-context span { color: var(--mu); }
  .shell-context b { color: var(--tx); font-weight: 650; }
  .tabs .nav-trigger { min-height: 38px; font-size: 14px; }
  .top .search { max-width: 420px; }
  #q { min-height: 40px; }
  .tools .icon { width: 36px; height: 36px; border-radius: 10px; }
}

/* —— Collection headings —— */
html[data-lang=zh] body[data-tab=portrait] .collection-head h1::after {
  content: "虚构人像参考，搭配姿势与服饰创作";
  display: block;
  margin-top: 8px;
  color: var(--mu);
  font-size: 13px;
  font-weight: 450;
  letter-spacing: -.01em;
  line-height: 1.5;
}
html[data-lang=zh] body[data-tab=fav] .collection-head h1::after {
  content: "已收藏的参考素材";
  display: block;
  margin-top: 8px;
  color: var(--mu);
  font-size: 13px;
  font-weight: 450;
}
html[data-lang=zh] body[data-tab=recent] .collection-head h1::after {
  content: "最近浏览过的参考";
  display: block;
  margin-top: 8px;
  color: var(--mu);
  font-size: 13px;
  font-weight: 450;
}

.collection-head h1 { font-size: clamp(22px, 2.2vw, 28px); }

html[data-lang] body.grouped-library .collection-head h1::after { content: none; }
body.grouped-library #poseLibraryDescription { display: block; margin: 8px 0 0; color: var(--mu); font-size: 14px; line-height: 1.5; }
@media (min-width:1280px) {
  body.grouped-library { --gutter: 36px; --w: 1680px; }
  body.grouped-library .gallery-heading { padding: 27px 36px 20px; }
  body.grouped-library .collection-head h1 { font-size: 40px; line-height: 50px; font-weight: 700; letter-spacing: -.02em; }
  body.grouped-library #poseLibraryDescription { font-size: 21.5px; line-height: 32px; color: var(--mu); }
}

/* —— Gallery toolbar & cards —— */
#count { font-size: 13px; color: var(--mu); }
#count b { color: var(--tx); font-weight: 650; }
.bar .tbar :is(#fBtn, #batchBtn, #sort, #sketchBtn, #favTools button, #clrRec) {
  background: var(--bg2);
  border: 1px solid var(--line);
}
#rand {
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(255, 36, 66, .22);
}
.chip.on {
  background: var(--ac);
  border-color: var(--ac);
  color: #fff;
}
.ph {
  border-radius: 12px;
  background: var(--bg2);
  border: 1px solid var(--line);
  box-shadow: var(--sh1);
}
.card:hover .ph {
  border-color: var(--line2);
  box-shadow: var(--ref-shadow);
}
.card.sel .ph {
  border-color: var(--ac);
  box-shadow: 0 0 0 2px var(--ac), var(--ref-shadow);
}
.cbtns button[data-a=fav] {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg2) 88%, transparent);
  color: var(--mu);
  box-shadow: var(--sh1);
}
.cbtns button[data-a=fav].on { color: var(--ac); }
.card.sel .cbtns button[data-a=sel] {
  background: var(--ac);
  color: #fff;
}

/* —— History —— */
.hist-bar .seg {
  padding: 3px;
  border-radius: 999px;
  background: var(--sf);
}
.hist-bar .seg button {
  border-radius: 999px;
  min-height: 32px;
  padding-inline: 14px;
}
.hist-bar .seg button.on {
  background: var(--bg2);
  color: var(--tx);
  box-shadow: var(--sh1);
  font-weight: 600;
}
.hist-card {
  border-radius: 14px;
  overflow: hidden;
}
#histEmpty .emo svg,
#empty .emo {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  color: var(--mu);
}
#histEmpty .pri,
#empty .pri {
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(255, 36, 66, .2);
}

/* —— Studio preview empty state —— */
body.studio .preview-placeholder > svg {
  width: 52px;
  height: 52px;
  padding: 14px;
  border-radius: 18px;
}
body.studio .preview-placeholder h3 {
  font-size: clamp(22px, 2.4vw, 30px);
}
body.studio #studioEditor {
  border-radius: 16px;
  box-shadow: 0 12px 36px rgba(29, 33, 41, .08), 0 0 0 1px var(--line);
}
[data-theme=dark] body.studio #studioEditor {
  box-shadow: 0 14px 40px rgba(0, 0, 0, .45), 0 0 0 1px var(--line2);
}
body.studio #wbGo {
  border-radius: 12px;
}

/* —— Tray / dock —— */
#workspaceDock {
  border-radius: 16px;
  background: color-mix(in srgb, var(--bg2) 92%, transparent);
  backdrop-filter: blur(12px) saturate(1.15);
  -webkit-backdrop-filter: blur(12px) saturate(1.15);
  box-shadow: 0 10px 32px rgba(29, 33, 41, .12), 0 0 0 1px var(--line);
}
#composeFab,
#tgStudio {
  border-radius: 10px;
  font-weight: 650;
  box-shadow: 0 4px 14px rgba(255, 36, 66, .22);
}
.basket-next {
  background: color-mix(in srgb, var(--sf) 55%, var(--bg2));
}

/* —— Overlays —— */
.pk-box,
.cfg-box,
.mdl .hb,
.cmd-box {
  border-radius: 16px;
  box-shadow: var(--sh3);
  border: 1px solid var(--line);
}
.pk-h,
.cfg-f {
  border-color: var(--line);
}
#pk .pk-g button,
#pk .pk-g .pick {
  border-radius: 10px;
}
.prov label > span {
  border-radius: 12px;
  border: 1px solid var(--line);
  transition: border-color 150ms var(--out), box-shadow 150ms var(--out);
}
.prov label:has(input:checked) > span {
  border-color: color-mix(in srgb, var(--ac) 45%, var(--line));
  box-shadow: 0 0 0 3px var(--acs);
}
.lb-tools {
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg2) 88%, transparent);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.lb-tools button {
  border-radius: 999px;
  min-height: 34px;
}
.lb-side .acts [data-x=try],
#cfSave {
  border-radius: 10px;
}
.cmd-box {
  overflow: hidden;
}
.cmd-in {
  border-bottom: 1px solid var(--line);
}
.cmd-list [aria-selected=true],
.cmd-list .on {
  background: var(--acs);
  color: var(--ac);
}
#sketch .sk-top,
#sketch .sk-foot {
  border-color: var(--line);
}
#sketch #skPause {
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(255, 36, 66, .22);
}
#toTop {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg2);
  box-shadow: var(--sh2);
}
#toast {
  border-radius: 12px;
  box-shadow: var(--sh2);
}

/* —— Account desktop —— */
@media (min-width: 761px) {
  body.accountview #accountSec { max-width: 1120px; }
  body.accountview .account-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  body.accountview .account-grid > section:nth-child(1),
  body.accountview .account-grid > section:nth-child(2),
  body.accountview .account-grid > section:nth-child(3),
  body.accountview .account-grid > section:nth-child(4),
  body.accountview #accountPreferences {
    grid-column: auto;
    grid-row: auto;
  }
  body.accountview .account-card {
    border-radius: 14px;
    padding: 26px;
  }
  body.accountview .account-heading {
    border-bottom: 0;
    margin-bottom: 28px;
  }
  body.accountview .account-heading h1 { font-size: 28px; }
}

/* —— Mobile —— */
@media (max-width: 1023px) {
  .shell-context { display: none; }
  .collection-head h1 { font-size: 22px; }
  html[data-lang=zh] body[data-tab] .collection-head h1::after { font-size: 12px; margin-top: 6px; }
}

@media (max-width: 767px) {
  .studio-mobile-tabs {
    border-radius: 12px;
    box-shadow: var(--sh1);
  }
  .studio-mobile-tabs [aria-selected=true] {
    background: var(--acs);
    color: var(--ac);
  }
  #studioEditor .gobar {
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -8px 24px rgba(29, 33, 41, .08);
  }
}

/* Account mobile: show real cards; hide marketing extras chrome handled in account.css */
@media (min-width: 761px) {
  .account-mobile-summary,
  .account-mobile-login,
  .account-mobile-extras { display: none !important; }
}
