:root {
  --bg: #0f1020;
  --bg2: #16182e;
  --card: rgba(255, 255, 255, 0.05);
  --line: rgba(255, 255, 255, 0.1);
  --text: #eef0ff;
  --muted: #9aa0c3;
  --accent: #ff2c55;
  --accent2: #25f4ee;
  --radius: 16px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; min-height: 100%; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  background: radial-gradient(1200px 700px at 15% -10%, #23264d 0%, transparent 60%),
              radial-gradient(900px 600px at 100% 0%, #3a1c2e 0%, transparent 55%),
              var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: 32px;
}

.bg-orbs { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.bg-orbs span {
  position: absolute;
  width: 380px; height: 380px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .25;
}
.bg-orbs span:nth-child(1) { background: #ff2c55; top: -80px; left: -60px; }
.bg-orbs span:nth-child(2) { background: #25f4ee; bottom: -120px; right: -40px; }
.bg-orbs span:nth-child(3) { background: #7a5cff; top: 40%; left: 45%; }

.topbar, .wrap { position: relative; z-index: 1; }

.topbar { max-width: 1360px; margin: 0 auto; padding: 28px 20px 6px; }
.brand { display: flex; align-items: center; gap: 14px; }
.logo {
  width: 46px; height: 46px; border-radius: 14px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 20px; color: #fff;
  background: linear-gradient(135deg, #ff2c55, #7a5cff);
  box-shadow: 0 8px 24px rgba(255, 44, 85, .35);
}
.brand h1 { margin: 0; font-size: 22px; letter-spacing: .5px; }
.brand p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }

.wrap { max-width: 1360px; margin: 0 auto; padding: 12px 20px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  backdrop-filter: blur(12px);
  margin-bottom: 14px;
}

textarea {
  width: 100%;
  resize: vertical;
  background: rgba(0, 0, 0, .25);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  padding: 14px;
  font: inherit;
  font-size: 14px;
  line-height: 1.6;
  outline: none;
}
textarea:focus { border-color: rgba(255, 44, 85, .6); box-shadow: 0 0 0 3px rgba(255, 44, 85, .12); }
textarea::placeholder { color: #6c7290; }

.input-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.input-actions .left { display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .06);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 16px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: .18s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.btn:hover { background: rgba(255, 255, 255, .12); transform: translateY(-1px); }
.btn.ghost { color: var(--muted); }
.btn.small { padding: 7px 12px; font-size: 13px; }
.btn.block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .6; cursor: default; transform: none; }
.btn.primary {
  background: linear-gradient(135deg, #ff2c55, #ff5f7e);
  border-color: transparent;
  font-weight: 600;
  padding: 11px 26px;
  box-shadow: 0 8px 20px rgba(255, 44, 85, .3);
}
.btn.primary:hover { filter: brightness(1.08); }
.btn.primary[disabled] { opacity: .65; cursor: not-allowed; transform: none; }
.btn.accent {
  background: rgba(37, 244, 238, .14);
  border-color: rgba(37, 244, 238, .35); color: #9ff5f1;
}
.btn.accent:hover { background: rgba(37, 244, 238, .22); }

.spinner { display: none; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading .spinner { display: inline-block; }

.history { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.history .chip {
  font-size: 12px; color: var(--muted);
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 12px; cursor: pointer;
  max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.history .chip:hover { color: var(--text); border-color: rgba(255,44,85,.5); }

.msg { margin: 12px 0 0; font-size: 13px; padding: 10px 12px; border-radius: 10px; }
.msg.err { background: rgba(255, 44, 85, .12); border: 1px solid rgba(255, 44, 85, .3); color: #ffb3c1; }
.msg.ok { background: rgba(37, 244, 238, .1); border: 1px solid rgba(37, 244, 238, .25); color: #9ff5f1; }

/* ---------- 三栏工作台 ---------- */
.workbench {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  backdrop-filter: blur(12px);
  margin-bottom: 14px;
}
.cols { display: grid; grid-template-columns: 290px minmax(0, 1fr) 290px; gap: 14px; align-items: start; }

.col {
  background: rgba(0, 0, 0, .18);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: calc(100vh - 190px);
  overflow: auto;
}
.col-head { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.col-head i {
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12px; font-style: normal; color: #fff;
  background: linear-gradient(135deg, #ff2c55, #7a5cff);
}
.chip-count { margin-left: auto; font-size: 12px; font-weight: 400; color: var(--muted); }
.col-title { margin: 0; font-size: 15px; line-height: 1.5; }
.col-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.col-note { margin: 0; font-size: 11.5px; line-height: 1.7; color: #6f7597; }

/* 封面 */
.cover-box {
  position: relative; width: 100%; height: 190px;
  border-radius: 12px; overflow: hidden; background: #000;
  display: grid; place-items: center;
}
.cover-box img { width: 100%; height: 100%; object-fit: cover; }
.cover-box video { width: 100%; height: 100%; object-fit: cover; background: #000; }
.cover-box .badge {
  position: absolute; top: 10px; left: 10px;
  font-size: 11px; padding: 3px 9px; border-radius: 999px;
  background: rgba(0,0,0,.55); color: #fff; backdrop-filter: blur(4px);
}
.cover-box .play {
  position: absolute; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(0,0,0,.5); color: #fff; display: grid; place-items: center;
  cursor: pointer; font-size: 15px; backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,.25);
}
.cover-box .play:hover { background: var(--accent); }
.cover-box.playing .play { display: none; }

.author-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.author-row img { width: 24px; height: 24px; border-radius: 50%; }
.author-row .dot { opacity: .5; }
.stats { display: flex; gap: 12px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.stats b { color: var(--text); font-weight: 600; }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs button {
  border: 1px solid var(--line); background: rgba(255,255,255,.05);
  color: var(--muted); border-radius: 999px; padding: 6px 14px;
  font: inherit; font-size: 12.5px; cursor: pointer;
}
.tabs button.active { background: rgba(255,44,85,.18); border-color: rgba(255,44,85,.55); color: #ffd0da; }

/* 文案与润色 */
.script-text {
  flex: 1 1 auto; min-height: 320px; resize: vertical;
  font-size: 13.5px; line-height: 1.85; color: #dfe3ff;
}
.tr-progress { display: flex; align-items: center; gap: 10px; }
.tr-progress .bar { flex: 1; height: 6px; background: rgba(255, 255, 255, .08); border-radius: 999px; overflow: hidden; }
.tr-progress .bar i {
  display: block; height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, #25f4ee, #7a5cff); transition: width .3s;
}
.tr-progress span { font-size: 12px; color: var(--muted); min-width: 140px; text-align: right; }

.tr-polish { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tr-replace { display: flex; gap: 8px; flex-wrap: wrap; }
.mini-input {
  flex: 1 1 110px;
  background: rgba(0, 0, 0, .25); border: 1px solid var(--line);
  color: var(--text); border-radius: 10px; padding: 7px 10px;
  font: inherit; font-size: 12.5px; outline: none;
}
.mini-input:focus { border-color: rgba(37, 244, 238, .5); box-shadow: 0 0 0 3px rgba(37, 244, 238, .1); }
.mini-input.wide { flex: 1 1 100%; }
.mini-input::placeholder { color: #6c7290; }
.polish-label { font-size: 12px; color: var(--muted); }
.mini-select {
  background: rgba(0, 0, 0, .25); border: 1px solid var(--line);
  color: var(--text); border-radius: 10px; padding: 7px 10px;
  font: inherit; font-size: 12.5px; outline: none; max-width: 100%;
}
.mini-select option { background: #1c1e33; }

/* 语音合成 */
.tts-row { display: flex; gap: 8px; flex-wrap: wrap; }
.tts-row .mini-select { flex: 1 1 120px; }
audio { width: 100%; height: 40px; }

/* 图集 */
.album { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; }
.album-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 14px; }
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.album-grid figure { margin: 0; position: relative; border-radius: 12px; overflow: hidden; background: rgba(0,0,0,.3); }
.album-grid img { width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; }
.album-grid .dl {
  position: absolute; right: 8px; bottom: 8px;
  background: rgba(0,0,0,.6); color: #fff; font-size: 12px;
  padding: 5px 10px; border-radius: 8px; text-decoration: none;
  border: 1px solid rgba(255,255,255,.2);
}
.album-grid .dl:hover { background: var(--accent); }

.tips { text-align: center; color: #6f7597; font-size: 12px; }

@media (max-width: 1100px) {
  .cols { grid-template-columns: 1fr; }
  .col { max-height: none; }
  .script-text { min-height: 240px; }
}
@media (max-width: 640px) {
  .input-actions { flex-direction: column; align-items: stretch; }
  .input-actions .left { justify-content: center; }
  .btn.primary { justify-content: center; }
}
