@font-face {
  font-family: CustomTitleHei;
  src: url("../assets/fonts/标题黑.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: CustomHappy;
  src: url("../assets/fonts/欢乐.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: CustomCuteRound;
  src: url("../assets/fonts/可爱圆.ttc") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: CustomLongYin;
  src: url("../assets/fonts/龙吟.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: CustomHand;
  src: url("../assets/fonts/手书.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: CustomGothic;
  src: url("../assets/fonts/哥特.ttf") format("truetype");
  font-display: swap;
}

:root {
  --bg: #060a14;
  --panel: rgba(12, 20, 38, 0.84);
  --panel-strong: rgba(8, 14, 28, 0.92);
  --line: rgba(158, 184, 220, 0.18);
  --text: #f6f9ff;
  --muted: #96a7bf;
  --blue: #38bdf8;
  --violet: #8b5cf6;
  --good: #8df3b0;
  --warn: #ffe08a;
  --bad: #ff9dad;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1120px;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 20% 12%, rgba(56, 189, 248, 0.16), transparent 28%),
    radial-gradient(circle at 82% 18%, rgba(139, 92, 246, 0.18), transparent 28%),
    linear-gradient(135deg, #040712, #0b1221 48%, #070916);
}

.page-shell {
  width: min(1560px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 28px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 27px;
  line-height: 1.25;
  letter-spacing: 0;
}

h2 {
  font-size: 16px;
  line-height: 1.3;
}

.fixed-badge {
  flex: 0 0 auto;
  border: 1px solid rgba(56, 189, 248, 0.36);
  border-radius: 999px;
  padding: 8px 13px;
  color: #c6edff;
  background: rgba(14, 165, 233, 0.14);
  font-size: 13px;
}

.workspace {
  display: grid;
  grid-template-columns: 360px minmax(410px, 520px) minmax(360px, 1fr);
  align-items: start;
  gap: 14px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 20px 58px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(12px);
}

.input-panel {
  padding: 15px;
}

.field {
  padding-bottom: 13px;
  margin-bottom: 13px;
  border-bottom: 1px solid rgba(158, 184, 220, 0.12);
}

.field:last-of-type {
  border-bottom: 0;
  margin-bottom: 0;
}

.field-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 14px;
}

.field-title label,
.field-title > span:first-child {
  color: #eef6ff;
}

.field-title span:not(:first-child),
.hint,
.file-name {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

input[type="text"],
select {
  width: 100%;
  height: 40px;
  border: 1px solid rgba(158, 184, 220, 0.22);
  border-radius: 8px;
  padding: 0 11px;
  color: #fff;
  background: rgba(2, 7, 18, 0.78);
  outline: none;
  font-size: 14px;
}

input[type="text"]:focus,
select:focus {
  border-color: rgba(56, 189, 248, 0.64);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.12);
}

.select-with-status {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.font-status {
  font-size: 12px;
  white-space: nowrap;
}

.font-status.ok {
  color: var(--good);
}

.font-status.missing {
  color: var(--bad);
}

.color-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.color-grid label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

input[type="color"] {
  width: 100%;
  height: 42px;
  border: 1px solid rgba(158, 184, 220, 0.22);
  border-radius: 8px;
  padding: 4px;
  background: rgba(2, 7, 18, 0.78);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--blue);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.pill {
  border: 1px solid rgba(158, 184, 220, 0.18);
  border-radius: 999px;
  padding: 5px 8px;
  color: #d4e7ff;
  background: rgba(9, 17, 32, 0.78);
  font-size: 12px;
}

.upload-box {
  border: 1px dashed rgba(158, 184, 220, 0.28);
  border-radius: 8px;
  padding: 11px;
  background: rgba(2, 7, 18, 0.34);
}

.file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-bottom: 10px;
}

.file-button {
  flex: 0 0 auto;
  border-radius: 8px;
  padding: 8px 12px;
  color: #07111f;
  background: #eef7ff;
  cursor: pointer;
  font-size: 13px;
}

.file-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

input[type="file"] {
  display: none;
}

.notice-stack {
  display: grid;
  gap: 8px;
}

.notice {
  display: none;
  border: 1px solid rgba(158, 184, 220, 0.18);
  border-radius: 8px;
  padding: 8px 9px;
  font-size: 12px;
  line-height: 1.5;
}

.notice.show {
  display: block;
}

.notice.good {
  color: #c9ffd9;
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.24);
}

.notice.warn {
  color: var(--warn);
  background: rgba(234, 179, 8, 0.12);
  border-color: rgba(234, 179, 8, 0.26);
}

.notice.bad {
  color: #ffd1d9;
  background: rgba(244, 63, 94, 0.12);
  border-color: rgba(244, 63, 94, 0.26);
}

.preview-column {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 10px;
  min-height: 0;
}

.preview-column h2 {
  text-align: center;
  color: #68d7ff;
  font-size: 23px;
  text-shadow: 0 0 18px rgba(56, 189, 248, 0.34);
}

.phone-frame {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  align-self: start;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel-strong);
  overflow: hidden;
}

#gameCanvas {
  display: block;
  width: auto;
  max-width: 100%;
  height: min(67vh, 720px);
  background: #000;
  border-radius: 6px;
}

.scene-thumbs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.scene-thumb {
  overflow: hidden;
  border: 2px solid rgba(158, 184, 220, 0.16);
  border-radius: 8px;
  background: rgba(2, 7, 18, 0.88);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.scene-thumb.active {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.18);
}

.scene-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 1.25 / 1;
  object-fit: cover;
}

.scene-thumb span {
  display: block;
  padding: 6px 4px;
  color: #d8e8fb;
  text-align: center;
  font-size: 12px;
  white-space: nowrap;
}

.right-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: var(--right-column-height, auto);
  min-height: 0;
  overflow: hidden;
}

