:root {
  --bg: #0f172a;
  --bg2: #1e293b;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --danger: #dc2626;
  --ok: #16a34a;
  --warn: #f59e0b;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  background: linear-gradient(160deg, #0f172a 0%, #1e3a8a 100%);
  color: var(--text);
  min-height: 100vh;
}
.wrap { max-width: 1040px; margin: 0 auto; padding: 32px 16px 64px; }
.card { background: var(--card); border-radius: 14px; padding: 24px; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.auth-card { max-width: 400px; margin: 8vh auto 0; }
.logo { margin: 0 0 4px; font-size: 26px; }
.sub { color: var(--muted); margin: 0 0 20px; font-size: 14px; }
h2 { font-size: 18px; margin: 0 0 12px; }
h1.page-title { color: #fff; font-size: 22px; margin: 0; }
/* 三列栅格：左右两列宽度严格相等，导航固定居中，不再受两侧内容宽度影响 */
.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.topbar .nav { justify-self: center; }
.topbar-actions { justify-self: end; display: flex; align-items: center; gap: 10px; }
@media (max-width: 760px) {
  .topbar { grid-template-columns: minmax(0, 1fr); }
  .topbar .nav { justify-self: start; flex-wrap: wrap; }
  .topbar-actions { justify-self: start; }
}
.topbar .who { color: #cbd5e1; font-size: 14px; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
input[type=text], input[type=password], input[type=number], input[type=file], select {
  width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 9px; font-size: 14px; background: #fff; color: var(--text); font-family: inherit;
}
button { font-family: inherit; cursor: pointer; border-radius: 9px; border: 1px solid var(--line); background: #fff; padding: 8px 14px; font-size: 14px; }
button.primary { width: 100%; background: var(--primary); border-color: var(--primary); color: #fff; padding: 11px; font-size: 15px; margin-top: 4px; }
button.primary:hover { background: var(--primary-dark); }
button.small { padding: 5px 10px; font-size: 13px; }
button.danger { color: var(--danger); border-color: #fecaca; }
button.ghost { background: transparent; color: #e2e8f0; border-color: #475569; }
button:disabled { opacity: .5; cursor: not-allowed; }
.msg { font-size: 13px; min-height: 18px; margin: 12px 0 0; }
.msg.err { color: var(--danger); }
.msg.ok { color: var(--ok); }
.panel { background: var(--card); border-radius: 14px; padding: 20px; margin-bottom: 18px; box-shadow: 0 12px 40px rgba(0,0,0,.18); }
.drop { border: 2px dashed #cbd5e1; border-radius: 12px; padding: 26px; text-align: center; color: var(--muted); transition: .15s; }
.drop.hover { border-color: var(--primary); background: #eff6ff; color: var(--primary); }
.progress { height: 8px; background: #e2e8f0; border-radius: 99px; margin-top: 14px; overflow: hidden; display: none; }
.progress.show { display: block; }
.progress > i { display: block; height: 100%; width: 0; background: var(--primary); transition: width .15s; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
td.actions, td.actions-cell { text-align: right; white-space: nowrap; }
td.actions button, td.actions-cell button { margin-left: 6px; }
.empty { color: var(--muted); text-align: center; padding: 26px 0; font-size: 14px; }
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.6); display: none; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 14px; padding: 22px; width: 100%; max-width: 480px; max-height: 90vh; overflow: auto; }
.modal.wide { max-width: 860px; }
.share-link { display: flex; gap: 8px; margin-top: 8px; }
.share-link input { margin-top: 0; font-size: 13px; }
.file-meta { color: var(--muted); font-size: 14px; line-height: 1.9; }
.big-name { font-size: 19px; font-weight: 600; word-break: break-all; }
.center { text-align: center; }
.mt { margin-top: 16px; }

/* ---------- 导航 ---------- */
.nav { display: flex; gap: 6px; }
.nav-link { color: #cbd5e1; text-decoration: none; padding: 6px 14px; border-radius: 8px; font-size: 14px; border: 1px solid #475569; }
.nav-link.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- 工具栏与标签 ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input[type=text] { width: auto; flex: 1; min-width: 150px; margin-top: 0; }
.toolbar select { width: auto; margin-top: 0; }
.chip { padding: 8px 16px; border-radius: 99px; border: 1px solid var(--line); background: #f8fafc; font-size: 13px; }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; font-size: 13px; color: var(--muted); gap: 10px; }
.tag { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 99px; background: #f1f5f9; color: #475569; margin-left: 6px; }
.tag.warn { background: #fef3c7; color: #92400e; }
.tag.info { background: #eff6ff; color: var(--primary); }
.tag.ok { background: #dcfce7; color: #15803d; }
.link-cell { color: var(--muted); font-size: 12px; word-break: break-all; max-width: 260px; display: inline-block; }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ---------- 面包屑 ---------- */
.breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: 14px; margin-bottom: 14px; }
.crumb { background: none; border: none; color: var(--primary); padding: 4px 6px; font-size: 14px; border-radius: 6px; }
.crumb:hover { background: #eff6ff; }
.crumb.current { color: var(--text); font-weight: 600; }
.crumb-sep { color: var(--muted); }

/* ---------- 文件夹行 ---------- */
.folder-row { cursor: pointer; }
.folder-row:hover td { background: #f8fafc; }
.folder-name { font-weight: 500; }
.folder-icon { margin-right: 8px; }

/* ---------- 空间进度条 ---------- */
.storage-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.storage-title { font-size: 15px; font-weight: 600; margin: 0; }
.storage-text { font-size: 13px; color: var(--muted); }
.storage-bar { height: 12px; background: #e2e8f0; border-radius: 99px; overflow: hidden; margin-top: 10px; }
.storage-bar > i { display: block; height: 100%; width: 0; background: var(--ok); transition: width .3s; }
.storage-bar > i.warn { background: var(--warn); }
.storage-bar > i.danger { background: var(--danger); }

/* ---------- 预览 ---------- */
.preview-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.preview-name { font-size: 15px; font-weight: 600; word-break: break-all; }
.preview-body { text-align: center; }
.preview-img { max-width: 100%; max-height: 66vh; border-radius: 10px; }
.preview-text {
  text-align: left; white-space: pre-wrap; word-break: break-all;
  background: #f8fafc; border: 1px solid var(--line); border-radius: 10px;
  padding: 14px; font-size: 13px; line-height: 1.6; max-height: 60vh; overflow: auto;
  font-family: Consolas, Menlo, monospace; margin: 0;
}

/* ---------- 移动目标选择 ---------- */
.move-list { max-height: 50vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; margin-top: 10px; }
.move-item { display: block; width: 100%; text-align: left; border: none; border-bottom: 1px solid var(--line); border-radius: 0; padding: 10px 12px; background: #fff; font-size: 14px; }
.move-item:last-child { border-bottom: none; }
.move-item:hover { background: #eff6ff; color: var(--primary); }
/* ---------- 顶部：名称 + 迷你容量条 ---------- */
.topbar-left { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.storage-mini { display: flex; align-items: center; gap: 9px; }
.storage-mini-main { display: flex; flex-direction: column; gap: 3px; }
.storage-mini-text { font-size: 11px; color: #cbd5e1; line-height: 1.1; white-space: nowrap; min-width: 172px; }
button.danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
button.danger-solid:hover { background: #b91c1c; }
.storage-mini-bar { width: 96px; height: 8px; background: rgba(255,255,255,.22); border-radius: 99px; overflow: hidden; }
.storage-mini-bar > i { display: block; height: 100%; width: 0; background: #22c55e; transition: width .3s; }
.storage-mini-bar > i.warn { background: var(--warn); }
.storage-mini-bar > i.danger { background: var(--danger); }
.refresh-circle {
  width: 24px; height: 24px; padding: 0; border-radius: 50%; border: 1px solid #475569;
  background: transparent; color: #cbd5e1; font-size: 13px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.refresh-circle:hover { background: rgba(255,255,255,.14); }
.refresh-circle.spinning { animation: spin .9s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ---------- 拖拽提示（跟随光标） ---------- */
.drag-label {
  position: fixed; z-index: 200; display: none; padding: 6px 12px; border-radius: 8px;
  background: var(--primary); color: #fff; font-size: 13px; pointer-events: none;
  box-shadow: 0 6px 18px rgba(0,0,0,.35); white-space: nowrap;
}

/* ---------- 合并后的列表 ---------- */
.row-folder { cursor: pointer; }
.row-folder:hover td { background: #f8fafc; }
.row-file:hover td { background: #fbfdff; }
.icon { margin-right: 8px; }
.toolbar .progress { flex: 1 0 100%; margin-top: 2px; }
/* ---------- 多选与批量操作 ---------- */
th.sel-col, td.sel-col { width: 34px; padding-right: 0; text-align: center; }
td.sel-col input, th.sel-col input { width: 15px; height: 15px; margin: 0; cursor: pointer; vertical-align: middle; }
.batch-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 10px;
  padding: 8px 12px; margin-bottom: 12px;
}
.batch-count { font-size: 13px; color: var(--primary); font-weight: 600; margin-right: 4px; }
.share-textarea {
  width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 9px; font-size: 12px; line-height: 1.6; font-family: Consolas, Menlo, monospace;
  resize: vertical; background: #f8fafc; color: var(--text);
}
/* ---------- 行内图标按钮与"更多"菜单 ---------- */
.icon-btn {
  width: 30px; height: 28px; padding: 0; margin-left: 5px; font-size: 14px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: #fff; border-radius: 8px; vertical-align: middle;
}
.icon-btn:hover:not(:disabled) { background: #eff6ff; border-color: #bfdbfe; }
.icon-btn.danger:hover:not(:disabled) { background: #fef2f2; border-color: #fecaca; }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.action-menu {
  position: fixed; z-index: 210; min-width: 148px; padding: 5px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(15,23,42,.2);
}
.action-menu-item {
  display: block; width: 100%; text-align: left; border: none; border-radius: 7px;
  padding: 8px 10px; background: #fff; font-size: 13px; color: var(--text);
}
.action-menu-item:hover { background: #eff6ff; color: var(--primary); }
.action-menu-item.danger { color: var(--danger); }
.action-menu-item.danger:hover { background: #fef2f2; }
.toolbar-sep { width: 1px; height: 22px; background: #cbd5e1; margin: 0 2px; }
/* ---------- 顶部栏图标按钮（账号设置 / 退出登录） ---------- */
.topbar-icon {
  width: 34px; height: 34px; padding: 0; border-radius: 50%;
  border: 1px solid #475569; background: transparent; color: #e2e8f0;
  font-size: 16px; line-height: 1; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.topbar-icon:hover { background: rgba(255,255,255,.16); }
.topbar-icon.active { background: var(--primary); border-color: var(--primary); }
