:root {
  color-scheme: dark;
  --bg: #050506;
  --panel: rgba(24, 24, 27, 0.74);
  --panel-soft: rgba(32, 32, 36, 0.72);
  --panel-raised: rgba(43, 43, 47, 0.76);
  --line: rgba(255, 255, 255, 0.085);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f5f5f7;
  --muted: #b3b3bb;
  --subtle: #7f8088;
  --accent: #f5f5f7;
  --accent-strong: #ffffff;
  --brand: #ffae4d;
  --green: #44d38a;
  --red: #ff6767;
  --blue: #8cc8ff;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.38);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--text);
  background:
    radial-gradient(circle at 50% -16%, rgba(255, 255, 255, 0.12), transparent 360px),
    linear-gradient(180deg, #0c0c0f 0%, #050506 46%, #030304 100%),
    var(--bg);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  height: 60px;
  display: grid;
  grid-template-columns: minmax(170px, 1fr) auto minmax(250px, 1fr);
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.075);
  background: rgba(10, 10, 12, 0.72);
  backdrop-filter: blur(26px) saturate(1.18);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 780;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #111;
  background: linear-gradient(135deg, #ff9d2e, #ffc170);
  box-shadow: 0 12px 28px rgba(255, 157, 46, 0.2);
}

.main-nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.055);
}

.main-nav button {
  height: 34px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  background: transparent;
  color: var(--muted);
}

.main-nav button.active {
  color: #09090a;
  background: var(--accent);
  font-weight: 760;
}

.top-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.user-email {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.points,
.balance,
.eyebrow {
  color: var(--brand);
}

.points,
.balance {
  font-weight: 760;
}

.eyebrow {
  font-size: 11px;
  font-weight: 790;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ghost-btn,
.primary-btn {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  padding: 0 14px;
}

.ghost-btn:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.09);
}

.primary-btn {
  border-color: transparent;
  color: #070708;
  background: linear-gradient(180deg, #ffffff, #e9e9ed);
  font-weight: 790;
  box-shadow: 0 18px 46px rgba(255, 255, 255, 0.14);
}

.primary-btn:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.stretch {
  width: 100%;
}

.auth-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 30px;
}

.auth-panel {
  width: min(920px, 100%);
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(18, 20, 25, 0.82);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.auth-copy {
  padding: 44px;
  background: linear-gradient(135deg, rgba(255, 139, 32, 0.16), rgba(130, 207, 255, 0.08));
}

.auth-copy .eyebrow {
  display: block;
  margin-top: 52px;
}

.auth-copy h1 {
  margin: 12px 0;
  font-size: 36px;
  letter-spacing: 0;
}

.auth-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.auth-form {
  padding: 44px;
  display: grid;
  align-content: center;
  gap: 18px;
  background: rgba(7, 8, 10, 0.44);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.auth-tabs button {
  height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}

.auth-tabs button.active {
  color: #15110d;
  background: var(--accent);
  font-weight: 760;
}

.field {
  display: grid;
  gap: 8px;
}

.field span,
.group-title span,
.muted {
  color: var(--subtle);
  font-size: 12px;
}

.field input,
.prompt-group textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  padding: 12px 13px;
}

.field input:focus,
.prompt-group textarea:focus {
  border-color: rgba(255, 180, 95, 0.78);
  box-shadow: 0 0 0 3px rgba(255, 180, 95, 0.12);
}

.studio-shell {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr) 320px;
  gap: 14px;
  padding: 16px;
  min-height: calc(100vh - 58px);
}

.create-panel,
.result-panel,
.side-panel,
.api-card,
.api-hero > div,
.api-sidebar {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 18px 56px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(24px) saturate(1.14);
}

.create-panel,
.side-panel {
  position: sticky;
  top: 74px;
  max-height: calc(100vh - 90px);
  overflow: auto;
}

.create-panel {
  display: grid;
  grid-template-rows: auto minmax(180px, 1fr) auto auto;
  gap: 15px;
  padding: 16px;
}

.panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.panel-head h1 {
  margin: 5px 0 0;
  font-size: 24px;
  letter-spacing: 0;
}