.right-column .panel {
  padding: 13px;
}

.title-preview-card {
  flex: 0 0 375px;
  min-height: 0;
}

.title-preview-card h2,
.summary-card h2,
.checklist-card h2 {
  margin-bottom: 10px;
}

#titleCanvas {
  display: block;
  width: 100%;
  max-width: 424px;
  height: auto;
  margin: 0 auto 8px;
  border: 1px solid rgba(158, 184, 220, 0.16);
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.02);
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, 0.1) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.1) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.1) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.1) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}

.summary-card {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

#summaryBox {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  border: 1px solid rgba(56, 189, 248, 0.24);
  border-radius: 8px;
  padding: 11px;
  overflow-x: hidden;
  overflow-y: auto;
  color: #dff4ff;
  background: rgba(2, 7, 18, 0.66);
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  padding: 9px 12px;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
}

.button.primary {
  background: linear-gradient(135deg, #0284c7, #2563eb, #7c3aed);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.25);
}

.button.secondary {
  border: 1px solid rgba(158, 184, 220, 0.2);
  background: rgba(30, 41, 59, 0.86);
}

.button.wide {
  width: 100%;
}

.checklist-card {
  flex: 0 0 168px;
  overflow: hidden;
  color: #cfddf0;
  font-size: 13px;
  line-height: 1.62;
}

.checklist-card ol {
  margin: 6px 0 0;
  padding-left: 20px;
}

.company-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-top: 18px;
  color: rgba(220, 232, 248, 0.48);
  font-size: 14px;
}

.company-footer img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  opacity: 0.52;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 18px);
  opacity: 0;
  border: 1px solid rgba(158, 184, 220, 0.22);
  border-radius: 999px;
  padding: 10px 15px;
  color: #fff;
  background: rgba(2, 7, 18, 0.94);
  transition: opacity 0.18s, transform 0.18s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 1260px) {
  body {
    min-width: 0;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  #gameCanvas {
    height: auto;
    max-height: 78vh;
  }

  .right-column {
    height: auto;
    overflow: visible;
  }

  .title-preview-card,
  .checklist-card {
    flex-basis: auto;
  }

  .summary-card {
    flex: 0 0 auto;
  }

  #summaryBox {
    max-height: 420px;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 20px, 1560px);
  }

  .page-header {
    display: block;
  }

  .fixed-badge {
    display: inline-block;
    margin-top: 10px;
  }

  h1 {
    font-size: 21px;
  }

  .scene-thumbs,
  .color-grid,
  .button-row {
    grid-template-columns: 1fr;
  }
}
