:root {
  --bg: #f5f6f8;
  --bg-soft: #eceef3;
  --card: #ffffff;
  --card-2: #fafbfc;
  --line: #e6e8ee;
  --line-strong: #d7dbe4;
  --text: #151823;
  --muted: #6b7385;
  --faint: #98a0b0;
  --accent: #4f46e5;
  --accent-soft: #eef0ff;
  --accent-line: #d9dcff;
  --danger: #d92d20;
  --ok: #039855;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 12px 32px -16px rgba(16, 24, 40, 0.22);
  --header-h: 62px;
  --sidebar-w: 236px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1015;
    --bg-soft: #161922;
    --card: #14171f;
    --card-2: #191d26;
    --line: #232833;
    --line-strong: #2e3542;
    --text: #e8eaf0;
    --muted: #98a0b0;
    --faint: #6f7787;
    --accent: #8b8cf8;
    --accent-soft: #1e2033;
    --accent-line: #2f3357;
    --danger: #ff6b5e;
    --ok: #3ddc97;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px -20px rgba(0, 0, 0, 0.8);
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

a {
  color: inherit;
  text-decoration: none;
}

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

::selection {
  background: var(--accent-soft);
}

/* ---------------- 通用控件 ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
  white-space: nowrap;
}

.btn:hover {
  background: var(--card-2);
}

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

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

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

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

.btn.ghost:hover {
  background: var(--bg-soft);
  color: var(--text);
}

.btn.danger {
  color: var(--danger);
  border-color: var(--line-strong);
}

.btn.block {
  width: 100%;
}

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

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

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

.icon-btn.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-line);
}

/* ---------------- 品牌 ---------------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.logo {
  width: 30px;
  height: 30px;
  display: block;
  border-radius: 9px;
  box-shadow: 0 6px 14px -8px rgba(79, 70, 229, 0.9);
}

.brand-name {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

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

.login-view {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background: radial-gradient(120% 80% at 50% 0%, var(--accent-soft) 0%, transparent 55%), var(--bg);
}

.login-card {
  width: 100%;
  max-width: 372px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 32px 28px 24px;
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin: 26px 0 6px;
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

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

.field {
  display: block;
  margin-bottom: 14px;
}

.field span {
  display: block;
  margin-bottom: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
}

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

.field textarea {
  height: auto;
  min-height: 68px;
  padding: 9px 12px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.5;
}

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

.form-error {
  min-height: 18px;
  margin: 4px 0 10px;
  color: var(--danger);
  font-size: 13px;
}

.login-foot {
  margin: 18px 0 0;
  color: var(--faint);
  font-size: 11.5px;
  text-align: center;
}

/* ---------------- 顶栏 ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--header-h);
  background: var(--card);
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: 1280px;
  height: 100%;
  margin: 0 auto;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.user-chip {
  margin-right: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 12px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 22px;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.sidebar {
  min-width: 0;
  position: sticky;
  top: calc(var(--header-h) + 22px);
  padding: 6px;
}

.sidebar-title {
  padding: 6px 10px 10px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

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

.source-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.source-item:hover {
  background: var(--bg-soft);
}

.source-item.active {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent);
}

.source-icon {
  flex: none;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--bg-soft);
  color: var(--muted);
}

.source-item.active .source-icon {
  background: var(--card);
  color: var(--accent);
}

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

.source-name {
  display: block;
  font-size: 13.5px;
  font-weight: 550;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-note {
  display: block;
  font-size: 11.5px;
  color: var(--faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-foot {
  margin-top: 14px;
  padding: 10px;
  border-top: 1px dashed var(--line);
  color: var(--faint);
  font-size: 11.5px;
  line-height: 1.6;
}

/* ---------------- 内容区 ---------------- */

.content {
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.content-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
  flex-wrap: wrap;
}

.crumb {
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 550;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}

.crumb:hover {
  background: var(--bg-soft);
  color: var(--text);
}

.crumb.current {
  color: var(--text);
  cursor: default;
}

.crumb.current:hover {
  background: transparent;
}

.crumb-sep {
  color: var(--faint);
  font-size: 12px;
  padding: 0 1px;
}

.content-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.search {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card-2);
  color: var(--faint);
}

.search:focus-within {
  border-color: var(--accent);
  background: var(--card);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search input {
  width: 132px;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 13px;
  color: var(--text);
}

.search input::placeholder {
  color: var(--faint);
}

.meta-line {
  padding: 9px 18px;
  color: var(--faint);
  font-size: 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

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

.file-area {
  min-height: 320px;
}

.file-head,
.file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px 148px 56px;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
}

.file-head {
  height: 34px;
  color: var(--faint);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--line);
  background: var(--card-2);
}

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

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

