:root {
  --bg: #f3efe8;
  --panel: #fffdf8;
  --ink: #1f2a32;
  --muted: #5f6f7b;
  --accent: #0f766e;
  --accent-2: #e38a42;
  --warn: #b94e2d;
  --line: #d8d2c8;
  --shadow: 0 12px 40px rgba(31, 42, 50, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 15% 10%, #fff4d6 0%, transparent 35%),
              radial-gradient(circle at 90% 0%, #d6efe8 0%, transparent 38%),
              var(--bg);
}

.bg-shape {
  position: fixed;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(42px);
  opacity: 0.28;
}

.bg-shape-a {
  width: 360px;
  height: 360px;
  background: #ebb686;
  top: -140px;
  left: -100px;
}

.bg-shape-b {
  width: 420px;
  height: 420px;
  background: #78b3aa;
  right: -120px;
  bottom: -180px;
}

.shell {
  width: min(1080px, calc(100% - 28px));
  margin: 24px auto 40px;
  position: relative;
  z-index: 1;
}

.hero {
  margin-bottom: 16px;
  animation: rise 520ms ease-out;
}

.eyebrow {
  margin: 0;
  letter-spacing: 0.12em;
  color: #54707b;
  font-size: 12px;
}

h1 {
  margin: 8px 0 8px;
  font-family: "ZCOOL XiaoWei", serif;
  font-size: clamp(30px, 4vw, 44px);
}

.sub {
  margin: 0;
  color: var(--muted);
}

.panel {
  background: color-mix(in srgb, var(--panel) 92%, white 8%);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 18px;
  margin-top: 14px;
  animation: rise 520ms ease both;
}

.panel:nth-of-type(2) { animation-delay: 70ms; }
.panel:nth-of-type(3) { animation-delay: 140ms; }
.panel:nth-of-type(4) { animation-delay: 210ms; }
.panel:nth-of-type(5) { animation-delay: 280ms; }

h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

.grid {
  display: grid;
  gap: 12px;
}

.grid.two {
  grid-template-columns: 1fr;
}

label span {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: #4f5d66;
}

input,
select {
  width: 100%;
  height: 42px;
  border: 1px solid #cfc7bb;
  border-radius: 10px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.18);
}

textarea {
  width: 100%;
  min-height: 150px;
  border: 1px solid #cfc7bb;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
}

textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.18);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.btn {
  border: 1px solid #c8bfb3;
  background: #fff8ec;
  color: #2c3d47;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(31, 42, 50, 0.12);
}

.btn-primary {
  border-color: #0d6a63;
  background: linear-gradient(120deg, #0f766e, #0a5f65);
  color: #effffc;
}

.btn-warn {
  border-color: #9e4126;
  background: linear-gradient(120deg, #ba4f2d, #9c3c24);
  color: #fff6f2;
}

.hint,
.meta {
  margin: 8px 0 0;
  font-size: 12px;
  color: #5f6f7b;
}

.mode-note {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #cfe5df;
  background: #f2fbf8;
}

.mode-note-title {
  margin: 0 0 6px;
  font-size: 13px;
  color: #0f615b;
  font-weight: 700;
}

.mode-note-item {
  margin: 4px 0 0;
  font-size: 12px;
  color: #3f5f65;
}

.preview-wrap {
  margin-top: 12px;
}

.preview-wrap p {
  margin: 0 0 8px;
  color: #4f5d66;
}

#coverPreview {
  display: block;
  width: 100%;
  max-width: 480px;
  height: 190px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px dashed #c9c0b4;
  background: #f6f4ee;
}

.icon-preview {
  display: block;
  width: 120px;
  height: 120px;
  border-radius: 20px;
  border: 1px dashed #c9c0b4;
  background: #f6f4ee;
  object-fit: cover;
}

.list {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.list-item {
  border: 1px solid #d5cdc2;
  background: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.list-item .k {
  font-weight: 700;
}

.list-item .v {
  color: #51626e;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.output {
  margin: 0;
  background: #1d272e;
  color: #d2ffe8;
  border-radius: 10px;
  padding: 10px;
  min-height: 80px;
  white-space: pre-wrap;
  word-break: break-word;
}

.btn-ghost {
  background: #ffffff;
  border-color: #cfc7bb;
}

.session-row {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  border: 1px solid transparent;
}

.badge-idle {
  background: #ece7de;
  color: #5f6f7b;
  border-color: #d8d2c8;
}

.badge-ok {
  background: #dff3ee;
  color: #0b5c56;
  border-color: #a8dbd2;
}

.badge-warn {
  background: #fdeadd;
  color: #8a4322;
  border-color: #f0c3a5;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 13px;
  color: #4f5d66;
  cursor: pointer;
}

.switch input {
  width: 16px;
  height: 16px;
}

.status {
  align-self: center;
  font-size: 12px;
  color: #0b5c56;
}

.btn:disabled {
  opacity: 0.65;
  cursor: progress;
  transform: none;
  box-shadow: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 12px);
  max-width: min(520px, calc(100% - 32px));
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 14px;
  color: #f4fffd;
  background: linear-gradient(120deg, #0f766e, #0a5f65);
  box-shadow: 0 14px 34px rgba(15, 118, 110, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 50;
}

.toast-show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast-error {
  background: linear-gradient(120deg, #ba4f2d, #9c3c24);
  box-shadow: 0 14px 34px rgba(186, 79, 45, 0.35);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 860px) {
  .grid.two {
    grid-template-columns: 1fr 1fr;
  }
}
