:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  background: #f4f7fb;
  color: #111827;
  --ink: #111827;
  --muted: #697386;
  --line: #d9e1ea;
  --panel: rgba(255, 255, 255, 0.9);
  --blue: #2563eb;
  --navy: #0f172a;
  --soft: #f4f7fb;
  --shadow: 0 24px 70px rgba(15, 23, 42, 0.13);
  --poster-aurora:
    radial-gradient(circle at 70% 22%, rgba(137, 247, 255, 0.46), transparent 30%),
    linear-gradient(180deg, rgba(8, 15, 28, 0.16), rgba(2, 6, 23, 0.78)),
    linear-gradient(120deg, #0b1830 0%, #123548 42%, #06101e 100%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(115deg, rgba(202, 232, 229, 0.76) 0%, rgba(244, 247, 251, 0.92) 38%, rgba(232, 236, 242, 1) 100%),
    var(--soft);
}

.login-body {
  display: grid;
  place-items: center;
  padding: 42px 22px;
}

.login-shell {
  width: min(980px, 100%);
}

.login-layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  gap: 18px;
  align-items: stretch;
}

.login-panel,
.tool-panel,
.logs-panel,
.hero {
  background: var(--panel);
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: var(--shadow);
}

.login-panel {
  padding: 34px;
  border-radius: 8px;
}

.login-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 30px;
  color: var(--ink);
  text-decoration: none;
  font-size: 18px;
  font-weight: 950;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--navy);
  color: #fff;
  font-weight: 900;
  letter-spacing: 0;
  font-size: 13px;
}

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

.login-panel h1 {
  font-size: 36px;
  line-height: 1.12;
}

.login-panel p,
.hero p,
.status-line {
  color: var(--muted);
}

.login-form {
  margin-top: 28px;
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
  color: #334155;
  font-size: 14px;
  font-weight: 900;
}

input {
  width: 100%;
  height: 48px;
  border: 1px solid #d7dee9;
  border-radius: 10px;
  padding: 0 14px;
  font-size: 15px;
  outline: none;
  background: #fff;
}

input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

button {
  height: 48px;
  border: 0;
  border-radius: 10px;
  padding: 0 18px;
  background: var(--blue);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
}

.login-form button {
  background: var(--navy);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.form-error {
  color: #dc2626;
  font-size: 14px;
}

.login-note {
  margin-top: 16px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.7;
}

.login-preview-card {
  position: relative;
  min-height: 560px;
  overflow: hidden;
  padding: 26px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  color: #fff;
  background:
    linear-gradient(160deg, rgba(17, 24, 39, 0.92), rgba(17, 74, 87, 0.92)),
    var(--navy);
  box-shadow: var(--shadow);
}

.login-preview-card::before {
  content: "";
  position: absolute;
  inset: auto -8% -14% 18%;
  height: 48%;
  background:
    linear-gradient(105deg, transparent 0 20%, rgba(255, 255, 255, 0.16) 21% 23%, transparent 24% 38%, rgba(91, 219, 208, 0.2) 39% 41%, transparent 42%);
  transform: skewX(-15deg);
}

.login-preview-content {
  position: relative;
  min-height: 508px;
  display: grid;
  align-content: space-between;
  gap: 20px;
}

.login-preview-content h2 {
  max-width: 430px;
  margin: 0;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1.06;
}

.login-preview-content p:not(.eyebrow) {
  max-width: 440px;
  margin: 12px 0 0;
  color: rgba(226, 232, 240, 0.72);
  line-height: 1.8;
}

.login-mini-player {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
}

.login-mini-stage {
  aspect-ratio: 16 / 8.8;
  background: var(--poster-aurora);
  background-size: cover;
  background-position: center;
}

.login-mini-control {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 10px;
  align-items: center;
  padding: 12px;
}

.login-mini-control span {
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #111827;
  background: #fff;
  font-size: 12px;
  font-weight: 950;
}

.login-mini-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.2);
}

.login-mini-bar::before {
  content: "";
  display: block;
  width: 42%;
  height: 100%;
  background: #93c5fd;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px 26px;
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  backdrop-filter: blur(18px);
}

.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #1f2937;
  text-decoration: none;
  font-size: 18px;
  font-weight: 950;
  white-space: nowrap;
}

.topbar .brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-size: 13px;
}

.top-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-link,
.nav-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  padding: 0 14px;
  color: #334155;
  background: transparent;
  text-decoration: none;
  font-size: 14px;
  font-weight: 900;
}

.nav-link:hover,
.nav-link-active {
  color: #0f172a;
  background: #e8eef8;
}

.nav-button {
  height: 38px;
  border: 1px solid var(--line);
  color: #0f172a;
  background: #ffffff;
}

.secondary-nav-button {
  color: #ffffff;
  background: var(--navy);
  border-color: var(--navy);
}

