/* =========================================================
   FileBridge · 玻璃拟态主题
   ========================================================= */
:root {
  --text: #eaf0ff;
  --muted: rgba(186, 200, 226, .62);
  --dim: rgba(186, 200, 226, .42);
  --accent: #5b8cff;
  --accent-2: #a06bff;
  --green: #37d68b;
  --red: #ff6b7d;
  --amber: #ffb454;
  --glass: rgba(255, 255, 255, .07);
  --glass-2: rgba(255, 255, 255, .045);
  --line: rgba(255, 255, 255, .12);
  --line-soft: rgba(255, 255, 255, .07);
  --radius: 22px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: #070b14;
  color: var(--text);
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button { cursor: pointer; }

/* ---------------- 背景光斑 ---------------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(1200px 700px at 15% -10%, rgba(91, 140, 255, .20), transparent 60%),
    radial-gradient(1000px 600px at 100% 0%, rgba(160, 107, 255, .16), transparent 55%),
    radial-gradient(900px 700px at 50% 120%, rgba(43, 200, 200, .10), transparent 60%);
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .55;
  will-change: transform;
}

.blob.b1 {
  width: 520px; height: 520px;
  left: -140px; top: -120px;
  background: radial-gradient(circle, rgba(91, 140, 255, .85), transparent 65%);
  animation: float1 22s ease-in-out infinite;
}

.blob.b2 {
  width: 460px; height: 460px;
  right: -120px; top: 40px;
  background: radial-gradient(circle, rgba(160, 107, 255, .8), transparent 65%);
  animation: float2 26s ease-in-out infinite;
}

.blob.b3 {
  width: 480px; height: 480px;
  left: 45%; bottom: -220px;
  background: radial-gradient(circle, rgba(50, 210, 210, .55), transparent 65%);
  animation: float3 30s ease-in-out infinite;
}

@keyframes float1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(70px, 50px) scale(1.08); }
}
@keyframes float2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-60px, 70px) scale(1.1); }
}
@keyframes float3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-90px, -50px) scale(1.12); }
}

/* ---------------- 玻璃容器 ---------------- */
.glass {
  background: linear-gradient(158deg, rgba(255, 255, 255, .085), rgba(255, 255, 255, .032));
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, .45),
    0 2px 6px rgba(0, 0, 0, .25),
    inset 0 1px 0 rgba(255, 255, 255, .16);
}

/* ---------------- 布局 ---------------- */
.app {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 26px 22px 70px;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  margin-bottom: 22px;
  border-radius: 20px;
  background: linear-gradient(158deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .025));
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid var(--line-soft);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .14);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .3px;
}

.brand .logo {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: linear-gradient(135deg, #5b8cff, #a06bff);
  display: grid;
  place-items: center;
  box-shadow: 0 10px 26px rgba(91, 140, 255, .45), inset 0 1px 0 rgba(255, 255, 255, .35);
}

.brand small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: .7px;
  margin-top: 2px;
}

.topbar .spacer { flex: 1; }

.who {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 6px 14px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  backdrop-filter: blur(10px);
}

.who .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(55, 214, 139, .2), 0 0 12px rgba(55, 214, 139, .8);
}

.chip-admin {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 180, 84, .28), rgba(255, 107, 125, .22));
  border: 1px solid rgba(255, 180, 84, .35);
  color: #ffd9a3;
  font-weight: 600;
}

.grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 880px) {
  .grid { grid-template-columns: 1fr; }
}

.card { overflow: hidden; }

.card-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: .3px;
}

.card-head .count {
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  background: rgba(255, 255, 255, .08);
  border: 1px solid var(--line-soft);
  padding: 2px 10px;
  border-radius: 999px;
}

.card-body { padding: 16px 18px; }

/* ---------------- 在线用户 ---------------- */
.users { max-height: 470px; overflow-y: auto; }

.user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 14px;
  transition: background .18s, transform .18s;
  cursor: pointer;
}

.user:hover {
  background: rgba(255, 255, 255, .06);
  transform: translateX(2px);
}

.user.is-me { opacity: .55; cursor: default; }
.user.is-me:hover { transform: none; }

