:root {
  --studio-seal: #a33327;
  --studio-seal-soft: #f9eeeb;
  --studio-rule: #dadcd9;
  --studio-serif: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "STSong", "SimSun", serif;
  --shell-action: #292b2b;
  --shell-accent: #a33327;
}
:root.dark {
  --studio-seal: #f2a193;
  --studio-seal-soft: #402d2c;
  --studio-rule: #434644;
  --shell-action: #e8e9e6;
  --shell-on-action: #202220;
  --shell-accent: #f2a193;
}
.studio-header {
  grid-template-columns: 174px minmax(0,1fr) auto;
  gap: 24px;
  padding-inline: 18px 28px;
  border-bottom: 1px solid var(--shell-line);
}
.studio-search {
  max-width: 500px;
  height: 36px;
  border-radius: 6px;
  padding: 0 2px 0 12px;
}
.studio-search .search-hint { display: none; }
.studio-search .shell-icon-btn { width: 36px; height: 34px; border-radius: 5px; background: none; }
.header-tools { gap: 8px; }
.header-link, #header-register { border-radius: 5px; }
.studio-identity { padding: 0; }
#studio-nav { border-right: 1px solid var(--shell-line); padding-top: 22px; }
#studio-nav .lbgen-nav-item { border-radius: 4px; }
#studio-nav .lbgen-nav-item.active { background: var(--studio-seal-soft); color: var(--studio-seal); }
#studio-nav .lbgen-nav-title { padding-top: 18px; }
.nav-service { margin-top: auto; padding: 18px 10px 0; }
#service-mode { border-top: 1px solid var(--shell-line); padding-top: 12px; }
.rail-only .nav-service { display: none; }
.studio-main { padding: 28px 28px 64px; }
.studio-main > :is(#discovery-strip, #gallery-root) { max-width: 1680px; margin-inline: auto; }
.studio-main .lg-gallery { --lg-gap: 16px; --lg-accent: var(--studio-seal); --lg-solid: #963429; }
.studio-main .lg-caption { margin-left: 0; margin-bottom: 2px; }
.studio-main .lg-card-meta { padding-inline: 0; }
.studio-main .lg-filters { gap: 4px; }
.home-discovery [hidden] { display: none !important; }
.home-mast {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px 24px;
  padding-block: 2px 24px;
  border-bottom: 1px solid var(--studio-rule);
}
.home-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 16px; }
.home-heading h1 { margin: 0; font: 700 44px/1.18 var(--studio-serif); }
.home-heading p { margin: 0; font-size: 14px; color: var(--shell-muted); }
.home-actions, .selection-controls { display: flex; align-items: center; gap: 8px; }
.home-actions a {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding-inline: 16px;
  border: 1px solid var(--studio-rule); border-radius: 5px;
  font-weight: 600; color: var(--shell-fg); text-decoration: none;
}
.home-actions .home-create { border-color: #a33327; background: #a33327; color: #fff; }
.home-actions a:hover { background: var(--shell-soft); }
.home-actions .home-create:hover { background: #852a20; }
.home-actions i { width: 16px; height: 16px; }
.home-selection { margin: 20px 0 28px; }
.selection-heading { display: flex; justify-content: space-between; align-items: center; min-height: 40px; margin-bottom: 12px; }
.selection-heading h2, .studio-main #gallery-root .lg-heading h2 {
  font: 700 24px/1.3 var(--studio-serif);
  margin: 0;
}
.selection-controls { gap: 3px; }
.selection-controls button {
  display: grid; place-items: center; width: 40px; height: 40px;
  border: 1px solid var(--studio-rule); background: var(--shell-bg); color: var(--shell-fg); border-radius: 4px;
}
.selection-controls button:hover:enabled { background: var(--shell-soft); }
.selection-controls button:disabled { opacity: .4; cursor: default; }
#selection-prev i { transform: rotate(180deg); }
.selection-prints {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0,1fr);
  gap: 12px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.selection-prints::-webkit-scrollbar { display: none; }
.selection-print { display: block; min-width: 0; text-decoration: none; scroll-snap-align: start; }
.selection-print:focus-visible { outline-offset: -2px; }
.selection-frame {
  display: block; overflow: hidden; width: 100%;
  height: clamp(180px, 18vw, 290px); border-radius: 4px; background: var(--shell-soft);
}
.selection-frame img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  transition: transform .35s cubic-bezier(.2,.7,.25,1);
}
.home-selection[aria-busy="true"] .selection-prints:empty {
  min-height: calc(clamp(180px, 18vw, 290px) + 55px);
  background: var(--shell-soft);
}
.selection-print:is(:hover,:focus-visible) img { transform: scale(1.025); }
.selection-print:is(:hover,:focus-visible) .selection-title { color: var(--studio-seal); }
.selection-caption {
  display: grid;
  grid-template-columns: minmax(0,1fr) 16px;
  align-items: center;
  gap: 1px 12px;
  padding-top: 8px;
}
.selection-caption::after {
  content: ""; grid-area: 1/2; width: 16px; height: 16px;
  background: var(--shell-muted); mask: url("/assets/icons/chevron-right.svg") center/contain no-repeat;
}
.selection-title, .selection-by { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selection-title { grid-area: 1/1; font-size: 16px; font-weight: 650; }
.selection-by { grid-area: 2/1/3/3; color: var(--shell-muted); font-size: 12px; }
.selection-print[href$="9da0e27b760c4d9c8fd2a2855840a43f"] img { object-position: 74% 50%; }
.home-discovery:not(:has(.home-selection:not([hidden]))) { margin-bottom: 22px; }
.home-discovery:not([hidden]) + #gallery-root { border-top: 1px solid var(--studio-rule); padding-top: 18px; }
@media (min-width: 1041px) {
  .selection-prints:has(> :nth-child(3)) { grid-template-columns: calc(46% - 12px); grid-auto-columns: calc(27% - 6px); }
}
@media (min-width: 761px) and (max-width: 1040px) {
  .selection-prints:has(> :nth-child(3)) { grid-auto-columns: calc(50% - 6px); }
}
@media (min-width: 761px) and (max-width: 1100px) {
  .studio-main { padding: 22px 20px 56px; }
  .home-heading { display: block; }
  .home-heading h1 { font-size: 36px; }
  .home-heading p { margin-top: 3px; }
}
@media (max-width: 760px) {
  .studio-header {
    grid-template-columns: auto minmax(0,1fr) auto;
    grid-template-rows: 44px 36px;
    gap: 4px 8px;
    padding: 4px 14px 8px;
  }
  body { --shell-header: 96px; }
  .studio-search { grid-area: 2/1/3/4; max-width: none; }
  .studio-header .header-tools { gap: 1px; }
  .studio-main { padding: 18px 14px 48px; }
  .studio-main .lg-gallery { --lg-gap: 10px; }
  .home-mast { padding: 0 0 16px; gap: 14px; }
  .home-heading { gap: 4px 12px; }
  .home-heading h1 { font-size: 34px; }
  .home-heading p { font-size: 13px; }
  .home-actions a { min-height: 44px; padding-inline: 15px; }
  .home-selection { margin: 12px 0 18px; }
  .selection-heading { min-height: 44px; margin-bottom: 6px; }
  .selection-heading h2, .studio-main #gallery-root .lg-heading h2 { font-size: 22px; }
  .selection-controls button { width: 44px; height: 44px; }
  .selection-prints {
    grid-auto-columns: 79%;
    gap: 10px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding-block: 3px;
  }
  .selection-prints::-webkit-scrollbar { display: none; }
  .selection-prints:has(> :only-child) { grid-auto-columns: 100%; }
  .selection-print { scroll-snap-align: start; }
  .selection-print:focus-visible { outline-offset: -2px; }
  .selection-frame { height: auto; aspect-ratio: 1.68; }
  .home-selection[aria-busy="true"] .selection-prints:empty { min-height: 0; aspect-ratio: 1.74; }
  .selection-caption { padding-top: 6px; gap: 0 6px; }
  .home-discovery:not([hidden]) + #gallery-root { padding-top: 14px; }
  .studio-main .lg-filters { flex-wrap: nowrap; overflow: auto; padding-block: 0 8px; scrollbar-width: thin; }
}
@media (max-width: 400px) {
  .home-actions { width: 100%; }
  .home-actions a { flex: 1; }
}
