/* 文件行 */
.row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  cursor: pointer; border-bottom: 1px solid #f3f4f6;
  user-select: none; transition: background .12s;
}
.row:hover { background: var(--bg-2); }
.row .icon { color: var(--text-2); flex-shrink: 0; }
.row-folder .icon { color: var(--primary); }
.row-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.row-size { color: var(--text-3); font-size: 12px; flex-shrink: 0; }
.row-sub { color: var(--text-3); font-size: 12px; }
.row-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.row-main .row-name { flex: none; }

/* 侧栏工具栏 */
.sidebar-toolbar { padding: 8px 12px; display: flex; gap: 6px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.sidebar-toolbar button {
  flex: 1; min-width: 0; height: 32px; padding: 0 4px;
  border-radius: 6px; background: var(--bg-2); color: var(--text);
  font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-toolbar button:hover { background: var(--primary-bg); color: var(--primary); }

/* 右键菜单 */
.ctx-menu {
  position: fixed; z-index: 1000;
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 4px; min-width: 160px;
}
.ctx-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.ctx-item:hover { background: var(--bg-2); }
.ctx-item.danger { color: var(--danger); }
.ctx-item .icon { width: 16px; height: 16px; color: var(--text-2); }
.ctx-item.danger .icon { color: var(--danger); }
.ctx-sep { height: 1px; background: var(--line); margin: 4px 8px; }

/* 弹窗 */
#modal-mask {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, .35);
  z-index: 1100; display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.modal {
  background: #fff; border-radius: 12px; padding: 24px;
  width: 440px; max-width: 100%;
  box-shadow: 0 8px 32px rgba(15, 23, 42, .16);
}
.modal.modal-lg { width: 560px; }
.modal h3 { margin: 0 0 12px; font-size: 16px; }
.modal p { margin: 0 0 20px; color: var(--text-2); line-height: 1.6; word-break: break-all; }
.modal-input {
  width: 100%; height: 38px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 6px; margin-bottom: 14px;
}
.modal-input:focus { outline: 0; border-color: var(--primary); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.modal-actions button { height: 34px; padding: 0 16px; border-radius: 6px; font-size: 13px; }
.btn-ok { background: var(--primary); color: #fff; }
.btn-ok:hover { background: var(--primary-hover); }
.btn-ok.btn-danger { background: var(--danger); color: #fff; }
.btn-ok.btn-danger:hover { background: #b91c1c; color: #fff; }
.btn-cancel { background: var(--bg-2); color: var(--text); }
.btn-cancel:hover { background: var(--line); }

/* 远程上传弹窗 */
.remote-label { display: block; font-size: 12px; color: var(--text-2); margin: 4px 0 4px; }
.remote-req { color: var(--danger); margin-left: 2px; }
.remote-tip { font-size: 12px; color: var(--text-3); line-height: 1.5; margin-bottom: 16px; }

/* 文件夹选择器 */
.pick-board-tabs {
  display: flex; gap: 4px; margin-bottom: 12px; padding: 4px;
  background: var(--bg-2); border-radius: 8px; flex-wrap: wrap;
}
.pick-board-tab {
  flex: 1; min-width: 56px; height: 30px; padding: 0 8px;
  border-radius: 6px; font-size: 12px; color: var(--text-2);
  cursor: pointer; transition: background .12s, color .12s;
}
.pick-board-tab:hover { background: #fff; color: var(--text); }
.pick-board-tab.active {
  background: #fff; color: var(--primary); font-weight: 600;
  box-shadow: 0 1px 3px rgba(15,23,42,.06);
}
.pick-breadcrumb {
  padding: 8px 12px; background: var(--bg-2); border-radius: 6px;
  font-size: 12px; margin-bottom: 8px; word-break: break-all;
}
.pick-breadcrumb a { cursor: pointer; color: var(--text-2); }
.pick-breadcrumb a:hover { color: var(--primary); }
.pick-list {
  max-height: 320px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: 6px; margin-bottom: 16px;
}
.pick-item {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; cursor: pointer;
  border-bottom: 1px solid #f3f4f6; font-size: 13px;
}
.pick-item:hover { background: var(--bg-2); }
.pick-item .icon { color: var(--primary); }

/* 登录/安装 */
#auth-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .6);
  z-index: 1200; display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.auth-card {
  background: #fff; border-radius: 12px; padding: 32px;
  width: 380px; max-width: 100%;
  box-shadow: 0 8px 32px rgba(15, 23, 42, .2);
}
.auth-card h2 { margin: 0 0 20px; font-size: 20px; }
.auth-card form { display: flex; flex-direction: column; gap: 12px; }
.auth-card input { height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; }
.auth-card input:focus { outline: 0; border-color: var(--primary); }
.auth-card button[type=submit] {
  height: 40px; border-radius: 6px;
  background: var(--primary); color: #fff; font-weight: 600; margin-top: 8px;
}
.auth-card button[type=submit]:hover { background: var(--primary-hover); }
.auth-error { color: var(--danger); font-size: 12px; min-height: 16px; }

/* 上传队列 - 右下角浮动框 */
#upload-queue {
  position: fixed; right: 16px; bottom: 16px;
  width: 360px; max-width: calc(100vw - 32px);
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px; z-index: 1050;
}
.uq-title { font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.uq-item { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.uq-item:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.uq-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.uq-name { flex: 1; font-size: 12px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 4px; }
.uq-tag {
  display: inline-block; font-size: 10px; font-weight: 600;
  padding: 1px 4px; border-radius: 3px;
  background: #E0E7FF; color: #3730A3; flex-shrink: 0;
}
.uq-tag-remote { background: #FEF3C7; color: #92400E; }
.uq-tag-instant { background: #D1FAE5; color: #065F46; }
.uq-actions { display: flex; gap: 4px; flex-shrink: 0; }
.uq-btn {
  width: 26px; height: 26px; border-radius: 4px;
  background: var(--bg-2); color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .12s, color .12s;
}
.uq-btn:hover { background: var(--primary-bg); color: var(--primary); }
.uq-btn-danger { background: #fef2f2; color: var(--danger); }
.uq-btn-danger:hover { background: #fee2e2; color: var(--danger); }
.uq-btn .icon { width: 14px; height: 14px; }
.uq-meta { font-size: 11px; color: var(--text-3); margin-bottom: 6px; }
.uq-bar { height: 4px; background: var(--bg-2); border-radius: 2px; overflow: hidden; }
.uq-bar-fill { height: 100%; background: var(--primary); width: 0; transition: width .2s; }
.uq-pct { font-size: 11px; color: var(--text-3); margin-top: 3px; }

/* 上传队列 - 左侧栏列表 */
.upload-row { padding: 10px 14px; border-bottom: 1px solid #f3f4f6; cursor: pointer; user-select: none; transition: background .12s; }
.upload-row:hover { background: var(--bg-2); }
.upload-row-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.upload-row-name { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 4px; }
.upload-row-state { font-size: 11px; padding: 2px 6px; border-radius: 4px; flex-shrink: 0; font-weight: 500; }
.state-uploading { background: var(--primary-bg); color: var(--primary); }
.state-hashing   { background: #E0E7FF; color: #3730A3; }
.state-pending   { background: var(--bg-2); color: var(--text-2); }
.state-paused    { background: #FEF3C7; color: #92400E; }
.state-failed    { background: #FEE2E2; color: var(--danger); }
.state-completed { background: #D1FAE5; color: #065F46; }
.state-cancelled { background: var(--bg-2); color: var(--text-3); }
.upload-row-meta { font-size: 11px; color: var(--text-3); margin-bottom: 6px; word-break: break-all; }
.upload-row-bar { height: 4px; background: var(--bg-2); border-radius: 2px; overflow: hidden; }
.upload-row-bar > div { height: 100%; background: var(--primary); transition: width .2s; }

/* 预览区 */
.view-header {
  height: 52px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px 0 12px; border-bottom: 1px solid var(--line); flex-shrink: 0; gap: 8px;
}
.btn-toggle-nav {
  width: 32px; height: 32px; border-radius: 6px; color: var(--text-2);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.btn-toggle-nav:hover { background: var(--bg-2); color: var(--primary); }
.btn-toggle-nav .icon { width: 20px; height: 20px; }

.view-title { display: flex; align-items: center; gap: 8px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.view-title .icon { color: var(--text-2); }
.view-actions { display: flex; gap: 8px; flex-shrink: 0; }
.btn { height: 32px; padding: 0 14px; border-radius: 6px; font-size: 13px; display: inline-flex; align-items: center; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger { background: #fef2f2; color: var(--danger); }
.btn-danger:hover { background: #fee2e2; }
.btn-share { background: var(--bg-2); color: var(--text); }
.btn-share:hover { background: var(--primary-bg); color: var(--primary); }
.view-body { flex: 1; overflow: auto; padding: 24px; display: flex; align-items: center; justify-content: center; }
.view-img { max-width: 100%; max-height: 100%; border-radius: 8px; }
.view-audio { width: 100%; max-width: 480px; }
.view-video { max-width: 100%; max-height: 100%; border-radius: 8px; }
.view-pdf { width: 100%; height: 100%; border: 0; }
.view-info { color: var(--text-2); text-align: center; padding: 40px; }
.view-text {
  width: 100%; height: 100%; margin: 0; padding: 16px;
  background: var(--bg-2); border-radius: 8px; overflow: auto;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px; line-height: 1.6; white-space: pre-wrap; word-break: break-word;
}
.zip-list { width: 100%; max-width: 720px; }
.zip-head { padding: 8px 12px; background: var(--bg-2); border-radius: 6px 6px 0 0; font-size: 12px; color: var(--text-2); }
.zip-row { display: flex; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.zip-name { word-break: break-all; }
.zip-size { color: var(--text-3); font-size: 12px; flex-shrink: 0; margin-left: 12px; }

/* 设置面板 */
.settings-panel { padding: 20px; max-width: 560px; }
.settings-panel h4 { margin: 0 0 12px; font-size: 14px; color: var(--text); }
.stat-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 13px; color: var(--text-2); }
.stat-row b { color: var(--text); }
.stat-bar { height: 6px; background: var(--bg-2); border-radius: 3px; overflow: hidden; margin: 4px 0 12px; }
.stat-bar div { height: 100%; background: var(--primary); }
.settings-panel input { width: 100%; height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; margin-bottom: 8px; }
.settings-panel .btn { height: 36px; }