:root {
  --bg: #0a1120;
  --bg-soft: #0e1729;
  --card: #121d31;
  --card-2: #16233a;
  --line: #243652;
  --line-soft: #1b2a43;
  --text: #e8eef7;
  --muted: #8ba1bc;
  --faint: #5f7590;
  --teal: #2dd4bf;
  --teal-soft: rgba(45, 212, 191, .12);
  --teal-line: rgba(45, 212, 191, .35);
  --amber: #f0b35b;
  --red: #f2777a;
  --green: #52d49b;
  --radius: 16px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .32);
  --font: "MiSans", "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 8% -8%, rgba(45, 212, 191, .13), transparent 60%),
    radial-gradient(760px 500px at 96% 4%, rgba(82, 130, 210, .12), transparent 62%),
    radial-gradient(700px 600px at 60% 110%, rgba(45, 212, 191, .05), transparent 65%);
  z-index: 0;
}

.ambient::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .25;
  background-image: radial-gradient(rgba(255,255,255,.12) .6px, transparent .6px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, black, transparent 75%);
}

button, textarea, input { font: inherit; color: inherit; }

button { cursor: pointer; }

h1, h2, h3, p { margin: 0; }

.topbar {
  position: relative;
  z-index: 2;
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 28px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand { display: flex; align-items: center; gap: 13px; }

.logo {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(150deg, rgba(45,212,191,.16), rgba(45,212,191,.02));
  border: 1px solid rgba(45, 212, 191, .28);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07);
}

.brand h1 {
  font-size: 23px;
  letter-spacing: .16em;
  font-weight: 720;
  line-height: 1.1;
}

.brand p {
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: .26em;
  margin-top: 4px;
}

.top-actions { display: flex; align-items: center; gap: 12px; }

.conn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: rgba(18, 29, 49, .5);
}

.conn i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(82, 212, 155, .12);
}

.conn.off i { background: var(--red); box-shadow: 0 0 0 4px rgba(242,119,122,.12); }

.ghost {
  background: rgba(22, 35, 58, .6);
  border: 1px solid var(--line);
  color: #cdd9e8;
  border-radius: 10px;
  padding: 8px 13px;
  font-size: 13px;
  transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease;
}