.avatar {
  width: 36px; height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  flex: none;
  background: linear-gradient(135deg, #5b8cff, #a06bff);
  box-shadow: 0 6px 16px rgba(91, 140, 255, .35), inset 0 1px 0 rgba(255, 255, 255, .35);
}

.user .meta { min-width: 0; }

.user .name {
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 165px;
}

.user .sub { font-size: 11px; color: var(--dim); margin-top: 2px; }

.empty {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 38px 12px;
  line-height: 1.9;
}

/* ---------------- 发送区 ---------------- */
.dropzone {
  border: 1.5px dashed rgba(255, 255, 255, .16);
  border-radius: 18px;
  padding: 28px 18px;
  text-align: center;
  transition: all .18s;
  background: rgba(255, 255, 255, .025);
}

.dropzone.hot {
  border-color: rgba(91, 140, 255, .8);
  background: rgba(91, 140, 255, .12);
  box-shadow: inset 0 0 40px rgba(91, 140, 255, .15);
}

.dropzone .big {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 7px;
}

.dropzone .hint { color: var(--muted); font-size: 12.5px; line-height: 1.9; }

.dropzone .pick { margin-top: 16px; display: inline-flex; gap: 8px; }

.btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .07);
  color: var(--text);
  padding: 9px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  transition: all .16s;
  white-space: nowrap;
  backdrop-filter: blur(6px);
}

.btn:hover {
  background: rgba(255, 255, 255, .13);
  transform: translateY(-1px);
}

.btn:active { transform: translateY(0); }

.btn.primary {
  background: linear-gradient(135deg, #5b8cff, #8f6bff);
  border-color: transparent;
  box-shadow: 0 10px 24px rgba(91, 140, 255, .38), inset 0 1px 0 rgba(255, 255, 255, .3);
  font-weight: 600;
}

.btn.primary:hover { filter: brightness(1.1); }

.btn.green {
  background: linear-gradient(135deg, #22b573, #37d68b);
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 10px 22px rgba(55, 214, 139, .3);
}

.btn.red {
  background: rgba(255, 107, 125, .14);
  border-color: rgba(255, 107, 125, .4);
  color: #ff9aa5;
}

.btn.ghost { background: transparent; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.sm { padding: 6px 12px; font-size: 12.5px; border-radius: 10px; }

.send-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
  flex-wrap: wrap;
}

select, input[type="text"], input[type="password"] {
  background: rgba(8, 12, 22, .55);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 13px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  backdrop-filter: blur(8px);
}

select { min-width: 175px; }

select:focus, input:focus {
  border-color: rgba(91, 140, 255, .85);
  box-shadow: 0 0 0 3px rgba(91, 140, 255, .18);
}

/* ---------------- 传输列表 ---------------- */
.transfers { display: flex; flex-direction: column; gap: 10px; }

.tr {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 15px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: rgba(255, 255, 255, .035);
  backdrop-filter: blur(10px);
  transition: background .16s, border-color .16s;
}

.tr:hover { background: rgba(255, 255, 255, .06); }

.tr.incoming {
  border-color: rgba(255, 180, 84, .45);
  background: linear-gradient(120deg, rgba(255, 180, 84, .12), rgba(255, 107, 125, .06));
  box-shadow: 0 0 0 1px rgba(255, 180, 84, .1), 0 12px 30px rgba(255, 150, 60, .12);
}

.tr .ic {
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .07);
  border: 1px solid var(--line-soft);
  flex: none;
  font-size: 16px;
}

.tr .body { flex: 1; min-width: 0; }

.tr .title {
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tr .desc { font-size: 11.5px; color: var(--muted); margin-top: 3px; }

.tr .acts { display: flex; gap: 7px; flex: none; }

.bar {
  height: 4px;
  background: rgba(255, 255, 255, .09);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 8px;
}

.bar > i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, #5b8cff, #a06bff);
  box-shadow: 0 0 12px rgba(120, 140, 255, .8);
  transition: width .2s;
}

.tag {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid var(--line-soft);
  color: var(--muted);
  flex: none;
  white-space: nowrap;
}

.tag.ok { background: rgba(55, 214, 139, .15); border-color: rgba(55, 214, 139, .3); color: #7cf0b6; }
.tag.err { background: rgba(255, 107, 125, .15); border-color: rgba(255, 107, 125, .3); color: #ff9aa5; }
.tag.wait { background: rgba(255, 180, 84, .15); border-color: rgba(255, 180, 84, .3); color: #ffc97a; }

/* ---------------- 下载区 ---------------- */
.pkg {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, .035);
  margin-bottom: 9px;
}

.pkg .nm { flex: 1; min-width: 0; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pkg .sz { color: var(--muted); font-size: 12px; }

/* ---------------- 登录 ---------------- */
.mask {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5, 8, 15, .55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.mask.hidden { display: none; }

.login {
  width: 100%;
  max-width: 396px;
  padding: 34px 30px 28px;
  border-radius: 26px;
  background: linear-gradient(158deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .04));
  backdrop-filter: blur(30px) saturate(170%);
  -webkit-backdrop-filter: blur(30px) saturate(170%);
  border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: 0 40px 90px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .22);
  animation: pop .3s cubic-bezier(.2, .9, .3, 1.2);
}

@keyframes pop {
  from { opacity: 0; transform: translateY(16px) scale(.98); }
  to { opacity: 1; transform: none; }
}

.login .mark {
  width: 52px; height: 52px;
  margin: 0 auto 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, #5b8cff, #a06bff);
  display: grid;
  place-items: center;
  box-shadow: 0 14px 30px rgba(91, 140, 255, .45), inset 0 1px 0 rgba(255, 255, 255, .4);
}

.login h1 {
  font-size: 20px;
  margin: 0 0 6px;
  text-align: center;
  letter-spacing: .4px;
}

.login p.sub {
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  margin: 0 0 24px;
}

.field { margin-bottom: 14px; }

.field label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 7px;
  padding-left: 2px;
}

.field input {
  width: 100%;
  padding: 12px 14px;
}

.login .btn.primary {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
  padding: 12px;
  border-radius: 13px;
}

.switch {
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 18px;
}

.switch a { color: #8fb0ff; text-decoration: none; cursor: pointer; }
.switch a:hover { text-decoration: underline; }

.err-msg {
  color: #ff9aa5;
  font-size: 12.5px;
  min-height: 18px;
  margin-bottom: 6px;
  text-align: center;
}

/* ---------------- 管理面板 ---------------- */
.modal {
  width: 100%;
  max-width: 640px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  background: linear-gradient(158deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .04));
  backdrop-filter: blur(30px) saturate(170%);
  -webkit-backdrop-filter: blur(30px) saturate(170%);
  border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: 0 40px 90px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .22);
  animation: pop .28s cubic-bezier(.2, .9, .3, 1.2);
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line-soft);
}

