:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #111111;
  --muted: #777d88;
  --line: #e4e6eb;
  --dark: #4a4a4a;
  --accent: #ffc44f;
  --accent-strong: #ffb728;
  --blue: #4c7dff;
  --danger: #c83f45;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at top left, #eef6ff 0, transparent 28%), var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

button,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.shell {
  width: min(620px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 22px 26px;
  background: var(--panel);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 22px 55px rgba(0, 0, 0, 0.1);
}

.topbar {
  display: grid;
  grid-template-columns: 72px 1fr 164px;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}

.topbar h1 {
  margin: 0;
  text-align: center;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0;
}

.icon-button {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: transparent;
  color: #252a31;
  font-size: 32px;
  line-height: 1;
}

.window-actions {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  border: 1px solid var(--line);
  border-radius: 24px;
  color: #151515;
}

.window-actions span:first-child {
  font-size: 28px;
  line-height: 1;
  transform: translateY(-3px);
}

.window-actions span:nth-child(2),
.window-actions b {
  display: block;
  width: 1px;
  height: 24px;
  background: #d5d5d5;
}

.window-actions b::after {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  margin-left: 18px;
  border: 4px solid #1f1f1f;
  border-radius: 50%;
  transform: translateY(1px);
}

.input-panel {
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.input-panel label {
  display: block;
  margin-bottom: 8px;
  color: #3f4650;
  font-size: 14px;
}

.input-panel textarea,
.content-box {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  outline: none;
  line-height: 1.6;
}

.input-panel textarea:focus,
.content-box:focus {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px rgba(255, 196, 79, 0.2);
}

.input-actions,
.upload-actions,
.bottom-actions {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 16px;
  margin-top: 12px;
}

.input-actions button,
.upload-actions button,
.bottom-actions button {
  min-height: 52px;
  border-radius: 8px;
  background: #f1f2f4;
  color: #151515;
  font-size: 20px;
  font-weight: 600;
}

.upload-actions {
  grid-template-columns: 1.2fr 1.4fr;
}

.file-line {
  min-height: 20px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
  word-break: break-all;
}

.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong)) !important;
}

.summary-grid {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.cover-card,
.copy-title-card,
.preview-card {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: #f2f2f4;
}

.cover-card {
  height: 150px;
}

.cover-box {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #2d3035, #8f969f);
  color: #ffffff;
  background-size: cover;
  background-position: center;
}

.overlay-button,
.copy-title-card button {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 49px;
  background: rgba(50, 50, 50, 0.94);
  color: var(--accent);
  font-size: 20px;
  font-weight: 700;
}

.copy-title-card {
  min-height: 150px;
  padding: 18px 18px 58px;
}

.meta-line {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

#platformPill {
  padding: 4px 8px;
  border-radius: 8px;
  background: #fff3d2;
  color: #765000;
}

#titleText {
  margin: 0;
  color: #30343a;
  line-height: 1.55;
}

.preview-card {
  margin-bottom: 26px;
  background: #000;
}

.video-stage {
  width: 100%;
  aspect-ratio: 16 / 7;
  display: grid;
  place-items: center;
  background: #000;
}

.video-stage video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.play-placeholder {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.78);
  color: #ffffff;
  font-size: 40px;
  text-indent: 6px;
}

.play-placeholder.empty {
  background: rgba(255, 196, 79, 0.92);
  color: #2f2410;
  font-weight: 800;
  text-indent: 0;
}

.text-section h2 {
  margin: 0 0 14px;
  font-size: 24px;
  font-weight: 500;
}

.tool-tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
}

.tool-tabs button {
  min-height: 49px;
  background: var(--dark);
  color: var(--accent);
  font-size: 18px;
  font-weight: 700;
}

.tool-tabs button:first-child {
  border-top-left-radius: 8px;
}

.tool-tabs button:last-child {
  border-top-right-radius: 8px;
}

