/* ===== Aurenlane Files · UI ===== */
:root {
  color-scheme: dark;
  --bg: #06070c;
  --sky: #1a1836;
  --sea: #07222a;
  --bg-2: #0b0d16;
  --panel: rgba(22, 25, 38, .58);
  --panel-solid: #12141f;
  --stroke: rgba(255, 255, 255, .085);
  --stroke-strong: rgba(255, 255, 255, .16);
  --text: #eef0f8;
  --muted: #99a0b8;
  --faint: #6a7188;
  --a1: #8b7bff;
  --a2: #38e8c8;
  --a3: #ff7bd5;
  --danger: #ff5d73;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, .75);
  --ease: cubic-bezier(.22, .68, .32, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --font: "SF Pro Display", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .35s var(--ease);
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

/* ---------- 背景光晕 ---------- */
.aurora {
  position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  background-color: var(--bg);
  background-image: radial-gradient(1200px 800px at 78% -10%, var(--sky) 0%, transparent 60%),
                    radial-gradient(900px 700px at 0% 100%, var(--sea) 0%, transparent 55%);
}
.blob { position: absolute; border-radius: 50%; filter: blur(90px) saturate(120%); opacity: .5; }
.b1 { width: 52vw; height: 52vw; left: 4%; top: 6%; background: radial-gradient(circle at 30% 30%, #6b5bff, transparent 65%); animation: drift1 26s var(--ease) infinite alternate; }
.b2 { width: 44vw; height: 44vw; right: 2%; top: 22%; background: radial-gradient(circle at 60% 40%, #12c9b1, transparent 65%); animation: drift2 32s var(--ease) infinite alternate; }
.b3 { width: 40vw; height: 40vw; left: 32%; bottom: -8%; background: radial-gradient(circle at 50% 60%, #ff5fb0, transparent 65%); animation: drift3 38s var(--ease) infinite alternate; opacity: .65; }
.grain { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.42'/%3E%3C/svg%3E");
  }
@keyframes drift1 { to { transform: translate3d(8vw, 6vh, 0) scale(1.18) rotate(12deg); } }
@keyframes drift2 { to { transform: translate3d(-7vw, 9vh, 0) scale(1.12) rotate(-10deg); } }
@keyframes drift3 { to { transform: translate3d(5vw, -8vh, 0) scale(1.22) rotate(8deg); } }

/* ---------- 通用 ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--stroke); border-radius: 12px; padding: 11px 18px;
  background: rgba(255, 255, 255, .045); color: var(--text); font-weight: 600; font-size: 14px;
  transition: transform .22s var(--spring), background .2s, border-color .2s, box-shadow .25s;
}
.btn:hover { background: rgba(255, 255, 255, .085); border-color: var(--stroke-strong); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.985); }
.btn.primary {
  border: none; color: #0a0a12; font-weight: 700;
  background: linear-gradient(120deg, var(--a2), #7de0ff 42%, var(--a1));
  box-shadow: 0 12px 30px -12px rgba(56, 232, 200, .55);
  overflow: hidden;
}
.btn.primary::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-120%);
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent);
}
.btn.primary:hover::after { animation: sweep .9s var(--ease); }
.btn.primary:hover { box-shadow: 0 16px 38px -12px rgba(56, 232, 200, .7); }
.btn.ghost { background: transparent; }
.btn.danger { background: rgba(255, 93, 115, .14); border-color: rgba(255, 93, 115, .35); color: #ff8d9d; }
.btn.danger:hover { background: rgba(255, 93, 115, .22); }
@keyframes sweep { to { transform: translateX(120%); } }
.link { background: none; border: none; padding: 0; color: var(--a2); font-weight: 600; border-bottom: 1px dashed rgba(56, 232, 200, .5); }
.link:hover { color: #7df3dc; }

.field { display: flex; flex-direction: column; gap: 8px; }
.field > span { font-size: 12.5px; color: var(--muted); letter-spacing: .02em; }
.field input, .search input, select {
  background: rgba(255, 255, 255, .04); border: 1px solid var(--stroke); border-radius: 12px;
  padding: 12px 14px; outline: none; color: var(--text); transition: border-color .2s, box-shadow .2s, background .2s;
}
.field input:focus, .search:focus-within, select:focus {
  border-color: rgba(139, 123, 255, .6); box-shadow: 0 0 0 4px rgba(139, 123, 255, .12); background: rgba(255, 255, 255, .06);
}
.field.compact input { padding: 10px 12px; }

/* ---------- 登录 ---------- */
.login-view { position: relative; z-index: 1; min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: min(400px, 100%); padding: 38px 32px 30px; text-align: center;
  background: var(--panel); border: 1px solid var(--stroke); border-radius: 26px;
  backdrop-filter: blur(26px) saturate(140%); box-shadow: var(--shadow);
  animation: popIn .7s var(--spring) both;
}
.login-card.shake { animation: shake .45s var(--ease); }
.login-logo { width: 66px; height: 66px; margin: 0 auto 18px; animation: bob 5s ease-in-out infinite; }
.login-logo svg { width: 100%; height: 100%; filter: drop-shadow(0 8px 20px rgba(139, 123, 255, .45)); }
.login-card h1 { margin: 0 0 6px; font-size: 24px; letter-spacing: -.02em; }
.login-card .muted { margin: 0 0 24px; font-size: 13.5px; }
.login-card .field { text-align: left; margin-bottom: 18px; }
.login-card .btn { width: 100%; padding: 13px; }
.login-card .hint { min-height: 18px; margin: 14px 0 0; font-size: 12.5px; color: var(--danger); }
@keyframes bob { 50% { transform: translateY(-6px); } }
@keyframes popIn { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes shake {
  20% { transform: translateX(-9px); } 40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); } 80% { transform: translateX(3px); }
}

/* ---------- 顶栏 ---------- */
.app { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 26px 26px 60px; animation: fadeIn .5s var(--ease) both; }
@keyframes fadeIn { from { opacity: 0; } }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.brand { display: flex; align-items: center; gap: 13px; }
.mark { width: 42px; height: 42px; }
.mark svg { width: 100%; height: 100%; filter: drop-shadow(0 6px 16px rgba(139, 123, 255, .35)); }
.brand-text h1 { margin: 0; font-size: 17px; letter-spacing: -.01em; }
.brand-text p { margin: 2px 0 0; font-size: 11.5px; color: var(--faint); font-family: var(--mono); letter-spacing: .02em; }
.brand-text .dot { color: var(--a2); }
.top-actions { display: flex; align-items: center; gap: 10px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; font-size: 12.5px; color: var(--muted);
  background: var(--panel); border: 1px solid var(--stroke); border-radius: 999px; backdrop-filter: blur(18px);
}
.pill svg { width: 16px; height: 16px; opacity: .8; }
.pill b { color: var(--text); font-weight: 600; font-family: var(--mono); }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--stroke); backdrop-filter: blur(18px);
  transition: transform .2s var(--spring), background .2s, border-color .2s;
}
.icon-btn svg { width: 18px; height: 18px; color: var(--muted); transition: color .2s; }
.icon-btn:hover { transform: translateY(-2px); border-color: var(--stroke-strong); background: rgba(255, 255, 255, .07); }
.icon-btn:hover svg { color: var(--text); }

/* ---------- 上传区 ---------- */
.dropzone {
  position: relative; overflow: hidden; border-radius: 26px; padding: 46px 26px; text-align: center;
  background: linear-gradient(160deg, rgba(139, 123, 255, .1), rgba(56, 232, 200, .05) 55%, rgba(255, 255, 255, .02));
  border: 1px dashed rgba(255, 255, 255, .16); cursor: pointer;
  transition: border-color .25s, transform .3s var(--spring), background .3s, box-shadow .3s;
  animation: riseIn .6s var(--ease) both .05s;
}
.dropzone:hover { border-color: rgba(56, 232, 200, .45); transform: translateY(-2px); box-shadow: 0 20px 50px -30px rgba(56, 232, 200, .5); }
.dropzone.drag {
  border-color: var(--a2); background: linear-gradient(160deg, rgba(56, 232, 200, .16), rgba(139, 123, 255, .1));
  transform: scale(1.008); box-shadow: 0 0 0 6px rgba(56, 232, 200, .08), 0 30px 80px -40px rgba(56, 232, 200, .7);
}
.dz-ring {
  position: absolute; width: 420px; height: 420px; left: 50%; top: 50%; translate: -50% -50%; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .05); box-shadow: inset 0 0 90px rgba(139, 123, 255, .12);
  animation: breathe 6s ease-in-out infinite;
}
@keyframes breathe { 50% { transform: scale(1.12); opacity: .55; } }
.dz-inner { position: relative; z-index: 1; }
.dz-icon { width: 54px; height: 54px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 16px;
  background: rgba(255, 255, 255, .06); border: 1px solid var(--stroke); color: var(--a2); transition: transform .35s var(--spring); }
.dz-icon svg { width: 26px; height: 26px; }
.dropzone:hover .dz-icon { transform: translateY(-4px) scale(1.05); }
.dropzone h2 { margin: 0 0 6px; font-size: 19px; letter-spacing: -.01em; }
.dropzone p { margin: 0; color: var(--muted); font-size: 13px; }
.dz-overlay {
  position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; pointer-events: none;
  background: rgba(7, 9, 15, .62); backdrop-filter: blur(6px); transition: opacity .2s;
  font-size: 18px; font-weight: 700; letter-spacing: .06em; color: var(--a2);
}
.dropzone.drag .dz-overlay { opacity: 1; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }
@keyframes riseIn { from { opacity: 0; transform: translateY(14px); } }

/* ---------- 文件库 ---------- */
.library { margin-top: 40px; }
.lib-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.lib-head h2 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -.01em; display: flex; align-items: center; gap: 9px; }
.count { font-size: 11.5px; font-family: var(--mono); color: var(--a2); background: rgba(56, 232, 200, .1);
  border: 1px solid rgba(56, 232, 200, .22); padding: 2px 8px; border-radius: 999px; }
.tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search { display: flex; align-items: center; gap: 9px; padding: 0 13px; border: 1px solid var(--stroke); border-radius: 12px;
  background: rgba(255, 255, 255, .04); transition: border-color .2s, box-shadow .2s; }
.search svg { width: 16px; height: 16px; color: var(--faint); }
.search input { border: none; background: none; padding: 10px 0; width: 168px; outline: none; font-size: 13.5px; }
select { padding: 9px 12px; font-size: 13px; border-radius: 12px; cursor: pointer; }
select option { background: var(--panel-solid); }
.view-toggle { display: flex; padding: 3px; gap: 2px; background: rgba(255, 255, 255, .04); border: 1px solid var(--stroke); border-radius: 12px; }
.view-toggle button { width: 32px; height: 30px; display: grid; place-items: center; border: none; border-radius: 9px; background: none; color: var(--faint); transition: background .2s, color .2s; }
.view-toggle button svg { width: 17px; height: 17px; }
.view-toggle button.active { background: rgba(255, 255, 255, .1); color: var(--text); }

/* 网格卡片 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 16px; }
.card {
  position: relative; overflow: hidden; border-radius: 18px; background: var(--panel);
  border: 1px solid var(--stroke); backdrop-filter: blur(20px) saturate(130%);
  transition: transform .6s cubic-bezier(.22,.68,.32,1), border-color .45s ease,
              box-shadow .6s cubic-bezier(.22,.68,.32,1), background .45s ease;
  animation: cardIn .55s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 38ms);
}
@keyframes cardIn { from { opacity: 0; transform: translateY(16px) scale(.97); } }
.card:hover { transform: translateY(-6px) scale(1.008); border-color: rgba(255, 255, 255, .2);
  box-shadow: 0 26px 50px -24px rgba(0, 0, 0, .8), 0 0 0 1px rgba(139, 123, 255, .12); }
.thumb { position: relative; aspect-ratio: 16 / 10; background: linear-gradient(150deg, rgba(139, 123, 255, .16), rgba(56, 232, 200, .07));
  display: grid; place-items: center; overflow: hidden; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; transition: transform .7s cubic-bezier(.22,.68,.32,1); }
.card:hover .thumb img, .card:hover .thumb video { transform: scale(1.04); }
.thumb .fileicon { width: 46px; height: 46px; color: rgba(255, 255, 255, .82); filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .4)); }
.thumb .ext { position: absolute; bottom: 10px; left: 10px; padding: 3px 8px; font-size: 10.5px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; font-family: var(--mono); border-radius: 7px;
  background: rgba(6, 8, 13, .68); border: 1px solid var(--stroke); color: var(--muted); backdrop-filter: blur(8px); }
.card-actions { position: absolute; top: 9px; right: 9px; display: flex; gap: 6px; opacity: 0; transform: translateY(-6px);
  transition: opacity .22s, transform .28s var(--spring); }
.card:hover .card-actions, .card:focus-within .card-actions { opacity: 1; transform: none; }
.act { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--stroke);
  background: rgba(8, 10, 16, .72); backdrop-filter: blur(10px); color: var(--muted); transition: background .2s, color .2s, transform .2s var(--spring); }
.act svg { width: 15px; height: 15px; }
.act:hover { background: rgba(255, 255, 255, .14); color: var(--text); transform: scale(1.08); }
.act.del:hover { background: rgba(255, 93, 115, .22); color: #ff8d9d; }
.card-body { padding: 12px 14px 14px; }
.card-name { margin: 0; font-size: 13.5px; font-weight: 600; line-height: 1.35; word-break: break-all;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { margin: 7px 0 0; display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--faint); font-family: var(--mono); }
.card-meta .sep { opacity: .45; }
.toastlink { position: absolute; inset: 0; }

/* 列表视图 */
.grid.list { display: flex; flex-direction: column; gap: 8px; }
.grid.list .card:hover { transform: translateY(-2px); }
.grid.list .card { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 14px; animation-name: rowIn; }
@keyframes rowIn { from { opacity: 0; transform: translateX(-10px); } }
.grid.list .thumb { width: 46px; height: 46px; border-radius: 11px; flex: none; aspect-ratio: auto; }
.grid.list .thumb .fileicon { width: 22px; height: 22px; }
.grid.list .thumb .ext, .grid.list .card-actions { display: none; }
.grid.list .card-body { flex: 1; min-width: 0; padding: 0; }
.grid.list .card-name { -webkit-line-clamp: 1; }
.grid.list .card-meta { margin-top: 4px; }
.grid.list .list-actions { display: flex; gap: 6px; opacity: 1; position: static; transform: none; }
.grid:not(.list) .list-actions { display: none; }

/* 空状态 */
.empty { text-align: center; padding: 60px 20px; animation: riseIn .6s var(--ease) both; }
.empty-art { color: var(--a2); margin-bottom: 10px; }
.empty-art svg { width: 110px; height: 110px; animation: breathe 6s ease-in-out infinite; }
.empty h3 { margin: 0 0 6px; font-size: 17px; }
.empty p { margin: 0; color: var(--muted); font-size: 13.5px; }
.footer { margin-top: 60px; text-align: center; font-size: 11.5px; color: var(--faint); letter-spacing: .02em; }

/* ---------- 上传队列 ---------- */
.uploads { position: fixed; right: 20px; bottom: 20px; width: min(360px, calc(100vw - 40px)); display: flex; flex-direction: column; gap: 10px; z-index: 40; }
.up-item { background: rgba(14, 16, 26, .86); border: 1px solid var(--stroke); border-radius: 15px; padding: 12px 14px;
  backdrop-filter: blur(22px); box-shadow: var(--shadow); animation: slideUp .4s var(--spring) both; }
.up-item.done { animation: slideUp .4s var(--spring) both, fadeOut .4s var(--ease) forwards 2.2s; }
@keyframes slideUp { from { opacity: 0; transform: translateY(18px) scale(.97); } }
@keyframes fadeOut { to { opacity: 0; transform: translateX(20px); } }
.up-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.up-name { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-pct { font-size: 11.5px; font-family: var(--mono); color: var(--a2); flex: none; }
.up-bar { height: 5px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.up-fill { height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--a2), var(--a1));
  transition: width .25s var(--ease); box-shadow: 0 0 14px rgba(56, 232, 200, .55); }
.up-sub { margin-top: 7px; font-size: 11px; color: var(--faint); font-family: var(--mono); display: flex; justify-content: space-between; }
.up-item.failed .up-fill { background: linear-gradient(90deg, #ff5d73, #ff8d9d); }
.up-item.failed .up-pct { color: #ff8d9d; }

/* ---------- Toast ---------- */
.toasts { position: fixed; left: 50%; bottom: 28px; translate: -50% 0; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 60; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 9px; padding: 11px 18px; border-radius: 999px; font-size: 13px; font-weight: 500;
  background: rgba(16, 18, 28, .92); border: 1px solid var(--stroke-strong); backdrop-filter: blur(20px); box-shadow: var(--shadow);
  animation: toastIn .45s var(--spring) both; }
.toast.out { animation: toastOut .3s var(--ease) forwards; }
.toast.ok { border-color: rgba(56, 232, 200, .34); }
.toast.err { border-color: rgba(255, 93, 115, .4); }
.toast .dotmark { width: 7px; height: 7px; border-radius: 50%; background: var(--a2); box-shadow: 0 0 10px var(--a2); }
.toast.err .dotmark { background: var(--danger); box-shadow: 0 0 10px var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.95); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px) scale(.96); } }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column;
  background: rgba(4, 5, 9, .82); backdrop-filter: blur(22px); animation: fadeIn .3s var(--ease) both; }
.lb-stage { flex: 1; display: grid; place-items: center; padding: 30px; min-height: 0; }
.lb-stage img, .lb-stage video { max-width: 100%; max-height: 100%; border-radius: 14px; box-shadow: 0 40px 90px -30px #000; animation: lbIn .45s var(--spring) both; }
@keyframes lbIn { from { opacity: 0; transform: scale(.94); } }
.lb-close { position: absolute; top: 18px; right: 18px; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, .06); color: var(--text); font-size: 15px; display: grid; place-items: center;
  transition: background .2s, transform .2s var(--spring); z-index: 2; }
.lb-close:hover { background: rgba(255, 255, 255, .14); transform: rotate(90deg); }
.lb-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 24px 22px; }
.lb-bar > span { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-actions { display: flex; gap: 8px; flex: none; }

/* ---------- 弹窗 ---------- */
.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 24px;
  background: rgba(4, 5, 9, .7); backdrop-filter: blur(14px); animation: fadeIn .25s var(--ease) both; }
.modal-card { width: min(520px, 100%); padding: 26px 26px 22px; border-radius: 22px; background: rgba(17, 19, 29, .97);
  border: 1px solid var(--stroke); box-shadow: var(--shadow); animation: popIn .45s var(--spring) both; }
.modal-card.small { width: min(400px, 100%); }
.modal-card h3 { margin: 0 0 18px; font-size: 17px; }
.modal-card hr { border: none; border-top: 1px solid var(--stroke); margin: 20px 0; }
.settings-grid { display: flex; flex-direction: column; gap: 11px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; font-size: 13px; color: var(--muted); }
.setting-row code { font-family: var(--mono); font-size: 12px; color: var(--a2); background: rgba(56, 232, 200, .08);
  border: 1px solid rgba(56, 232, 200, .16); padding: 3px 8px; border-radius: 7px; }
.pw-form h4 { margin: 0 0 14px; font-size: 14px; }
.pw-form .field { margin-bottom: 12px; }
.pw-form .btn { width: 100%; margin-top: 4px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.danger-note { color: #ff8d9d; font-size: 12.5px; margin: 0; }

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  .app { padding: 18px 16px 48px; }
  .topbar { flex-wrap: wrap; }
  .pill span { display: none; }
  .dropzone { padding: 34px 18px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .search input { width: 120px; }
  .lb-bar { flex-direction: column; align-items: stretch; gap: 12px; }
  .uploads { right: 12px; left: 12px; bottom: 12px; width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---------- 登录页标签 ---------- */
.tabs { display: flex; gap: 5px; padding: 4px; margin-bottom: 18px; border-radius: 12px;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--stroke); }
.tab { flex: 1; padding: 9px 8px; border: none; background: none; color: var(--muted); border-radius: 9px;
  font-size: 13px; font-weight: 600; transition: background .2s, color .2s, transform .2s var(--spring); }
.tab:hover { color: var(--text); }
.tab.active { background: rgba(255, 255, 255, .1); color: var(--text); }
.login-card form .field { text-align: left; margin-bottom: 14px; }
.hint-sub { margin: 12px 0 0; font-size: 11.5px; color: var(--faint); line-height: 1.6; }

/* ---------- 设置弹窗（宽） ---------- */
.modal-card.wide { width: min(640px, 100%); max-height: 88dvh; overflow-y: auto; }
.codes-section h4 { margin: 0; font-size: 14px; }
.codes-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.code-create { display: flex; gap: 8px; flex-wrap: wrap; }
.code-create input { flex: 1 1 170px; min-width: 0; background: rgba(255, 255, 255, .04); border: 1px solid var(--stroke);
  border-radius: 12px; padding: 10px 12px; outline: none; font-size: 13px; transition: border-color .2s, box-shadow .2s; }
.code-create input:focus { border-color: rgba(139, 123, 255, .6); box-shadow: 0 0 0 4px rgba(139, 123, 255, .12); }
.code-create select { padding: 9px 10px; font-size: 12.5px; }
.code-list { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; max-height: 230px; overflow-y: auto; }
.code-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--stroke); background: rgba(255, 255, 255, .03); animation: riseIn .35s var(--ease) both; }
.code-item.inactive { opacity: .45; }
.code-value { font-family: var(--mono); font-size: 13px; letter-spacing: .06em; color: var(--a2); flex: none; }
.code-note { flex: 1; min-width: 0; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code-meta { font-size: 10.5px; color: var(--faint); font-family: var(--mono); flex: none; }
.code-item .act { width: 28px; height: 28px; }
.pw-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.pw-row .field { flex: 1 1 150px; margin: 0; }
.small { font-size: 12px; }
.badge-up { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; padding: 2px 7px; border-radius: 999px;
  font-size: 10.5px; color: #b7adff; background: rgba(139, 123, 255, .12); border: 1px solid rgba(139, 123, 255, .24); }

/* ============ 浅色主题（跟随系统） ============ */
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f2f4fa;
    --sky: #e3e7ff;
    --sea: #d6f4ef;
    --panel: rgba(255, 255, 255, .74);
    --panel-solid: #ffffff;
    --stroke: rgba(16, 22, 45, .10);
    --stroke-strong: rgba(16, 22, 45, .18);
    --text: #141a2b;
    --muted: #59607a;
    --faint: #878ea6;
    --a1: #6b5be6;
    --a2: #0f9e98;
    --a3: #d94f9f;
    --danger: #d62b4a;
    --shadow: 0 24px 60px -26px rgba(28, 38, 78, .35);
  }
  .b1 { background: radial-gradient(circle at 30% 30%, #b3a7ff, transparent 65%); opacity: .55; }
  .b2 { background: radial-gradient(circle at 60% 40%, #7fe4d7, transparent 65%); opacity: .5; }
  .b3 { background: radial-gradient(circle at 50% 60%, #ffb9dc, transparent 65%); opacity: .45; }

  .login-card, .modal-card { background: rgba(255, 255, 255, .9); }
  .modal { background: rgba(20, 26, 48, .38); }
  .btn { background: rgba(16, 22, 45, .05); }
  .btn:hover { background: rgba(16, 22, 45, .09); }
  .btn.ghost { background: transparent; }
  .icon-btn, .pill { background: rgba(255, 255, 255, .72); }
  .icon-btn:hover { background: rgba(255, 255, 255, .96); }
  .dropzone {
    background: linear-gradient(160deg, rgba(139, 123, 255, .12), rgba(15, 158, 152, .07) 55%, rgba(255, 255, 255, .35));
    border-color: rgba(16, 22, 45, .18);
  }
  .dz-icon { background: rgba(255, 255, 255, .75); border-color: var(--stroke); }
  .dz-overlay { background: rgba(248, 250, 255, .84); }
  .search, select, .field input, .code-create input { background: rgba(255, 255, 255, .85); }
  .view-toggle { background: rgba(255, 255, 255, .7); }
  .view-toggle button.active { background: rgba(16, 22, 45, .1); }
  .card { background: rgba(255, 255, 255, .84); }
  .card:hover { box-shadow: 0 26px 50px -26px rgba(28, 38, 78, .45), 0 0 0 1px rgba(107, 91, 230, .14); }
  .thumb { background: linear-gradient(150deg, rgba(139, 123, 255, .16), rgba(15, 158, 152, .09)); }
  .thumb .ext { background: rgba(255, 255, 255, .82); color: var(--muted); }
  .act { background: rgba(255, 255, 255, .9); }
  .act:hover { background: rgba(16, 22, 45, .1); }
  .up-item, .toast { background: rgba(255, 255, 255, .94); }
  .up-bar { background: rgba(16, 22, 45, .1); }
  .code-item { background: rgba(255, 255, 255, .78); }
  .badge-up { color: #5b4bd6; background: rgba(107, 91, 230, .1); border-color: rgba(107, 91, 230, .22); }
  .tab.active { background: rgba(16, 22, 45, .1); }
  .lb-close { background: rgba(255, 255, 255, .14); color: #fff; }
  .lb-bar > span { color: #ccd2e2; }
  .lb-bar .btn.ghost { color: #eef1f8; border-color: rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .08); }
}


/* ---------- 登录弹窗 ---------- */
.modal-card.login-card { width: min(380px, 100%); padding: 30px 26px 24px; text-align: center; position: relative; }
.login-card .login-logo { width: 54px; height: 54px; margin: 0 auto 14px; }
.login-card .tabs { margin-top: 2px; }
.login-card .field { text-align: left; margin-bottom: 14px; }
.login-card .btn.primary { width: 100%; }
.login-card .hint { min-height: 16px; margin: 10px 0 0; }
.login-close {
  position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border-radius: 9px;
  border: 1px solid var(--stroke); background: rgba(255, 255, 255, .05); color: var(--muted);
  font-size: 12px; display: grid; place-items: center;
  transition: background .2s, color .2s, transform .25s var(--spring);
}
.login-close:hover { background: rgba(255, 255, 255, .12); color: var(--text); transform: rotate(90deg); }

@media (prefers-color-scheme: light) {
  .login-close { background: rgba(16, 22, 45, .05); }
  .login-close:hover { background: rgba(16, 22, 45, .1); }
}

/* ---------- 紧凑布局与可访问交互 ---------- */
:root { --muted: #b0b7ca; --faint: #9ba5be; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
button:focus-visible, a:focus-visible, [role="button"]:focus-visible { outline: 2px solid var(--a2); outline-offset: 4px; }
button:disabled { cursor: default; opacity: .5; }
.app { max-width: 1240px; }
.topbar { margin-bottom: 22px; }
.dropzone { padding: 22px 26px; border-radius: 22px; text-align: left; }
.dz-inner { display: grid; grid-template-columns: 42px 1fr; column-gap: 16px; align-items: center; }
.dz-icon { width: 42px; height: 42px; grid-row: 1 / 4; margin: 0; border-radius: 13px; }
.dz-icon svg { width: 23px; height: 23px; }
.dropzone h2 { font-size: 17px; margin-bottom: 4px; }
.dropzone p { font-size: 13px; line-height: 1.6; }
.public-note { margin-top: 5px; font-size: 12px; color: var(--muted); }
.dz-ring { width: 340px; height: 340px; left: 78%; opacity: .7; }
.library { margin-top: 28px; }
.lib-head { margin-bottom: 16px; }
.grid { grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 14px; }
.thumb { aspect-ratio: 16 / 8; }
.thumb .fileicon { width: 34px; height: 34px; }
.card { cursor: pointer; }
.card:hover { transform: translateY(-4px); }
.card-body { padding: 13px 14px 14px; }
.card-name { display: flex; align-items: baseline; gap: 0; width: 100%; min-width: 0; padding: 0; border: 0; background: none; color: var(--text); text-align: left; font: inherit; font-size: 14px; font-weight: 600; line-height: 1.5; white-space: nowrap; word-break: normal; }
.name-base { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.name-ext { flex: none; white-space: nowrap; }
.card-meta { margin-top: 6px; font-family: var(--font); font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.card-meta .sep { opacity: .7; }
.card-actions { z-index: 2; }
.card-actions .act { width: 32px; height: 32px; }
.badge-up { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; }
.grid.list { gap: 7px; }
.grid.list .card { gap: 13px; padding: 11px 14px; border-radius: 14px; }
.grid.list .thumb { width: 40px; height: 40px; border-radius: 10px; }
.grid.list .thumb .fileicon { width: 21px; height: 21px; }
.grid.list .card-body { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(150px, .6fr) auto; align-items: center; column-gap: 20px; row-gap: 3px; }
.grid.list .card-name { grid-column: 1; }
.grid.list .card-meta { grid-column: 2; grid-row: 1; margin: 0; white-space: nowrap; }
.grid.list .list-actions { grid-column: 3; grid-row: 1 / 3; }
.grid.list .badge-up { grid-column: 1 / 3; grid-row: 2; justify-self: start; margin: 0; }
.list-actions .act { width: 32px; height: 32px; }
.sort-picker { position: relative; z-index: 5; }
.sort-button { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 40px; min-width: 126px; padding: 8px 12px; background: rgba(255,255,255,.04); border: 1px solid var(--stroke); border-radius: 12px; font-size: 13px; transition: border-color .25s var(--ease), background .25s var(--ease); }
.sort-button svg { width: 16px; height: 16px; color: var(--muted); transition: transform .35s var(--ease); }
.sort-button[aria-expanded="true"] { border-color: rgba(139,123,255,.55); background: rgba(139,123,255,.08); }
.sort-button[aria-expanded="true"] svg { transform: rotate(180deg); }
.sort-options { position: absolute; top: calc(100% + 8px); right: 0; width: 166px; padding: 5px; border: 1px solid var(--stroke-strong); border-radius: 14px; background: var(--panel-solid); box-shadow: var(--shadow); transform-origin: top right; animation: sortIn .3s cubic-bezier(.16,1,.3,1) both; }
.sort-options button { display: flex; width: 100%; min-height: 38px; align-items: center; border: 0; border-radius: 9px; padding: 8px 10px; background: transparent; text-align: left; color: var(--muted); font-size: 13px; transition: background .18s var(--ease), color .18s var(--ease); }
.sort-options button:hover, .sort-options button:focus-visible { background: rgba(139,123,255,.12); color: var(--text); outline: none; }
.sort-options button[aria-selected="true"] { color: var(--a2); background: rgba(56,232,200,.08); }
.sort-options button[aria-selected="true"]::after { content: "✓"; margin-left: auto; }
@keyframes sortIn { from { opacity: 0; transform: translateY(-6px) scale(.96); } }
.uploads { max-height: min(460px, calc(100dvh - 48px)); overflow-y: auto; overscroll-behavior: contain; padding: 3px; }
.up-item { flex: none; }
.up-name { display: flex; font-size: 13px; }
.up-sub { align-items: flex-start; gap: 10px; font-family: var(--font); font-size: 12px; color: var(--muted); }
.up-size { flex: none; }
.up-actions { display: flex; gap: 14px; align-items: center; margin-top: 10px; font-size: 12px; }
.up-dismiss { border: 0; background: none; color: var(--muted); padding: 3px 0; margin-left: auto; font-size: 12px; }
.up-item.done { animation: slideUp .4s var(--spring) both; }
.up-item.done .up-bar { display: none; }
.field textarea { width: 100%; resize: vertical; font-family: var(--mono); font-size: 13px; line-height: 1.6; padding: 12px; border: 1px solid var(--stroke-strong); border-radius: 12px; color: var(--text); background: rgba(255,255,255,.04); overflow-wrap: anywhere; }
#copyHint { font-size: 13px; line-height: 1.7; }
.file-preview { max-width: min(500px, 88vw); text-align: center; color: #d8ddec; }
.file-preview .fileicon { width: 48px; height: 48px; color: #b5abff; }
.file-preview p { font-size: 16px; overflow-wrap: anywhere; line-height: 1.6; }
.file-preview span { font-size: 13px; color: #aeb6ce; }
.modal-card { max-height: calc(100dvh - 48px); overflow-y: auto; }
.lb-stage iframe { max-height: calc(100dvh - 140px); }
@media (prefers-color-scheme: light) {
  :root { --muted: #4d5872; --faint: #59657e; }
  .thumb .fileicon { color: #5b627e; filter: none; }
  .sort-button, .field textarea { background: rgba(255,255,255,.85); }
  .sort-options button[aria-selected="true"] { background: rgba(15,158,152,.1); }
  .up-item.failed .up-pct { color: #ba2842; }
}
@media (hover: none) { .card-actions { opacity: 1; transform: none; } }
@media (max-width: 720px) {
  .topbar { gap: 14px; margin-bottom: 18px; }
  .top-actions { flex-wrap: wrap; gap: 8px; width: 100%; }
  .pill span { display: inline; }
  .pill { padding: 8px 10px; font-size: 12px; }
  .dropzone { padding: 18px; }
  .dz-inner { grid-template-columns: 36px minmax(0, 1fr); column-gap: 12px; }
  .dz-icon { width: 36px; height: 36px; }
  .dropzone h2 { font-size: 16px; }
  .public-note { font-size: 11.5px; line-height: 1.5; }
  .library { margin-top: 24px; }
  .tools { width: 100%; gap: 8px; flex-wrap: nowrap; }
  .search { flex: 1; min-width: 72px; padding: 0 10px; gap: 6px; }
  .search input { width: 100%; min-width: 0; font-size: 13px; }
  .sort-button { min-width: 112px; gap: 8px; padding: 8px 10px; font-size: 12px; }
  .view-toggle { flex: none; }
  .view-toggle button { width: 29px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 10px; }
  .card-body { padding: 11px 12px 12px; }
  .card-name { font-size: 13.5px; }
  .card-meta { flex-wrap: wrap; gap: 4px; font-size: 12px; }
  .grid.list .card { padding: 10px; gap: 10px; }
  .grid.list .card-body { grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; }
  .grid.list .card-meta { grid-column: 1; grid-row: 2; margin-top: 0; }
  .grid.list .list-actions { grid-column: 2; grid-row: 1 / 4; gap: 5px; }
  .grid.list .badge-up { grid-column: 1; grid-row: 3; }
  .grid.list .thumb { width: 34px; height: 34px; }
  .list-actions .act { width: 30px; height: 32px; }
  .uploads { max-height: min(350px, 48dvh); }
  .modal { padding: 16px; }
  .modal-card { max-height: calc(100dvh - 32px); padding: 22px 20px; }
  .code-item { flex-wrap: wrap; gap: 8px; }
  .code-meta { width: 100%; order: 5; font-size: 11.5px; }
  .setting-row { flex-wrap: wrap; gap: 7px; }
  .lb-stage { padding: 64px 16px 16px; }
  .lb-bar > span { white-space: normal; overflow-wrap: anywhere; }
  .toast { max-width: calc(100vw - 32px); line-height: 1.5; border-radius: 16px; }
}

/* ---------- 文件夹与管理员范围 ---------- */
.folder-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.breadcrumbs { display: flex; align-items: center; gap: 12px; min-width: 0; font-size: 13px; }
.breadcrumbs button { flex: none; border: 0; background: none; padding: 6px 0; color: var(--muted); font-size: 13px; }
.breadcrumbs button[aria-current="page"] { color: var(--text); font-weight: 600; }
#folderCrumb { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
#folderCrumb::before { content: "/"; color: var(--muted); padding-right: 12px; }
.folder-admin { display: flex; gap: 8px; flex: none; }
.folder-admin .btn { padding: 8px 11px; font-size: 12px; }
.folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 12px; margin-bottom: 18px; }
.folders:empty { display: none; }
.folder-tile { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; grid-template-rows: 24px 22px; align-items: center; align-content: center; column-gap: 12px; row-gap: 4px; min-width: 0; min-height: 100px; padding: 18px; border: 1px solid var(--stroke); border-radius: 16px; background: var(--panel); color: var(--text); text-align: left; backdrop-filter: blur(18px); transition: transform .35s var(--ease), border-color .25s var(--ease), background .25s var(--ease); animation: riseIn .35s var(--ease) both; }
.folder-tile:hover { transform: translateY(-3px); border-color: var(--stroke-strong); background: rgba(139,123,255,.09); }
.folder-tile svg { grid-column: 1; grid-row: 1 / 3; width: 40px; height: 40px; color: var(--a1); }
.folder-title { grid-column: 2 / -1; grid-row: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; line-height: 24px; font-weight: 600; }
.folder-count { grid-column: 2; grid-row: 2; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 13px; line-height: 22px; }
.folder-tile .visibility-badge { grid-column: 3; grid-row: 2; white-space: nowrap; font-size: 11px; line-height: 18px; padding: 2px 8px; }
.visibility-badge { flex: none; display: inline-flex; align-items: center; padding: 1px 6px; border-radius: 6px; font-size: 10.5px; line-height: 1.6; font-family: var(--font); font-weight: 500; color: var(--muted); background: rgba(255,255,255,.05); }
.visibility-badge.private { color: #c3baff; background: rgba(139,123,255,.12); }
.visibility-badge.public { color: var(--muted); }
.card-meta .visibility-badge { margin-left: auto; }
.upload-destination { display: flex; align-items: center; gap: 9px; margin-bottom: 18px; font-size: 12px; color: var(--muted); }
.upload-destination select { max-width: min(300px, 48vw); padding: 7px 10px; font-size: 12px; border-radius: 9px; }
.upload-destination #uploadAccess { max-width: 120px; }
.grid.list .card-meta { flex-wrap: wrap; }
.grid.list .card-meta .visibility-badge { margin-left: 3px; }
#manageForm > .field { margin: 14px 0; }
.managed-name { font-size: 13px; color: var(--muted); line-height: 1.7; overflow-wrap: anywhere; }
.managed-name:empty { display: none; }
.visibility-field { margin: 18px 0 0; border: 0; padding: 0; }
.visibility-field legend { padding: 0; margin-bottom: 8px; color: var(--muted); font-size: 12.5px; }
.visibility-switch { display: flex; gap: 8px; }
.visibility-switch label { display: flex; flex: 1; align-items: center; justify-content: center; gap: 7px; padding: 10px 12px; border: 1px solid var(--stroke); border-radius: 12px; font-size: 13px; cursor: pointer; transition: background .25s var(--ease), border-color .25s var(--ease); }
.visibility-switch label:has(input:checked) { background: rgba(139,123,255,.12); border-color: rgba(139,123,255,.5); }
.visibility-switch label:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.visibility-switch input { width: 14px; height: 14px; margin: 0; accent-color: var(--a1); }
#visibilityHint { min-height: 0; font-size: 12px; margin-bottom: 0; }
#manageError { font-size: 12px; color: var(--danger); }
#manageDelete { margin-right: auto; }
#publishText { font-size: 13px; line-height: 1.7; }
@media (prefers-color-scheme: light) {
  .visibility-badge { background: rgba(16,22,45,.04); }
  .visibility-badge.private { color: #5c49ac; background: rgba(107,91,230,.1); }
}
@media (max-width: 720px) {
  .folder-toolbar { flex-wrap: wrap; gap: 8px; }
  .folder-admin { margin-left: auto; }
  .folders { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 10px; }
  .folder-tile { grid-template-columns: 36px minmax(0, 1fr) auto; min-height: 96px; padding: 16px; column-gap: 12px; }
  .folder-tile svg { width: 36px; height: 36px; }
  .upload-destination { flex-wrap: wrap; gap: 7px; }
  .upload-destination select { max-width: 52vw; }
  #manageForm .modal-actions { flex-wrap: wrap; gap: 8px; }
  #manageForm .modal-actions .btn { padding: 9px 11px; font-size: 13px; }
  .card-meta .visibility-badge { margin-left: 0; }
}
/* Hub workspace retains Files components and Vault motion language. */
:root { --ease: cubic-bezier(.22,1,.36,1); }
.app { animation:none; }
.topbar { position:sticky; top:12px; z-index:20; padding:14px 18px; background:var(--panel); backdrop-filter:blur(24px); border:1px solid var(--stroke); border-radius:24px; }
.hub-nav { display:flex; flex-wrap:wrap; gap:8px; margin:24px 0; }
.hub-nav button,.hub-nav a { font:inherit; font-size:14px; color:var(--muted); padding:11px 20px; border-radius:999px; border:1px solid var(--stroke); background:var(--panel); text-decoration:none; cursor:pointer; transition:background .45s var(--ease),color .45s var(--ease); }
.hub-nav [aria-pressed=true] { color:var(--text); border-color:var(--a1); background:var(--bg-2); }
.hub-nav a[aria-disabled] { opacity:.6; cursor:default; }
.hub-nav :focus-visible { outline:2px solid var(--a2); outline-offset:3px; }
.hub-context { min-height:112px; padding:8px 4px 22px; }
.hub-context h2 { font-size:28px; margin:0 0 10px; letter-spacing:-.02em; }
.hub-context p { color:var(--muted); font-size:14px; line-height:1.7; margin:0; max-width:65ch; }
@media(max-width:600px) { .topbar { top:6px; padding:12px; } .hub-nav { gap:6px; } .hub-nav button,.hub-nav a { padding:10px 14px; } .hub-context { min-height:140px; } }
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { animation:none!important; transition:none!important; scroll-behavior:auto!important; } }
.hub-nav [aria-pressed=true] { background:var(--panel); color:var(--text); box-shadow:inset 0 0 0 1px var(--a1); }