.balance {
  white-space: nowrap;
  padding: 6px 9px;
  border-radius: 7px;
  background: rgba(255, 180, 95, 0.1);
}

.field-group {
  display: grid;
  gap: 10px;
}

.group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.group-title strong {
  font-size: 13px;
  font-weight: 680;
}

.model-list {
  display: grid;
  gap: 9px;
}

.model-card {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  text-align: left;
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
}

.model-card.active {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.11);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 26px;
  padding: 0 8px;
  border-radius: 9px;
  color: var(--blue);
  background: rgba(130, 207, 255, 0.11);
  font-size: 12px;
  font-weight: 790;
}

.badge.pro {
  color: #111;
  background: linear-gradient(135deg, #ff9d2e, #ffc170);
}

.model-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.model-copy strong,
.generate-bar strong {
  font-size: 13px;
}

.model-copy small,
.cost,
.generate-bar span,
.generate-bar small,
.api-shortcut span,
.quick-metric span {
  color: var(--subtle);
  font-size: 11px;
}

.cost {
  white-space: nowrap;
}

.split-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  height: 34px;
  min-width: 45px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  padding: 0 10px;
}

.chip.active {
  border-color: transparent;
  color: #070708;
  background: var(--accent);
  font-weight: 760;
}

.upload-box {
  min-height: 74px;
  border: 1px dashed rgba(255, 255, 255, 0.24);
  border-radius: 12px;
  display: grid;
  place-items: center;
  gap: 4px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
}

.upload-box:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.07);
}

.upload-box span {
  color: var(--subtle);
  font-size: 12px;
}

.file-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.file-preview {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.file-preview img {
  width: 54px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  background: #07080a;
}

.file-preview div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.file-preview strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.file-preview span {
  color: var(--subtle);
  font-size: 11px;
}

.file-preview button {
  width: 25px;
  height: 25px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  line-height: 1;
  padding: 0;
}

.file-preview button:hover {
  color: var(--red);
  border-color: rgba(255, 103, 103, 0.42);
}

.prompt-group textarea {
  min-height: 160px;
  resize: vertical;
  line-height: 1.6;
  border-radius: 12px;
}

.generate-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.generate-bar div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.generate-bar strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-panel {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  background: rgba(10, 10, 12, 0.62);
}

.result-toolbar {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}

.result-toolbar div {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.result-toolbar span {
  color: var(--subtle);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.result-toolbar a {
  color: var(--brand);
  text-decoration: none;
  white-space: nowrap;
  font-size: 12px;
}

.result-stage {
  min-height: 500px;
  display: grid;
  place-items: center;
  background: #050506;
  padding: 14px;
}

.result-stage img {
  max-width: 100%;
  max-height: calc(100vh - 154px);
  object-fit: contain;
  border-radius: 14px;
  display: block;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.46);
}

.result-panel.empty {
  min-height: 500px;
  place-items: center;
  align-content: center;
  gap: 12px;
  text-align: center;
  padding: 28px;
  color: var(--muted);
  background: rgba(10, 10, 12, 0.62);
}

.result-panel.empty strong {
  color: var(--text);
  font-size: 18px;
}

.result-panel.empty span {
  max-width: 420px;
  line-height: 1.7;
}

.empty-visual {
  width: 82px;
  height: 64px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.04));
}

.side-panel {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 14px;
}

.api-shortcut,
.task-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.api-shortcut {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.api-shortcut div {
  display: grid;
  gap: 5px;
}

.task-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.task-list {
  display: grid;
  gap: 8px;
}

.task-item {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 9px;
  align-items: center;
  width: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  text-align: left;
  background: rgba(255, 255, 255, 0.04);
}

.task-item.clickable:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.075);
}

.task-thumb {
  width: 52px;
  height: 42px;
  border-radius: 9px;
  object-fit: cover;
  background: #07080a;
  border: 1px solid var(--line);
}

.task-body {
  min-width: 0;
}

