:root {
  --bg: #fbfbff;
  --panel: #ffffff;
  --text: #111116;
  --muted: #707083;
  --line: #ebe7f5;
  --accent: #8b5cf6;
  --accent-strong: #6d35d8;
  --accent-soft: #f0e9ff;
  --blue-soft: #e8f1ff;
  --green-soft: #eaf7ef;
  --pink: #ff8cc8;
  --yellow: #ffd84f;
  --shadow: 0 22px 60px rgba(66, 42, 121, 0.12);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1120px;
  color: var(--text);
  background:
    radial-gradient(circle at 50% 8%, rgba(139, 92, 246, 0.18), transparent 28%),
    radial-gradient(circle at 88% 22%, rgba(255, 140, 200, 0.12), transparent 24%),
    var(--bg);
}

body.auth-locked {
  overflow: hidden;
}

body.auth-locked .app-shell {
  filter: blur(8px);
  pointer-events: none;
  user-select: none;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(251, 251, 255, 0.72);
  backdrop-filter: blur(16px);
}

body:not(.auth-locked) .auth-gate {
  display: none;
}

.auth-card {
  position: relative;
  width: min(520px, calc(100vw - 32px));
  padding: 28px;
  border: 1px solid rgba(235, 231, 245, 0.92);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 32px 90px rgba(66, 42, 121, 0.18);
  overflow: hidden;
}

.auth-card::before {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  right: -90px;
  top: -110px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.24), transparent 68%);
}

.auth-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.auth-logo {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 16px;
  background: var(--accent);
  color: #fff;
  font-size: 22px;
}

.auth-brand strong {
  font-size: 20px;
}

.auth-brand p,
.auth-note,
.redeem-panel p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.auth-ip {
  position: absolute;
  right: 20px;
  top: 18px;
  width: 92px;
  height: 92px;
  border: 6px solid #fff;
  border-radius: 22px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(66, 42, 121, 0.14);
}

.auth-ip img {
  width: 210px;
  height: 210px;
  object-fit: cover;
  object-position: 0 0;
  transform: translate(-12px, -24px);
}

.auth-form {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  margin-top: 8px;
}

.code-row {
  display: grid;
  grid-template-columns: 1fr 136px;
  gap: 10px;
  align-items: end;
}

.code-row .ghost-button {
  height: 42px;
  padding: 0 10px;
}

.auth-submit {
  height: 46px;
}

.redeem-panel {
  display: none;
  position: relative;
  z-index: 1;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbf7ff;
}

.redeem-panel.active {
  display: grid;
  gap: 12px;
}

.redeem-row {
  display: grid;
  grid-template-columns: 1fr 96px;
  gap: 10px;
}

.auth-note {
  position: relative;
  z-index: 1;
  margin-top: 14px;
  font-size: 13px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1480px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 28px 0 36px;
}

.hero-section {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(520px, 1.05fr);
  gap: 44px;
  align-items: center;
  min-height: 620px;
  padding: 76px 0 56px;
}

.hero-copy {
  position: relative;
  z-index: 2;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  height: 42px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-weight: 800;
  box-shadow: 0 10px 28px rgba(109, 53, 216, 0.08);
}

.hero-copy h1 {
  max-width: 700px;
  margin: 24px 0 18px;
  font-size: 70px;
  line-height: 1.08;
  letter-spacing: 0;
}

.hero-copy h1 span {
  color: var(--accent);
}

.hero-subtitle {
  max-width: 660px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 30px;
}

.hero-actions .primary-button,
.hero-actions .ghost-button {
  height: 48px;
  padding: 0 22px;
}

.hero-visual-card {
  position: relative;
  min-height: 440px;
}

.hero-visual-card > img {
  width: 100%;
  display: block;
  border-radius: 28px;
  box-shadow: 0 30px 90px rgba(72, 48, 137, 0.16);
}

.ip-chip {
  position: absolute;
  left: 34px;
  top: 34px;
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 44px rgba(66, 42, 121, 0.12);
}

.ip-chip span {
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 900;
}

.ip-chip strong {
  font-size: 14px;
}

.ip-sticker {
  position: absolute;
  right: -12px;
  bottom: -18px;
  width: 210px;
  height: 210px;
  border: 10px solid #fff;
  border-radius: 34px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(66, 42, 121, 0.18);
}

