:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --border: #e3e8f0;
  --text: #1f2937;
  --muted: #7b8794;
  --primary: #3b6ef6;
  --primary-hover: #2f5de0;
  --danger: #e5484d;
  --danger-hover: #cf3b40;
  --shadow: 0 6px 24px rgba(31, 41, 55, 0.08);
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 15px;
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.spacer { flex: 1; }

/* SVG 图标 */
.icon {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: -0.15em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.icon-logo { color: var(--primary); width: 1.3em; height: 1.3em; vertical-align: -0.26em; }
.icon-folder { color: #f0a020; }
.icon-file { color: var(--muted); }
.btn .icon { margin-right: 5px; }

/* 登录 */
.center {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.login-card {
  width: 100%;
  max-width: 380px;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.logo { margin: 0 0 4px; font-size: 22px; text-align: center; }
.logo .icon { margin-right: 7px; }
.login-card p { margin: 0 0 8px; text-align: center; }

input[type="password"], input[type="text"], input[type="number"], select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 15px;
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 110, 246, .15);
}

/* 按钮 */
.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  padding: 9px 15px;
  border-radius: 9px;
  font-size: 14px;
  cursor: pointer;
  transition: background .15s, border-color .15s, opacity .15s;
  white-space: nowrap;
}
.btn:hover { background: #f3f5fa; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { background: var(--danger-hover); border-color: var(--danger-hover); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: #eef1f7; color: var(--text); }
.btn.block { width: 100%; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* 布局 */
.topbar {
  height: 58px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { font-weight: 600; font-size: 17px; display: inline-flex; align-items: center; }
.brand .icon { margin-right: 7px; }
.brand .version { font-size: 12px; font-weight: 400; margin-left: 4px; }
.container { max-width: 1080px; margin: 0 auto; padding: 18px 16px 96px; }

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.toolbar-actions { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }

.breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; font-size: 14px; }
.breadcrumb a {
  color: var(--primary);
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 6px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.breadcrumb a .icon { margin-right: 5px; }
.breadcrumb a:hover { background: #eaf0ff; }
.breadcrumb .sep { color: var(--muted); }

.selection-bar {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 420px;
  max-width: calc(100vw - 32px);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: 0 12px 32px rgba(31, 41, 55, 0.18);
  font-size: 14px;
  flex-wrap: wrap;
  row-gap: 8px;
  animation: selection-in 0.16s ease-out;
}
@keyframes selection-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* 表格 */
.table-wrap {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
table.files { width: 100%; border-collapse: collapse; }
table.files th, table.files td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.files thead th {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: #fafbfe;
}
table.files tbody tr:last-child td { border-bottom: none; }
table.files tbody tr:hover { background: #fafbff; }
.col-check { width: 42px; }
.col-size { width: 110px; }
.col-time { width: 170px; }
.col-expire { width: 170px; }
.col-actions { width: 130px; text-align: right; }

.name-cell { display: flex; align-items: center; gap: 9px; min-width: 0; }
.name-cell .icon { width: 18px; height: 18px; }
.name-cell .name-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.name-cell .name-text:hover { color: var(--primary); text-decoration: underline; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: nowrap; }
.icon-only { padding: 6px 8px; }
.icon-only .icon { margin-right: 0; }

/* 行操作下拉菜单 */
.row-menu {
  position: fixed;
  z-index: 70;
  min-width: 150px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(31, 41, 55, 0.16);
}
.row-menu-item {
  appearance: none;
  border: none;
  background: transparent;
  text-align: left;
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.row-menu-item:hover { background: #f1f4fa; }
.row-menu-item.danger { color: var(--danger); }
.row-menu-item.danger:hover { background: #fdecec; }

.expire-soon { color: #c2410c; font-weight: 600; }
.expire-never { color: var(--muted); }
.tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 12px;
  background: #eef1f7;
  color: var(--muted);
  margin-left: 6px;
}
.empty { padding: 40px; text-align: center; color: var(--muted); }

/* 上传面板 */
.upload-panel {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 360px;
  max-width: calc(100vw - 36px);
  max-height: 50vh;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 40;
}
.upload-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  position: sticky;
  top: 0;
  background: #fff;
}
.upload-item { padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
.upload-item:last-child { border-bottom: none; }
.upload-item .fname {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 6px;
}
.progress { height: 6px; background: #eef1f7; border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--primary); transition: width .15s; }
.upload-item.ok > i, .progress.ok > i { background: #22c55e; }
.progress.err > i { background: var(--danger); }

/* 模态框 */
.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-mask { position: absolute; inset: 0; background: rgba(17, 24, 39, .45); }
.modal-box {
  position: relative;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 420px;
  padding: 22px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.modal-box h3 { margin: 0 0 16px; font-size: 17px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.field { margin-bottom: 14px; }
.field label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--muted); }
.radio-row { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-row label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 11px;
  cursor: pointer;
}
.radio-row input { width: auto; }

/* 提示 */
.msg { font-size: 13px; padding: 9px 11px; border-radius: 8px; }
.msg.error { background: #fdecec; color: #b42318; }
.msg.ok { background: #e8f7ee; color: #127a3b; }
.hint { margin: 6px 0 0; font-size: 12px; line-height: 1.5; color: var(--muted); }

/* 分享页 */
.share-wrap { flex-direction: column; gap: 14px; padding: 20px; }
.share-card { width: 100%; max-width: 420px; padding: 26px; }
.share-head {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  font-size: 17px;
  margin-bottom: 18px;
}
.share-logo {
  width: 26px; height: 26px; flex-shrink: 0;
  fill: none; stroke: var(--primary); stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.share-status { color: var(--muted); padding: 16px 0; text-align: center; }
.share-file {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; margin-bottom: 16px;
  background: #f8faff; border: 1px solid var(--border); border-radius: 10px;
}
.share-file-icon {
  width: 34px; height: 34px; flex-shrink: 0;
  fill: none; stroke: var(--primary); stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.share-file-meta { min-width: 0; }
.share-file-name { font-weight: 600; word-break: break-all; }
.share-file-sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.share-file-sub .dot { margin: 0 6px; }
.share-download { display: block; text-decoration: none; text-align: center; }
.share-foot { font-size: 12px; color: var(--muted); }

/* 临时上传页 */
.upload-card { width: 100%; max-width: 560px; padding: 26px; }
.upload-target { margin-bottom: 14px; font-size: 14px; line-height: 1.7; }
.dropzone {
  border: 2px dashed #c7d2e5;
  border-radius: 12px;
  padding: 30px 16px;
  text-align: center;
  cursor: pointer;
  background: #f8faff;
  transition: border-color .15s, background .15s;
  outline: none;
}
.dropzone:hover, .dropzone:focus, .dropzone.dragover {
  border-color: var(--primary);
  background: #eef4ff;
}
.dropzone p { margin: 6px 0; }
.drop-icon {
  width: 38px; height: 38px; margin-bottom: 4px;
  fill: none; stroke: var(--primary); stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.upload-list { margin-top: 14px; }
.api-box { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.api-box h2 { font-size: 14px; margin: 0 0 8px; }
.api-box p { margin: 6px 0; font-size: 13px; }
.api-box pre, .code-block {
  background: #f5f7fb;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  overflow: auto;
  font-size: 12.5px;
  line-height: 1.55;
  margin: 6px 0 10px;
  white-space: pre-wrap;
  word-break: break-all;
}
.api-box code, .code-block code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.toast {
  position: fixed;
  left: 50%;
  top: 70px;
  transform: translateX(-50%);
  background: #111827;
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  z-index: 80;
  box-shadow: var(--shadow);
  max-width: 90vw;
}
.toast.error { background: var(--danger); }
.toast.ok { background: #16a34a; }

@media (max-width: 720px) {
  .col-time, .col-expire { display: none; }
  .col-actions { width: auto; }
  .row-actions .btn span { display: none; }
  table.files th, table.files td { padding: 10px 8px; }
  .toolbar-actions { width: 100%; margin-left: 0; }
  .toolbar-actions .btn { flex: 1; }
  .selection-bar {
    left: 12px;
    right: 12px;
    bottom: 12px;
    transform: none;
    min-width: 0;
    gap: 6px;
    padding: 8px 10px;
    animation: none;
  }
  .selection-bar #selection-count { flex: 1; }
}

/* 上传链接管理 */
.modal-wide { max-width: 780px; }
.ulm-wrap {
  max-height: 58vh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.ulm-table { width: 100%; border-collapse: collapse; }
.ulm-table th, .ulm-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 13px;
}
.ulm-table thead th {
  background: #fafbfe;
  color: var(--muted);
  font-weight: 600;
  position: sticky;
  top: 0;
}
.ulm-table tbody tr:last-child td { border-bottom: none; }
.ulm-folder { word-break: break-all; max-width: 200px; }
.ulm-actions { white-space: nowrap; text-align: right; }
.status-active { color: #127a3b; font-weight: 600; }
.status-expired { color: var(--danger); font-weight: 600; }
.ulm-empty { padding: 30px 12px; text-align: center; color: var(--muted); }

/* 设置页 */
.settings-section { margin-bottom: 18px; }
.settings-section:last-child { margin-bottom: 0; }
.settings-section h4 {
  margin: 0 0 10px;
  font-size: 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 14px; }
@media (max-width: 560px) {
  .field-grid { grid-template-columns: 1fr; }
}

/* 搜索 / 排序 / 分页 */
.search-toolbar { gap: 10px; }
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 200px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0 10px;
}
.search-box .icon { color: var(--muted); width: 16px; height: 16px; margin: 0; }
.search-box input {
  border: none;
  outline: none;
  box-shadow: none;
  padding: 9px 0;
  background: transparent;
  flex: 1;
}
.search-box input:focus { box-shadow: none; }
.sort-controls { display: flex; align-items: center; gap: 8px; }
.sort-controls select { width: auto; min-width: 120px; }
.search-label { color: var(--muted); font-size: 14px; }

.pager {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
}
.pager select { width: auto; }
.pager .btn:disabled { opacity: 0.45; cursor: not-allowed; }

.name-cell { flex-wrap: wrap; }
.result-path {
  flex-basis: 100%;
  margin-left: 27px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.result-path:hover { color: var(--primary); text-decoration: underline; }

.ulm-toolbar { display: flex; justify-content: flex-end; margin-bottom: 8px; }

@media (max-width: 720px) {
  .topbar {
    height: auto;
    min-height: 58px;
    flex-wrap: wrap;
    padding: 8px 12px;
    row-gap: 4px;
  }
  .topbar .btn.ghost { padding: 6px 8px; font-size: 13px; }
  .search-toolbar { align-items: stretch; }
  .sort-controls { width: 100%; }
  .sort-controls select { flex: 1; }
  .pager { flex-wrap: wrap; }
}

/* 在线预览 */
.preview {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.preview-mask { position: absolute; inset: 0; background: rgba(10, 14, 22, 0.82); }
.preview-box {
  position: relative;
  width: 100%;
  max-width: 1100px;
  max-height: calc(100dvh - 48px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}
.preview-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}
.preview-title {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.preview-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: #0b0f17;
  display: flex;
  align-items: center;
  justify-content: center;
}
.preview-media { max-width: 100%; max-height: calc(100dvh - 150px); display: block; }
.preview-frame { width: 100%; height: calc(100dvh - 150px); border: none; background: #fff; }
.preview-text {
  margin: 0;
  padding: 16px;
  width: 100%;
  height: 100%;
  overflow: auto;
  background: #0f172a;
  color: #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.preview-msg { color: #cbd5e1; padding: 40px; text-align: center; }
body.preview-open { overflow: hidden; }

.share-preview { display: block; text-align: center; margin-top: 10px; text-decoration: none; }

.share-lock { display: flex; flex-direction: column; gap: 10px; }
.share-lock p { margin: 0; }
.btn.disabled { opacity: 0.5; pointer-events: none; }

/* 拖拽上传浮层 */
.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 85;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 15, 23, 0.55);
  backdrop-filter: blur(2px);
}
.drop-overlay-box {
  background: #fff;
  border: 2px dashed var(--primary);
  border-radius: 14px;
  padding: 36px 48px;
  text-align: center;
  box-shadow: var(--shadow);
}
.drop-overlay-icon {
  width: 44px;
  height: 44px;
  color: var(--primary);
  margin-bottom: 10px;
}
.drop-overlay-title { font-size: 18px; font-weight: 600; margin-bottom: 6px; }
@media (max-width: 560px) {
  .drop-overlay-box { padding: 28px 20px; margin: 16px; }
}

/* 存储用量 */
.stats-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}
.stats-summary b { color: var(--text); font-weight: 600; }
.stats-disk { margin: 8px 0; }
.stats-bar {
  height: 6px;
  background: #eef1f7;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 4px;
}
.stats-bar > i { display: block; height: 100%; background: var(--primary); }
.stats-list { margin-top: 8px; display: flex; flex-direction: column; gap: 2px; }
.stats-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 3px 0;
}
.stats-row .icon { width: 15px; height: 15px; }
.stats-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats-size { color: var(--muted); font-variant-numeric: tabular-nums; }

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}
.checkbox-label input { width: auto; }

/* 操作日志 */
.audit-time { white-space: nowrap; }
.audit-ip { white-space: nowrap; color: var(--muted); }
.audit-detail { max-width: 420px; word-break: break-word; }

/* ---------- 响应式 ---------- */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.mobile-only { display: none; }

@media (max-width: 720px) {
  html, body { -webkit-text-size-adjust: 100%; }

  .topbar {
    flex-wrap: wrap;
    height: auto;
    min-height: 0;
    padding: 8px 10px;
    row-gap: 6px;
  }
  .topbar .spacer { display: none; }
  .brand { font-size: 16px; }
  .brand .version { display: none; }
  .topbar-actions {
    width: 100%;
    flex-wrap: wrap;
    gap: 4px 6px;
    padding-bottom: 2px;
  }
  .topbar-actions .btn {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 7px 9px;
    font-size: 13px;
  }

  .mobile-only { display: inline-flex; align-items: center; justify-content: center; }
  .container { padding: 14px 10px 110px; }
  .toolbar { gap: 8px; }
  .toolbar-actions {
    width: 100%;
    margin-left: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .toolbar-actions .btn {
    width: 100%;
    min-height: 38px;
    padding: 8px 6px;
    font-size: 14px;
  }
  .breadcrumb {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .search-toolbar { gap: 8px; }
  .search-box { min-width: 0; flex-basis: 100%; }
  .search-box input { font-size: 16px; }
  .sort-controls {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .sort-controls select { width: 100%; min-width: 0; font-size: 16px; }
  .sort-controls .btn { width: 100%; min-height: 38px; }

  .selection-bar {
    left: 8px;
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    padding: 8px;
    gap: 6px;
  }
  .selection-bar #selection-count { flex-basis: 100%; }
  .selection-bar .btn {
    flex: 1 1 calc(33% - 6px);
    min-height: 36px;
    padding: 7px 4px;
    font-size: 13px;
  }

  .pager { gap: 6px; font-size: 12px; }
  .pager .btn { min-height: 34px; }
  .upload-panel {
    left: 8px;
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    width: auto;
    max-height: 45vh;
  }

  .modal { padding: 8px; }
  .modal-box {
    padding: 16px;
    max-height: calc(100dvh - 16px);
  }
  .modal-wide { max-width: 100%; }
  .field-grid { grid-template-columns: 1fr; }
  .modal-actions {
    position: sticky;
    bottom: -16px;
    background: #fff;
    padding: 10px 0 0;
    margin-top: 14px;
  }

  .ulm-wrap { max-height: 52vh; }
  .ulm-table { min-width: 720px; }
  .ulm-toolbar { justify-content: flex-start; flex-wrap: wrap; gap: 6px; }
  .ulm-toolbar input { flex: 1 1 160px; width: auto; }

  .toast {
    top: max(64px, env(safe-area-inset-top));
    width: max-content;
    max-width: calc(100vw - 24px);
  }

  .preview { padding: 0; }
  .preview-box {
    max-width: none;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }
  .preview-head { padding: 8px 10px; }
  .preview-media { max-height: calc(100dvh - 110px); }
  .preview-frame { height: calc(100dvh - 110px); }
  .preview-text { padding: 12px; }

  .share-wrap { padding: 10px; }
  .share-card, .upload-card, .login-card { padding: 18px; }
  .dropzone { padding: 24px 12px; }
  .share-file { padding: 10px; }
}

@media (max-width: 640px) {
  .table-wrap {
    background: transparent;
    border: 0;
    box-shadow: none;
    overflow: visible;
  }
  table.files { width: 100%; }
  table.files thead { display: none; }
  table.files, table.files tbody, table.files tr, table.files td { display: block; width: 100%; }
  table.files tbody tr {
    position: relative;
    margin-bottom: 10px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
  }
  table.files tbody tr:hover { background: #fff; }
  table.files td { border: 0; padding: 0; }
  table.files .col-check { position: absolute; top: 13px; left: 12px; width: auto; }
  table.files .col-name { padding-left: 26px; margin-bottom: 4px; }
  table.files .col-name .name-text { font-size: 15px; }
  table.files .col-size { margin-left: 26px; margin-bottom: 2px; color: var(--muted); font-size: 12px; }
  table.files .col-expire { display: block; margin-left: 26px; margin-bottom: 8px; color: var(--muted); font-size: 12px; }
  table.files .col-expire::before { content: "过期："; }
  table.files .col-actions { margin-left: 26px; text-align: left; }
  table.files .row-actions { justify-content: flex-start; }
  table.files .col-time { display: none; }
  table.files .name-cell .tag { display: none; }
}