.topbar-user {
  padding: 0 8px;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.topbar-form {
  margin: 0;
}

.workspace {
  width: min(1180px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 30px 0 84px;
  display: grid;
  gap: 18px;
  align-content: start;
}

.hero,
.tool-panel,
.logs-panel {
  border-radius: 8px;
  padding: 24px;
}

.eyebrow {
  margin-bottom: 8px;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 900;
  color: #2563eb;
}

.hero h2 {
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.04;
}

.hero p {
  max-width: 680px;
  margin-top: 10px;
  line-height: 1.8;
}

.parser-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: end;
  padding: 26px 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(239, 246, 255, 0.92)),
    radial-gradient(circle at 86% 12%, rgba(37, 99, 235, 0.16), transparent 28%);
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.quiet-pill {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  color: #475569;
  background: #fff;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.tool-panel {
  padding: 22px;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr 132px;
  gap: 12px;
  align-items: center;
}

.status-line {
  margin-top: 12px;
  min-height: 22px;
  font-size: 14px;
}

.result-box {
  margin-top: 18px;
  padding: 22px;
  border-radius: 8px;
  background: var(--navy);
  color: #dbeafe;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.player-panel {
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #f8fafc;
}

.player-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--poster-aurora);
  background-size: cover;
  background-position: center;
}

.player-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 72% 24%, rgba(255, 255, 255, 0.18), transparent 22%),
    linear-gradient(90deg, rgba(2, 6, 23, 0.38), transparent 45%, rgba(2, 6, 23, 0.2));
  pointer-events: none;
}

.player-stage::after {
  content: "封面预览";
  position: absolute;
  right: 18px;
  top: 18px;
  z-index: 1;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(2, 6, 23, 0.34);
  font-size: 12px;
  font-weight: 900;
  backdrop-filter: blur(10px);
}

.player-stage video {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: block;
  background: transparent;
  object-fit: contain;
}

.player-message {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  color: #e5e7eb;
  text-align: center;
  background: rgba(0, 0, 0, 0.24);
  font-size: 14px;
  z-index: 3;
}

.player-message.hidden {
  display: none;
}

.player-controlbar {
  min-height: 64px;
  display: grid;
  grid-template-columns: auto auto auto 112px 1fr;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  background: #eef2f7;
}

.time-label {
  color: #0f172a;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.player-progress {
  position: relative;
  height: 18px;
  border-radius: 0;
  background: #2f3137;
  cursor: pointer;
  overflow: hidden;
}

.progress-buffer,
.progress-played {
  position: absolute;
  top: 6px;
  left: 0;
  height: 6px;
  width: 0%;
}

.progress-buffer {
  background: #8a8d94;
}

.progress-played {
  background: #2563eb;
}

.progress-knob {
  position: absolute;
  top: 2px;
  left: 0%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.12);
  transform: translateX(-50%);
}

.player-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 0 16px;
  border-top: 1px solid #dbe3ef;
  color: #334155;
  background: #f8fafc;
}

.player-info strong {
  color: #0f172a;
  overflow-wrap: anywhere;
  font-size: 16px;
}

.player-info span {
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.result-title {
  margin-bottom: 14px;
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
}

.result-grid {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 10px 14px;
  align-items: start;
}

.result-grid span {
  color: #93c5fd;
  font-weight: 800;
}

.result-grid code {
  color: #bfdbfe;
  white-space: normal;
  overflow-wrap: anywhere;
}

.copy-button {
  margin-top: 16px;
  background: #2563eb;
}

.hidden {
  display: none;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.small-button {
  height: 36px;
  background: var(--navy);
}

.secondary-button {
  background: #64748b;
}

.danger-button {
  background: #dc2626;
}

.logs-list {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.user-form {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 120px;
  gap: 12px;
}

.users-list {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.user-item {
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.button-link {
  margin-top: 22px;
  min-height: 46px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  background: #2563eb;
  color: #fff;
  text-decoration: none;
  font-weight: 900;
}

.log-item {
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.log-item strong {
  display: block;
  margin-bottom: 4px;
  overflow-wrap: anywhere;
}

.editable-log-name {
  cursor: text;
}

.editable-log-name:hover {
  color: #2563eb;
}

.log-name-input {
  width: min(360px, 100%);
  height: 34px;
  margin-bottom: 4px;
  border-radius: 8px;
  font-weight: 800;
}

.log-meta {
  color: #64748b;
  font-size: 13px;
}

.success {
  color: #047857;
}

.failed {
  color: #dc2626;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: start center;
  padding: 56px 20px 20px;
  background: rgba(15, 23, 42, 0.48);
}

.modal-overlay.hidden {
  display: none;
}

.modal-panel {
  width: min(860px, 100%);
  max-height: calc(100vh - 92px);
  overflow: auto;
  padding: 22px;
  border-radius: 8px;
  background: #f8fafc;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}

.modal-subtitle {
  margin-top: 4px;
  color: #64748b;
  font-size: 13px;
}

.modal-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.history-list {
  max-height: calc(100vh - 190px);
  overflow: auto;
}

@media (max-width: 800px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 18px;
  }

  .top-nav {
    width: 100%;
    justify-content: flex-start;
  }

  .workspace {
    width: min(100% - 24px, 1180px);
    padding-top: 18px;
  }

  .login-layout,
  .parser-hero {
    grid-template-columns: 1fr;
  }

  .login-preview-card {
    min-height: 430px;
  }

  .login-preview-content {
    min-height: 378px;
  }

  .input-row {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    justify-content: flex-start;
  }

  .user-form {
    grid-template-columns: 1fr;
  }

  .user-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .log-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .player-controlbar {
    grid-template-columns: auto auto auto 1fr;
  }

  .time-label {
    grid-column: 1 / -1;
  }

  .player-progress {
    grid-column: 1 / -1;
  }

  .player-info {
    align-items: flex-start;
    flex-direction: column;
  }
}
