*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef2f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #dbeafe;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --success: #059669;
  --warning: #d97706;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
  --radius: 10px;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--primary);
}

[hidden] {
  display: none !important;
}

.app-root {
  min-height: 100%;
}

/* ---------- 通用组件 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.05s;
}

.btn:hover {
  background: var(--surface-2);
  border-color: var(--muted-2);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.btn.primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.btn.ghost:hover {
  background: var(--surface-3);
  color: var(--text);
}

.btn.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.btn.danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

.btn.small {
  min-height: 30px;
  padding: 0 10px;
  font-size: 13px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}

.icon-btn:hover {
  background: var(--surface-3);
  color: var(--text);
}

.icon-btn.danger:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.btn-group {
  display: inline-flex;
  gap: 8px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.field input,
.field select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:focus,
.field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.field .hint {
  font-size: 12px;
  color: var(--muted);
}

.form-error {
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--danger-soft);
  color: #991b1b;
  font-size: 13px;
}

.form-error:empty {
  display: none;
}

.form-success {
  padding: 9px 12px;
  border-radius: 8px;
  background: #d1fae5;
  color: #065f46;
  font-size: 13px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(37, 99, 235, 0.25);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- 登录页 ---------- */

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background:
    radial-gradient(900px 450px at 15% 0%, #dbeafe 0%, transparent 60%),
    radial-gradient(700px 400px at 100% 100%, #e0e7ff 0%, transparent 55%),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 34px 32px 28px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.login-brand .logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
}

.login-brand .logo svg {
  width: 24px;
  height: 24px;
}

.login-brand h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.login-sub {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 13px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-form .btn {
  height: 42px;
  margin-top: 4px;
}

.login-hint {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--muted-2);
  font-size: 12px;
  text-align: center;
}

/* ---------- 主布局 ---------- */

.layout {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 14px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 18px;
  font-size: 16px;
  font-weight: 700;
}

.brand .logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--primary);
  color: #fff;
}

.brand .logo svg {
  width: 18px;
  height: 18px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
}

.nav-item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav-item.active {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.quota-card {
  margin-top: auto;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}

.quota-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--muted);
}

.quota-bar {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.quota-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--primary);
  transition: width 0.3s;
}

.quota-fill.warn {
  background: var(--warning);
}

.quota-fill.danger {
  background: var(--danger);
}

.quota-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted-2);
}

.sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 4px 0;
  font-size: 13px;
  color: var(--muted);
}

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 10px 24px;
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.menu-toggle {
  display: none;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  font-size: 14px;
}

.crumb {
  padding: 4px 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
}

.crumb:hover {
  background: var(--surface-3);
  color: var(--text);
}

.crumb.current {
  color: var(--text);
  font-weight: 600;
}

.crumb-sep {
  color: var(--muted-2);
  font-size: 12px;
}

.searchbox {
  display: flex;
  align-items: center;
  width: min(320px, 32vw);
  height: 38px;
  padding: 0 4px 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--surface);
}

.searchbox:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.searchbox svg {
  width: 16px;
  height: 16px;
  color: var(--muted-2);
  flex: none;
}

.searchbox input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 8px;
  border: 0;
  background: transparent;
  outline: none;
}

.searchbox button {
  height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 13px;
}

.top-actions {
  display: flex;
  gap: 8px;
  flex: none;
}

.view {
  flex: 1;
  padding: 22px 24px 110px;
  min-width: 0;
}

/* ---------- 文件列表 ---------- */

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.toolbar h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.toolbar .muted {
  color: var(--muted);
  font-size: 13px;
}

.sort-select {
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
}

.bulk-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 9px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 9px;
  background: #eff6ff;
  color: #1e40af;
  font-size: 13px;
}

.bulk-bar .spacer {
  flex: 1;
}

