/* =========================================================
   文件中转站 — 毛玻璃视觉
   ========================================================= */

:root {
  --accent: #ffb27a;
  --accent-2: #ff8f6b;
  --accent-ink: #2a1608;
  --text: #f6f4f1;
  --text-dim: rgba(246, 244, 241, 0.62);
  --text-faint: rgba(246, 244, 241, 0.42);
  --glass: linear-gradient(158deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
  --glass-border: rgba(255, 255, 255, 0.18);
  --line: rgba(255, 255, 255, 0.13);
  --danger: #ff7a7a;
  --ok: #7ce0b0;
  --radius-lg: 26px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.45);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: "SFMono-Regular", ui-monospace, "JetBrains Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: #0d0f13;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---------- 背景图 ---------- */
.bg-layer {
  position: fixed;
  inset: 0;
  background: url("/bg.png") center center / cover no-repeat;
  transform: scale(1.04);
  filter: saturate(1.06) contrast(1.02);
  z-index: -2;
}

.bg-veil {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 70% at 72% 18%, rgba(255, 170, 120, 0.14), transparent 55%),
    linear-gradient(180deg, rgba(9, 11, 15, 0.42) 0%, rgba(9, 11, 15, 0.62) 45%, rgba(9, 11, 15, 0.86) 100%);
  backdrop-filter: blur(1.5px);
}

/* ---------- 布局 ---------- */
.page {
  width: min(1040px, 100%);
  margin: 0 auto;
  padding: 44px 24px 56px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}

.brand { display: flex; align-items: center; gap: 14px; }

.logo {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: var(--accent);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.05));
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
}

.logo svg { width: 24px; height: 24px; }

.brand-text h1 {
  margin: 0;
  font-size: 25px;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.4);
}

