/* ==========================================================================
   云盘 · 界面样式（浅色 / 移动优先）
   ========================================================================== */

:root {
  --bg: #f4f7fc;
  --card: #ffffff;
  --text: #16203a;
  --text-2: #56617d;
  --muted: #8b96af;
  --line: #eaeef7;
  --accent: #2f6bff;
  --accent-2: #6aa4ff;
  --accent-soft: #eaf1ff;
  --danger: #f04438;
  --ok: #12b76a;
  --radius: 18px;
  --shadow-sm: 0 2px 10px rgba(23, 43, 88, .05);
  --shadow-md: 0 18px 40px -22px rgba(23, 43, 88, .35);
  --shadow-lg: 0 30px 70px -30px rgba(20, 40, 90, .45);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  color: var(--text);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(1000px 620px at 4% -12%, #e4edff 0%, rgba(228, 237, 255, 0) 58%),
    radial-gradient(900px 520px at 108% -6%, #e9f0ff 0%, rgba(233, 240, 255, 0) 52%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
input { font: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d3dcec; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.ic {
  width: 20px; height: 20px; flex: none; display: block;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.ic-fill { fill: currentColor; stroke: none; }

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

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 252px; flex: 0 0 252px; height: 100vh; position: sticky; top: 0;
  padding: 26px 16px 22px; display: flex; flex-direction: column; gap: 22px;
  border-right: 1px solid rgba(224, 232, 246, .8);
  background: linear-gradient(180deg, rgba(255,255,255,.82), rgba(255,255,255,.55));
  backdrop-filter: blur(12px);
}

.brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 11px; color: #fff; display: grid; place-items: center;
  background: linear-gradient(135deg, #2f6bff, #74a8ff);
  box-shadow: 0 8px 18px -8px rgba(47, 107, 255, .85);
}
.brand-mark .ic { width: 21px; height: 21px; }
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: .6px; }

.side-nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 12px;
  color: var(--text-2); font-size: 14px; text-align: left; transition: background .18s, color .18s;
}
.nav-item .ic { width: 19px; height: 19px; color: #7f8dab; }
.nav-item:hover { background: #f1f6ff; color: var(--text); }
.nav-item.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-item.is-active .ic { color: var(--accent); }
.nav-badge {
  margin-left: auto; font-style: normal; font-size: 11px; font-weight: 700; color: #fff;
  background: var(--accent); min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; display: grid; place-items: center;
}

.side-storage {
  margin-top: auto; padding: 14px; border-radius: 14px; background: #fff;
  box-shadow: var(--shadow-sm); border: 1px solid #f0f3fa;
}
.ss-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; color: var(--text-2); margin-bottom: 9px; }
.ss-head span:last-child { color: var(--accent); font-weight: 600; }
.ss-text { margin-top: 8px; font-size: 11.5px; color: var(--muted); }

.side-tip { display: flex; gap: 9px; padding: 0 6px; color: var(--muted); font-size: 11.5px; line-height: 1.6; }
.side-tip .ic { width: 16px; height: 16px; margin-top: 2px; color: #a7b4cd; }
.side-tip-body { min-width: 0; }
.side-tip-body p { font-size: 11.5px; }
.side-tip code {
  display: block; margin-top: 5px; font-family: inherit; font-size: 11.5px; color: var(--accent);
  background: #eef3ff; padding: 4px 7px; border-radius: 7px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.side-tip code:hover { background: #e3edff; }

.storage-bar { height: 6px; border-radius: 99px; background: #edf1fa; overflow: hidden; }
.storage-bar > i {
  display: block; height: 100%; width: 0; border-radius: 99px;
  background: linear-gradient(90deg, #2f6bff, #7fb0ff);
  transition: width .45s cubic-bezier(.22, 1, .36, 1);
}

/* ---------------------------------------------------------------- 主区 */

.main {
  flex: 1; min-width: 0; max-width: 1000px; margin: 0 auto;
  padding: 26px 34px 130px;
}

.topbar { display: flex; align-items: center; gap: 14px; }
.brand--mobile { display: none; }

.search-wrap {
  position: relative; flex: 1; max-width: 420px; display: flex; align-items: center;
  height: 42px; border-radius: 13px; background: #fff; border: 1px solid #e8edf7;
  box-shadow: var(--shadow-sm); transition: border-color .18s, box-shadow .18s;
}
.search-wrap:focus-within { border-color: #bcd2ff; box-shadow: 0 0 0 4px rgba(47, 107, 255, .09); }
.search-ic { position: absolute; left: 13px; width: 18px; height: 18px; color: #9aa7c0; pointer-events: none; }
.search-wrap input {
  width: 100%; height: 100%; border: 0; outline: 0; background: transparent;
  padding: 0 38px 0 40px; font-size: 14px; color: var(--text); border-radius: 13px;
  -webkit-appearance: none; appearance: none;
}
.search-wrap input::-webkit-search-cancel-button { display: none; }
.search-wrap input::placeholder { color: #a3aec5; }
.search-clear {
  position: absolute; right: 8px; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; color: #9aa7c0; background: #f2f5fb;
}
.search-clear .ic { width: 14px; height: 14px; }

.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.btn-upload {
  display: inline-flex; align-items: center; gap: 7px; height: 42px; padding: 0 18px;
  border-radius: 13px; color: #fff; font-weight: 600; font-size: 14px;
  background: linear-gradient(135deg, #2f6bff, #5b8cff);
  box-shadow: 0 12px 22px -14px rgba(47, 107, 255, .95);
  transition: transform .15s, box-shadow .18s;
}
.btn-upload:hover { box-shadow: 0 16px 26px -14px rgba(47, 107, 255, .95); }
.btn-upload:active { transform: translateY(1px); }
.btn-upload .ic { width: 18px; height: 18px; stroke-width: 2; }

.icon-btn {
  width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center;
  background: #fff; border: 1px solid #e8edf7; color: #5d6a86; box-shadow: var(--shadow-sm);
  transition: background .18s, color .18s, transform .15s;
}
.icon-btn:hover { background: #f6f9ff; color: var(--accent); }
.icon-btn:active { transform: translateY(1px); }
.icon-btn--sm { width: 34px; height: 34px; border-radius: 10px; box-shadow: none; }
.icon-btn--sm .ic { width: 17px; height: 17px; }
.icon-btn--dark { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.16); color: #fff; box-shadow: none; }

.storage-card {
  display: none; margin-top: 16px; padding: 15px 16px; border-radius: 16px;
  background: #fff; box-shadow: var(--shadow-sm); border: 1px solid #f0f3fa;
}
.sc-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 9px; }
.sc-title { font-size: 13px; color: var(--text-2); }
.sc-pct { font-size: 12px; font-weight: 700; color: var(--accent); }
.sc-text { margin-top: 8px; font-size: 11.5px; color: var(--muted); }

/* ---------------------------------------------------------------- 列表头 */

.list-head {
  display: flex; align-items: center; gap: 12px; margin: 24px 2px 12px; min-height: 26px;
}

.crumbs { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; font-size: 14px; min-width: 0; }
.crumb {
  padding: 3px 6px; border-radius: 8px; color: var(--text-2); max-width: 190px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: background .15s, color .15s;
}
.crumb:hover { background: #eaf1ff; color: var(--accent); }
.crumb.is-current { color: var(--text); font-weight: 600; pointer-events: none; }
.crumb-sep { color: #c2cbdd; display: grid; place-items: center; }
.crumb-sep .ic { width: 15px; height: 15px; }

.list-count { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }

.list-side { margin-left: auto; display: flex; align-items: center; gap: 10px; flex: none; }
.list-side .list-count { margin-left: 0; }
.ro-chip {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 9px;
  border-radius: 99px; font-size: 11.5px; font-weight: 600; color: #7a5af8;
  background: #f2eeff; border: 1px solid #e3dcff; white-space: nowrap;
}
.ro-chip .ic { width: 13px; height: 13px; }
.ro-chip .ro-owner { font-weight: 500; opacity: .85; }

.pending-banner {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 12px;
  border-radius: 14px; background: linear-gradient(120deg, #eef4ff, #f7faff);
  border: 1px solid #e2ebff;
}
.pb-icon {
  width: 34px; height: 34px; border-radius: 11px; flex: none; display: grid; place-items: center;
  background: #fff; color: var(--accent); box-shadow: 0 4px 10px -6px rgba(47,107,255,.7);
}
.pb-icon .ic { width: 18px; height: 18px; }
.pb-text { display: flex; flex-direction: column; gap: 1px; font-size: 12px; color: var(--text-2); min-width: 0; }
.pb-text strong { font-size: 13px; color: var(--text); font-weight: 600; }
.pb-btn {
  margin-left: auto; flex: none; height: 30px; padding: 0 14px; border-radius: 99px;
  background: #fff; color: var(--accent); font-size: 12.5px; font-weight: 600;
  border: 1px solid #d7e4ff;
}

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

.file-list {
  background: #fff; border-radius: 20px; padding: 6px; box-shadow: var(--shadow-sm);
  border: 1px solid #eef2fa;
}

.row {
  display: flex; align-items: center; gap: 13px; padding: 11px 10px; border-radius: 14px;
  cursor: pointer; transition: background .15s;
  -webkit-user-select: none; user-select: none;
  animation: rowIn .24s cubic-bezier(.22, 1, .36, 1) both;
}
@keyframes rowIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.row:hover { background: #f7faff; }
.row:active { background: #f1f6ff; }
.row[draggable="true"] { cursor: grab; }
.row[draggable="true"]:active { cursor: grabbing; }
/* 拖拽进行中：所有文件夹行给出可放置的暗示 */
body.is-dragging-row .row[data-type="folder"] {
  background: #f5f9ff;
  box-shadow: inset 0 0 0 1.2px #dfeaff;
}
body.is-dragging-row::after {
  content: "拖到文件夹上松手即可移动";
  position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%);
  padding: 8px 16px; border-radius: 99px; background: rgba(22, 32, 58, .92); color: #fff;
  font-size: 12.5px; letter-spacing: .2px; z-index: 70; pointer-events: none;
  box-shadow: 0 12px 26px -16px rgba(10, 20, 45, .8);
}
.row.is-dragging { opacity: .45; }
.row.is-drop-target {
  background: #eaf1ff;
  box-shadow: inset 0 0 0 1.6px #9dc0ff;
}
.row.is-drop-target .row-name { color: var(--accent); font-weight: 600; }
.row.is-drop-target .row-more { opacity: 0; pointer-events: none; }
.crumb.is-drop-target { background: #dbe8ff; color: var(--accent); }

.thumb {
  position: relative; width: 44px; height: 44px; border-radius: 13px; flex: none; overflow: hidden;
  display: grid; place-items: center; color: #fff; font-size: 10.5px; font-weight: 700;
  letter-spacing: .3px; user-select: none;
  background: linear-gradient(135deg, #b9c6dd, #93a3bf);
}
.thumb .ic { width: 23px; height: 23px; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.t-folder { background: linear-gradient(135deg, #ffcd6e, #ffa726); }
.t-image  { background: linear-gradient(135deg, #7fc6ff, #3f8dfd); }
.t-video  { background: linear-gradient(135deg, #b295ff, #7c5cff); }
.t-audio  { background: linear-gradient(135deg, #f7a8d3, #ec4899); }
.t-pdf    { background: linear-gradient(135deg, #fda4af, #f43f5e); }
.t-doc    { background: linear-gradient(135deg, #9cc3ff, #3b82f6); }
.t-sheet  { background: linear-gradient(135deg, #8ee5ab, #22c55e); }
.t-ppt    { background: linear-gradient(135deg, #fdc08a, #f97316); }
.t-zip    { background: linear-gradient(135deg, #c3cede, #8d9cb4); }
.t-code   { background: linear-gradient(135deg, #aebbfb, #6366f1); }
.t-file   { background: linear-gradient(135deg, #c3cede, #97a6bf); }

.row-main { flex: 1; min-width: 0; }
.row-name {
  font-size: 14px; font-weight: 500; color: var(--text); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.row-meta { margin-top: 2px; font-size: 11.5px; color: var(--muted); display: flex; gap: 6px; overflow: hidden; white-space: nowrap; }
.row-meta > span { overflow: hidden; text-overflow: ellipsis; }
.row-meta .dot { flex: none; }
.row-meta .dot { color: #ccd4e4; }

/* 共享文件夹行：加一个来源标记 */
.row-badge {
  display: inline-flex; align-items: center; gap: 3px; flex: none; margin-left: 6px;
  padding: 0 6px; height: 17px; border-radius: 6px; font-size: 10.5px; font-weight: 600;
  color: #7a5af8; background: #f3efff; vertical-align: 1px;
}
.row-badge .ic { width: 11px; height: 11px; }
.row.is-shared-folder .thumb { background: linear-gradient(135deg, #8f7bff, #b7a8ff); }
.row.is-shared-folder .thumb .ic { color: #fff; }

/* 顶部移动端共享入口 */
.top-shared { display: none; position: relative; }
.mobile-back { display: none; }
.icon-badge {
  position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px; background: var(--accent); color: #fff; font-style: normal;
  font-size: 10px; font-weight: 700; display: grid; place-items: center;
  box-shadow: 0 0 0 2px #fff;
}

.row-more {
  width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center;
  color: #9aa7c0; transition: background .15s, color .15s;
}
.row-more:hover { background: #eef3fd; color: var(--accent); }
.row-more .ic { width: 18px; height: 18px; }

/* 骨架屏 */
.skeleton { display: flex; flex-direction: column; gap: 10px; padding: 14px; background: #fff; border-radius: 20px; }
.sk-row {
  height: 46px; border-radius: 12px;
  background: linear-gradient(100deg, #f1f4fb 20%, #f8fafe 40%, #f1f4fb 60%);
  background-size: 220% 100%; animation: shimmer 1.2s infinite linear;
}
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -80% 0; } }

/* 空状态 */
.empty { padding: 46px 20px 30px; text-align: center; }
.empty-art { width: 190px; margin: 0 auto 6px; }
.empty-art svg { width: 100%; height: auto; display: block; }
.empty h3 { font-size: 15.5px; font-weight: 600; margin-top: 6px; }
.empty p { color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.empty .btn-primary { margin: 18px auto 0; height: 42px; padding: 0 22px; border-radius: 12px; }
.empty .btn-primary .ic { width: 17px; height: 17px; }

/* ---------------------------------------------------------------- 按钮 */

.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 20px; border-radius: 14px; color: #fff; font-weight: 600; font-size: 14px;
  background: linear-gradient(135deg, #2f6bff, #5b8cff);
  box-shadow: 0 14px 26px -16px rgba(47, 107, 255, .95);
  transition: transform .15s, filter .18s;
}
.btn-primary:hover { filter: brightness(1.03); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary[disabled] { opacity: .55; pointer-events: none; }
.btn-block { width: 100%; }
.btn-ghost {
  height: 46px; padding: 0 20px; border-radius: 14px; background: #f3f6fc;
  color: var(--text-2); font-weight: 600; font-size: 14px;
}
.btn-ghost:hover { background: #ecf1fa; }
.text-btn { font-size: 12.5px; color: var(--accent); font-weight: 600; padding: 6px 8px; border-radius: 8px; }
.text-btn:hover { background: var(--accent-soft); }

/* ---------------------------------------------------------------- FAB */

.fab {
  position: fixed; right: 26px; bottom: calc(26px + var(--safe-b)); z-index: 40;
  display: inline-flex; align-items: center; gap: 8px; height: 52px; padding: 0 22px;
  border-radius: 999px; color: #fff; font-weight: 600; font-size: 14.5px;
  background: linear-gradient(135deg, #2f6bff, #5b8cff);
  box-shadow: 0 18px 34px -14px rgba(47, 107, 255, .8), 0 2px 0 rgba(255,255,255,.35) inset;
  transition: transform .18s cubic-bezier(.22,1,.36,1), box-shadow .18s;
}
.fab:hover { transform: translateY(-2px); box-shadow: 0 24px 40px -16px rgba(47, 107, 255, .85); }
.fab:active { transform: scale(.97); }
.fab .ic { width: 20px; height: 20px; stroke-width: 2.2; }

.fab-mini {
  position: fixed; right: 26px; bottom: calc(26px + 52px + 14px + var(--safe-b)); z-index: 40;
  width: 46px; height: 46px; border-radius: 50%; display: none; place-items: center;
  background: #fff; color: #5b6a87; border: 1px solid #e6ecf8;
  box-shadow: 0 12px 26px -14px rgba(20, 45, 100, .45);
  transition: transform .18s, color .18s;
}
.fab-mini:hover { color: var(--accent); transform: translateY(-1px); }
.fab-mini .ic { width: 20px; height: 20px; }
.fab-mini em {
  position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: #f04438; color: #fff; font-style: normal;
  font-size: 10.5px; font-weight: 700; display: grid; place-items: center;
  box-shadow: 0 0 0 2px #f4f7fc;
}

/* ---------------------------------------------------------------- 遮罩 / 面板 */

.overlay {
  position: fixed; inset: 0; z-index: 50; background: rgba(15, 25, 48, .35);
  backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity .26s;
}
.overlay.show { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed; left: 50%; bottom: 0; z-index: 60;
  width: min(560px, 100%); max-height: 82vh; display: flex; flex-direction: column;
  background: #fff; border-radius: 24px 24px 0 0; box-shadow: var(--shadow-lg);
  transform: translate(-50%, 104%); transition: transform .34s cubic-bezier(.22, 1, .36, 1);
  padding-bottom: var(--safe-b);
}
.sheet.open { transform: translate(-50%, 0); }
.sheet-handle { width: 38px; height: 4px; border-radius: 99px; background: #e2e8f4; margin: 9px auto 0; flex: none; }
.sheet-head {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 18px 10px; flex: none;
  border-bottom: 1px solid #f2f5fb;
}
.sheet-head h3 { font-size: 16px; font-weight: 700; }
.sheet-head p { margin-top: 2px; font-size: 12px; color: var(--muted); }
.sheet-head-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.sheet-body { overflow-y: auto; padding: 14px 16px 4px; -webkit-overflow-scrolling: touch; }
.sheet-foot { padding: 10px 16px 14px; flex: none; border-top: 1px solid #f2f5fb; }
.sheet-foot .btn-primary { height: 46px; }

.section-label {
  display: flex; align-items: baseline; gap: 8px; margin: 4px 2px 9px;
  font-size: 12px; color: var(--text-2); font-weight: 600;
}
.section-label em { font-style: normal; font-weight: 400; color: var(--muted); font-size: 11.5px; }
.section-label b { color: var(--accent); }

.pending-section { margin-bottom: 16px; }

.task {
  display: flex; gap: 11px; padding: 11px 12px; border-radius: 14px; background: #f8faff;
  margin-bottom: 8px; border: 1px solid #eef3fc;
}
.task-icon {
  width: 36px; height: 36px; border-radius: 11px; flex: none; display: grid; place-items: center;
  color: #fff; font-size: 9.5px; font-weight: 700;
}
.task-main { flex: 1; min-width: 0; }
.task-top { display: flex; align-items: baseline; gap: 10px; }
.task-name { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-pct { margin-left: auto; font-size: 11.5px; font-weight: 700; color: var(--accent); flex: none; }
.task-bar { height: 5px; border-radius: 99px; background: #e7eefc; overflow: hidden; margin: 7px 0 6px; }
.task-bar > i {
  display: block; height: 100%; width: 0; border-radius: 99px;
  background: linear-gradient(90deg, #2f6bff, #7fb0ff);
  transition: width .25s linear;
}
.task.is-paused .task-bar > i { background: linear-gradient(90deg, #b6c3da, #d3dcec); }
.task.is-error .task-bar > i { background: linear-gradient(90deg, #f97066, #fda29b); }
.task.is-done .task-bar > i { background: linear-gradient(90deg, #12b76a, #6ce9a6); }
.task.is-done .task-pct { color: var(--ok); }
.task.is-error .task-pct { color: var(--danger); }

.task-meta { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); }
.task-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-btns { margin-left: auto; display: flex; align-items: center; gap: 4px; flex: none; }
.tbtn {
  width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center;
  color: #74819c; background: #fff; border: 1px solid #e6ecf8;
}
.tbtn:hover { color: var(--accent); border-color: #cfe0ff; }
.tbtn .ic { width: 14px; height: 14px; }
.tbtn--danger:hover { color: var(--danger); border-color: #ffd5d2; }
.task-note { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.task-note b { color: var(--accent); font-weight: 600; }

.task-empty { text-align: center; padding: 34px 10px 26px; color: var(--muted); }
.task-empty .ic { width: 30px; height: 30px; margin: 0 auto 10px; color: #c3cee3; stroke-width: 1.4; }
.task-empty p { font-size: 13px; color: var(--text-2); }
.task-empty span { display: block; font-size: 11.5px; margin-top: 4px; }

/* ---------------------------------------------------------------- 操作菜单 */

.action-sheet {
  position: fixed; left: 50%; bottom: 0; z-index: 60; width: min(460px, 100%);
  background: #fff; border-radius: 22px 22px 0 0; box-shadow: var(--shadow-lg);
  transform: translate(-50%, 104%); transition: transform .3s cubic-bezier(.22, 1, .36, 1);
  padding: 6px 14px calc(14px + var(--safe-b));
  max-height: 80vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.action-sheet.open { transform: translate(-50%, 0); }
.as-head { display: flex; gap: 12px; align-items: center; padding: 14px 4px 14px; border-bottom: 1px solid #f2f5fb; }
.as-icon { width: 42px; height: 42px; border-radius: 12px; flex: none; overflow: hidden; display: grid; place-items: center; color: #fff; font-size: 10px; font-weight: 700; }
.as-icon .ic { width: 22px; height: 22px; }
.as-icon img { width: 100%; height: 100%; object-fit: cover; }
.as-info { min-width: 0; }
.as-name { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.as-meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.as-actions { padding: 6px 0 2px; }
.as-item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 8px;
  border-radius: 12px; font-size: 14px; color: var(--text); text-align: left;
}
.as-item:hover { background: #f5f8ff; }
.as-item .ic { width: 19px; height: 19px; color: #7d8aa6; }
.as-item.is-danger { color: var(--danger); }
.as-item.is-danger .ic { color: var(--danger); }
#moveClose { margin-left: auto; align-self: center; }
#moveList .as-item .ic { color: #f5a623; }
.move-empty { padding: 22px 10px; text-align: center; font-size: 12.5px; color: var(--muted); }
.as-cancel {
  width: 100%; height: 46px; border-radius: 13px; background: #f3f6fc; color: var(--text-2);
  font-weight: 600; margin-top: 4px;
}

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

.modal {
  position: fixed; inset: 0; z-index: 140; display: grid; place-items: center; padding: 22px;
  background: rgba(12, 22, 44, .45); backdrop-filter: blur(4px);
  animation: fadeIn .18s ease both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  width: min(400px, 100%); background: #fff; border-radius: 20px; padding: 22px;
  box-shadow: 0 40px 80px -30px rgba(10, 25, 60, .55);
  animation: popIn .24s cubic-bezier(.22, 1, .36, 1) both;
}
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
.modal-card h3 { font-size: 16px; font-weight: 700; }
.modal-text { font-size: 13px; color: var(--text-2); margin-top: 8px; word-break: break-all; }
.modal-text:empty { display: none; }
.modal-input {
  width: 100%; height: 46px; margin-top: 16px; padding: 0 14px; border-radius: 12px;
  border: 1px solid #e3eaf6; background: #f8faff; outline: 0; font-size: 15px; color: var(--text);
}
.modal-input:focus { border-color: #b9d0ff; background: #fff; box-shadow: 0 0 0 4px rgba(47,107,255,.08); }
.modal-foot { display: flex; gap: 10px; margin-top: 20px; }
.modal-foot button { flex: 1; height: 44px; }

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

.preview {
  position: fixed; inset: 0; z-index: 90; background: #0b1220;
  display: flex; flex-direction: column; color: #fff;
  animation: fadeIn .2s ease both;
}
.preview[hidden] { display: none; }
.preview-top {
  display: flex; align-items: center; gap: 12px; padding: calc(10px + var(--safe-t)) 14px 10px;
  background: linear-gradient(180deg, rgba(0,0,0,.55), rgba(0,0,0,0));
}
.preview-name { flex: 1; font-size: 13.5px; color: #e8eefc; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-body { flex: 1; display: grid; place-items: center; padding: 8px 14px; overflow: hidden; }
.preview-body img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.preview-body video { max-width: 100%; max-height: 100%; border-radius: 8px; background: #000; }
.preview-body audio { width: min(420px, 100%); }
.preview-body iframe { width: 100%; height: 100%; border: 0; border-radius: 10px; background: #fff; }
.preview-foot { padding: 10px 14px calc(18px + var(--safe-b)); display: flex; justify-content: center; }
.preview-dl {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 22px;
  border-radius: 99px; background: rgba(255,255,255,.14); color: #fff; font-size: 13.5px; font-weight: 600;
  border: 1px solid rgba(255,255,255,.18);
}
.preview-dl:hover { background: rgba(255,255,255,.2); }
.preview-dl .ic { width: 17px; height: 17px; }

/* ---------------------------------------------------------------- 拖拽 / Toast */

.drop-overlay {
  position: fixed; inset: 0; z-index: 100; display: none; place-items: center;
  background: rgba(47, 107, 255, .12); backdrop-filter: blur(2px);
}
.drop-overlay.show { display: grid; }
.drop-box {
  padding: 34px 46px; border-radius: 22px; border: 2px dashed #8db4ff; background: rgba(255,255,255,.94);
  text-align: center; color: var(--accent); box-shadow: var(--shadow-lg);
}
.drop-box .ic { width: 40px; height: 40px; margin: 0 auto 10px; stroke-width: 1.6; }
.drop-box p { font-size: 14px; font-weight: 600; }

.toast {
  position: fixed; left: 50%; top: calc(22px + var(--safe-t)); z-index: 160;
  transform: translate(-50%, -12px); opacity: 0; pointer-events: none;
  max-width: min(86vw, 460px); padding: 10px 18px; border-radius: 12px;
  background: rgba(22, 32, 58, .93); color: #fff; font-size: 13px; line-height: 1.5;
  box-shadow: 0 18px 40px -20px rgba(10, 20, 45, .8); transition: opacity .22s, transform .22s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.noscript { padding: 40px; text-align: center; color: var(--danger); }

/* ---------------------------------------------------------------- 登录 / 注册 */

.auth {
  position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 24px;
  background:
    radial-gradient(900px 520px at 15% 0%, #e2ecff 0%, rgba(226, 236, 255, 0) 60%),
    radial-gradient(800px 500px at 100% 20%, #eaf1ff 0%, rgba(234, 241, 255, 0) 55%),
    #f4f7fc;
}
.auth-card {
  width: min(400px, 100%); background: #fff; border-radius: 24px; padding: 30px 28px 26px;
  box-shadow: 0 34px 80px -38px rgba(20, 40, 90, .5); border: 1px solid #eef2fa;
  animation: popIn .3s cubic-bezier(.22, 1, .36, 1) both;
}
.auth-brand { justify-content: center; padding: 0; margin-bottom: 16px; }
.auth-card h2 { font-size: 21px; text-align: center; letter-spacing: .3px; }
.auth-sub { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.auth-tabs { display: flex; gap: 4px; padding: 4px; margin: 20px 0 16px; background: #f2f6fc; border-radius: 12px; }
.auth-tab { flex: 1; height: 36px; border-radius: 9px; font-size: 13.5px; color: var(--text-2); }
.auth-tab.is-active { background: #fff; color: var(--accent); font-weight: 600; box-shadow: 0 2px 8px rgba(23, 43, 88, .08); }
.auth-field { display: block; margin-bottom: 12px; }
.auth-field > span { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.auth-field input {
  width: 100%; height: 46px; border-radius: 12px; border: 1px solid #e4eaf6; background: #f8faff;
  padding: 0 14px; font-size: 16px; color: var(--text); outline: 0; transition: border-color .18s, background .18s, box-shadow .18s;
}
.auth-field input:focus { border-color: #b9d0ff; background: #fff; box-shadow: 0 0 0 4px rgba(47, 107, 255, .08); }
.auth-error {
  margin: 2px 0 10px; padding: 9px 12px; border-radius: 10px; background: #fff1f0;
  color: #d92d20; font-size: 12.5px; line-height: 1.5;
}
.auth-submit { height: 48px; margin-top: 6px; }
.auth-notice {
  margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: #eef8f2;
  color: #0f8a52; font-size: 12.5px; line-height: 1.6; text-align: left;
}
.auth-tip { margin-top: 14px; text-align: center; font-size: 12px; color: var(--muted); line-height: 1.6; }
.auth-foot { position: absolute; bottom: calc(18px + var(--safe-b)); font-size: 11.5px; color: #a3aec5; }

/* ---------------------------------------------------------------- 账号 */

.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 13px; letter-spacing: .5px; user-select: none;
  background: linear-gradient(135deg, #2f6bff, #7fb0ff);
}
.side-user {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px;
  border-radius: 14px; background: #fff; border: 1px solid #f0f3fa; box-shadow: var(--shadow-sm);
  text-align: left; transition: background .16s;
}
.side-user:hover { background: #f8fbff; }
.su-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.su-info b { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.su-info em { font-style: normal; font-size: 11px; color: var(--muted); }
.side-user > .ic { width: 15px; height: 15px; color: #b6c1d6; transform: rotate(-90deg); }

.top-avatar { display: none; padding: 2px; border-radius: 50%; }
.top-avatar .avatar { width: 100%; height: 100%; border-radius: 50%; font-size: 13px; }

.user-menu {
  position: fixed; left: 16px; bottom: calc(100px + var(--safe-b)); z-index: 78; width: 236px;
  background: #fff; border-radius: 16px; border: 1px solid #eef2fa; box-shadow: var(--shadow-lg);
  padding: 6px; animation: popIn .18s cubic-bezier(.22, 1, .36, 1) both;
}
.um-head { display: flex; align-items: center; gap: 10px; padding: 10px 10px 12px; border-bottom: 1px solid #f2f5fb; margin-bottom: 4px; }
.um-info { min-width: 0; }
.um-info b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.um-info em { font-style: normal; font-size: 11px; color: var(--muted); }
.um-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border-radius: 10px;
  font-size: 13.5px; color: var(--text); text-align: left;
}
.um-item:hover { background: #f5f8ff; }
.um-item .ic { width: 17px; height: 17px; color: #7d8aa6; }
.um-item.is-danger { color: var(--danger); }
.um-item.is-danger .ic { color: var(--danger); }


.modal-custom { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.modal-custom label { display: block; font-size: 12px; color: var(--text-2); }
.modal-custom label span { display: block; margin-bottom: 5px; }
.modal-custom input, .modal-custom select {
  width: 100%; height: 44px; border-radius: 11px; border: 1px solid #e4eaf6; background: #f8faff;
  padding: 0 12px; font-size: 16px; color: var(--text); outline: 0;
}
.modal-custom input:focus, .modal-custom select:focus {
  border-color: #b9d0ff; background: #fff; box-shadow: 0 0 0 4px rgba(47, 107, 255, .08);
}
.modal-custom .hint { font-size: 11px; color: var(--muted); }

/* ---------------------------------------------------------------- 共享面板 */

.share-url { display: flex; gap: 8px; margin-top: 14px; }
.share-url input {
  flex: 1; min-width: 0; height: 42px; padding: 0 12px; border-radius: 11px;
  border: 1px solid #e4eaf6; background: #f8faff; font-size: 12.5px; color: var(--text-2);
}
.share-url button {
  flex: none; height: 42px; padding: 0 14px; border-radius: 11px;
  background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 13px;
}
.share-members { margin-top: 14px; border-top: 1px solid #f0f3fa; padding-top: 12px; }
.sm-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.sm-head b { color: var(--text); font-weight: 600; }
.member-list { margin-top: 8px; display: flex; flex-direction: column; gap: 2px; max-height: 168px; overflow: auto; }
.member-row { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-radius: 8px; font-size: 13px; }
.member-row:hover { background: #f8faff; }
.member-ava {
  width: 24px; height: 24px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: linear-gradient(135deg, #2f6bff, #7fb0ff); color: #fff; font-size: 11px; font-weight: 700;
}
.member-row b { flex: 1; min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-kick { flex: none; font-size: 11.5px; color: var(--danger); padding: 3px 8px; border-radius: 7px; }
.member-kick:hover { background: #fff1f0; }
.share-revoke {
  margin-top: 12px; width: 100%; height: 38px; border-radius: 10px; font-size: 12.5px;
  color: var(--danger); background: #fff5f4; border: 1px solid #ffe0dd;
}
.share-revoke:hover { background: #ffeceb; }
.share-empty { font-size: 12px; color: var(--muted); padding: 10px 2px; }
.share-tip { font-size: 11px; color: var(--muted); line-height: 1.65; margin-top: 10px; }

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

@media (min-width: 900px) {
  .sheet {
    left: auto; right: 24px; bottom: 24px; width: 420px; max-height: 68vh;
    border-radius: 22px; transform: translateY(18px) scale(.98);
    opacity: 0; pointer-events: none; padding-bottom: 0;
  }
  .sheet.open { transform: none; opacity: 1; pointer-events: auto; }
  .sheet-handle { display: none; }
  .sheet-head { padding-top: 16px; }
  .action-sheet {
    left: 50%; right: auto; bottom: 24px; width: 400px; border-radius: 22px;
    max-height: 72vh; overflow-y: auto;
  }
}

@media (max-width: 899px) {
  .sidebar { display: none; }
  .main { padding: calc(10px + var(--safe-t)) 14px 120px; }
  .brand--mobile { display: flex; padding: 0; gap: 8px; }
  .brand--mobile .brand-mark { width: 32px; height: 32px; border-radius: 10px; }
  .brand--mobile .brand-name { font-size: 16px; }

  .topbar { flex-wrap: wrap; gap: 10px; position: sticky; top: 0; z-index: 30; padding: 6px 0 10px; }
  .topbar::before {
    content: ""; position: absolute; inset: -14px -14px 0; z-index: -1;
    background: linear-gradient(180deg, #f4f7fc 72%, rgba(244, 247, 252, 0));
    /* 移动端去掉 backdrop-filter，滚动更跟手 */
  }
  .overlay { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .modal { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .search-wrap { order: 3; flex-basis: 100%; max-width: none; height: 40px; }
  .top-actions { gap: 6px; }
  .btn-upload { height: 38px; padding: 0 13px; font-size: 13px; border-radius: 11px; }
  .btn-upload .ic { width: 16px; height: 16px; }
  .icon-btn { width: 38px; height: 38px; border-radius: 11px; }
  .icon-btn .ic { width: 18px; height: 18px; }
  .storage-card { display: block; margin-top: 4px; }

  .list-head { margin: 16px 2px 10px; flex-wrap: wrap; row-gap: 6px; }
  .list-side { margin-left: auto; }
  .ro-chip .ro-owner { display: none; }
  .crumbs { font-size: 15px; }
  .list-count { display: none; }

  .file-list { border-radius: 18px; padding: 4px; }
  .row { padding: 10px 8px; gap: 11px; }
  .thumb { width: 42px; height: 42px; border-radius: 12px; }
  .row-more { width: 32px; height: 32px; }

  .fab {
    right: 18px; bottom: calc(18px + var(--safe-b)); height: 50px; padding: 0 19px;
    font-size: 14px;
  }
  .fab-mini { display: grid; right: 18px; bottom: calc(18px + 50px + 12px + var(--safe-b)); width: 42px; height: 42px; }

  .top-avatar { display: grid; }
  .top-shared { display: grid; }
  .mobile-back { display: grid; }
  /* 进入共享区后，移动端顶部用返回键替换品牌，避免没有回到「我的文件」的入口 */
  body.is-readonly-mode .brand--mobile { display: none; }
  .user-menu {
    left: 12px; right: 12px; bottom: calc(12px + var(--safe-b)); width: auto;
    border-radius: 18px; padding: 8px;
  }
  .auth-card { padding: 26px 22px 22px; border-radius: 22px; }
  .auth-foot { display: none; }


  .search-wrap input { font-size: 16px; }
  .modal-input { font-size: 16px; }

  .empty { padding-top: 34px; }
  .empty-art { width: 158px; }
  .modal { align-items: end; padding: 0; }
  .modal-card { width: 100%; border-radius: 22px 22px 0 0; padding: 22px 20px calc(20px + var(--safe-b)); }
}

@media (max-width: 380px) {
  .btn-upload span { display: none; }
  .btn-upload { width: 38px; padding: 0; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
