:root {
  color-scheme: light;
  --paper: #fff;
  --ink: #19191b;
  --muted: #636369;
  --rule: #e8e8eb;
  --accent: #252329;
  --focus: #6b4c78;
  --wash: #f7f7f8;
  font: 15px/1.55 "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.top { background: #fff; border-bottom: 1px solid var(--rule); }
.nav, main { width: min(1160px, calc(100% - 48px)); margin-inline: auto; }
.nav { min-height: 66px; display: flex; align-items: center; flex-wrap: wrap; gap: 22px; padding-block: 12px; }
.nav a:not(.button) { color: var(--muted); }
.nav a[aria-current="page"] { color: var(--accent); font-weight: 700; }
.nav .brand { display: inline-flex; align-items: center; gap: 9px; margin-right: 8px; font-size: 21px; font-weight: 800; color: var(--ink); }
.mark { width: 19px; height: 19px; border: 1px solid var(--accent); transform: rotate(-10deg); border-radius: 3px; box-shadow: inset 0 -6px var(--accent); }
.balance { margin-left: auto; }
.recharge, .nav a.recharge[aria-current="page"] { background: #11594e; color: #fff; white-space: nowrap; }
.studio-recharge { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 10px 12px; margin-bottom: 16px; background: #edf6f3; border-radius: 6px; }
.studio-recharge a { color: #11594e; font-weight: 700; text-decoration: underline; }
main { padding-block: 52px 72px; }
.heading { margin-bottom: 34px; }
h1, h2, p { margin-top: 0; }
h1 { font: 600 42px/1.2 "Songti SC", "SimSun", serif; margin-bottom: 0; }
h2 { font-size: 18px; margin-bottom: 16px; }
.eyebrow { font-size: 11px; color: var(--muted); font-weight: 700; margin-bottom: 10px; }
.studio { display: grid; grid-template-columns: minmax(270px, 360px) minmax(0, 1fr); gap: 32px; border-top: 1px solid var(--rule); padding-top: 26px; }
.controls { padding-right: 28px; border-right: 1px solid var(--rule); }
.stack { display: grid; gap: 13px; }
label { display: block; font-weight: 600; overflow-wrap: anywhere; }
input, textarea, select, button { font: inherit; color: inherit; min-width: 0; }
input:not([type="radio"]), textarea, select { border: 1px solid #d8d8de; background: #fff; border-radius: 6px; padding: 9px 10px; width: 100%; }
label > input:not([type="radio"]) { margin-top: 5px; }
textarea { resize: vertical; min-height: 150px; }
fieldset { border: 0; padding: 0; margin: 0 0 8px; min-width: 0; }
legend { padding: 0; font-weight: 600; margin-bottom: 8px; }
.sizes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.sizes label { position: relative; }
.sizes input { position: absolute; opacity: 0; }
.sizes span { display: block; text-align: center; padding: 8px 4px; border: 1px solid var(--rule); border-radius: 6px; background: #fff; cursor: pointer; }
.sizes input:checked + span { border-color: var(--accent); background: var(--wash); color: var(--accent); }
.sizes input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
button, .button { display: inline-block; text-align: center; border: 1px solid transparent; background: var(--accent); color: #fff; border-radius: 6px; padding: 8px 13px; cursor: pointer; font-weight: 700; }
button:hover, .button:hover { filter: brightness(.9); text-decoration: none; }
button:disabled { opacity: .55; cursor: not-allowed; }
[data-generate-button] { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; min-height: 46px; }
[aria-busy="true"] button { cursor: wait; }
[data-model-cost] { color: #eeeaf1; font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.secondary, .quiet { color: var(--accent); background: #fff; border-color: var(--rule); }
.quiet { background: none; border-color: transparent; }
.empty { min-height: 310px; aspect-ratio: 4 / 3; display: grid; align-content: center; justify-items: center; gap: 14px; background: var(--wash); border: 1px solid var(--rule); border-radius: 8px; color: var(--muted); }
.frame { height: 29px; width: 38px; border: 1px solid #8c8790; border-radius: 4px; }
figure { margin: 0; min-width: 0; }
figure img { display: block; width: 100%; height: auto; max-height: 590px; object-fit: contain; border-radius: 8px; background: var(--wash); }
figcaption { display: flex; align-items: start; justify-content: space-between; gap: 10px; margin-top: 10px; flex-wrap: wrap; overflow-wrap: anywhere; }
figcaption span { flex: 1 1 150px; }
.gallery, .settings { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,250px),1fr)); gap: 20px; }
.gallery img { aspect-ratio: 4 / 3; }
.settings > div, .payment-options { grid-column: 1 / -1; }
.payment-options label { display: inline-flex; align-items: center; gap: 5px; margin-right: 14px; }
.payment-options input[type="checkbox"] { width: auto; margin: 0; }
.subnav { display: flex; flex-wrap: wrap; gap: 16px; }
main > section { border-top: 1px solid var(--rule); padding-top: 20px; margin-top: 28px; }
.auth { max-width: 390px; }
.flash { padding: 11px 14px; background: var(--wash); border-left: 3px solid var(--focus); overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.section-title { margin-top: 28px; }
.table { max-width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
td, th { padding: 10px 12px; border-bottom: 1px solid var(--rule); }
th { background: var(--wash); white-space: nowrap; }
#models details { border-bottom: 1px solid var(--rule); }
#models summary { padding-block: 12px; cursor: pointer; font-weight: 600; overflow-wrap: anywhere; }
.model-editor { padding-block: 8px 16px; }
.model-editor select { margin-top: 5px; }
.api-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.image-dimensions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.65fr); gap: 8px; }
.image-dimensions select { margin-top: 5px; }
.key-field { max-width: 620px; margin-bottom: 12px; }
.key-field input { font-family: monospace; }
.home { padding-top: 0; }
.home > .home-hero {
  margin: 0 calc(50% - 50vw);
  padding: 64px max(24px, calc((100vw - 1160px) / 2));
  min-height: 420px;
  display: grid;
  align-items: center;
  border: 0;
  background: #e6eef5 url("https://images.unsplash.com/photo-1642617916560-77159bba9f2f?auto=format&fit=crop&w=2000&q=82") center 28% / cover no-repeat;
}
.home-intro { max-width: 360px; color: #152332; }
.home-intro .eyebrow { color: inherit; }
.home-intro h1 { font-size: 70px; margin-bottom: 16px; }
.home-intro p:not(.eyebrow) { font-size: 17px; max-width: 26ch; margin-bottom: 24px; }
.home-intro .button { padding: 10px 19px; }
.home > .home-features { margin-top: 0; padding-top: 24px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 32px; }
.home-features h2 { margin-bottom: 6px; }
.home-features p { color: var(--muted); margin-bottom: 0; }
@media (max-width: 680px) {
  .home > .home-hero { padding: 38px 20px; min-height: 360px; background-position: 45% 20%; }
  .home-intro h1 { font-size: 54px; }
  .home > .home-features { grid-template-columns: 1fr; }
}
.row, .search { display: flex; align-items: center; gap: 8px; }
.row { min-width: 255px; }
.row button, .search button { white-space: nowrap; }
.search { max-width: 390px; margin-bottom: 12px; }
@media (max-width: 680px) {
  .nav, main { width: calc(100% - 28px); }
  .nav { gap: 8px 13px; }
  .nav .brand { margin-right: 0; }
  main { padding-top: 28px; }
  h1 { font-size: 30px; }
  .studio { grid-template-columns: 1fr; gap: 25px; }
  .controls { padding: 0 0 22px; border-right: 0; border-bottom: 1px solid var(--rule); }
  .empty { min-height: 180px; }
}