.modal-head h2 {
  font-size: 16px;
  margin: 0;
  flex: 1;
  letter-spacing: .4px;
}

.modal-body {
  padding: 18px 24px 24px;
  overflow-y: auto;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.stat {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line-soft);
  text-align: center;
}

.stat b { display: block; font-size: 19px; font-weight: 700; letter-spacing: .5px; }
.stat span { font-size: 11.5px; color: var(--muted); }

.section-title {
  font-size: 12.5px;
  color: var(--muted);
  margin: 18px 0 10px;
  letter-spacing: .6px;
}

.invite-row { display: flex; gap: 9px; align-items: center; }
.invite-row input { flex: 1; letter-spacing: 1px; }

.user-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 13px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, .035);
  margin-bottom: 8px;
}

.user-row .nm { flex: 1; min-width: 0; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row .sub { font-size: 11px; color: var(--dim); }

.badge {
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  color: var(--muted);
  flex: none;
}

.badge.on { color: #7cf0b6; border-color: rgba(55, 214, 139, .35); background: rgba(55, 214, 139, .12); }
.badge.admin { color: #ffd9a3; border-color: rgba(255, 180, 84, .4); background: rgba(255, 180, 84, .14); }

.add-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.add-row input { flex: 1; min-width: 110px; }

/* ---------------- 提示 ---------------- */
.toasts {
  position: fixed;
  right: 22px;
  bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 90;
}

.toast {
  background: rgba(20, 26, 42, .82);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 14px;
  padding: 12px 17px;
  font-size: 13px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .1);
  max-width: 340px;
  animation: slide .24s ease-out;
}

.toast.ok { border-left-color: var(--green); }
.toast.err { border-left-color: var(--red); }
.toast.warn { border-left-color: var(--amber); }

@keyframes slide {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .16);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .26); }
::-webkit-scrollbar-track { background: transparent; }