.task-prompt {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.task-meta,
.task-retention,
.task-error {
  margin-top: 4px;
  color: var(--subtle);
  font-size: 11px;
}

.task-retention {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-error {
  color: var(--red);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(10px);
}

.task-dialog {
  width: min(1040px, 100%);
  max-height: min(860px, calc(100vh - 56px));
  display: grid;
  grid-template-rows: auto minmax(260px, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(18, 20, 25, 0.98);
  box-shadow: var(--shadow);
}

.task-dialog-head {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.task-dialog-head div {
  display: grid;
  gap: 3px;
}

.task-dialog-head span,
.task-dialog-prompt span,
.task-dialog-error span {
  color: var(--subtle);
  font-size: 12px;
}

.task-dialog-image {
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 14px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    #07080a;
  background-size: 34px 34px;
}

.task-dialog-image img {
  max-width: 100%;
  max-height: 58vh;
  object-fit: contain;
  border-radius: 8px;
}

.task-dialog-empty {
  display: grid;
  place-items: center;
  min-height: 260px;
  color: var(--muted);
  background: #07080a;
}

.task-dialog-prompt,
.task-dialog-error {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-top: 1px solid var(--line);
}

.task-dialog-prompt p,
.task-dialog-error p {
  margin: 0;
  color: var(--text);
  line-height: 1.65;
  white-space: pre-wrap;
}

.task-dialog-error p {
  color: var(--red);
}

.status {
  height: 23px;
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  padding: 0 7px;
  font-size: 11px;
  font-weight: 760;
}

.status.ok {
  color: var(--green);
  background: rgba(68, 211, 138, 0.1);
}

.status.failed {
  color: var(--red);
  background: rgba(255, 103, 103, 0.1);
}

.status.working {
  color: var(--blue);
  background: rgba(130, 207, 255, 0.1);
}

.toast {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  max-width: min(620px, calc(100vw - 32px));
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 12px 16px;
  background: rgba(18, 20, 25, 0.97);
  box-shadow: var(--shadow);
}

.billing-page {
  padding: 20px;
  display: grid;
  gap: 16px;
}

.billing-hero,
.billing-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 18px 56px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(24px) saturate(1.14);
}

.billing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 16px;
  padding: 24px;
  background: linear-gradient(135deg, rgba(255, 139, 32, 0.13), rgba(130, 207, 255, 0.07));
}

.billing-hero h1 {
  margin: 8px 0;
  font-size: 28px;
  letter-spacing: 0;
}

.billing-hero p,
.billing-card p,
.billing-notes p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.billing-balance {
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
}

.billing-balance span {
  color: var(--subtle);
  font-size: 12px;
}

.billing-balance strong {
  font-size: 34px;
}

.billing-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.7fr);
  gap: 14px;
}

.billing-card {
  padding: 18px;
}

.billing-card.wide {
  grid-column: span 1;
}

.billing-card h2 {
  margin: 0;
  font-size: 17px;
}

.billing-card-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
  margin-bottom: 16px;
}

.billing-card-head p {
  margin-top: 6px;
  font-size: 13px;
}

.recharge-packages {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.recharge-card {
  min-height: 122px;
  display: grid;
  align-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  text-align: left;
  background: rgba(255, 255, 255, 0.045);
  padding: 16px;
}

.recharge-card:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
}

.recharge-card span {
  color: var(--brand);
  font-weight: 760;
}

.recharge-card strong {
  font-size: 20px;
}

.recharge-card small,
.recharge-order span {
  color: var(--subtle);
}

