:root {
  --ink-950: #10182a;
  --ink-900: #18233d;
  --ink-700: #34548e;
  --sky-100: #edf5ff;
  --sky-200: #dceaff;
  --sky-300: #bfd7ff;
  --paper: rgba(255, 255, 255, 0.9);
  --line: rgba(33, 61, 119, 0.12);
  --line-strong: rgba(33, 61, 119, 0.24);
  --text: #162036;
  --muted: #60718f;
  --green: #14975f;
  --amber: #e5a420;
  --red: #d44040;
  --shadow: 0 30px 80px rgba(15, 30, 70, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(157, 196, 255, 0.65), transparent 34%),
    radial-gradient(circle at right 12%, rgba(233, 184, 86, 0.28), transparent 18%),
    linear-gradient(180deg, #f2f7ff 0%, #fbfdff 45%, #eef4fc 100%);
}

.page-shell {
  width: min(1240px, calc(100vw - 36px));
  margin: 0 auto;
  padding: 34px 0 54px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 22px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 32px;
  background:
    linear-gradient(135deg, rgba(16, 24, 42, 0.96), rgba(32, 80, 151, 0.92)),
    rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow);
  color: #fff;
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.eyebrow {
  color: rgba(222, 234, 255, 0.78);
}

.section-kicker {
  color: var(--ink-700);
}

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

h1 {
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.06;
  letter-spacing: -0.04em;
}

.subtitle {
  max-width: 760px;
  margin-top: 16px;
  color: rgba(239, 245, 255, 0.82);
  font-size: 18px;
  line-height: 1.8;
}

.hero-panel {
  display: grid;
  gap: 14px;
}

.stat-card {
  display: grid;
  gap: 8px;
  min-height: 156px;
  padding: 22px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(12px);
}

.stat-card.muted {
  background: rgba(8, 14, 26, 0.2);
}

.stat-card span,
.stat-card small {
  color: rgba(233, 241, 255, 0.78);
}

.stat-card strong {
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(380px, 1.05fr);
  gap: 22px;
  margin-top: 22px;
}

.panel {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--paper);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.panel-head,
.queue-head,
.library-toolbar,
.toolbar-group,
.library-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.panel-head {
  justify-content: space-between;
  margin-bottom: 18px;
}

.queue-head {
  justify-content: space-between;
  margin: 20px 0 12px;
}

.library-toolbar {
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.toolbar-group,
.library-actions {
  flex-wrap: wrap;
}

.ghost-button,
.primary-button {
  height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.ghost-button {
  color: var(--ink-900);
  background: #edf4ff;
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.primary-button {
  color: #fff;
  background: linear-gradient(135deg, #1b4fac, #237be0);
  box-shadow: 0 14px 28px rgba(36, 92, 180, 0.22);
}

.ghost-button:hover,
.primary-button:hover {
  transform: translateY(-1px);
}

.ghost-button:disabled,
.primary-button:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
}

.danger-button,
.delete-button {
  height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.danger-button {
  color: #fff;
  background: linear-gradient(135deg, #c64040, #eb6464);
  box-shadow: 0 14px 28px rgba(189, 55, 55, 0.22);
}

.delete-button {
  height: 34px;
  padding: 0 14px;
  color: #b62f2f;
  background: #fff1f1;
  box-shadow: inset 0 0 0 1px rgba(205, 74, 74, 0.18);
}

.danger-button:hover,
.delete-button:hover {
  transform: translateY(-1px);
}

.danger-button:disabled,
.delete-button:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
}

.dropzone {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 30px 24px;
  border: 1.5px dashed rgba(39, 89, 171, 0.34);
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgba(159, 193, 255, 0.24), transparent 26%),
    linear-gradient(180deg, rgba(233, 242, 255, 0.92), rgba(246, 250, 255, 0.98));
  text-align: center;
  cursor: pointer;
}

.dropzone.dragover {
  border-color: rgba(27, 91, 182, 0.8);
  box-shadow: inset 0 0 0 1px rgba(27, 91, 182, 0.18);
}

.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone strong {
  font-size: 20px;
}

.dropzone span {
  color: var(--muted);
  line-height: 1.7;
}

.queue-list,
.library-list {
  display: grid;
  gap: 12px;
}

.empty-state {
  padding: 24px;
  border-radius: 20px;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  background: rgba(244, 248, 255, 0.72);
  text-align: center;
}

.queue-item {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.86);
}

.queue-meta,
.library-subline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.queue-size,
.queue-status,
.library-subline {
  color: var(--muted);
  font-size: 14px;
}

.queue-status {
  margin-top: 8px;
}

.progress-track {
  height: 10px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8effb;
}

.progress-bar {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1e5fcb, #3e9eff);
  transition: width 120ms linear;
}

.queue-item.success .progress-bar {
  background: linear-gradient(90deg, #148d59, #30ca87);
}

.queue-item.error .progress-bar {
  background: linear-gradient(90deg, #d44040, #ff7c7c);
}

.summary-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 14px;
  border-radius: 999px;
  color: var(--ink-900);
  background: #eef5ff;
  box-shadow: inset 0 0 0 1px var(--line);
}

.selection-hint {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.library-item {
  display: grid;
  grid-template-columns: 70px 118px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.88);
}

.library-check {
  display: grid;
  align-content: start;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  user-select: none;
}

.library-select {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #245cc0;
}

.preview-link {
  color: inherit;
  text-decoration: none;
}

.preview-frame {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  min-height: 118px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(199, 220, 255, 0.6), rgba(245, 249, 255, 0.92));
}

.preview-image {
  width: 100%;
  height: 118px;
  object-fit: cover;
}

.preview-frame.no-image {
  background:
    linear-gradient(135deg, rgba(21, 38, 67, 0.96), rgba(40, 84, 153, 0.92));
}

.preview-frame.no-image .preview-image {
  display: none;
}

.file-mark {
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.library-meta {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.library-name {
  font-size: 16px;
  line-height: 1.5;
  word-break: break-all;
}

.library-link,
.download-link {
  color: #245cc0;
  font-weight: 700;
  text-decoration: none;
}

.library-link:hover,
.download-link:hover {
  text-decoration: underline;
}

@media (max-width: 980px) {
  .hero,
  .content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .page-shell {
    width: min(100vw - 24px, 100%);
    padding-top: 18px;
  }

  .hero,
  .panel {
    padding: 20px;
    border-radius: 24px;
  }

  .panel-head,
  .queue-head,
  .library-toolbar,
  .toolbar-group,
  .queue-meta,
  .library-subline {
    flex-direction: column;
    align-items: stretch;
  }

  .library-item {
    grid-template-columns: 1fr;
  }

  .library-check {
    grid-auto-flow: column;
    justify-content: start;
    align-items: center;
  }

  .preview-image {
    height: 180px;
  }
}