.content-box {
  min-height: 230px;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  font-size: 20px;
  background: #fff;
}

.status-line {
  min-height: 24px;
  margin: 8px 0 18px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

.status-line a {
  color: var(--blue);
}

.status-line.error {
  color: var(--danger);
}

.bot-panel {
  margin: 4px 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.bot-panel summary {
  min-height: 52px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  cursor: pointer;
  font-size: 20px;
  font-weight: 700;
}

.bot-panel summary::marker {
  color: var(--muted);
}

#botSummary {
  min-width: 72px;
  color: var(--muted);
  font-size: 15px;
  text-align: right;
}

.bot-body {
  padding: 0 14px 14px;
}

.bot-state-row {
  display: grid;
  grid-template-columns: auto 1fr 82px;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 14px;
}

.bot-badge {
  min-width: 62px;
  padding: 5px 8px;
  border-radius: 8px;
  text-align: center;
  font-weight: 700;
}

.bot-badge.ok {
  background: #def7e8;
  color: #14733e;
}

.bot-badge.warn {
  background: #fff3d2;
  color: #765000;
}

.bot-badge.missing,
.bot-badge.muted {
  background: #f5e2e4;
  color: var(--danger);
}

.bot-state-row button,
.bot-copy-line button,
.bot-actions button {
  min-height: 42px;
  border-radius: 8px;
  background: #f1f2f4;
  color: #151515;
  font-weight: 700;
}

.bot-body label {
  display: block;
  margin-bottom: 6px;
  color: #3f4650;
  font-size: 14px;
}

.bot-copy-line {
  display: grid;
  grid-template-columns: 1fr 82px;
  gap: 10px;
}

.bot-copy-line input {
  min-width: 0;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
  color: #30343a;
}

.bot-fields {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.bot-fields span {
  min-height: 58px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.bot-fields b {
  color: var(--muted);
  font-size: 15px;
}

.bot-fields b.ok {
  color: #14733e;
}

.bot-fields b.missing {
  color: var(--danger);
}

.bot-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.bot-note {
  min-height: 22px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  word-break: break-all;
}

.bot-note.error {
  color: var(--danger);
}

.bot-test {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.bot-test textarea {
  width: 100%;
  min-height: 88px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  outline: none;
  line-height: 1.55;
}

.bot-test textarea:focus {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px rgba(255, 196, 79, 0.2);
}

.bot-test button {
  min-height: 42px;
  border-radius: 8px;
  background: #20242a;
  color: #ffffff;
  font-weight: 700;
}

.bot-test pre {
  min-height: 44px;
  max-height: 240px;
  overflow: auto;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #30343a;
  font-family: inherit;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-all;
}

.bot-subpanel {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.bot-subpanel h3 {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 700;
}

@media (max-width: 560px) {
  .shell {
    padding: 16px 14px 20px;
  }

  .topbar {
    grid-template-columns: 48px 1fr 112px;
  }

  .topbar h1 {
    font-size: 19px;
  }

  .window-actions {
    height: 40px;
  }

  .summary-grid {
    grid-template-columns: 112px 1fr;
    gap: 10px;
  }

  .cover-card,
  .copy-title-card {
    min-height: 112px;
    height: 112px;
  }

  .copy-title-card {
    padding: 10px 10px 44px;
  }

  .overlay-button,
  .copy-title-card button,
  .tool-tabs button,
  .bottom-actions button,
  .input-actions button,
  .upload-actions button {
    font-size: 16px;
  }

  .upload-actions {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .tool-tabs {
    grid-template-columns: repeat(2, 1fr);
  }

  .content-box {
    font-size: 17px;
  }

  .bot-state-row,
  .bot-copy-line,
  .bot-actions {
    grid-template-columns: 1fr;
  }

  .bot-state-row button,
  .bot-copy-line button,
  .bot-actions button {
    width: 100%;
  }

  .bot-fields {
    grid-template-columns: repeat(2, 1fr);
  }
}