.custom-recharge {
  margin-top: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.billing-notes {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.recharge-order-list {
  display: grid;
  gap: 8px;
}

.recharge-order {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.recharge-order div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.recharge-order strong,
.recharge-order span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recharge-order span {
  font-size: 12px;
}

.api-page {
  padding: 20px;
  display: grid;
  gap: 16px;
}

.api-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 16px;
}

.api-hero > div:first-child {
  padding: 22px;
  background: linear-gradient(135deg, rgba(255, 139, 32, 0.13), rgba(130, 207, 255, 0.07));
}

.api-hero h1 {
  margin: 8px 0;
  font-size: 28px;
}

.api-hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.api-base {
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 22px;
}

.api-base span {
  color: var(--subtle);
  font-size: 12px;
}

.api-base strong {
  overflow-wrap: anywhere;
}

.api-base em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.api-doc-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.api-sidebar {
  position: sticky;
  top: 80px;
  display: grid;
  gap: 4px;
  padding: 10px;
}

.api-sidebar a {
  display: block;
  border-radius: 9px;
  padding: 10px 12px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
}

.api-sidebar a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

.api-doc-content {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.api-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.api-card {
  padding: 18px;
  overflow: hidden;
}

.api-card.wide {
  grid-column: span 2;
}

.api-card h2 {
  margin: 0 0 12px;
  font-size: 16px;
}

.api-section {
  scroll-margin-top: 86px;
}

.api-section h2 {
  font-size: 22px;
}

.api-step {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 790;
  letter-spacing: 0.08em;
}

.api-card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 13px;
}

.api-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.api-card-title h2 {
  margin: 0;
}

.key-box {
  min-height: 42px;
  display: flex;
  align-items: center;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: #dce7f2;
  background: #07080a;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.danger-btn {
  margin-top: 12px;
  min-height: 34px;
  border: 1px solid rgba(255, 103, 103, 0.28);
  border-radius: 8px;
  color: var(--red);
  background: rgba(255, 103, 103, 0.08);
  padding: 0 12px;
}

.danger-btn:hover {
  border-color: rgba(255, 103, 103, 0.46);
  background: rgba(255, 103, 103, 0.12);
}

.api-model-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.api-model-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.045);
}

.api-model-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.api-model-head span {
  width: 34px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #111;
  background: var(--brand);
  font-weight: 820;
  font-size: 12px;
}

.api-model-head strong {
  font-size: 16px;
}

.api-model-card small {
  display: block;
  margin-top: 10px;
  color: var(--blue);
}

.model-table-wrap {
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #07080a;
}

.model-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.model-table th,
.model-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  font-size: 12px;
}

.model-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: #0d0f13;
}

.model-table td {
  color: var(--text);
}

.model-table code {
  color: var(--blue);
  white-space: nowrap;
}

.api-card pre {
  margin: 0;
  padding: 14px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #07080a;
  color: #dce7f2;
  line-height: 1.55;
}

.api-card code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.param-table-wrap {
  margin: 14px 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #07080a;
}

.param-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.param-table th,
.param-table td {
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
  text-align: left;
  vertical-align: top;
  font-size: 12px;
}

.param-table th {
  color: var(--muted);
  background: #0d0f13;
}

.notice-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.8;
}

.notice-list strong {
  color: var(--text);
}

.home-page {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 30px 0 56px;
}

.home-hero {
  min-height: calc(100vh - 108px);
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(420px, 1fr);
  align-items: center;
  gap: 34px;
  padding: 46px 0 38px;
}

.hero-copy h1 {
  margin: 14px 0 14px;
  max-width: 720px;
  font-size: clamp(42px, 5.4vw, 76px);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero-copy p {
  max-width: 620px;
  margin: 0;
  color: #d5d5dc;
  font-size: clamp(16px, 1.6vw, 21px);
  line-height: 1.8;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 26px 0 30px;
}

.hero-points span {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  color: #f4f4f7;
  background: rgba(255, 255, 255, 0.06);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.hero-btn {
  min-height: 46px;
  padding: 0 22px;
  font-size: 15px;
}

.ghost-link {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 18px;
  color: var(--text);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.045);
}

.hero-showcase {
  position: relative;
  min-height: 500px;
  border: 1px solid var(--line);
  border-radius: 26px;
  overflow: hidden;
  background:
    radial-gradient(circle at 72% 20%, rgba(255, 181, 91, 0.24), transparent 260px),
    radial-gradient(circle at 10% 80%, rgba(117, 196, 255, 0.15), transparent 240px),
    rgba(255, 255, 255, 0.045);
  box-shadow: var(--shadow);
}

.hero-showcase::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.055) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.7), transparent 82%);
}

.showcase-window {
  position: absolute;
  display: grid;
  align-content: end;
  gap: 8px;
  width: 56%;
  min-height: 56%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 22px;
  padding: 0;
  overflow: hidden;
  background: rgba(255,255,255,0.04);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.38);
}

.showcase-window::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 46%;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.76));
  z-index: 1;
}

.showcase-window.source {
  left: 34px;
  top: 48px;
}