.brand-text p {
  margin: 5px 0 0;
  font-size: 12.5px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

/* ---------- 标签切换 ---------- */
.tabs {
  display: inline-flex;
  padding: 4px;
  gap: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.tab {
  appearance: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 550;
  letter-spacing: 0.02em;
  padding: 10px 20px;
  border-radius: 999px;
  color: var(--text-dim);
  background: transparent;
  transition: color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tab:hover { color: var(--text); }

.tab.is-active {
  color: #1a1c20;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

.tab-badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
  background: rgba(255, 255, 255, 0.16);
  color: var(--text);
}

.tab.is-active .tab-badge { background: rgba(20, 22, 26, 0.12); color: #1a1c20; }

/* ---------- 视图 ---------- */
.view { display: none; animation: fade-up 0.35s ease both; }
.view.is-active { display: block; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 玻璃卡片 ---------- */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.card { padding: 30px; }

/* ---------- 上传区 ---------- */
.dropzone {
  border: 1.5px dashed rgba(255, 255, 255, 0.26);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.035);
  padding: 46px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
  outline: none;
}

.dropzone:hover,
.dropzone:focus-visible {
  border-color: rgba(255, 178, 122, 0.7);
  background: rgba(255, 178, 122, 0.06);
}

.dropzone.is-dragging {
  border-color: var(--accent);
  background: rgba(255, 178, 122, 0.11);
  transform: scale(1.005);
}

.dropzone-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: linear-gradient(160deg, rgba(255, 178, 122, 0.22), rgba(255, 143, 107, 0.08));
  border: 1px solid rgba(255, 178, 122, 0.28);
  box-shadow: 0 10px 30px rgba(255, 143, 107, 0.14);
}

.dropzone-icon svg { width: 26px; height: 26px; }

.dropzone-title {
  margin: 0 0 8px;
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.dropzone-hint {
  margin: 0 auto;
  max-width: 520px;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--text-faint);
}

/* ---------- 已选文件 ---------- */
.picked { margin-top: 22px; display: flex; flex-direction: column; gap: 24px; }

.picked-file {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
}

.file-badge {
  flex: 0 0 auto;
  min-width: 46px;
  height: 42px;
  padding: 0 8px;
  border-radius: 11px;
  display: inline-grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(255, 178, 122, 0.12);
  border: 1px solid rgba(255, 178, 122, 0.22);
}

.picked-meta { min-width: 0; display: flex; flex-direction: column; gap: 4px; }

.picked-name {
  font-size: 14px;
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.picked-size { font-size: 12px; color: var(--text-dim); font-family: var(--mono); }

.icon-btn {
  margin-left: auto;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.icon-btn:hover { background: rgba(255, 255, 255, 0.1); color: var(--text); }
.icon-btn svg { width: 15px; height: 15px; }

/* ---------- 表单块 ---------- */
.field { display: flex; flex-direction: column; gap: 11px; }

.field-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.muted { color: var(--text-faint); font-weight: 400; text-transform: none; letter-spacing: 0; }

.field-note { margin: 0; font-size: 12px; color: var(--text-faint); line-height: 1.6; }

.chips { display: flex; flex-wrap: wrap; gap: 9px; }

.chip {
  appearance: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 550;
  padding: 9px 18px;
  border-radius: 999px;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.16);
  transition: all 0.18s ease;
}

.chip:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.34); }

.chip.is-active {
  color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  box-shadow: 0 8px 22px rgba(255, 143, 107, 0.28);
}

/* ---------- 密码开关 ---------- */
.switch-row { display: flex; align-items: center; gap: 11px; }

.switch { position: relative; display: inline-block; width: 40px; height: 23px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }

.switch-dot {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: background 0.2s ease;
  cursor: pointer;
}

.switch-dot::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #f4f2ef;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.switch input:checked + .switch-dot {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
}

.switch input:checked + .switch-dot::after { transform: translateX(17px); }

.switch-text { font-size: 12.5px; color: var(--text-dim); }

.pwd-wrap { display: flex; gap: 9px; }
.pwd-wrap[hidden] { display: none; }

/* ---------- 输入 / 按钮 ---------- */
.input {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.input::placeholder { color: rgba(255, 255, 255, 0.35); }

.input:focus {
  border-color: rgba(255, 178, 122, 0.7);
  background: rgba(255, 255, 255, 0.09);
}

.input.mono { font-family: var(--mono); font-size: 12.5px; letter-spacing: -0.01em; }

.primary-btn {
  width: 100%;
  appearance: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  border: 0;
  border-radius: 14px;
  padding: 15px 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  box-shadow: 0 12px 30px rgba(255, 143, 107, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.primary-btn svg { width: 18px; height: 18px; }

.primary-btn:hover { transform: translateY(-1px); box-shadow: 0 18px 38px rgba(255, 143, 107, 0.34); }
.primary-btn:active { transform: translateY(0) scale(0.995); }
.primary-btn:disabled { cursor: not-allowed; filter: grayscale(0.5) brightness(0.8); transform: none; box-shadow: none; }

.ghost-btn {
  appearance: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 550;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 12px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.ghost-btn:hover { background: rgba(255, 255, 255, 0.13); border-color: rgba(255, 255, 255, 0.3); }
.ghost-btn svg { width: 15px; height: 15px; }
.ghost-btn.wide { padding: 15px 24px; border-radius: 14px; font-size: 14px; }

/* ---------- 进度 ---------- */
.progress { display: flex; flex-direction: column; gap: 9px; }

.progress-track {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 14px rgba(255, 178, 122, 0.6);
  transition: width 0.18s ease;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--mono);
}

/* ---------- 上传结果 ---------- */
.result { display: flex; flex-direction: column; gap: 22px; animation: fade-up 0.3s ease both; }

.result-head { display: flex; align-items: center; gap: 15px; }

.result-check {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #10261c;
  background: linear-gradient(140deg, #8ce8bd, #4fd3a0);
  box-shadow: 0 10px 24px rgba(79, 211, 160, 0.28);
}

.result-check svg { width: 22px; height: 22px; }

.result-head h2 { margin: 0; font-size: 19px; font-weight: 650; }
.result-name { margin: 4px 0 0; font-size: 12.5px; color: var(--text-dim); word-break: break-all; }

.copy-row { display: flex; gap: 9px; }

.result-info {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dim);
}

.result-info span {
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
}

.result-info span[hidden] { display: none; }

.result-actions { display: flex; gap: 10px; }
.result-actions .primary-btn { flex: 1; }

/* ---------- 我的文件 ---------- */
.files-card { padding: 26px 26px 20px; }

.files-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.files-head h2 { margin: 0; font-size: 19px; font-weight: 650; }
.files-head p { margin: 5px 0 0; font-size: 12.5px; }

.file-list { display: flex; flex-direction: column; }

.file-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px 6px;
  border-bottom: 1px solid var(--line);
  transition: background 0.18s ease;
}

.file-row:last-child { border-bottom: 0; }

.file-main { min-width: 0; display: flex; flex-direction: column; gap: 6px; }

.file-name {
  font-size: 14px;
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: var(--text-faint);
  font-family: var(--mono);
}

.file-sub .sep { opacity: 0.4; }

.tag {
  padding: 2px 8px;
  border-radius: 6px;
  font-family: var(--font);
  font-size: 11px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  color: var(--text-dim);
}

.tag.warn { color: #ffc79a; border-color: rgba(255, 199, 154, 0.3); background: rgba(255, 178, 122, 0.1); }
.tag.lock { color: #d7c7ff; border-color: rgba(215, 199, 255, 0.24); background: rgba(180, 160, 255, 0.1); }
.tag.lock.copyable { cursor: pointer; transition: background 0.16s ease, border-color 0.16s ease; }
.tag.lock.copyable:hover { background: rgba(180, 160, 255, 0.2); border-color: rgba(215, 199, 255, 0.44); }
.tag.ok { color: var(--ok); border-color: rgba(124, 224, 176, 0.24); background: rgba(124, 224, 176, 0.08); }

.file-actions { display: flex; align-items: center; gap: 6px; }

.mini-btn {
  appearance: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 550;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9px;
  padding: 7px 12px;
  transition: all 0.16s ease;
  white-space: nowrap;
}

.mini-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.09); border-color: rgba(255, 255, 255, 0.28); }
.mini-btn.danger:hover { color: var(--danger); border-color: rgba(255, 122, 122, 0.45); background: rgba(255, 122, 122, 0.08); }

/* ---------- 空状态 ---------- */
.empty { padding: 46px 16px 34px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.empty[hidden] { display: none; }
.empty-icon { width: 54px; height: 54px; display: grid; place-items: center; color: var(--text-faint); opacity: 0.75; }
.empty-icon svg { width: 44px; height: 44px; }
.empty p { margin: 0; font-size: 13.5px; color: var(--text-dim); }

/* ---------- 页脚 / 提示 ---------- */
.hint-line {
  margin: 16px 0 0;
  text-align: center;
  font-size: 11.5px;
  letter-spacing: 0.03em;
  color: rgba(246, 244, 241, 0.4);
}

.footer {
  margin-top: auto;
  padding-top: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 11.5px;
  color: rgba(246, 244, 241, 0.36);
  letter-spacing: 0.04em;
}

.footer .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: 0.6; }

/* ---------- 维护提示 / 存储用量 ---------- */
.notice {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  padding: 15px 17px;
  margin-bottom: 20px;
  border-radius: var(--radius-md);
  background: rgba(255, 143, 107, 0.12);
  border: 1px solid rgba(255, 143, 107, 0.32);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.notice-icon { flex: 0 0 auto; width: 22px; height: 22px; color: #ffb08a; margin-top: 1px; }
.notice-icon svg { width: 22px; height: 22px; }

.notice-body { display: flex; flex-direction: column; gap: 4px; }
.notice-body strong { font-size: 13.5px; font-weight: 650; color: #ffd0b8; }
.notice-body span { font-size: 12px; line-height: 1.65; color: var(--text-dim); }

.dropzone.is-disabled {
  pointer-events: none;
  opacity: 0.45;
  filter: grayscale(0.5);
}

.storage { margin-top: 22px; display: flex; flex-direction: column; gap: 8px; }
.storage[hidden] { display: none; }

.storage-head {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  font-family: var(--mono);
}

.storage-track {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.storage-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0.7));
  transition: width 0.4s ease, background 0.3s ease;
}

.storage-fill.warn { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.storage-fill.full { background: linear-gradient(90deg, #ff9b7a, #ff6b6b); }

/* ---------- Toast ---------- */
.toast-wrap {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 50;
  pointer-events: none;
}

.toast {
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--text);
  background: rgba(24, 26, 32, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(16px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4);
  animation: toast-in 0.24s ease both;
}

.toast.err { border-color: rgba(255, 122, 122, 0.4); color: #ffc9c9; }
.toast.out { animation: toast-out 0.2s ease both; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateY(6px) scale(0.98); }
}

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  .page { padding: 26px 16px 40px; }
  .topbar { align-items: flex-start; flex-direction: column; gap: 16px; }
  .tabs { width: 100%; }
  .tab { flex: 1; justify-content: center; padding: 10px 12px; }
  .card { padding: 20px; }
  .dropzone { padding: 32px 16px; }
  .dropzone-hint { font-size: 11.5px; }
  .brand-text h1 { font-size: 21px; }
  .file-row { grid-template-columns: auto minmax(0, 1fr); }
  .file-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .result-actions { flex-direction: column; }
  .result-actions .ghost-btn { width: 100%; }
  .pwd-wrap { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
