:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --surface-2: #243044;
  --border: #334155;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --success: #22c55e;
  --danger: #ef4444;
  --radius: 14px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.18), transparent 28%),
    radial-gradient(circle at bottom right, rgba(34, 197, 94, 0.12), transparent 24%),
    var(--bg);
  color: var(--text);
}

.page {
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

.header-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

h1 {
  margin: 0 0 8px;
  font-size: 2rem;
  font-weight: 700;
}

h2 {
  margin: 0;
  font-size: 1.15rem;
}

.subtitle,
.footer p,
.upload-hint,
.count,
.progress-meta,
.file-meta {
  color: var(--muted);
}

.subtitle {
  margin: 0;
  line-height: 1.6;
}

.main {
  display: grid;
  gap: 20px;
}

.card {
  background: rgba(26, 35, 50, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.badge {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  font-size: 0.82rem;
}

.upload-area {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 34px 20px;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
}

.upload-area.dragover {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.08);
}

.upload-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  font-size: 1.6rem;
}

.upload-title {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.upload-hint {
  margin: 0 0 18px;
  font-size: 0.92rem;
}

.token-row {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.token-row label {
  font-size: 0.92rem;
  color: var(--muted);
}

input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.95rem;
}

input[type="password"]:focus {
  outline: none;
  border-color: var(--primary);
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.04);
}

.btn-small {
  padding: 8px 12px;
  font-size: 0.88rem;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

.progress-wrap {
  margin-top: 18px;
}

.progress-wrap.hidden {
  display: none;
}

.progress-bar {
  height: 10px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #22c55e);
  transition: width 0.2s;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.88rem;
}

.message {
  min-height: 22px;
  margin: 12px 0 0;
  font-size: 0.92rem;
}

.message.success {
  color: var(--success);
}

.message.error {
  color: var(--danger);
}

.file-list {
  display: grid;
  gap: 12px;
}

.file-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(15, 20, 25, 0.35);
}

.file-info {
  min-width: 0;
}

.file-name {
  margin: 0 0 6px;
  font-weight: 600;
  word-break: break-all;
}

.file-meta {
  margin: 0;
  font-size: 0.88rem;
}

.file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.empty {
  padding: 28px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 12px;
}

.footer {
  margin-top: 24px;
  text-align: center;
}

.footer p {
  margin: 0;
  font-size: 0.88rem;
}

@media (max-width: 720px) {
  .header-inner,
  .file-item {
    grid-template-columns: 1fr;
  }

  .file-actions {
    justify-content: flex-start;
  }
}
