@font-face {
  font-family: "PosterBlack";
  src: url("./2.ttf") format("truetype");
  font-display: swap;
}

:root {
  --bg: #090a0f;
  --panel: rgba(18, 20, 28, 0.92);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text: #f4f6ff;
  --muted: #9ea6c6;
  --accent: #7af0e9;
  --accent-strong: #3fe1c5;
  --field: rgba(8, 10, 16, 0.92);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(122, 240, 233, 0.1), transparent 28%),
    radial-gradient(circle at bottom right, rgba(255, 84, 110, 0.12), transparent 34%),
    linear-gradient(135deg, #07080c, #0d1018 58%, #08090d);
  color: var(--text);
  font-family: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

body {
  padding: 20px;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(340px, 420px) minmax(640px, 1fr);
  gap: 20px;
  min-height: calc(100vh - 40px);
}

.editor-panel,
.workspace-panel {
  border: 1px solid var(--panel-border);
  background: var(--panel);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(14px);
}

.editor-panel {
  border-radius: 24px;
  padding: 24px;
  position: sticky;
  top: 20px;
  height: fit-content;
}

.panel-header h1,
.workspace-header h2,
.workspace-header p {
  margin: 0;
}

.eyebrow,
.workspace-eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.panel-header h1 {
  font-size: 28px;
  line-height: 1.1;
}

.panel-copy {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.field-group {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.field {
  display: block;
  margin-bottom: 16px;
}

.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.field span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.field-row > span,
.switch-control > span,
.sub-label,
.color-picker-field > span {
  margin-bottom: 0;
}

.transform-group {
  margin-top: 10px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
}

.transform-header span,
.slider-label span {
  margin: 0;
}

.transform-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.slider-field {
  margin-top: 14px;
}

.slider-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.slider-label output {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.body-lines-editor {
  display: grid;
  gap: 10px;
}

.body-line-input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--field);
  color: var(--text);
  border-radius: 16px;
  padding: 13px 14px;
}

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

.segment-control-dynamic {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.segment-button {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 11px 0;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
  transition:
    background 140ms ease,
    color 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease;
}

.segment-button.is-active,
.segment-button[aria-pressed="true"] {
  background: linear-gradient(135deg, rgba(122, 240, 233, 0.22), rgba(63, 225, 197, 0.18));
  color: var(--text);
  border-color: rgba(122, 240, 233, 0.42);
  box-shadow: inset 0 0 0 1px rgba(122, 240, 233, 0.14);
}

.switch-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

.switch-control input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-strong);
  margin: 0;
}

.highlight-controls {
  display: grid;
  gap: 14px;
}

.highlight-controls.is-disabled {
  opacity: 0.52;
}

.sub-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.color-chip-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.color-chip {
  position: relative;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: var(--chip-color);
  cursor: pointer;
}

.color-chip.is-active,
.color-chip[aria-pressed="true"] {
  border-color: rgba(255, 255, 255, 0.72);
  box-shadow:
    inset 0 0 0 2px rgba(7, 9, 14, 0.2),
    0 0 0 1px rgba(122, 240, 233, 0.24);
}

.color-picker-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

input[type="color"] {
  width: 56px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
}

input[type="text"],
textarea,
input[type="file"],
input[type="range"],
button {
  width: 100%;
  font: inherit;
}

input[type="text"],
textarea,
input[type="file"] {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--field);
  color: var(--text);
  border-radius: 16px;
  padding: 13px 14px;
}

input[type="range"] {
  appearance: none;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(122, 240, 233, 0.2);
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(122, 240, 233, 0.2);
  cursor: pointer;
}

input[type="range"]:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

textarea {
  resize: vertical;
  min-height: 96px;
}

button {
  border: none;
  border-radius: 16px;
  padding: 13px 16px;
  cursor: pointer;
  font-weight: 700;
  color: #071016;
  background: linear-gradient(135deg, var(--accent), #b6fbef);
}

button.secondary-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.field-hint,
.field-meta,
.status-text,
.workspace-note,
.poster-size {
  color: var(--muted);
}

.field-hint,
.field-meta {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.6;
}

.field-meta {
  color: var(--accent);
}

.action-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.status-text {
  margin: 18px 0 0;
  min-height: 20px;
  font-size: 13px;
  line-height: 1.6;
}

.workspace-panel {
  border-radius: 26px;
  padding: 18px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
}

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

.workspace-header h2 {
  font-size: 24px;
  line-height: 1.1;
}

.poster-size {
  font-size: 13px;
  white-space: nowrap;
}

.poster-stage {
  min-height: 0;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top left, rgba(122, 240, 233, 0.08), transparent 20%),
    rgba(7, 9, 14, 0.84);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: auto;
}

#previewCanvas {
  width: min(100%, 680px);
  height: auto;
  display: block;
  border-radius: 28px;
  background: #08090d;
  box-shadow:
    0 26px 60px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.06);
}

.workspace-note {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
}

@media (max-width: 1100px) {
  body {
    padding: 12px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .editor-panel {
    position: static;
  }

  .workspace-panel {
    min-height: auto;
  }
}

@media (max-width: 720px) {
  .editor-panel,
  .workspace-panel {
    border-radius: 22px;
    padding: 18px;
  }

  .action-group {
    grid-template-columns: 1fr;
  }

  .workspace-header {
    flex-direction: column;
  }

  .poster-stage {
    padding: 14px;
  }
}
