:root {
  color-scheme: dark;
  font-family: "Microsoft YaHei UI", "Noto Sans SC", system-ui, sans-serif;
  background: #08101f;
  color: #eaf1ff;
  line-height: 1.5;
}

#login-panel,
#logout { display: none !important; }

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: radial-gradient(circle at 15% 0%, #19366d 0, transparent 35rem), #08101f;
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 56px 0 72px; }
.brand { max-width: 680px; margin-bottom: 28px; }
.brand h1, h2, h3, p { margin-top: 0; }
.brand h1 { margin-bottom: 8px; font-size: clamp(2rem, 5vw, 3.8rem); line-height: 1.1; }
.brand > p:last-child { color: #b7c6e4; font-size: 1.06rem; }

.eyebrow, .section-kicker { color: #7ed9ff; font-size: .78rem; font-weight: 800; letter-spacing: .12em; }
.section-kicker { margin-bottom: 8px; text-transform: uppercase; }
.muted { color: #9fb0d0; }

.panel {
  border: 1px solid #2b426c;
  border-radius: 18px;
  padding: clamp(20px, 4vw, 36px);
  background: rgba(13, 27, 53, .86);
  box-shadow: 0 22px 50px rgba(0, 0, 0, .22);
}

.login-panel { display: grid; grid-template-columns: 1fr minmax(260px, 380px); gap: 40px; align-items: start; }
.stack { display: grid; gap: 18px; }
.workspace { display: grid; gap: 24px; }
.workspace-head, .tasks-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.workspace-head h2, .tasks-heading h3 { margin-bottom: 0; }
.header-actions { display: flex; flex-wrap: wrap; gap: 10px; }

label, fieldset { display: grid; gap: 8px; color: #d6e2fa; font-weight: 700; }
fieldset { margin: 0; min-width: 0; padding: 0; border: 0; }
legend { margin-bottom: 8px; color: #d6e2fa; font-weight: 700; }
input, textarea, select {
  width: 100%;
  border: 1px solid #405985;
  border-radius: 10px;
  padding: 11px 13px;
  background: #091426;
  color: #f7f9ff;
}
textarea { min-height: 160px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #7185aa; }
input:disabled, textarea:disabled, select:disabled, button:disabled { cursor: not-allowed; opacity: .58; }

button { min-height: 44px; border: 1px solid transparent; border-radius: 10px; padding: 10px 16px; font-weight: 800; }
.primary { background: linear-gradient(135deg, #42bde9, #6575ef); color: #061224; }
.secondary { border-color: #5b75a7; background: #152947; color: #eaf1ff; }
.ghost { border-color: #4c5f80; background: transparent; color: #d3def3; }
.text-button { min-height: auto; padding: 6px 0; background: transparent; color: #8edfff; text-decoration: underline; }
.generate { width: fit-content; min-width: 180px; }

.create-panel { display: grid; grid-template-columns: minmax(200px, .72fr) minmax(0, 1.28fr); gap: 36px; }
.task-form { display: grid; gap: 20px; }
.source-grid { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }
.file-picker { min-height: 44px; justify-content: center; border: 1px dashed #6280b8; border-radius: 10px; padding: 10px 13px; color: #bee3ff; font-weight: 700; }
.file-picker input { width: 1px; height: 1px; padding: 0; border: 0; opacity: 0; position: absolute; }
.control-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-message { min-height: 1.5em; margin: 0; color: #a9c3ee; font-size: .92rem; }
.form-message.is-error { color: #ffb4bd; }
.notice { margin: 0; min-height: 1.5em; color: #bce8ff; }

.task-list { display: grid; gap: 14px; }
.empty { margin: 0; color: #9fb0d0; }
.task-card { border: 1px solid #344b74; border-radius: 14px; padding: 18px; background: #0a162a; }
.task-top, .task-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 20px; }
.task-top h4 { margin: 0; font-size: 1rem; }
.task-meta { margin: 12px 0; color: #a8b9d8; font-size: .9rem; }
.status { display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 9px; font-size: .8rem; font-weight: 800; }
.status-waiting, .status-submitted, .status-processing { background: #233a62; color: #a9d8ff; }
.status-succeeded, .status-success, .status-completed { background: #144a3b; color: #8cf3ce; }
.status-failed, .status-cancelled { background: #552c3b; color: #ffb2be; }
.task-prompt { margin: 12px 0; color: #d9e5fc; white-space: pre-wrap; overflow-wrap: anywhere; }
.task-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.video-wrap { display: grid; gap: 12px; margin-top: 16px; }
.video-wrap video { width: min(100%, 520px); max-height: 460px; border-radius: 12px; background: #03070f; }
.video-links { display: flex; flex-wrap: wrap; gap: 12px; }
.video-links a { color: #8ee8ff; overflow-wrap: anywhere; }

.skip-link { position: fixed; top: 8px; left: 8px; z-index: 3; transform: translateY(-180%); padding: 8px 12px; border-radius: 8px; background: #fff; color: #111; }
.skip-link:focus { transform: translateY(0); }
:focus-visible { outline: 3px solid #ffda71; outline-offset: 3px; }

@media (max-width: 760px) {
  .shell { width: min(100% - 24px, 1120px); padding-top: 32px; }
  .login-panel, .create-panel { grid-template-columns: 1fr; gap: 24px; }
  .workspace-head, .tasks-heading { align-items: flex-start; flex-direction: column; }
  .source-grid, .control-grid { grid-template-columns: 1fr; }
  .header-actions { width: 100%; }
  .header-actions button { flex: 1 1 160px; }
  .generate { width: 100%; }
}
:root {
