/* ============================================================
   云朵网盘 · 玫红 × 浅粉主题
   主色 玫红 #D34D7E · 辅助 浅粉 #FF9A9A
   ============================================================ */
:root {
  --c-pink: #D34D7E;
  --c-pink-deep: #A83A60;
  --c-purple: #E27297;
  --c-purple-deep: #C74E78;
  --c-mint: #FF9A9A;
  --c-mint-deep: #F2738C;
  --c-blue: #F2738C;
  --c-blue-deep: #E86E88;
  --c-peach: #F7C68B;
  --c-yellow: #F7C68B;

  --bg-1: #FDF5F7;
  --bg-2: #FBF0F2;
  --bg-3: #FDF1F3;

  --ink: #4A2A3A;
  --ink-soft: #8A6474;
  --ink-faint: #B79AA6;

  --card: #ffffff;
  --shadow-soft: 0 10px 30px rgba(211, 77, 126, 0.12);
  --shadow-pop: 0 14px 40px rgba(211, 77, 126, 0.25);
  --radius: 22px;
  --radius-sm: 14px;

  /* Element Plus 主色 → 玫红 / 成功 → 浅粉 / 危险 → 柔和红 */
  --el-color-primary: #D34D7E;
  --el-color-primary-light-3: #DE7299;
  --el-color-primary-light-5: #E89AB5;
  --el-color-primary-light-7: #F2C2D1;
  --el-color-primary-light-8: #F7D5E0;
  --el-color-primary-light-9: #FBEAF0;
  --el-color-primary-dark-2: #A83A60;
  --el-color-success: #FF9A9A;
  --el-color-success-light-3: #FFB4B4;
  --el-color-success-light-5: #FFC9C9;
  --el-color-success-light-7: #FFDDDD;
  --el-color-success-light-8: #FFE9E9;
  --el-color-success-light-9: #FFF5F5;
  --el-color-success-dark-2: #F2738C;
  --el-color-danger: #E05252;
  --el-color-danger-light-3: #EA7E7E;
  --el-color-danger-light-5: #F0A5A5;
  --el-color-danger-light-7: #F6CCCC;
  --el-color-danger-light-8: #F9DFDF;
  --el-color-danger-light-9: #FCF1F1;
  --el-color-danger-dark-2: #B33E3E;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1100px 600px at 12% -8%, #FDE8EE 0%, transparent 55%),
    radial-gradient(1000px 620px at 92% 4%, #FFE4E4 0%, transparent 55%),
    radial-gradient(900px 700px at 50% 120%, #FDEBF0 0%, transparent 55%),
    linear-gradient(160deg, var(--bg-1), var(--bg-2) 55%, var(--bg-3));
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
#app { height: 100vh; }

/* floating bobbing decoration */
.blob {
  position: fixed; border-radius: 50%; filter: blur(6px); opacity: .35; z-index: 0;
  animation: bob 9s ease-in-out infinite;
  pointer-events: none;
}
@keyframes bob { 0%,100%{ transform: translateY(0) } 50%{ transform: translateY(-18px) } }

/* ---------- buttons ---------- */
.btn-cute {
  border: none; border-radius: 999px; cursor: pointer;
  font-weight: 700; font-size: 14px; color: #fff;
  padding: 10px 18px; transition: transform .12s ease, box-shadow .12s ease, filter .12s;
  background: linear-gradient(135deg, var(--c-pink), var(--c-purple));
  box-shadow: 0 8px 18px rgba(255, 154, 154, .5);
}
.btn-cute:hover { transform: translateY(-2px); filter: brightness(1.04); }
.btn-cute:active { transform: translateY(0); }
.btn-cute.ghost {
  background: #fff; color: var(--c-purple-deep);
  box-shadow: inset 0 0 0 2px rgba(211,77,126,.35);
}
.btn-cute.ghost:hover { box-shadow: inset 0 0 0 2px rgba(211,77,126,.6); }
.btn-cute.mint { background: linear-gradient(135deg, var(--c-mint), var(--c-blue)); box-shadow: 0 8px 18px rgba(242,115,140,.32); }
.btn-cute.sm { padding: 7px 13px; font-size: 13px; }

/* ---------- login ---------- */
.login-wrap {
  height: 100vh; display: flex; align-items: center; justify-content: center; position: relative; z-index: 1;
}
.login-card {
  width: 380px; background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow-pop); padding: 34px 30px 30px; text-align: center;
  border: 3px solid #fff;
}
.login-title { font-size: 26px; font-weight: 800; margin: 6px 0 2px;
  background: linear-gradient(90deg, var(--c-pink-deep), var(--c-purple-deep));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-sub { color: var(--ink-soft); font-size: 13px; margin-bottom: 22px; }
.login-field { margin-bottom: 14px; text-align: left; }
.login-field label { display:block; font-size: 12px; color: var(--ink-soft); margin: 0 4px 6px; font-weight: 700;}
.login-err { color: var(--c-pink-deep); font-size: 13px; min-height: 18px; margin-top: 6px; }

/* ---------- shell ---------- */
.shell { display: flex; height: 100vh; position: relative; z-index: 1; }
.sidebar {
  width: 232px; flex: 0 0 232px; background: rgba(255,255,255,.72);
  backdrop-filter: blur(10px); border-right: 1px solid rgba(211,77,126,.18);
  display: flex; flex-direction: column; padding: 20px 14px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand-name { font-weight: 800; font-size: 19px;
  background: linear-gradient(90deg, var(--c-pink-deep), var(--c-purple-deep));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px;
  cursor: pointer; color: var(--ink-soft); font-weight: 700; font-size: 14.5px; margin-bottom: 6px;
  transition: all .15s ease;
}
.nav-item:hover { background: rgba(211,77,126,.12); color: var(--ink); }
.nav-item.active {
  background: linear-gradient(135deg, rgba(255,154,154,.9), rgba(211,77,126,.9));
  color: #fff; box-shadow: 0 8px 18px rgba(211,77,126,.3);
}
.nav-spacer { flex: 1; }
.side-foot { font-size: 11px; color: var(--ink-faint); padding: 8px; line-height: 1.6; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 64px; flex: 0 0 64px; display: flex; align-items: center; gap: 14px;
  padding: 0 22px; background: rgba(255,255,255,.6); backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(211,77,126,.16);
}
.topbar .page-title { font-weight: 800; font-size: 17px; color: var(--ink); }
.topbar .search-box { width: 280px; }
.content { flex: 1; overflow: hidden; padding: 18px 22px; display: flex; flex-direction: column; min-height: 0; }
.content-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-soft);
  flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: hidden;
  border: 2px solid #fff;
}

/* ---------- toolbar ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; padding: 14px 16px; flex-wrap: wrap;
  border-bottom: 1px dashed rgba(211,77,126,.25); }
.toolbar .spacer { flex: 1; }
.breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; font-size: 14px; }
.crumb { color: var(--c-purple-deep); cursor: pointer; font-weight: 700; padding: 3px 7px; border-radius: 10px; }
.crumb:hover { background: rgba(211,77,126,.12); }
.crumb.cur { color: var(--ink); cursor: default; }
.crumb.sep { color: var(--ink-faint); cursor: default; padding: 3px 2px; }
.view-toggle { display: inline-flex; background: #F9EFF2; border-radius: 999px; padding: 3px; }
.view-toggle button { border: none; background: transparent; width: 34px; height: 30px; border-radius: 999px;
  cursor: pointer; color: var(--ink-soft); display: flex; align-items: center; justify-content: center; }
.view-toggle button.on { background: #fff; color: var(--c-purple-deep); box-shadow: 0 3px 8px rgba(211,77,126,.2); }

/* ---------- file list (virtual) ---------- */
.file-area { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; }
.vscroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; position: relative; }
.vspace { position: relative; width: 100%; }
.vrows { position: absolute; left: 0; right: 0; top: 0; }

/* list rows */
.row-head, .row {
  display: grid; grid-template-columns: 42px 1fr 120px 180px 44px;
  align-items: center; gap: 6px; padding: 0 16px; height: 46px;
}
.row-head {
  flex: 0 0 46px;
  color: var(--ink-soft); font-size: 12px; font-weight: 700;
  border-bottom: 1px solid rgba(211,77,126,.16);
  background: rgba(255,255,255,.92); backdrop-filter: blur(6px);
  border-radius: 12px 12px 0 0; z-index: 3;
}
.row {
  border-bottom: 1px solid #F7E9EE; cursor: pointer; transition: background .12s;
  border-radius: 12px;
}
.row:hover { background: rgba(211,77,126,.08); }
.row.sel { background: rgba(211,77,126,.08); }
.row.drag-over { background: rgba(255,154,154,.28); outline: 2px dashed var(--c-mint-deep); outline-offset: -3px; }
.row .name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row .name .fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.row .size, .row .time { color: var(--ink-soft); font-size: 13px; }
.row .row-actions { display: flex; gap: 4px; justify-content: flex-end; opacity: 0; transition: opacity .12s; }
.row:hover .row-actions { opacity: 1; }
.mini-btn { border: none; background: rgba(211,77,126,.14); color: var(--c-purple-deep); width: 28px; height: 28px;
  border-radius: 9px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.mini-btn:hover { background: var(--c-purple); color: #fff; }

/* grid cards */
.grid-wrap { position: absolute; left: 0; top: 0; }
.card {
  position: absolute; border-radius: var(--radius-sm); background: #fff;
  box-shadow: 0 4px 14px rgba(211,77,126,.12); cursor: pointer; overflow: hidden;
  transition: transform .12s ease, box-shadow .12s ease; border: 2px solid #fff;
  display: flex; flex-direction: column; align-items: center; padding: 10px 8px;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-pop); }
.card.sel { border-color: var(--c-pink); background: rgba(211,77,126,.06); }
.card.drag-over { border-color: var(--c-mint-deep); background: rgba(255,154,154,.18); }
.card .thumb { width: 56px; height: 56px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  margin-bottom: 8px; }
.card .cname { font-size: 12.5px; font-weight: 700; text-align: center; width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .cmeta { font-size: 11px; color: var(--ink-faint); margin-top: 2px; }
.cat-dot { width: 100%; height: 100%; border-radius: 14px; display: flex; align-items: center; justify-content: center; color: #fff; }

/* drag mask */
.drop-mask { position: absolute; inset: 0; border: 3px dashed var(--c-purple); border-radius: var(--radius);
  background: rgba(211,77,126,.12); display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800; color: var(--c-purple-deep); z-index: 5; pointer-events: none; }

/* batch bar */
.batch-bar {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  background: linear-gradient(135deg, var(--c-pink), var(--c-purple)); color: #fff;
  border-radius: 999px; padding: 10px 18px; display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow-pop); z-index: 6; font-weight: 700;
}
.batch-bar .count { background: rgba(255,255,255,.28); padding: 2px 10px; border-radius: 999px; font-size: 13px; }
.batch-bar .bbtn { border: none; background: rgba(255,255,255,.22); color: #fff; border-radius: 999px;
  padding: 6px 12px; cursor: pointer; font-weight: 700; font-size: 13px; }
.batch-bar .bbtn:hover { background: rgba(255,255,255,.4); }

/* context menu */
.ctx-menu { position: fixed; z-index: 999; background: #fff; border-radius: 14px; box-shadow: var(--shadow-pop);
  padding: 6px; min-width: 168px; border: 2px solid #fff; }
.ctx-menu .item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px;
  cursor: pointer; font-size: 13.5px; color: var(--ink); font-weight: 600; }
.ctx-menu .item:hover { background: rgba(211,77,126,.12); }
.ctx-menu .item.danger { color: var(--c-pink-deep); }
.ctx-menu .item.danger:hover { background: rgba(211,77,126,.08); }
.ctx-menu .divider { height: 1px; background: #F7E9EE; margin: 5px 6px; }
.ctx-backdrop { position: fixed; inset: 0; z-index: 998; }

/* picker */
.picker-bc { display: flex; align-items: center; gap: 4px; font-size: 13px; flex-wrap: wrap; margin-bottom: 10px; }
.picker-list { max-height: 320px; overflow: auto; border-radius: 12px; background: #FDF5F6; padding: 6px; }
.picker-row { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 10px; cursor: pointer; font-weight: 600; }
.picker-row:hover { background: rgba(211,77,126,.12); }

/* webdav */
.client-card { background: #fff; border-radius: var(--radius-sm); padding: 16px 18px; box-shadow: var(--shadow-soft);
  border: 2px solid #fff; }
.client-card h4 { margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.step-list { margin: 0; padding-left: 18px; color: var(--ink-soft); font-size: 13.5px; line-height: 1.9; }
.code-block { background: #3A1E2E; color: #FFB8B8; border-radius: 10px; padding: 10px 12px; font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px; white-space: pre-wrap; word-break: break-all; margin: 8px 0; }
.tip-box { background: rgba(247,198,139,.18); border-radius: 10px; padding: 8px 12px; font-size: 12.5px; color: #8a6d2b; margin-top: 6px; }

/* result rows */
.res-client { border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow-soft); margin-bottom: 12px; }
.res-check { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 3px 0; color: var(--ink-soft); }
.res-check.ok { color: var(--c-mint-deep); }
.res-check.fail { color: var(--c-pink-deep); }

/* misc */
.empty-state { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--ink-faint); gap: 10px; }
.stat-card { background: #fff; border-radius: var(--radius-sm); padding: 16px; box-shadow: var(--shadow-soft); border: 2px solid #fff; }
.kv { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed #F7E9EE; font-size: 13.5px; }
.kv:last-child { border-bottom: none; }
.log-table { font-size: 13px; }
.user-chip { display: flex; align-items: center; gap: 8px; cursor: pointer; }

/* preview body */
.md-body { line-height: 1.75; font-size: 14px; word-break: break-word; }
.md-body h1, .md-body h2, .md-body h3, .md-body h4 { margin: .9em 0 .45em; }
.md-body code { background: #F9EFF2; border-radius: 6px; padding: 2px 6px; font-size: 12.5px; color: #8b6bff; }
.md-body pre { background: #3A1E2E; color: #FFB8B8; border-radius: 12px; padding: 12px 14px; overflow: auto; }
.md-body pre code { background: transparent; color: inherit; padding: 0; }
.md-body img { max-width: 100%; border-radius: 10px; }
.md-body blockquote { margin: 8px 0; padding: 4px 14px; border-left: 4px solid var(--c-purple); background: #FDF5F6; border-radius: 8px; color: var(--ink-soft); }
.md-body table { border-collapse: collapse; }
.md-body th, .md-body td { border: 1px solid #F2E1E8; padding: 5px 10px; }
.txt-body { white-space: pre-wrap; word-break: break-all; font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 13px; max-height: 62vh; overflow: auto; background: #FDF5F6; border-radius: 12px; padding: 14px; }

/* upload progress panel */
.upload-panel {
  position: fixed; right: 22px; bottom: 22px; width: 320px; max-height: 46vh; overflow: auto;
  background: #fff; border-radius: 16px; box-shadow: var(--shadow-pop); padding: 14px 16px;
  z-index: 60; border: 2px solid #fff;
}
.up-item { margin-bottom: 10px; }
.up-item:last-child { margin-bottom: 0; }
.up-name { font-size: 12.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 4px; }
.up-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-faint); margin-top: 3px; }

/* ============================================================
   响应式自适应（桌面 → 平板 → 手机）
   ============================================================ */

/* WebDAV 客户端卡片网格：min(360px,100%) 防止窄屏 auto-fit 横向溢出 */
.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr));
  gap: 16px;
}

/* --- ≤1100px：压缩列表时间列 --- */
@media (max-width: 1100px) {
  .row-head, .row { grid-template-columns: 42px 1fr 100px 140px 44px; }
  .topbar .search-box { width: 220px; }
}

/* --- ≤899px：侧边栏收窄为图标栏 --- */
@media (max-width: 899px) {
  .sidebar { width: 68px; flex: 0 0 68px; padding: 18px 10px; align-items: center; }
  .brand { flex-direction: column; gap: 4px; padding: 0 0 16px; }
  .brand div:nth-child(2) { display: none; }
  .nav-item { justify-content: center; padding: 12px 0; }
  .nav-item span { display: none; }
  .side-foot { display: none; }
  .content { padding: 14px 16px; }
}

/* --- ≤760px：隐藏列表的大小/时间列，行更紧凑 --- */
@media (max-width: 760px) {
  .row-head, .row { grid-template-columns: 42px 1fr 44px; padding: 0 10px; }
  .row .size, .row .time,
  .row-head > div:nth-child(3), .row-head > div:nth-child(4) { display: none; }
}

/* --- ≤640px：手机——底部固定导航栏（大图标 + 文字，醒目易点） --- */
@media (max-width: 640px) {
  .shell { flex-direction: column; }

  /* 底部导航：均分宽度、图标在上文字在下、渐变胶囊高亮 */
  .sidebar {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto;
    width: 100%; height: 64px; flex: none;
    flex-direction: row; align-items: stretch; justify-content: space-around;
    background: rgba(255,255,255,.94); backdrop-filter: blur(14px);
    border-right: none; border-top: 1px solid rgba(211,77,126,.22); border-bottom: none;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    gap: 4px; z-index: 50;
  }
  .brand, .nav-spacer, .side-foot { display: none; }
  .nav-item {
    flex: 1; margin-bottom: 0; padding: 4px 2px;
    flex-direction: column; justify-content: center; gap: 3px;
    border-radius: 16px; font-size: 12px;
    background: rgba(211,77,126,.08);
  }
  .nav-item .el-icon { font-size: 22px !important; }
  .nav-item span { display: inline; font-size: 12px; font-weight: 700; }
  .nav-item.active {
    background: linear-gradient(135deg, rgba(255,154,154,.95), rgba(211,77,126,.95));
    color: #fff; box-shadow: 0 6px 16px rgba(211,77,126,.35);
  }

  /* 主内容让位给底部导航 */
  .main { padding-bottom: 64px; }

  .topbar { height: auto; flex-wrap: wrap; padding: 8px 12px; gap: 8px; }
  .topbar .page-title { display: inline; font-size: 15px; }
  .topbar .search-box { width: 100%; order: 10; }

  .content { padding: 10px; }
  .content-card { border-radius: 16px; }
  .toolbar { padding: 10px; gap: 8px; }
  /* 工具栏按钮：隐藏文字只留图标（保留 title 提示） */
  .toolbar .btn-cute { font-size: 0; padding: 8px 11px; }
  .toolbar .btn-cute .el-icon { margin: 0 !important; font-size: 16px; }
  .toolbar span[style*="font-size:12px"] { display: none; }

  .row-head, .row { grid-template-columns: 36px 1fr 40px; padding: 0 8px; }
  .row-head { height: 40px; }
  .row { height: 44px; }

  /* 批量条全宽，浮于底部导航上方 */
  .batch-bar {
    left: 10px; right: 10px; bottom: 76px; transform: none; justify-content: center;
    flex-wrap: wrap; border-radius: 18px; padding: 8px 12px;
  }
  .batch-bar .bbtn { padding: 5px 9px; font-size: 12px; }
  /* 上传面板全宽，浮于底部导航上方 */
  .upload-panel { left: 12px; right: 12px; width: auto; bottom: 78px; max-height: 34vh; }
  /* 登录卡片全宽 */
  .login-card { width: calc(100vw - 36px); padding: 26px 20px; }
}

/* --- ≤400px：极小屏微调 --- */
@media (max-width: 400px) {
  .nav-item .el-icon { font-size: 20px !important; }
  .nav-item span { font-size: 11px; }
  .login-title { font-size: 22px; }
}

/* scrollbar */
.vscroll::-webkit-scrollbar, .picker-list::-webkit-scrollbar { width: 10px; }
.vscroll::-webkit-scrollbar-thumb, .picker-list::-webkit-scrollbar-thumb { background: rgba(211,77,126,.4); border-radius: 999px; }
.vscroll::-webkit-scrollbar-track { background: transparent; }