.ghost:hover { border-color: #3a5477; background: #1a2a44; color: #fff; }
.ghost:active { transform: translateY(1px); }

.layout {
  position: relative;
  z-index: 2;
  max-width: 1180px;
  margin: 0 auto;
  padding: 8px 28px 60px;
  display: grid;
  grid-template-columns: 392px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}

.composer { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 18px; }

.card {
  background: linear-gradient(180deg, rgba(24, 38, 60, .92), rgba(17, 28, 47, .96));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.input-card { border-color: #29415f; }

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}

.card-head h2 { font-size: 15px; font-weight: 650; letter-spacing: .04em; }

.hint { color: var(--faint); font-size: 12px; }
.tiny { color: var(--faint); font-size: 11.5px; line-height: 1.65; margin-top: 12px; }
.card-copy { color: var(--muted); font-size: 12.5px; line-height: 1.7; margin-bottom: 12px; }

textarea {
  width: 100%;
  resize: vertical;
  min-height: 112px;
  max-height: 260px;
  background: #0d1728;
  border: 1px solid #263a57;
  border-radius: 12px;
  padding: 13px 14px;
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.7;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}

textarea::placeholder { color: #5a708d; }
textarea:focus { border-color: var(--teal-line); box-shadow: 0 0 0 3px rgba(45, 212, 191, .09); }

.detect-row {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin: 12px 0 16px;
  min-height: 24px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  line-height: 1;
  padding: 6px 9px;
  border-radius: 7px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(22, 35, 58, .55);
}

.badge.idle { color: var(--faint); border-style: dashed; }
.badge.on { color: var(--teal); border-color: var(--teal-line); background: var(--teal-soft); }

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

.action-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(13, 23, 40, .7);
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, opacity .18s ease;
  user-select: none;
}

.action-card input { position: absolute; opacity: 0; pointer-events: none; }

.action-icon {
  flex: 0 0 auto;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 8px;
  color: #7e96b3;
  background: #152338;
  border: 1px solid #243a55;
}

.action-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.action-text b { font-size: 12.5px; font-weight: 620; }
.action-text small { color: var(--faint); font-size: 10.5px; white-space: nowrap; }

.action-card:hover { border-color: #38536f; }

.action-card.selected {
  border-color: var(--teal-line);
  background: linear-gradient(160deg, rgba(45,212,191,.10), rgba(45,212,191,.02));
}

.action-card.selected .action-icon { color: var(--teal); border-color: rgba(45,212,191,.32); background: rgba(45,212,191,.1); }
.action-card:focus-within { box-shadow: 0 0 0 3px rgba(45, 212, 191, .10); }
.action-card.disabled { opacity: .42; cursor: not-allowed; filter: grayscale(.5); }

.action-note { color: var(--faint); font-size: 11.5px; margin-top: 9px; min-height: 18px; }

.primary {
  margin-top: 14px;
  width: 100%;
  border: 1px solid #52e2cf;
  border-radius: 11px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 660;
  letter-spacing: .06em;
  color: #04231f;
  background: linear-gradient(180deg, #5eead4, #2dd4bf);
  box-shadow: 0 10px 26px rgba(45, 212, 191, .22), inset 0 1px 0 rgba(255,255,255,.4);
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}

.primary:hover { filter: brightness(1.04); box-shadow: 0 12px 30px rgba(45, 212, 191, .3); }
.primary:active { transform: translateY(1px); }
.primary:disabled { cursor: wait; filter: grayscale(.25) brightness(.85); box-shadow: none; }
.primary .spin { animation: spin 1s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }

.login-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.login-grid .login { padding: 9px 4px; font-size: 12px; text-align: center; }
.server-note { color: #f0b429; }
.server-mode .login-grid .login { opacity: 0.45; cursor: not-allowed; }

.tip-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tip-list li { display: flex; gap: 10px; font-size: 12px; color: var(--muted); }
.tip-list b { flex: 0 0 68px; color: #c3d0e0; font-weight: 580; }
.tip-list span { min-width: 0; }

.results { min-width: 0; }

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin: 4px 2px 14px;
}

.section-head h2 { font-size: 16px; font-weight: 650; letter-spacing: .05em; }
.section-head .hint { margin-top: 2px; }
.icon-btn { padding: 8px; line-height: 0; }

.jobs { display: flex; flex-direction: column; gap: 12px; }

.job {
  background: linear-gradient(180deg, rgba(22, 36, 57, .94), rgba(15, 26, 44, .96));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 16px 17px;
  box-shadow: 0 10px 30px rgba(0,0,0,.2);
  animation: rise .28s ease both;
}

@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

.job.running { border-color: rgba(45, 212, 191, .3); }
.job.error { border-color: rgba(242, 119, 122, .34); }

.job-top { display: flex; align-items: flex-start; gap: 12px; }

.job-main { min-width: 0; flex: 1; }

.job-title {
  font-size: 14px;
  font-weight: 610;
  line-height: 1.5;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

.job-sub {
  color: var(--faint);
  font-size: 11.5px;
  margin-top: 4px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.job-sub a { color: #7f9bbd; text-decoration: none; border-bottom: 1px dotted #3b5473; }
.job-sub a:hover { color: var(--teal); }

.pill {
  flex: 0 0 auto;
  font-size: 11px;
  line-height: 1;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: #121f34;
  white-space: nowrap;
}

.pill.running { color: var(--teal); border-color: var(--teal-line); background: var(--teal-soft); }
.pill.queued { color: var(--amber); border-color: rgba(240,179,91,.3); }
.pill.done { color: var(--green); border-color: rgba(82,212,155,.32); background: rgba(82,212,155,.08); }
.pill.partial { color: var(--amber); border-color: rgba(240,179,91,.34); background: rgba(240,179,91,.07); }
.pill.error { color: var(--red); border-color: rgba(242,119,122,.36); background: rgba(242,119,122,.07); }

.platform {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  padding: 3px 6px;
  border-radius: 5px;
  border: 1px solid #2c435f;
  color: #a9bdd4;
  background: #15243a;
}

.platform::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #6d87a5; }
.platform.douyin::before { background: #65e6e0; }
.platform.bilibili::before { background: #f48fb1; }
.platform.xiaohongshu::before { background: #ff6b6b; }
.platform.weibo::before { background: #f0b35b; }
.platform.wechat::before { background: #63d18b; }
.platform.channels::before { background: #7dd3fc; }

.progress-line { margin: 13px 0 10px; }

.progress-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 6px;
}

.progress-head .stage { color: #b8c9dc; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress-head .pct { font-family: var(--mono); font-size: 10.5px; color: var(--faint); }

.bar { height: 4px; border-radius: 999px; background: #1c2c45; overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #1fae9f, #5eead4); transition: width .4s ease; }
.job.error .bar span { background: linear-gradient(90deg, #b9525c, #f2777a); }

.meta-row { display: flex; flex-wrap: wrap; gap: 6px 8px; margin-top: 10px; }

.chip {
  font-size: 10.5px;
  color: #93a9c2;
  border: 1px solid #243852;
  background: #101d31;
  padding: 4px 7px;
  border-radius: 5px;
}
.chip.ok { color: var(--green); border-color: rgba(82,212,155,.25); }
.chip.warn { color: var(--amber); border-color: rgba(240,179,91,.28); }
.chip.bad { color: var(--red); border-color: rgba(242,119,122,.3); }

.file-list { display: flex; flex-direction: column; gap: 7px; margin-top: 12px; }

.file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: rgba(13, 23, 40, .62);
}

.file-kind {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  border-radius: 7px;
  display: grid; place-items: center;
  font-size: 9px;
  letter-spacing: .04em;
  font-weight: 700;
  color: var(--teal);
  background: rgba(45, 212, 191, .09);
  border: 1px solid rgba(45, 212, 191, .22);
}

.file-kind.video { color: #9db9ff; border-color: rgba(130,160,255,.24); background: rgba(130,160,255,.08); }
.file-info { min-width: 0; flex: 1; }
.file-name { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { font-size: 10.5px; color: var(--faint); margin-top: 1px; }
.file-meta.pending { color: var(--muted); }
.file-meta.error { color: var(--red); }

.download {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 9px;
  border-radius: 7px;
  font-size: 11.5px;
  color: #052b26;
  background: #48d8c5;
  border: 1px solid #62e3d2;
  text-decoration: none;
  transition: filter .15s ease;
}
.download:hover { filter: brightness(1.07); }

.job-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 11px; }
.job-actions .ghost { font-size: 11.5px; padding: 6px 9px; }

.warn-box {
  margin-top: 10px;
  border: 1px solid rgba(240, 179, 91, .2);
  background: rgba(240, 179, 91, .055);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 11px;
  color: #d7bd91;
}

.warn-box summary { cursor: pointer; color: #e0c69c; }
.warn-box ul { margin: 6px 0 0; padding-left: 16px; }
.warn-box li { margin: 3px 0; word-break: break-word; }

.err-line { margin-top: 10px; font-size: 11.5px; color: #f39b9d; word-break: break-word; }

.empty {
  border: 1px dashed #273b56;
  border-radius: var(--radius);
  min-height: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px;
  background: rgba(14, 24, 41, .45);
}

.empty-art { filter: drop-shadow(0 14px 30px rgba(0,0,0,.35)); margin-bottom: 12px; opacity: .95; }
.empty h3 { font-size: 15px; font-weight: 600; }
.empty p { color: var(--faint); font-size: 12px; margin-top: 6px; max-width: 300px; }
.empty.hidden { display: none; }

.footer {
  position: relative;
  z-index: 2;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 28px 26px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: #506783;
  font-size: 11px;
  border-top: 1px solid rgba(36, 54, 82, .5);
  padding-top: 14px;
}

.footer span:last-child { text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 18px);
  max-width: min(560px, calc(100vw - 40px));
  padding: 10px 15px;
  border-radius: 10px;
  background: #1b2c45;
  border: 1px solid #34506f;
  color: #eaf2ff;
  font-size: 12.5px;
  box-shadow: 0 16px 40px rgba(0,0,0,.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 20;
  word-break: break-word;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { border-color: rgba(242,119,122,.5); background: #35202a; }

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .composer { position: static; }
  .brand p { letter-spacing: .18em; }
}

@media (max-width: 560px) {
  .topbar { padding: 18px 16px 12px; }
  .layout { padding: 6px 16px 44px; }
  .footer { padding: 14px 16px 22px; flex-direction: column; gap: 4px; }
  .footer span:last-child { text-align: left; white-space: normal; }
  .conn { display: none; }
  .card { padding: 16px; }
  .actions { grid-template-columns: 1fr; }
  .login-grid { grid-template-columns: repeat(2, 1fr); }
  .brand h1 { font-size: 20px; }
  .ambient { opacity: .8; }
}
