:root {
  --primary: #2563EB;
  --primary-dark: #1D4ED8;
  --primary-light: #EFF6FF;
  --bg: #F4F6F9;
  --card: #FFFFFF;
  --text: #111827;
  --subtext: #6B7280;
  --border: #E5E7EB;
  --success: #10B981;
  --error: #EF4444;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 20px rgba(0,0,0,.07);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

/* ── Header ── */
.header {
  position: fixed; top: 0; left: 0; right: 0;
  height: 60px;
  padding: 0 28px;
  display: flex; align-items: center;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--text);
}

.logo-icon {
  width: 32px; height: 32px;
  background: var(--primary);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}

.logo-icon svg { color: white; }

.logo-name { font-size: 17px; font-weight: 700; letter-spacing: -.3px; }

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

/* ── Layout ── */
.page {
  min-height: 100vh;
  padding: 90px 20px 40px;
  display: flex; flex-direction: column; align-items: center;
}

.page-narrow { max-width: 560px; width: 100%; margin: 0 auto; }
.page-wide { max-width: 680px; width: 100%; margin: 0 auto; }

/* ── Card ── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
}

.card-body { padding: 28px; }
.card-body + .card-body { border-top: 1px solid var(--border); }
.section-label {
  font-size: 11px; font-weight: 600; letter-spacing: .6px;
  text-transform: uppercase; color: var(--subtext);
  margin-bottom: 14px;
}

/* ── Dropzone ── */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 52px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  position: relative;
}

.dropzone input[type=file] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
}

.dropzone:hover, .dropzone.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
}

.dropzone-icon { margin-bottom: 14px; color: var(--subtext); }
.dropzone h2 { font-size: 15px; font-weight: 600; margin-bottom: 5px; }
.dropzone p { font-size: 13px; color: var(--subtext); }
.dropzone .browse { color: var(--primary); font-weight: 500; }

/* ── File list ── */
.file-list { list-style: none; display: flex; flex-direction: column; gap: 0; }

.file-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.file-item:last-child { border-bottom: none; }

.file-type-icon {
  width: 36px; height: 36px;
  background: var(--primary-light);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.file-type-icon svg { color: var(--primary); }

.file-info { flex: 1; min-width: 0; }
.file-name { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-size { font-size: 12px; color: var(--subtext); }

.file-status { font-size: 12px; color: var(--subtext); flex-shrink: 0; }
.file-status.done { color: var(--success); font-weight: 500; }
.file-status.error { color: var(--error); }

.file-remove {
  color: var(--subtext); cursor: pointer;
  padding: 4px; border-radius: 4px;
  background: none; border: none;
  transition: color .15s;
  flex-shrink: 0;
}
.file-remove:hover { color: var(--error); }

/* ── Progress ── */
.progress { height: 3px; background: var(--border); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--primary); border-radius: 2px; transition: width .3s ease; width: 0; }

/* ── Options ── */
.options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 480px) { .options-grid { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 500; color: var(--subtext); }

.field input, .field select {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  background: white;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}

.field input:focus, .field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.08);
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px;
  border-radius: 9px;
  font-size: 14px; font-weight: 600;
  cursor: pointer; border: none;
  transition: all .15s;
  text-decoration: none;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }

.btn-outline {
  background: white; color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover { background: var(--bg); }

.btn-ghost {
  background: transparent; color: var(--subtext);
  padding: 8px 14px;
}
.btn-ghost:hover { background: var(--bg); color: var(--text); }

.btn-full { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 13px; }

/* ── Share box ── */
.share-box {
  display: flex; gap: 8px; align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 14px;
}

.share-link {
  flex: 1; font-size: 13px; color: var(--primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.copy-btn {
  flex-shrink: 0; padding: 7px 14px;
  border-radius: 7px; font-size: 13px; font-weight: 500;
  background: var(--primary); color: white;
  border: none; cursor: pointer;
  transition: background .15s;
}
.copy-btn:hover { background: var(--primary-dark); }
.copy-btn.copied { background: var(--success); }

/* ── Alert ── */
.alert {
  padding: 12px 16px; border-radius: 9px; font-size: 13px;
}
.alert-error { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.alert-success { background: #F0FDF4; color: #166534; border: 1px solid #BBF7D0; }
.alert-info { background: var(--primary-light); color: #1E40AF; border: 1px solid #BFDBFE; }

/* ── Download page ── */
.transfer-header { text-align: center; margin-bottom: 24px; }
.transfer-title { font-size: 22px; font-weight: 700; letter-spacing: -.3px; }
.transfer-meta { font-size: 13px; color: var(--subtext); margin-top: 6px; }
.transfer-meta span + span::before { content: "·"; margin: 0 6px; }

.download-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.download-item:last-child { border-bottom: none; }
.download-item .file-info { flex: 1; }
.download-btn { flex-shrink: 0; }

/* ── Login ── */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); padding: 24px;
}

.login-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 40px 36px;
  width: 100%; max-width: 380px;
}

.login-logo {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; margin-bottom: 32px;
}

.login-logo .logo-name { font-size: 20px; }

.login-title { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.login-sub { font-size: 14px; color: var(--subtext); margin-bottom: 28px; }

/* ── Utils ── */
.hidden { display: none !important; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.text-center { text-align: center; }
.text-subtext { color: var(--subtext); font-size: 14px; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.justify-between { justify-content: space-between; }