.file-row {
  height: 50px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.12s ease;
}

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

.file-row:hover {
  background: var(--card-2);
}

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

.file-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.file-row.is-dir .file-label {
  font-weight: 550;
}

.file-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--bg-soft);
  color: var(--muted);
}

.file-icon.dir {
  background: var(--accent-soft);
  color: var(--accent);
}

.file-icon.t-image {
  background: #e8f7f1;
  color: #0f9f6e;
}

.file-icon.t-video {
  background: #f1edff;
  color: #7c5cf0;
}

.file-icon.t-audio {
  background: #fff3e6;
  color: #d97706;
}

.file-icon.t-pdf {
  background: #fdecea;
  color: #d92d20;
}

.file-icon.t-archive {
  background: #eef2f8;
  color: #475569;
}

.file-icon.t-code {
  background: #eaf2ff;
  color: #2563eb;
}

.file-icon.t-text {
  background: #f4f5f7;
  color: #64748b;
}

@media (prefers-color-scheme: dark) {
  .file-icon.t-image { background: #10312a; color: #4ade9e; }
  .file-icon.t-video { background: #241d3d; color: #a78bfa; }
  .file-icon.t-audio { background: #33260f; color: #fbbf24; }
  .file-icon.t-pdf { background: #3a1a19; color: #ff8a80; }
  .file-icon.t-archive { background: #1e242e; color: #94a3b8; }
  .file-icon.t-code { background: #142138; color: #7cb0ff; }
  .file-icon.t-text { background: #1c212b; color: #94a3b8; }
}

.file-size,
.file-time {
  color: var(--muted);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.file-ops {
  display: flex;
  justify-content: flex-end;
  opacity: 0;
  transition: opacity 0.12s ease;
}

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

.mini-btn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
}

.mini-btn:hover {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

/* ---------------- 网格视图 ---------------- */

.file-area.grid .file-head {
  display: none;
}

.file-area.grid .file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(152px, 1fr));
  gap: 10px;
  padding: 16px;
}

.file-card {
  position: relative;
  padding: 14px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.08s ease;
}

.file-card:hover {
  border-color: var(--accent-line);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.file-card .file-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  margin-bottom: 10px;
}

.file-card .file-label {
  display: block;
  font-size: 13px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-all;
}

.file-card .card-meta {
  margin-top: 6px;
  color: var(--faint);
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------------- 空状态 / 加载 ---------------- */

.empty {
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 64px 20px;
  text-align: center;
  color: var(--muted);
}

.empty .empty-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--bg-soft);
  color: var(--faint);
  margin-bottom: 4px;
}

.empty strong {
  font-size: 14.5px;
  color: var(--text);
  font-weight: 550;
}

.empty span {
  font-size: 12.5px;
  color: var(--faint);
  max-width: 420px;
}

.skeleton-row {
  height: 50px;
  margin: 0 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
}

.skeleton-bar {
  height: 10px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--bg-soft) 25%, var(--line) 37%, var(--bg-soft) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

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

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(12, 14, 20, 0.55);
  backdrop-filter: blur(3px);
  animation: fade-in 0.15s ease;
}

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

.modal {
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 24px 64px -24px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  animation: pop-in 0.16s ease;
}

@keyframes pop-in {
  from { opacity: 0; transform: translateY(6px) scale(0.99); }
  to { opacity: 1; transform: none; }
}

.modal.preview {
  max-width: 1040px;
}

.modal.admin {
  max-width: 860px;
}

.modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  flex: none;
}

.modal-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-sub {
  color: var(--faint);
  font-size: 12px;
  font-weight: 400;
  margin-left: 8px;
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.modal-body {
  padding: 18px 18px 0;
  overflow: auto;
  min-height: 0;
}

.modal-body.flush {
  padding: 14px;
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
}

.preview-media {
  width: 100%;
  display: grid;
  place-items: center;
}

.preview-media.dark {
  border-radius: 10px;
  overflow: hidden;
  background: #07080b;
}

.preview-media img {
  max-width: 100%;
  max-height: calc(100vh - 200px);
  display: block;
  border-radius: 10px;
  box-shadow: 0 12px 32px -16px rgba(0, 0, 0, 0.4);
}

.preview-media video {
  max-width: 100%;
  max-height: calc(100vh - 200px);
  display: block;
}

.preview-media audio {
  width: min(560px, 90%);
  margin: 40px 0;
}

.preview-frame {
  width: 100%;
  height: calc(100vh - 200px);
  border: 0;
  border-radius: 10px;
  background: #fff;
}

.preview-text {
  margin: 0;
  background: var(--card);
  border-radius: 10px;
  padding: 16px 18px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  tab-size: 2;
  max-height: calc(100vh - 180px);
  overflow: auto;
}

.preview-note {
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
  background: var(--card);
}

/* ---------------- 文件源管理 ---------------- */

.admin-intro {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
}

.admin-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  background: var(--card-2);
}

.admin-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.admin-card-head strong {
  font-size: 13px;
  font-weight: 600;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}

.admin-grid .span-2 {
  grid-column: span 2;
}

.admin-grid .field {
  margin: 0;
}

.admin-grid .field span {
  font-size: 11.5px;
}

.admin-grid input,
.admin-grid select {
  height: 36px;
  font-size: 13px;
}

.admin-grid textarea {
  min-height: 62px;
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.admin-result {
  font-size: 12px;
  color: var(--muted);
  flex: 1 1 100%;
  min-height: 16px;
}

.admin-result.ok {
  color: var(--ok);
}

.admin-result.err {
  color: var(--danger);
}

.admin-footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0 4px;
  margin-top: 4px;
  border-top: 1px solid var(--line);
  background: var(--card);
  flex-wrap: wrap;
}

.notice {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--muted);
  font-size: 12.5px;
  margin-bottom: 14px;
  line-height: 1.6;
}

/* ---------------- Toast ---------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 90;
  max-width: min(90vw, 480px);
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(21, 24, 35, 0.92);
  color: #fff;
  font-size: 13px;
  box-shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.6);
  animation: toast-in 0.2s ease;
}

.toast.error {
  background: rgba(185, 28, 28, 0.94);
}

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

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

@media (max-width: 860px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
    padding: 14px;
    gap: 14px;
  }

  .sidebar {
    position: static;
    padding: 0;
  }

  .sidebar-title,
  .sidebar-foot {
    display: none;
  }

  .source-list {
    flex-direction: row;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .source-list::-webkit-scrollbar {
    display: none;
  }

  .source-item {
    flex: none;
    width: auto;
    padding: 7px 12px 7px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--card);
  }

  .source-item .source-note {
    display: none;
  }

  .source-icon {
    width: 22px;
    height: 22px;
  }

  .source-name {
    font-size: 13px;
  }

  .content-head {
    padding: 12px 14px;
  }

  .content-actions {
    width: 100%;
    justify-content: space-between;
  }

  .content-actions .search {
    flex: 1 1 auto;
  }

  .content-actions .search input {
    width: 100%;
  }

  .file-head,
  .file-row {
    grid-template-columns: minmax(0, 1fr) 78px 48px;
    padding: 0 14px;
  }

  .file-time,
  .file-head > div:nth-child(3) {
    display: none;
  }

  .file-ops {
    opacity: 1;
  }

  .modal-backdrop {
    padding: 10px;
  }

  .modal {
    max-height: calc(100vh - 20px);
    border-radius: 14px;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

  .admin-grid .span-2 {
    grid-column: span 1;
  }

  .preview-frame,
  .preview-text {
    height: calc(100vh - 150px);
  }
}

/* ---------------- 只读 / 文件管理 ---------------- */

[hidden] {
  display: none !important;
}

.file-row.has-manage .file-ops {
  opacity: 1;
}

.file-card .card-manage {
  position: absolute;
  top: 8px;
  right: 8px;
  opacity: 0;
}

.file-card:hover .card-manage,
.file-card:focus-within .card-manage {
  opacity: 1;
}

@media (hover: none) {
  .file-ops,
  .file-card .card-manage {
    opacity: 1;
  }
}

.modal.dialog {
  max-width: 460px;
}

.dialog-body {
  padding-bottom: 18px;
}

.dialog-message {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.manage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

.btn.danger-solid:hover {
  filter: brightness(1.06);
  background: var(--danger);
}

.modal.editor {
  max-width: 900px;
}

.editor-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 18px;
}

.editor-text {
  width: 100%;
  min-height: min(56vh, 520px);
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.65;
  resize: vertical;
}

@media (max-width: 640px) {
  .modal-head {
    flex-wrap: wrap;
  }

  .modal-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .modal-actions .btn {
    padding: 0 10px;
  }
}
