:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #2563eb;
  --accent-soft: #eff6ff;
  --danger: #dc2626;
  --ok: #059669;
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(1200px 600px at 50% -10%, #dbeafe 0%, var(--bg) 55%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 880px;
  margin: 0 auto;
  padding: 40px 20px 64px;
}

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

.hero h1 {
  margin: 0 0 6px;
  font-size: 30px;
  letter-spacing: 0.5px;
}

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

.usage {
  width: 240px;
}

.usage-bar {
  height: 8px;
  background: #e8edf7;
  border-radius: 999px;
  overflow: hidden;
}

.usage-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #3b82f6, #6366f1);
  border-radius: 999px;
  transition: width 0.35s ease;
}

.usage-bar span.warn {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.usage-text {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  text-align: right;
}

/* 上传区 */
.dropzone {
  background: var(--card);
  border: 2px dashed #c7d2fe;
  border-radius: var(--radius);
  padding: 36px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
  box-shadow: 0 12px 30px -18px rgba(37, 99, 235, 0.45);
}

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

.dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: scale(1.01);
}

.dropzone.busy {
  pointer-events: none;
  opacity: 0.75;
}

.dropzone-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 24px;
  line-height: 52px;
  font-weight: 700;
}

.dropzone-title {
  font-size: 16px;
}

.dropzone-title strong {
  color: var(--accent);
}

.dropzone-hint {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

/* 列表 */
.list-card {
  margin-top: 24px;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow: 0 20px 40px -30px rgba(17, 24, 39, 0.35);
}

.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.list-head h2 {
  margin: 0;
  font-size: 16px;
}

.count {
  color: var(--muted);
  font-weight: 400;
  font-size: 13px;
}

.ghost {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.ghost:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.file-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.file-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px 150px;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid #f1f5f9;
}

.file-list li:last-child {
  border-bottom: none;
}

.file-list li:hover {
  background: #f8fafc;
}

.file-list .empty,
.file-list .error {
  display: block;
  text-align: center;
  color: var(--muted);
  padding: 28px 20px;
  font-size: 14px;
}

.file-name {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.file-icon {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
}

.file-name a {
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.file-size,
.file-time {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}

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

/* 轻提示 */
.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translate(-50%, 20px);
  background: #111827;
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  max-width: 80vw;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.error {
  background: var(--danger);
}

.toast.ok {
  background: var(--ok);
}

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

  .usage {
    width: 100%;
  }

  .file-list li {
    grid-template-columns: minmax(0, 1fr) 80px;
    grid-template-areas:
      "name size"
      "name time";
    row-gap: 4px;
  }

  .file-name {
    grid-area: name;
  }

  .file-size {
    grid-area: size;
  }

  .file-time {
    grid-area: time;
  }
}