.showcase-window.result {
  right: 34px;
  bottom: 46px;
  background:
    radial-gradient(circle at 70% 16%, rgba(255, 174, 77, 0.34), transparent 220px),
    linear-gradient(145deg, rgba(255,255,255,0.14), rgba(255,255,255,0.035));
}

.showcase-window span,
.showcase-window strong {
  position: relative;
  z-index: 2;
  margin-left: 22px;
  margin-right: 22px;
}

.showcase-window img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.showcase-window.source img {
  object-position: left center;
}

.showcase-window.result img {
  object-position: right center;
}

.showcase-window span {
  color: var(--muted);
  font-size: 13px;
}

.showcase-window strong {
  margin-bottom: 22px;
  font-size: 28px;
}

.home-section {
  margin-top: 28px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(22, 22, 25, 0.68);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.22);
}

.section-head {
  display: grid;
  gap: 8px;
  margin-bottom: 24px;
}

.section-head h2,
.workflow-card h2,
.api-intro-card h2,
.bottom-cta h2 {
  margin: 0;
  font-size: clamp(26px, 3vw, 42px);
  letter-spacing: 0;
}

.section-head p,
.case-copy p,
.scenario-card p,
.workflow-card span,
.api-intro-card p,
.faq-grid p,
.bottom-cta p {
  color: var(--muted);
  line-height: 1.75;
}

.case-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.case-card,
.scenario-card,
.home-price-card,
.workflow-card,
.api-intro-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
}

.case-card {
  overflow: hidden;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.case-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.062);
}

.case-comparison {
  position: relative;
  margin: 12px 12px 0;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
}

.case-comparison img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 220ms ease;
}

.case-card:hover .case-comparison img {
  transform: scale(1.018);
}

.case-comparison::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 34%;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.68));
}

.case-comparison figcaption {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 12px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #fff;
  font-size: 12px;
}

.case-comparison figcaption span,
.case-comparison figcaption strong {
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(0, 0, 0, 0.56);
  backdrop-filter: blur(12px);
}

.case-comparison figcaption strong {
  color: var(--brand);
}

.case-images {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 12px;
}

.case-shot {
  position: relative;
  min-height: 180px;
  margin: 0;
  border-radius: 14px;
  color: #fff;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.02)),
    radial-gradient(circle at 24% 20%, rgba(255,255,255,0.22), transparent 120px);
}

.case-shot.after.orange { background-color: rgba(255, 159, 52, 0.24); }
.case-shot.after.blue { background-color: rgba(92, 174, 255, 0.22); }
.case-shot.after.green { background-color: rgba(72, 211, 139, 0.18); }
.case-shot.after.silver { background-color: rgba(230, 232, 239, 0.14); }

.case-shot img {
  width: 100%;
  height: 100%;
  min-height: 180px;
  display: block;
  object-fit: cover;
  transition: transform 220ms ease;
}

.case-card:hover .case-shot img {
  transform: scale(1.025);
}

.case-shot::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 44%;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.62));
}

.case-shot figcaption {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 1;
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(0,0,0,0.52);
  backdrop-filter: blur(12px);
  font-size: 12px;
}

.case-arrow {
  color: var(--brand);
  font-weight: 900;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 180, 95, 0.1);
}

.case-copy,
.scenario-card,
.home-price-card,
.workflow-card,
.api-intro-card {
  padding: 20px;
}

.scenario-grid,
.advantage-grid,
.home-pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.scenario-card strong {
  font-size: 18px;
}

.advantage-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.advantage-item {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.045);
}

.advantage-item span {
  color: var(--subtle);
  font-size: 12px;
}

.advantage-item strong {
  font-size: 20px;
}

.home-price-card {
  display: grid;
  gap: 10px;
}

.home-price-card.featured {
  border-color: rgba(255, 174, 77, 0.55);
  background: linear-gradient(180deg, rgba(255, 174, 77, 0.12), rgba(255,255,255,0.04));
}

.home-price-card span {
  color: var(--brand);
  font-size: 13px;
  font-weight: 760;
}

.home-price-card strong {
  font-size: 34px;
}

.home-price-card p,
.home-price-card small {
  margin: 0;
  color: var(--muted);
}

