/* PAN4LAB 网盘 样式 */
:root {
  --bg: #0f1220;
  --bg-soft: #161a2c;
  --bg-elev: #1c2137;
  --line: #2a3050;
  --text: #e8ecf8;
  --text-dim: #98a1c4;
  --accent: #4f7cff;
  --accent-soft: rgba(79, 124, 255, .15);
  --danger: #ef5350;
  --ok: #46c47c;
  --radius: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .38);
}

* { box-sizing: border-box; }

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

body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC",
        "PingFang SC", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
.spacer { flex: 1 1 auto; }

/* ------------------------------ 按钮 ------------------------------ */
.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s, border-color .15s, opacity .15s, transform .05s;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { background: #232a45; border-color: #3a4472; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .42; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover:not(:disabled) { background: #6a90ff; border-color: #6a90ff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-dim); }
.btn.ghost:hover:not(:disabled) { background: var(--bg-elev); color: var(--text); }
.btn.danger { border-color: #6a2a30; color: #ff9a97; }
.btn.danger:hover:not(:disabled) { background: #3a1c22; }
.btn.sm { padding: 6px 11px; font-size: 12.5px; }
.btn.block { width: 100%; padding: 11px; font-size: 14px; }

/* ------------------------------ 登录 ------------------------------ */
.login-wrap {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(1100px 620px at 20% -10%, #1c2450 0%, var(--bg) 60%);
}
.login-card {
  width: 100%;
  max-width: 350px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 30px 26px 24px;
  box-shadow: var(--shadow);
}
.login-logo {
  font-size: 23px;
  font-weight: 700;
  letter-spacing: .09em;
  color: #fff;
}
.login-sub { margin: 6px 0 22px; color: var(--text-dim); font-size: 13px; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 12.5px; color: var(--text-dim); margin-bottom: 6px; }
.field input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #10142a;
  color: var(--text);
  font-size: 14px;
  outline: none;
}
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.check { display: flex; align-items: center; gap: 7px; color: var(--text-dim); font-size: 12.5px; margin-bottom: 18px; }
.login-err { color: #ff8e8a; font-size: 12.5px; min-height: 18px; margin: 10px 0 0; text-align: center; }

/* ------------------------------ 顶栏 ------------------------------ */
.app { height: 100%; display: flex; flex-direction: column; }
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 18px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.brand { font-weight: 700; letter-spacing: .05em; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.search { display: flex; gap: 6px; flex: 0 1 420px; }
.search input {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #10142a;
  color: var(--text);
  outline: none;
  font-size: 13px;
}
.search input:focus { border-color: var(--accent); }
.storage { color: var(--text-dim); font-size: 12.5px; white-space: nowrap; }
.user { display: flex; align-items: center; gap: 8px; color: var(--text-dim); font-size: 12.5px; white-space: nowrap; }

/* ------------------------------ 面包屑 / 工具栏 ------------------------------ */
.crumbbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
  overflow: hidden;
}
.crumbs { display: flex; align-items: center; gap: 3px; overflow-x: auto; scrollbar-width: none; }
.crumbs::-webkit-scrollbar { display: none; }
.crumbs a {
  color: var(--text-dim);
  text-decoration: none;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
  cursor: pointer;
  font-size: 13px;
}
.crumbs a:hover { background: var(--bg-elev); color: var(--text); }
.crumbs a.current { color: var(--text); font-weight: 600; }
.crumbs .sep { color: #4a5378; }

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  flex: 0 0 auto;
  flex-wrap: wrap;
}
.selinfo { color: var(--text-dim); font-size: 12.5px; }

/* ------------------------------ 列表 ------------------------------ */
.listwrap { flex: 1 1 auto; overflow: auto; padding: 0 18px 28px; }
.filelist { width: 100%; border-collapse: collapse; }
.filelist thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg);
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  user-select: none;
}
.filelist th.sortable { cursor: pointer; }
.filelist th.sortable:hover { color: var(--text); }
.filelist th.sorted::after { content: " \25B4"; font-size: 10px; }
.filelist th.sorted.desc::after { content: " \25BE"; }
.filelist td { padding: 7px 10px; border-bottom: 1px solid #20263e; vertical-align: middle; }
.filelist tbody tr:hover { background: #171c30; }
.filelist tbody tr.selected { background: var(--accent-soft); }
.c-check { width: 34px; }
.c-size { width: 104px; }
.c-time { width: 168px; }
.c-act { width: 190px; }

.fname { display: flex; align-items: center; gap: 9px; min-width: 0; }
.fname .ico { width: 20px; text-align: center; font-size: 16px; flex: 0 0 auto; }
.fname .txt {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.fname .txt:hover { color: #9db6ff; text-decoration: underline; }
.fname .txt.dir { font-weight: 600; }
.fname .badge { font-size: 10px; color: var(--text-dim); border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; }
.muted { color: var(--text-dim); font-size: 12.5px; }
.actions { display: flex; gap: 4px; justify-content: flex-end; }
.actions button {
  border: none;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px 7px;
  border-radius: 6px;
  font-size: 12.5px;
}
.actions button:hover { background: var(--bg-elev); color: var(--text); }
.actions button.del:hover { background: #3a1c22; color: #ff9a97; }
.empty { text-align: center; color: var(--text-dim); padding: 60px 10px; font-size: 13.5px; }

/* ------------------------------ 拖拽 & 上传面板 ------------------------------ */
.drop-overlay {
  position: fixed;
  inset: 0;
  background: rgba(79, 124, 255, .16);
  backdrop-filter: blur(2px);
  border: 3px dashed var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  font-size: 19px;
  font-weight: 600;
  pointer-events: none;
}

.uploads {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 350px;
  max-height: 46vh;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  z-index: 50;
}
.uploads-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.uploads-body { overflow: auto; padding: 8px 12px 12px; }
.up-item { margin-bottom: 11px; }
.up-item .row { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.up-item .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-item .st { color: var(--text-dim); flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.up-item.error .st { color: #ff8e8a; }
.up-item.done .st { color: var(--ok); }
.bar { height: 5px; background: #232a45; border-radius: 3px; overflow: hidden; margin-top: 5px; }
.bar > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .18s; }
.up-item.done .bar > i { background: var(--ok); }
.up-item.error .bar > i { background: var(--danger); }

/* ------------------------------ 弹窗 ------------------------------ */
.modal { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; }
.modal-mask { position: absolute; inset: 0; background: rgba(6, 8, 18, .72); }
.modal-box {
  position: relative;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  width: min(1000px, 92vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  font-size: 13.5px;
}
.modal-head > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-tools { margin-left: auto; display: flex; gap: 6px; }
.modal-body { padding: 16px; overflow: auto; }
.modal-body img, .modal-body video { max-width: 100%; max-height: 74vh; display: block; margin: 0 auto; border-radius: 8px; }
.modal-body iframe { width: 100%; height: 74vh; border: 0; border-radius: 8px; background: #fff; }
.modal-body pre {
  margin: 0;
  background: #10142a;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  overflow: auto;
  max-height: 70vh;
  font: 12.5px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}
.modal-body textarea {
  width: 100%;
  min-height: 58vh;
  background: #10142a;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  padding: 14px;
  font: 12.5px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  outline: none;
  resize: vertical;
}
.modal-body textarea:focus { border-color: var(--accent); }
.dlg { min-width: 330px; }
.dlg p { margin: 0 0 12px; color: var(--text-dim); font-size: 13px; }
.dlg input[type=text] {
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #10142a;
  color: var(--text);
  outline: none;
  font-size: 14px;
}
.dlg input[type=text]:focus { border-color: var(--accent); }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* ------------------------------ Toast ------------------------------ */
.toasts { position: fixed; left: 50%; top: 18px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 16px;
  font-size: 13px;
  box-shadow: var(--shadow);
  animation: toastin .18s ease-out;
  max-width: 70vw;
}
.toast.err { border-color: #6a2a30; color: #ffc0be; }
.toast.ok { border-color: #245c3d; color: #b6f0cf; }
@keyframes toastin { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

@media (max-width: 760px) {
  .c-time { display: none; }
  .search { flex: 1 1 auto; }
  .storage { display: none; }
  .uploads { left: 12px; right: 12px; width: auto; }
}
/* ------------------------------ 登录 / 注册 ------------------------------ */
.tabs {
  display: flex;
  gap: 4px;
  background: #10142a;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 3px;
  margin-bottom: 18px;
}
.tab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-dim);
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 13.5px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--accent); color: #fff; }
.login-hint { color: var(--text-dim); font-size: 12px; margin: 12px 0 0; line-height: 1.55; }
.user .badge {
  font-size: 10px;
  color: var(--text-dim);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0 5px;
}
.dlg input[type=password] {
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #10142a;
  color: var(--text);
  outline: none;
  font-size: 14px;
}
.dlg input[type=password]:focus { border-color: var(--accent); }
/* ------------------------------ 管理员面板 / 限额 ------------------------------ */
.limits { color: var(--text-dim); font-size: 12.5px; white-space: nowrap; }
.admin-wrap { min-width: 640px; }
.admin-sec { margin-bottom: 20px; }
.admin-sec h4 { margin: 0 0 10px; font-size: 13.5px; color: var(--text); }
.admin-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.admin-head h4 { margin: 0; }
.admin-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.usertable { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.usertable th {
  text-align: left;
  color: var(--text-dim);
  font-weight: 600;
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.usertable td { padding: 6px 8px; border-bottom: 1px solid #20263e; vertical-align: middle; }
.usertable .pw { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.usertable .badge {
  font-size: 10px;
  color: var(--text-dim);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0 5px;
  margin-left: 6px;
}
.mini {
  border: none;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: 11.5px;
  padding: 2px 5px;
  border-radius: 5px;
}
.mini:hover { background: var(--bg-elev); }
@media (max-width: 760px) {
  .admin-wrap { min-width: 0; }
  .admin-grid { grid-template-columns: 1fr; }
}