:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --text: #1c2128;
  --muted: #6b7280;
  --border: #e5e7eb;
  --accent: #2f6feb;
  --accent-soft: #eaf1ff;
  --danger: #c0392b;
  --success: #1f7a4d;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.06);
}

* {
  box-sizing: border-box;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.page {
  width: min(960px, 100% - 32px);
  margin: 0 auto;
  padding: 40px 0 56px;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.hero h1 {
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.02em;
}

.hero .sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.stats {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}

.card h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

/* ---------- 上传区 ---------- */

.upload-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.pwd-form {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.pwd {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.pwd input,
.tools input {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fbfbfc;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.pwd input {
  width: 190px;
}

.pwd input:focus,
.tools input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: #fff;
}

.remember {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}

.remember input {
  accent-color: var(--accent);
}

.dropzone {
  border: 1.5px dashed #cfd4dc;
  border-radius: 12px;
  padding: 28px 18px;
  text-align: center;
  cursor: pointer;
  background: #fafbfc;
  transition: border-color 0.15s, background 0.15s;
}

.dropzone:hover,
.dropzone:focus-visible {
  border-color: var(--accent);
  background: #f7f9ff;
  outline: none;
}

.dropzone.dragging {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.dz-title {
  margin: 0;
  font-weight: 500;
}

.dz-hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

.queue {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.queue-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fcfcfd;
}

.queue-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.queue-name {
  font-size: 13.5px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.queue-meta {
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.bar {
  height: 4px;
  margin-top: 8px;
  border-radius: 999px;
  background: #eceef2;
  overflow: hidden;
}

.bar > i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.2s ease;
}

.queue-status {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--muted);
}

.queue-item.is-done .queue-status {
  color: var(--success);
}

.queue-item.is-failed .queue-status {
  color: var(--danger);
}

.queue-item.is-done .bar > i {
  background: var(--success);
}

.queue-item.is-failed .bar > i {
  background: var(--danger);
}

.link-btn {
  border: 0;
  padding: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.error {
  margin: 12px 0 0;
  padding: 9px 12px;
  border-radius: 9px;
  background: #fdf0ee;
  border: 1px solid #f3d2cc;
  color: var(--danger);
  font-size: 13px;
}

/* ---------- 列表 ---------- */

.list-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.count {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  margin-left: 6px;
  font-variant-numeric: tabular-nums;
}

.tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.tools input {
  width: 200px;
}

.btn {
  height: 34px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn.ghost {
  background: #fff;
  border-color: var(--border);
  color: var(--text);
}

.btn.ghost:hover {
  border-color: #c8ccd4;
  background: #f7f8fa;
}

.btn.small {
  height: 28px;
  padding: 0 10px;
  font-size: 12.5px;
}

.btn.link {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}

.btn.link:hover {
  background: #dfe9ff;
}

.table-wrap {
  overflow-x: auto;
}

table.files {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

table.files th {
  text-align: left;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 10px 8px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

table.files td {
  padding: 10px;
  border-bottom: 1px solid #f0f1f4;
  vertical-align: middle;
}

table.files tr:last-child td {
  border-bottom: 0;
}

.col-thumb {
  width: 44px;
}

.col-size,
.col-time {
  white-space: nowrap;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.col-actions {
  text-align: right;
  white-space: nowrap;
}

.thumb {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  background: #f0f2f5;
  display: block;
}

.thumb-ext {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #f0f2f5;
  color: var(--muted);
  display: grid;
  place-items: center;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.file-name {
  color: var(--text);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.file-name:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.actions {
  display: inline-flex;
  gap: 6px;
  justify-content: flex-end;
}

.empty {
  margin: 28px 0;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
}

.foot {
  margin-top: 28px;
  text-align: center;
  color: #9aa1ad;
  font-size: 12px;
}

.foot code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (max-width: 720px) {
  .page {
    padding-top: 24px;
  }

  .pwd-form {
    margin-left: 0;
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
  }

  .pwd {
    width: 100%;
  }

  .pwd input {
    flex: 1;
    width: auto;
  }

  .tools {
    margin-left: 0;
    width: 100%;
  }

  .tools input {
    flex: 1;
    width: auto;
  }

  table.files thead {
    display: none;
  }

  table.files,
  table.files tbody,
  table.files tr,
  table.files td {
    display: block;
    width: 100%;
  }

  table.files tr {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    gap: 2px 10px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f1f4;
  }

  table.files tr:last-child {
    border-bottom: 0;
  }

  table.files td {
    border: 0;
    padding: 0;
  }

  .col-thumb {
    grid-row: span 2;
  }

  .col-size {
    grid-column: 2;
    font-size: 12px;
  }

  .col-time {
    grid-column: 3;
    grid-row: 1;
    font-size: 12px;
    text-align: right;
  }

  .col-actions {
    grid-column: 2 / -1;
    margin-top: 8px;
    text-align: left;
  }

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