.flow-api-section {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.workflow-card,
.api-intro-card {
  padding: 28px;
}

.workflow-card ol {
  display: grid;
  gap: 14px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.workflow-card li {
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.faq-grid details {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.045);
}

.faq-grid summary {
  cursor: pointer;
  font-weight: 760;
}

.bottom-cta {
  display: grid;
  justify-items: center;
  gap: 14px;
  margin-top: 28px;
  padding: 48px 24px;
  border: 1px solid var(--line);
  border-radius: 28px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 174, 77, 0.22), transparent 360px),
    rgba(255, 255, 255, 0.05);
}

.advanced-settings {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.advanced-title {
  color: var(--text);
  font-weight: 760;
  font-size: 13px;
}

@media (max-width: 1460px) {
  .studio-shell {
    grid-template-columns: 360px minmax(0, 1fr);
  }

  .side-panel {
    grid-column: 1 / -1;
    position: static;
    max-height: none;
    grid-template-columns: 300px 280px minmax(0, 1fr);
  }

  .task-panel {
    min-width: 0;
  }
}

@media (max-width: 1040px) {
  .topbar,
  .studio-shell,
  .home-hero,
  .api-hero,
  .api-doc-layout,
  .api-grid,
  .billing-hero,
  .billing-grid,
  .case-grid,
  .flow-api-section {
    grid-template-columns: 1fr;
  }

  .home-hero {
    min-height: auto;
    padding-top: 36px;
  }

  .hero-showcase {
    min-height: 420px;
  }

  .scenario-grid,
  .home-pricing-grid,
  .advantage-grid,
  .faq-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .top-actions,
  .main-nav {
    justify-self: start;
  }

  .create-panel,
  .side-panel {
    position: static;
    max-height: none;
  }

  .side-panel {
    grid-template-columns: 1fr;
  }

  .result-stage {
    min-height: 360px;
  }

  .api-card.wide {
    grid-column: span 1;
  }

  .api-sidebar {
    position: static;
    display: flex;
    overflow: auto;
  }

  .api-model-grid {
    min-width: 0;
    grid-template-columns: 1fr;
  }

  .recharge-packages {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .topbar,
  .studio-shell,
  .home-page,
  .api-page,
  .billing-page {
    padding-left: 12px;
    padding-right: 12px;
  }

  .topbar {
    height: auto;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .auth-panel,
  .split-controls,
  .file-list,
  .scenario-grid,
  .home-pricing-grid,
  .advantage-grid,
  .faq-grid {
    grid-template-columns: 1fr;
  }

  .home-page {
    width: 100%;
    padding-top: 16px;
  }

  .home-hero {
    gap: 22px;
  }

  .hero-copy h1 {
    font-size: 42px;
  }

  .hero-points span {
    min-height: 32px;
    font-size: 13px;
  }

  .hero-actions,
  .hero-actions .primary-btn,
  .hero-actions .ghost-link {
    width: 100%;
  }

  .hero-actions .primary-btn,
  .hero-actions .ghost-link {
    justify-content: center;
  }

  .hero-showcase {
    min-height: 320px;
    border-radius: 20px;
  }

  .showcase-window {
    width: 68%;
    min-height: 52%;
    padding: 0;
  }

  .showcase-window.source {
    left: 16px;
    top: 20px;
  }

  .showcase-window.result {
    right: 16px;
    bottom: 20px;
  }

  .showcase-window strong {
    font-size: 20px;
  }

  .home-section {
    padding: 22px;
    border-radius: 18px;
  }

  .case-images {
    grid-template-columns: 1fr;
  }

  .case-arrow {
    transform: rotate(90deg);
    justify-self: center;
  }

  .workflow-card li {
    grid-template-columns: 1fr;
  }

  .auth-copy,
  .auth-form {
    padding: 28px;
  }

  .generate-bar {
    grid-template-columns: 1fr;
  }

  .custom-recharge,
  .recharge-packages {
    grid-template-columns: 1fr;
  }

  .task-item {
    grid-template-columns: 50px 1fr;
  }

  .task-item .status {
    grid-column: 2;
    justify-self: start;
  }
}