.ip-sticker img {
  width: 430px;
  height: 430px;
  object-fit: cover;
  object-position: 0 0;
  transform: translate(-18px, -38px);
}

.ip-brand-strip {
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) minmax(460px, 1.2fr);
  gap: 28px;
  align-items: center;
  margin-bottom: 28px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
}

.ip-brand-strip h2 {
  margin-bottom: 10px;
  font-size: 30px;
}

.ip-brand-strip p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.75;
}

.ip-expression-row {
  height: 190px;
  border-radius: 22px;
  overflow: hidden;
  background: #fff;
}

.ip-expression-row img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 16%;
}

.image-gallery-section {
  margin-bottom: 32px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.gallery-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  margin-bottom: 18px;
}

.gallery-heading h2 {
  margin: 0 0 8px;
  font-size: 30px;
}

.gallery-heading p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.video-card-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.video-case-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(66, 42, 121, 0.08);
}

.case-cover {
  height: 158px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(17, 17, 22, 0.18)),
    var(--case-bg);
  background-size: cover;
  background-position: center;
}

.fashion-1 {
  --case-bg: linear-gradient(135deg, #b36c66, #f5d7cc 46%, #4b5563);
}

.portrait-1 {
  --case-bg: radial-gradient(circle at 50% 24%, #ffe6ee 0 10%, transparent 11%), linear-gradient(145deg, #1f2937, #f9fafb 45%, #111827);
}

.study-1 {
  --case-bg: linear-gradient(135deg, #f9e6a4, #ffffff 42%, #b08968);
}

.denim-1 {
  --case-bg: linear-gradient(145deg, #dbeafe, #4f7da1 48%, #f7c8d8);
}

.stage-1 {
  --case-bg: radial-gradient(circle at 55% 40%, #ffffff 0 5%, transparent 7%), linear-gradient(135deg, #111827, #3345a7 52%, #020617);
}

.street-1 {
  --case-bg: linear-gradient(145deg, #d1fae5, #6b7280 48%, #111827);
}

.play-button {
  position: absolute;
  left: 50%;
  top: 58px;
  z-index: 2;
  width: 54px;
  height: 54px;
  transform: translateX(-50%);
  border: 0;
  border-radius: 999px;
  background: rgba(17, 17, 22, 0.58);
  color: #fff;
  font-size: 18px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
}

.case-body {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.case-body p {
  min-height: 44px;
  margin: 0;
  color: #4b4b58;
  font-size: 13px;
  line-height: 1.55;
}

.case-body span {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: #c0267a;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: 32px;
  line-height: 1.2;
}

.topbar h2 {
  margin: 0 0 10px;
  font-size: 32px;
}

.subtitle {
  max-width: 820px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.7;
}

.topbar-actions,
.toolbar-buttons,
.mode-tabs,
.prompt-tabs {
  display: flex;
  gap: 10px;
}

.account-pill {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 900;
}

.primary-button,
.ghost-button,
.generate-button,
.icon-button,
.tab,
.prompt-tab,
.mini-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  transition: 0.18s ease;
}

.primary-button,
.ghost-button,
.mini-button {
  height: 40px;
  padding: 0 16px;
}

.primary-button,
.generate-button {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.primary-button:hover,
.generate-button:hover {
  background: var(--accent-strong);
}

.ghost-button:hover,
.icon-button:hover,
.tab:hover,
.prompt-tab:hover,
.mini-button:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.mode-tabs {
  margin-bottom: 18px;
}

.tab {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 18px;
  font-weight: 800;
}

.tab span {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: #efe9df;
  font-size: 13px;
}

.tab.active,
.prompt-tab.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.workspace {
  display: grid;
  grid-template-columns: 520px 1fr;
  gap: 18px;
  align-items: start;
}

.input-panel,
.result-panel,
.records-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.input-panel,
.result-panel {
  padding: 22px;
}

.panel-heading,
.result-toolbar,
.records-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.panel-heading h2,
.result-toolbar h2,
.records-heading h2 {
  margin-bottom: 6px;
  font-size: 20px;
}

.panel-heading p,
.result-toolbar p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.status-pill,
.metadata-row span,
.records-heading span {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #fff4cf;
  color: #7a5400;
  font-size: 13px;
  white-space: nowrap;
}

form {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.field-card,
.settings-card {
  display: grid;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 16px;
}

.ip-assistant-card {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(135deg, #ffffff, #fbf7ff);
  padding: 14px;
}

.ip-assistant-card h3 {
  margin-bottom: 6px;
  font-size: 16px;
}

.ip-assistant-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.65;
}

.ip-avatar {
  width: 78px;
  height: 78px;
  border-radius: 20px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 12px 28px rgba(66, 42, 121, 0.12);
}

.ip-avatar img {
  width: 170px;
  height: 170px;
  object-fit: cover;
  object-position: 0 0;
  transform: translate(-10px, -18px);
}

.field-card h3,
.settings-card h3 {
  margin-bottom: 0;
  font-size: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
  color: #3c352f;
  font-size: 14px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  outline: none;
}

input,
select {
  height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 104px;
  padding: 12px;
  resize: vertical;
  line-height: 1.65;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(109, 53, 216, 0.12);
}

.mode-block,
.prompt-editor {
  display: none;
  gap: 16px;
}

.mode-block.active,
.prompt-editor.active {
  display: grid;
}

.upload-box {
  min-height: 136px;
  place-items: center;
  border: 1px dashed #c8baac;
  border-radius: 10px;
  background: #fffaf2;
  text-align: center;
  color: var(--muted);
  font-weight: 500;
}

.upload-box input {
  display: none;
}

.upload-box strong {
  color: var(--text);
  font-weight: 900;
}

.upload-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 26px;
  font-weight: 800;
}

.video-upload.has-file {
  border-color: #2f74d0;
  background: #f3f8ff;
}

.video-upload .upload-icon {
  background: var(--blue-soft);
  color: #2f74d0;
  font-size: 18px;
}

.mini-button {
  justify-self: start;
  height: 34px;
}

.prompt-box {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: #fbf8f2;
}

.prompt-box summary {
  color: var(--accent-strong);
  font-weight: 900;
  cursor: pointer;
}

.prompt-tabs {
  margin: 14px 0;
}

.prompt-tab {
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 800;
}

.generate-button {
  height: 48px;
  font-size: 16px;
}

form.is-generating .generate-button {
  opacity: 0.72;
  cursor: wait;
}

.result-panel {
  display: grid;
  gap: 16px;
}

.settings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.settings-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.toggle-row label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbf8f2;
  font-size: 13px;
}

.toggle-row input {
  width: 14px;
  height: 14px;
  padding: 0;
}

.icon-button {
  width: 38px;
  height: 38px;
  font-size: 20px;
}

.metadata-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.metadata-row span:nth-child(2) {
  background: var(--green-soft);
  color: #2f8f64;
}

.metadata-row span:nth-child(3) {
  background: var(--blue-soft);
  color: #2f74d0;
}

.metadata-row span:nth-child(4) {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.result-stack {
  display: grid;
  gap: 14px;
}

.output-block {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.output-block h3 {
  margin: 0;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #f8f5ee;
  font-size: 16px;
}

pre {
  min-height: 360px;
  max-height: 660px;
  margin: 0;
  padding: 18px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: #2f2a25;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.75;
}

.records-panel {
  box-shadow: none;
  padding: 16px;
}

.records-heading {
  align-items: center;
  margin-bottom: 12px;
}

.records-heading h2 {
  margin-bottom: 0;
}

.records-table {
  max-height: 230px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th {
  background: #f8f5ee;
  color: #594f45;
  text-align: left;
  font-weight: 900;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  line-height: 1.55;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  min-width: 220px;
  max-width: 480px;
  padding: 12px 16px;
  border-radius: 8px;
  background: #201a16;
  color: #fff;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 900px) {
  body {
    min-width: 0;
  }

  .app-shell {
    width: calc(100vw - 24px);
    padding-top: 18px;
  }

  .topbar,
  .panel-heading,
  .result-toolbar,
  .hero-section {
    flex-direction: column;
  }

  .workspace,
  .form-grid,
  .settings-grid,
  .hero-section,
  .ip-brand-strip,
  .video-card-grid {
    grid-template-columns: 1fr;
  }

  .gallery-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-section {
    min-height: 0;
    padding-top: 28px;
  }

  .hero-copy h1 {
    font-size: 42px;
  }

  .hero-subtitle {
    font-size: 16px;
  }

  .ip-sticker {
    width: 150px;
    height: 150px;
    right: 8px;
  }

  h1,
  .topbar h2 {
    font-size: 26px;
  }
}
