/* CunDrop · 深色高级感 UI */
:root {
  --bg: #0a0e17;
  --bg2: #0d1320;
  --card: #131a2a;
  --card2: #182032;
  --line: #232d45;
  --text: #e8edf7;
  --muted: #8b96b0;
  --accent1: #6366f1;
  --accent2: #22d3ee;
  --grad: linear-gradient(135deg, #6366f1, #22d3ee);
  --danger: #f87171;
  --radius: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  min-height: 100vh;
}
a { color: var(--accent2); }
code {
  background: #0a0e17; border: 1px solid var(--line);
  padding: 2px 8px; border-radius: 6px; font-size: 13px;
}

/* ---------- 通用 ---------- */
.btn {
  background: var(--card2); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 18px; font-size: 14px; cursor: pointer;
  transition: transform .12s, box-shadow .12s, background .12s;
}
.btn:hover { background: #1f2940; transform: translateY(-1px); }
.btn.primary {
  background: var(--grad); border: none; color: #fff; font-weight: 600;
  box-shadow: 0 4px 18px rgba(99, 102, 241, .35);
}
.btn.primary:hover { box-shadow: 0 6px 24px rgba(99, 102, 241, .5); }
.btn.danger { color: var(--danger); }
.btn-block { width: 100%; margin-top: 14px; padding: 12px; font-size: 15px; }
input, select {
  width: 100%; background: #0a0e17; border: 1px solid var(--line);
  color: var(--text); border-radius: 10px; padding: 11px 14px;
  font-size: 14px; margin-top: 8px; outline: none;
}
input:focus, select:focus { border-color: var(--accent1); box-shadow: 0 0 0 3px rgba(99,102,241,.18); }
label { display: block; font-size: 13px; color: var(--muted); margin-top: 14px; }
.muted { color: var(--muted); font-size: 13px; margin-top: 8px; }
.hidden { display: none !important; }
.alert {
  border-radius: 10px; padding: 11px 15px; font-size: 14px; margin-bottom: 16px;
}
.alert.error { background: rgba(248,113,113,.1); border: 1px solid rgba(248,113,113,.35); color: #fca5a5; }
.logo { font-size: 20px; font-weight: 800; letter-spacing: .5px; }
.logo-mark {
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; margin-right: 4px;
}
.logo.small { font-size: 14px; color: var(--muted); text-align: center; margin-top: 22px; font-weight: 400; }

/* ---------- 登录 / 分享 ---------- */
.auth-body, .share-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 20px; position: relative; overflow: hidden;
}
.blob { position: absolute; border-radius: 50%; filter: blur(110px); opacity: .5; z-index: 0; }
.blob-1 { width: 480px; height: 480px; background: #4f46e5; top: -140px; left: -120px; }
.blob-2 { width: 420px; height: 420px; background: #0e7490; bottom: -140px; right: -100px; }
.auth-card, .share-card {
  position: relative; z-index: 1; width: 380px; max-width: 100%;
  background: rgba(19, 26, 42, .82); backdrop-filter: blur(18px);
  border: 1px solid var(--line); border-radius: 20px;
  padding: 38px 34px; box-shadow: 0 24px 70px rgba(0,0,0,.5);
}
.share-card.wide { width: 620px; }
.auth-sub { color: var(--muted); font-size: 13px; margin: 8px 0 20px; }
.share-file-head { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.share-filename { font-weight: 700; font-size: 16px; word-break: break-all; }
.share-meta { color: var(--muted); font-size: 12px; margin-top: 4px; }
.share-preview {
  width: 100%; border-radius: 12px; background: #000;
  max-height: 52vh; margin-bottom: 18px; border: 1px solid var(--line);
}
.share-audio { width: 100%; margin-bottom: 18px; }
.share-err-code { font-size: 64px; font-weight: 800; text-align: center; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.share-err-msg { text-align: center; color: var(--muted); margin: 10px 0 6px; }

/* 文件类型图标 */
.file-icon {
  width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; background: var(--card2); border: 1px solid var(--line);
}
.file-icon::before { content: "📄"; }
.file-icon.video { background: rgba(99,102,241,.14); border-color: rgba(99,102,241,.4); }
.file-icon.video::before { content: "🎬"; }
.file-icon.image { background: rgba(34,211,238,.1); border-color: rgba(34,211,238,.35); }
.file-icon.image::before { content: "🖼️"; }
.file-icon.audio::before { content: "🎵"; }
.file-icon.file::before { content: "📦"; }

/* ---------- 主界面 ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 250px; flex-shrink: 0; background: var(--bg2);
  border-right: 1px solid var(--line); padding: 26px 18px;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar nav { margin-top: 30px; display: flex; flex-direction: column; gap: 6px; }
.nav-item {
  background: none; border: none; color: var(--muted); text-align: left;
  padding: 12px 14px; border-radius: 10px; font-size: 15px; cursor: pointer;
  transition: all .15s;
}
.nav-item:hover { background: var(--card); color: var(--text); }
.nav-item.active { background: var(--grad); color: #fff; font-weight: 600; box-shadow: 0 4px 16px rgba(99,102,241,.3); }
.side-foot { margin-top: auto; }
.storage-label { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.storage-bar { height: 7px; background: #0a0e17; border-radius: 4px; overflow: hidden; }
.storage-bar i { display: block; height: 100%; background: var(--grad); border-radius: 4px; transition: width .5s; }
.storage-text { font-size: 12px; color: var(--muted); margin: 8px 0 14px; }
.logout { font-size: 13px; color: var(--muted); text-decoration: none; }
.logout:hover { color: var(--danger); }

main { flex: 1; padding: 28px 34px; max-width: 1080px; }
.topbar { display: flex; gap: 12px; margin-bottom: 22px; }
.topbar input { margin-top: 0; }
.topbar .btn { white-space: nowrap; }
.view h3 { margin-bottom: 12px; }

/* 上传区 */
.dropzone {
  border: 2px dashed var(--line); border-radius: var(--radius);
  padding: 38px; text-align: center; color: var(--muted);
  cursor: pointer; transition: all .2s; margin-bottom: 20px;
  background: rgba(19,26,42,.5);
}
.dropzone:hover, .dropzone.over {
  border-color: var(--accent1); background: rgba(99,102,241,.07);
  box-shadow: 0 0 30px rgba(99,102,241,.12) inset;
}
.dz-icon { font-size: 34px; margin-bottom: 10px; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.link { color: var(--accent2); }
.dz-hint { font-size: 12px; margin-top: 8px; opacity: .7; }

/* 文件列表 */
.file-list { display: flex; flex-direction: column; gap: 10px; }
.file-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 13px 16px;
  transition: transform .12s, border-color .12s;
}
.file-row:hover { transform: translateX(3px); border-color: #31405f; }
.file-info { flex: 1; min-width: 0; }
.file-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-sub { color: var(--muted); font-size: 12px; margin-top: 3px; }
.file-sub a { color: var(--accent2); text-decoration: none; word-break: break-all; }
.file-actions { display: flex; gap: 8px; flex-shrink: 0; }
.file-actions .btn { padding: 7px 13px; font-size: 13px; }
.tag {
  display: inline-block; font-size: 11px; padding: 2px 9px; border-radius: 20px;
  background: rgba(34,211,238,.12); color: var(--accent2); border: 1px solid rgba(34,211,238,.3);
  margin-left: 8px; vertical-align: 1px;
}
.tag.pwd { background: rgba(251,191,36,.1); color: #fbbf24; border-color: rgba(251,191,36,.3); }
.tag.exp { background: rgba(248,113,113,.1); color: #fca5a5; border-color: rgba(248,113,113,.3); }

/* 上传进度 */
.up-item {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 13px 16px; margin-bottom: 10px;
}
.up-top { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 9px; }
.up-top .pct { color: var(--accent2); font-weight: 700; }
.up-bar { height: 7px; background: #0a0e17; border-radius: 4px; overflow: hidden; }
.up-bar i { display: block; height: 100%; background: var(--grad); width: 0; transition: width .2s; border-radius: 4px; }
.up-item.done .up-bar i { background: linear-gradient(135deg, #10b981, #22d3ee); }
.up-item.error { border-color: rgba(248,113,113,.4); }

.empty { text-align: center; color: var(--muted); padding: 60px 20px; font-size: 15px; }

/* 卡片 */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; margin-bottom: 18px; max-width: 560px;
}
.health-row { padding: 5px 0; font-size: 14px; }
.help { margin: 10px 0 0 20px; color: var(--muted); font-size: 14px; line-height: 2; }

/* 弹窗 */
.modal {
  position: fixed; inset: 0; background: rgba(4,7,13,.7);
  backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center;
  z-index: 50; padding: 20px;
}
.modal-card {
  width: 440px; max-width: 100%; background: var(--card);
  border: 1px solid var(--line); border-radius: 18px; padding: 28px;
  box-shadow: 0 24px 70px rgba(0,0,0,.55);
}
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
#shareResult { display: flex; gap: 8px; margin-top: 16px; }
#shareResult input { margin-top: 0; }

/* toast */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  background: var(--card2); border: 1px solid var(--line); color: var(--text);
  padding: 12px 24px; border-radius: 30px; font-size: 14px; z-index: 99;
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
}

@media (max-width: 760px) {
  .sidebar { display: none; }
  main { padding: 18px; }
  .file-actions { flex-wrap: wrap; }
}