.file-table {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.trash-head,
.trash-row {
  grid-template-columns: minmax(200px, 1fr) 100px 150px 90px 120px;
}

.file-head.trash-head,
.file-row.trash-row {
  grid-template-columns: minmax(200px, 1fr) 100px 150px 90px 120px;
}

.trash-head {
  display: grid;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.trash-row {
  display: grid;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  padding: 0 14px;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.12s;
}

.trash-row:last-child {
  border-bottom: 0;
}

.trash-row:hover {
  background: #f8fafc;
}

.trash-row .file-actions {
  opacity: 0;
}

.trash-row:hover .file-actions,
.trash-row:focus-within .file-actions {
  opacity: 1;
}

.trash-row .file-link {
  cursor: default;
}

.file-head,
.file-row {
  display: grid;
  grid-template-columns: 38px minmax(200px, 1fr) 110px 150px 132px;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
}

.file-head {
  height: 40px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.file-head .sortable {
  cursor: pointer;
  user-select: none;
}

.file-head .sortable:hover {
  color: var(--text);
}

.file-row {
  min-height: 56px;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.12s;
}

.file-row:last-child {
  border-bottom: 0;
}

.file-row:hover {
  background: #f8fafc;
}

.file-row.selected {
  background: #eff6ff;
}

.file-check {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.file-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

.file-name {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.file-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--surface-3);
  color: var(--muted);
  flex: none;
}

.file-icon svg {
  width: 19px;
  height: 19px;
}

.file-icon.folder {
  background: #fef3c7;
  color: #d97706;
}

.file-icon.image {
  background: #dcfce7;
  color: #16a34a;
}

.file-icon.video {
  background: #ede9fe;
  color: #7c3aed;
}

.file-icon.audio {
  background: #fce7f3;
  color: #db2777;
}

.file-icon.archive {
  background: #ffedd5;
  color: #ea580c;
}

.file-icon.text {
  background: #e0f2fe;
  color: #0284c7;
}

.file-link {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 4px 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.file-link .name {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-link .path {
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-row.is-clickable .file-link .name:hover {
  color: var(--primary);
  text-decoration: underline;
}

.file-meta {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.file-actions {
  display: flex;
  justify-content: flex-end;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.12s;
}

.file-row:hover .file-actions,
.file-row.selected .file-actions,
.file-row:focus-within .file-actions {
  opacity: 1;
}

.file-actions .icon-btn {
  width: 30px;
  height: 30px;
}

.file-actions .icon-btn svg {
  width: 16px;
  height: 16px;
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 320px;
  padding: 40px;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  text-align: center;
}

.empty .empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  height: 62px;
  border-radius: 18px;
  background: var(--surface-3);
  color: var(--muted-2);
}

.empty .empty-icon svg {
  width: 30px;
  height: 30px;
}

.empty-title {
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
}

.empty-sub {
  font-size: 13px;
}

.drop-hint {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px dashed var(--primary);
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary-dark);
  font-size: 18px;
  font-weight: 600;
  pointer-events: none;
}

/* ---------- 设置 ---------- */

.settings {
  max-width: 760px;
}

.settings-card {
  margin-bottom: 18px;
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.settings-card h2 {
  margin: 0 0 4px;
  font-size: 16px;
}

.settings-card .sub {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 380px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
}

.settings-row:last-child {
  border-bottom: 0;
}

.settings-row .label {
  font-weight: 600;
}

.settings-row .value {
  color: var(--muted);
}

.totp-secret {
  display: block;
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  background: var(--surface-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  letter-spacing: 0.08em;
  word-break: break-all;
}

.totp-uri {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12px;
  word-break: break-all;
}

.code-input {
  max-width: 180px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.16em;
}

/* ---------- 弹窗 ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.45);
  animation: fade-in 0.12s ease-out;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

.modal {
  width: min(520px, 100%);
  max-height: min(80vh, 720px);
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: pop-in 0.14s ease-out;
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

.modal.wide {
  width: min(680px, 100%);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 12px;
}

.modal-head h3 {
  margin: 0;
  font-size: 16px;
}

.modal-body {
  padding: 4px 20px 16px;
  overflow: auto;
}

.modal-body p {
  margin: 0 0 12px;
  color: var(--muted);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px 18px;
}

.modal-message {
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.modal-message.muted {
  color: var(--muted);
}

.folder-picker {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.folder-picker .picker-crumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  font-size: 13px;
}

.folder-picker .picker-list {
  min-height: 160px;
  max-height: 300px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 9px;
}

.folder-picker .picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-bottom: 1px solid #f1f5f9;
  background: transparent;
  text-align: left;
}

.folder-picker .picker-item:last-child {
  border-bottom: 0;
}

.folder-picker .picker-item:hover {
  background: var(--surface-2);
}

.folder-picker .picker-item svg {
  width: 18px;
  height: 18px;
  color: #d97706;
}

.folder-picker .picker-empty {
  padding: 28px;
  color: var(--muted-2);
  font-size: 13px;
  text-align: center;
}

/* ---------- 提示 ---------- */

.toast-root {
  position: fixed;
  right: 20px;
  top: 76px;
  bottom: auto;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(360px, calc(100vw - 40px));
}

.toast {
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 13px;
  animation: toast-in 0.16s ease-out;
  word-break: break-word;
}

.toast.success {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: #065f46;
}

.toast.error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ---------- 预览 ---------- */

.preview-image {
  display: block;
  max-width: 100%;
  max-height: 60vh;
  margin: 0 auto;
  border-radius: 8px;
}

.preview-video {
  display: block;
  width: 100%;
  max-height: 62vh;
  border-radius: 8px;
  background: #000;
}

.preview-audio {
  width: 100%;
  margin: 12px 0;
}

.preview-text {
  margin: 0;
  max-height: 56vh;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  white-space: pre-wrap;
  word-break: break-word;
}

.preview-note {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

/* ---------- 上传面板 ---------- */

.upload-dock {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  width: min(392px, calc(100vw - 24px));
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.upload-dock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 13px;
  font-weight: 600;
}

.upload-dock-head .count {
  color: var(--muted);
  font-weight: 500;
}

.upload-dock-head .dock-actions {
  display: flex;
  gap: 2px;
}

.upload-list {
  max-height: 260px;
  overflow: auto;
}

.upload-item {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
}

.upload-item:last-child {
  border-bottom: 0;
}

.upload-item-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.upload-item-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-item-status {
  flex: none;
  color: var(--muted);
  font-size: 12px;
}

.upload-progress {
  height: 5px;
  margin: 7px 0 3px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.upload-progress > span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--primary);
  transition: width 0.2s;
}

.upload-progress.error > span {
  background: var(--danger);
}

.upload-progress.done > span {
  background: var(--success);
}

.upload-item-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted-2);
  font-size: 11.5px;
}

.upload-item-actions {
  display: flex;
  gap: 0;
}

.upload-item-actions .icon-btn {
  width: 24px;
  height: 24px;
}

.upload-item-actions .icon-btn svg {
  width: 14px;
  height: 14px;
}

.upload-resume {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  background: #fffbeb;
  font-size: 12px;
  color: #92400e;
}

/* ---------- 响应式 ---------- */

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

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 45;
    width: 264px;
    transform: translateX(-100%);
    transition: transform 0.18s ease-out;
    box-shadow: var(--shadow);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 44;
    background: rgba(15, 23, 42, 0.35);
  }

  .menu-toggle {
    display: inline-flex;
  }

  .topbar {
    flex-wrap: wrap;
    padding: 10px 14px;
  }

  .breadcrumb {
    order: 1;
    flex-basis: calc(100% - 46px);
  }

  .searchbox {
    order: 3;
    width: 100%;
  }

  .top-actions {
    order: 2;
    margin-left: auto;
  }

  .view {
    padding: 16px 14px 120px;
  }

  .file-head,
  .file-row {
    grid-template-columns: 34px minmax(0, 1fr) 84px;
  }

  .file-head .col-size,
  .file-head .col-time,
  .file-row .col-size,
  .file-row .col-time {
    display: none;
  }

  .file-actions {
    opacity: 1;
  }

  .file-actions .icon-btn:not(.keep) {
    display: none;
  }

  .file-actions .icon-btn.keep {
    display: inline-flex;
  }

  .upload-dock {
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
  }

  .toast-root {
    right: 12px;
    top: 148px;
    left: 12px;
    bottom: auto;
    max-width: none;
  }
}

@media (max-width: 560px) {
  .top-actions .btn {
    padding: 0 10px;
  }

  .upload-dock {
    max-height: 50vh;
  }

  .modal {
    max-height: 88vh;
  }
}

@media (max-width: 980px) {
  .trash-head,
  .trash-row {
    grid-template-columns: minmax(0, 1fr) 84px 110px;
  }

  .file-head.trash-head,
  .file-row.trash-row {
    grid-template-columns: minmax(0, 1fr) 84px 110px;
  }

  .trash-head > .col-size,
  .trash-head > .col-time,
  .trash-row > .col-size,
  .trash-row > .col-time {
    display: none;
  }

  .trash-row .file-actions {
    opacity: 1;
  }
}
