* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --blue: #2f7cf6;
  --text: #2b3240;
  --sub: #8a93a3;
  --line: #e9edf3;
}
html, body { height: 100%; overflow: hidden; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  user-select: none;
}
[hidden] { display: none !important; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { text-decoration: none; color: inherit; }

/* ============ 模式切换 ============ */
.mobile-shell { display: none; }
.desktop-shell { display: none; }
body.mode-mobile .mobile-shell { display: block; }
body.mode-desktop .desktop-shell { display: block; }

/* ============================================================
   手机桌面
============================================================ */
.mobile-shell {
  position: fixed; inset: 0;
  color: #fff;
  background:
    radial-gradient(120% 70% at 15% 0%, #7b9cff 0%, rgba(123,156,255,0) 55%),
    radial-gradient(120% 80% at 100% 20%, #b98cff 0%, rgba(185,140,255,0) 55%),
    linear-gradient(165deg, #3a63d5 0%, #5b54c9 45%, #8e4fb8 100%);
}
.m-statusbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 18px 2px;
  font-size: 13px; font-weight: 600;
  padding-top: calc(10px + env(safe-area-inset-top));
}
.m-icons { display: flex; align-items: center; gap: 6px; }
.m-icons svg { width: 17px; height: 17px; }
.m-icons .battery { width: 25px; height: 13px; }
.m-date { text-align: center; margin-top: 7vh; font-size: 15px; opacity: .9; letter-spacing: 1px; }

.m-appgrid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px 18px;
  padding: 6vh 26px 0;
  max-width: 480px; margin: 0 auto;
}
.m-app { display: flex; flex-direction: column; align-items: center; gap: 8px; color: #fff; }
.m-app-icon {
  width: 62px; height: 62px; border-radius: 16px;
  box-shadow: 0 8px 18px rgba(20, 30, 80, .35);
  overflow: hidden; transition: transform .15s;
}
.m-app:active .m-app-icon { transform: scale(.9); }
.m-app-icon svg { width: 100%; height: 100%; display: block; }
.m-app-label { font-size: 12.5px; text-shadow: 0 1px 3px rgba(0,0,0,.35); }

/* 手机 App 全屏页 */
.m-sheet {
  position: fixed; inset: 0; z-index: 50;
  background: #f5f6f9;
  display: flex; flex-direction: column;
  transform: translateY(104%);
  transition: transform .28s cubic-bezier(.32,.72,.28,1);
  color: var(--text);
}
.m-sheet.open { transform: translateY(0); }
.m-sheet-head {
  display: flex; align-items: center; gap: 4px;
  padding: calc(10px + env(safe-area-inset-top)) 10px 10px;
  background: #fff; border-bottom: 1px solid var(--line);
}
.m-sheet-head h2 { font-size: 17px; font-weight: 600; flex: 1; text-align: center; padding: 0 4px; }
.icon-btn {
  position: relative;
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #3a4356; flex: none;
}
.icon-btn:active { background: #eef1f6; }
.icon-btn svg { width: 21px; height: 21px; }
.icon-btn.light { color: #fff; }
.icon-btn.light:active { background: rgba(255,255,255,.18); }
.sheet-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }

/* ============================================================
   电脑桌面
============================================================ */
.desktop-shell {
  position: fixed; inset: 0;
  background:
    radial-gradient(70% 55% at 80% 10%, rgba(120,170,255,.55) 0%, rgba(120,170,255,0) 60%),
    radial-gradient(60% 50% at 15% 85%, rgba(170,110,255,.45) 0%, rgba(170,110,255,0) 60%),
    linear-gradient(140deg, #0e2a6e 0%, #1c3f8f 40%, #4a2f96 100%);
}
.d-icons {
  position: absolute; top: 16px; left: 16px;
  display: grid; grid-template-columns: repeat(1, 84px); gap: 6px;
}
.d-icon {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 10px 4px 8px; border-radius: 8px; color: #fff;
  border: 1px solid transparent;
}
.d-icon:hover { background: rgba(255,255,255,.12); }
.d-icon.selected { background: rgba(255,255,255,.22); border-color: rgba(255,255,255,.25); }
.d-icon-img { width: 44px; height: 44px; filter: drop-shadow(0 3px 5px rgba(0,0,0,.35)); }
.d-icon-img svg { width: 100%; height: 100%; }
.d-icon-label { font-size: 12.5px; text-shadow: 0 1px 3px rgba(0,0,0,.6); text-align: center; }

/* 窗口 */
.window {
  position: absolute; z-index: 10;
  background: #fff; border-radius: 10px;
  box-shadow: 0 18px 50px rgba(8, 16, 45, .45);
  display: flex; flex-direction: column;
  overflow: hidden;
  min-width: 330px; min-height: 260px;
}
.window.open { display: flex; animation: winIn .18s ease; }
@keyframes winIn { from { transform: scale(.97); opacity: .4; } to { transform: none; opacity: 1; } }
.win-titlebar {
  height: 42px; flex: none;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 6px 0 14px;
  background: #f3f5f9; border-bottom: 1px solid var(--line);
  cursor: grab;
}
.win-titlebar:active { cursor: grabbing; }
.win-title { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; }
.win-actions { display: flex; gap: 2px; align-items: center; }
.win-btn {
  width: 34px; height: 30px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center; color: #59627a;
}
.win-btn:hover { background: #e4e9f2; }
.win-btn.win-close:hover { background: #e8453c; color: #fff; }
.win-toolbar {
  flex: none; display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.toolbar-hint { font-size: 12px; color: var(--sub); flex: 1; }
.win-body { flex: 1; overflow-y: auto; background: #fff; position: relative; }
.win-status {
  flex: none; padding: 6px 14px; font-size: 12px; color: var(--sub);
  border-top: 1px solid var(--line); background: #f8f9fb;
}
.win-footer {
  flex: none; display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-top: 1px solid var(--line); background: #f8f9fb;
}

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px; font-size: 13.5px;
  background: #eef1f7; color: #3a4356; font-weight: 500; white-space: nowrap;
}
.btn:hover { background: #e3e8f1; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: #1f6ae0; }
.btn.mini { padding: 5px 10px; font-size: 12.5px; }
.btn.danger-ghost { color: #d6453b; background: #fdeceb; }
.btn.danger-ghost:hover { background: #fadbd9; }

/* 任务栏 */
.taskbar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 48px;
  display: flex; align-items: center; gap: 6px; padding: 0 10px;
  background: rgba(16, 22, 42, .78);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  color: #dce4f5; z-index: 5;
}
.task-start {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 7px; font-size: 13.5px; font-weight: 600;
}
.task-start:hover { background: rgba(255,255,255,.12); }
.task-items { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.task-item {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 13px; border-radius: 7px; font-size: 13px; color: #c6d0e6;
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.task-item:hover { background: rgba(255,255,255,.1); }
.task-item.active { background: rgba(255,255,255,.16); border-bottom-color: #6aa7ff; color: #fff; }
.task-clock { font-size: 12.5px; text-align: right; line-height: 1.35; padding-right: 8px; flex: none; }

/* ============================================================
   搜索框 / 面包屑 / 角标
============================================================ */
.search-row {
  flex: none; display: flex; align-items: center; gap: 8px;
  margin: 8px 12px; padding: 0 12px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  color: #a2aab9;
}
.m-sheet .search-row { margin: 8px 12px 4px; }
.search-row:focus-within { border-color: #9dbdf7; box-shadow: 0 0 0 3px rgba(47,124,246,.12); }
.search-row input {
  flex: 1; border: none; outline: none; background: none;
  padding: 9px 0; font-size: 14px; color: var(--text); font-family: inherit;
}
.search-row.compact { margin: 0; flex: 1; min-width: 130px; padding: 0 10px; background: #eef1f7; border-color: transparent; }
.search-row.compact input { padding: 7px 0; font-size: 13px; }

.crumbs {
  flex: none; display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  padding: 7px 14px; font-size: 12.5px; color: var(--sub);
  background: #f8f9fb; border-bottom: 1px solid var(--line);
}
.window .crumbs { border-bottom: 1px solid var(--line); }
.crumb { padding: 2px 7px; border-radius: 6px; color: #4a5468; white-space: nowrap; }
.crumb:hover { background: #e8edf6; }
.crumb.cur { color: var(--sub); font-weight: 600; }
.crumb-sep { opacity: .5; }

.badge-dot {
  position: absolute; top: 4px; right: 4px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px; background: #f2453c; color: #fff;
  font-size: 10.5px; line-height: 16px; text-align: center; font-weight: 700;
}
.badge-dot:empty, .badge-dot[data-count="0"] { display: none; }
.trash-entry { position: relative; padding-right: 26px; }
.trash-entry .badge-dot { top: 50%; transform: translateY(-50%); right: 7px; }

/* ============================================================
   文件列表（双端共用）
============================================================ */
.file-list { padding-bottom: 12px; }
.file-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-bottom: 1px solid #f0f2f6;
  background: #fff; width: 100%; text-align: left;
}
.file-row:hover { background: #f6f9ff; }
.file-thumb {
  width: 46px; height: 46px; border-radius: 10px; flex: none;
  object-fit: cover; background: #eef1f7;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-thumb svg { width: 24px; height: 24px; }
.file-thumb.tb-dir { background: #fff1cf; }
.file-thumb.tb-dir svg { width: 30px; height: 30px; }
.file-meta { flex: 1; min-width: 0; }
.file-name {
  font-size: 14px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.file-sub { font-size: 12px; color: var(--sub); margin-top: 2px; }
.file-acts { display: flex; gap: 6px; flex: none; }
.act-btn {
  width: 36px; height: 36px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: #f1f4f9; color: #59627a;
}
.act-btn:hover { background: #e4eaf4; }
.act-btn.danger:hover { background: #fde8e7; color: #e0443b; }
.act-btn svg { width: 18px; height: 18px; }

.empty-tip { text-align: center; color: #aab3c2; padding: 14% 30px; }
.empty-tip svg { width: 52px; height: 52px; opacity: .7; }
.empty-tip p { margin-top: 12px; font-size: 15px; color: #8a93a3; }
.empty-tip p.sub { margin-top: 4px; font-size: 13px; }

/* 类型角标颜色 */
.tb-video { background: #ffe9e3; color: #e0613b; }
.tb-audio { background: #ede4ff; color: #7b4de0; }
.tb-pdf   { background: #ffe7e7; color: #d63b3b; }
.tb-doc   { background: #e3edff; color: #2f6fe0; }
.tb-sheet { background: #e2f6e9; color: #1f9c57; }
.tb-zip   { background: #fff0d6; color: #d08a18; }
.tb-code  { background: #e6e9f0; color: #4a5568; }
.tb-file  { background: #eef1f7; color: #7a8499; }
.tb-badge { font-size: 11px; font-weight: 700; letter-spacing: .5px; }

/* 拖拽上传 */
.drop-zone { position: relative; }
.drop-zone.dragging { outline: 2px dashed #6aa0f5; outline-offset: -8px; background: #f2f7ff; }
.drop-mask {
  position: absolute; inset: 0; z-index: 8;
  display: none; align-items: center; justify-content: center;
  background: rgba(47,124,246,.12); color: #2f6fe0;
  font-size: 16px; font-weight: 600; pointer-events: none;
}
.drop-zone.dragging .drop-mask { display: flex; }

/* ============================================================
   记事本 / 进度条 / 提示
============================================================ */
.notes-area {
  flex: 1; width: 100%; border: none; outline: none; resize: none;
  padding: 16px; font-size: 15px; line-height: 1.75;
  font-family: inherit; color: var(--text); background: #fff;
  user-select: text; -webkit-user-select: text;
}
.save-state { font-size: 12.5px; color: #2ea86a; min-width: 52px; text-align: right; }
.save-state.saving { color: #aab3c2; }

.progress {
  flex: none; display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; background: #eef4ff; border-bottom: 1px solid #dde9ff;
}
.progress-track { flex: 1; height: 6px; border-radius: 3px; background: #d7e4fb; overflow: hidden; }
.progress-bar { height: 100%; width: 0; border-radius: 3px; background: var(--blue); transition: width .2s; }
.progress-text { font-size: 12px; color: #3a63b8; min-width: 64px; text-align: right; }
.compact-progress { flex-basis: 100%; border: none; border-radius: 8px; padding: 6px 10px; }

.toast {
  position: fixed; left: 50%; bottom: 70px; transform: translateX(-50%) translateY(20px);
  background: rgba(25,30,45,.92); color: #fff; font-size: 13.5px;
  padding: 10px 20px; border-radius: 22px; z-index: 999;
  opacity: 0; pointer-events: none; transition: all .25s;
  max-width: 80vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================================================
   预览弹层
============================================================ */
.viewer {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(12,15,25,.94);
  display: flex; flex-direction: column;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.viewer-bar {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
  color: #fff;
}
.viewer-name {
  font-size: 14.5px; font-weight: 600; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px;
}
.viewer-acts { display: flex; align-items: center; gap: 6px; flex: none; }
.viewer-body { flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; padding: 8px 12px 18px; }
.viewer-body img { max-width: 100%; max-height: 100%; border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.viewer-body video { max-width: 100%; max-height: 100%; border-radius: 6px; background: #000; }
.viewer-body audio { width: min(520px, 92%); }
.viewer-body iframe { width: 100%; height: 100%; border: none; background: #fff; border-radius: 6px; }
.viewer-body pre {
  width: 100%; height: 100%; overflow: auto;
  background: #1d2333; color: #d8e0f0; border-radius: 8px;
  padding: 18px; font-size: 13.5px; line-height: 1.7; white-space: pre-wrap; word-break: break-word;
  user-select: text; -webkit-user-select: text;
}
.viewer-other { text-align: center; color: #c6d0e6; }
.viewer-other .file-thumb { width: 88px; height: 88px; margin: 0 auto 16px; background: rgba(255,255,255,.1); color: #c6d0e6; }
.viewer-other .file-thumb svg { width: 44px; height: 44px; }
.viewer-other p { font-size: 15px; margin-bottom: 16px; word-break: break-all; padding: 0 20px; }

/* ============================================================
   回收站弹层
============================================================ */
.modal {
  position: fixed; inset: 0; z-index: 180;
  background: rgba(12,15,25,.5);
  display: flex; align-items: center; justify-content: center; padding: 16px;
  animation: fadeIn .18s ease;
}
.modal-card {
  background: #fff; border-radius: 14px; width: min(600px, 100%);
  max-height: min(82vh, 680px); display: flex; flex-direction: column;
  overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.modal-head {
  flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 10px 10px 18px; border-bottom: 1px solid var(--line);
}
.modal-head h3 { font-size: 16px; }
.modal-head > div { display: flex; align-items: center; gap: 6px; }
.modal-body { flex: 1; overflow-y: auto; }
.modal-foot {
  flex: none; padding: 8px 16px; font-size: 12.5px; color: var(--sub);
  border-top: 1px solid var(--line); background: #f8f9fb;
}
.restore-btn { color: #2f7cf6; }

/* ============================================================
   相册
============================================================ */
.gallery-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px; padding: 12px;
}
.gallery-item {
  position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden;
  background: #eef1f7; cursor: pointer;
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.gallery-item:hover img { transform: scale(1.06); }
.gallery-item .g-name {
  position: absolute; left: 0; right: 0; bottom: 0;
  font-size: 11px; color: #fff; padding: 16px 7px 6px;
  background: linear-gradient(transparent, rgba(0,0,0,.65));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; transition: opacity .15s;
}
.gallery-item:hover .g-name, .gallery-item:active .g-name { opacity: 1; }

/* ============================================================
   计算器
============================================================ */
.calc {
  flex: 1; display: flex; flex-direction: column;
  background: #1f2433; padding: 12px; gap: 10px;
}
.win-calc { padding: 14px; }
.calc-screen {
  flex: none; border-radius: 12px; background: #151a28;
  padding: 16px 18px; text-align: right; color: #fff;
  min-height: 86px; display: flex; flex-direction: column; justify-content: flex-end;
}
.calc-expr { font-size: 13px; color: #8a94ac; min-height: 18px; white-space: nowrap; overflow: hidden; }
.calc-value { font-size: 34px; font-weight: 600; line-height: 1.25; word-break: break-all; }
.calc-keys { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.calc-key {
  border: none; border-radius: 12px; font-size: 19px; font-weight: 600;
  background: #31384d; color: #eef2fb; font-family: inherit;
  transition: filter .1s;
}
.calc-key:active { filter: brightness(1.35); }
.calc-key.fn { background: #424b66; color: #b9c4de; }
.calc-key.op { background: #3d4a6e; color: #8fb4ff; font-size: 22px; }
.calc-key.eq { background: #2f7cf6; color: #fff; }
.calc-key.zero { grid-column: span 2; }

/* ============================================================
   右键 / 长按 菜单
============================================================ */
.ctx-menu {
  position: fixed; z-index: 300;
  min-width: 172px; max-width: 82vw;
  background: rgba(252, 253, 255, .97);
  border-radius: 11px; padding: 6px;
  box-shadow: 0 12px 38px rgba(10, 16, 40, .28), 0 0 0 1px rgba(15, 23, 50, .07);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  animation: ctxIn .13s ease;
}
@keyframes ctxIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.ctx-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 8px 11px;
  border-radius: 7px; font-size: 13.5px; color: #2b3240;
  text-align: left; white-space: nowrap; line-height: 1.3;
}
.ctx-item:hover, .ctx-item:active { background: #e8f0fe; }
.ctx-item svg { width: 16px; height: 16px; flex: none; color: #68728a; }
.ctx-item.danger { color: #d6453b; }
.ctx-item.danger:hover, .ctx-item.danger:active { background: #fdeceb; }
.ctx-item.danger svg { color: #d6453b; }
.ctx-item .ctx-sub { margin-left: auto; font-size: 11.5px; color: #a6aebd; }
.ctx-sep { height: 1px; background: #e7eaf1; margin: 5px 9px; }

body.mode-mobile .ctx-menu { min-width: 196px; }
body.mode-mobile .ctx-item { padding: 11px 13px; font-size: 15px; border-radius: 9px; }
body.mode-mobile .ctx-item svg { width: 18px; height: 18px; }

/* 手机端微调 */
@media (max-width: 480px) {
  .m-app-icon { width: 58px; height: 58px; }
  .m-sheet-head { gap: 2px; }
  .m-sheet-head h2 { font-size: 16px; }
  .icon-btn { width: 36px; height: 36px; }
}

/* ============================================================
   自定义弹窗 / 底部动作选择（替代 prompt/confirm，兼容手机 WebView）
============================================================ */
.ui-mask {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(12, 15, 25, .45);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; transition: opacity .18s ease;
}
.ui-mask.show { opacity: 1; }
.ui-dialog {
  width: min(360px, 100%);
  background: #fff; border-radius: 16px;
  padding: 20px 18px 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
  transform: translateY(14px) scale(.98);
  transition: transform .2s cubic-bezier(.32,.72,.28,1);
}
.ui-mask.show .ui-dialog { transform: none; }
.ui-dialog-title { font-size: 16.5px; font-weight: 700; text-align: center; }
.ui-dialog-msg {
  font-size: 14px; color: #5a6376; line-height: 1.65;
  text-align: center; margin-top: 10px; word-break: break-word;
}
.ui-field { margin-top: 14px; }
.ui-input {
  width: 100%; border: 1.5px solid #dce3ee; border-radius: 10px;
  padding: 11px 13px; font-size: 15px; font-family: inherit; color: var(--text);
  outline: none; background: #f8fafc; user-select: text; -webkit-user-select: text;
}
.ui-input:focus { border-color: #7facf5; background: #fff; box-shadow: 0 0 0 3px rgba(47,124,246,.14); }
.ui-textarea { min-height: 110px; resize: vertical; line-height: 1.6; }
.ui-input.shake { animation: uiShake .35s; border-color: #f0837b; }
@keyframes uiShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
.ui-dialog-foot { display: flex; gap: 10px; margin-top: 18px; }
.ui-dialog-foot .btn { flex: 1; justify-content: center; padding: 11px 0; font-size: 15px; border-radius: 10px; }
.ui-ok.btn.danger, .btn.danger-solid { background: #e8453c; color: #fff; }
.ui-ok.btn.danger:hover, .btn.danger-solid:hover { background: #d23b33; }

/* 底部动作选择（sheet 形态） */
.ui-dialog.as-sheet {
  width: min(420px, 100%);
  align-self: flex-end;
  border-radius: 18px 18px 6px 6px;
  padding: 8px;
  margin-bottom: env(safe-area-inset-bottom);
}
.ui-sheet-list { display: flex; flex-direction: column; gap: 1px; }
.ui-sheet-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 14px 12px;
  font-size: 15.5px; color: var(--text);
  border-radius: 10px; text-align: left;
}
.ui-sheet-item:active, .ui-sheet-item:hover { background: #eef3fc; }
.ui-sheet-item.danger { color: #e0443b; }
.ui-sheet-item.cancel { justify-content: center; color: var(--sub); margin-top: 6px; border-top: 1px solid var(--line); border-radius: 0; }
.ui-sheet-ic { width: 20px; height: 20px; display: inline-flex; color: #68728a; }
.ui-sheet-ic svg { width: 100%; height: 100%; }
@media (min-width: 560px) {
  .ui-dialog.as-sheet { align-self: center; border-radius: 16px; }
}

/* ============================================================
   移动到… 选择器
============================================================ */
.move-card { width: min(460px, 100%); max-height: min(72vh, 560px); }
.move-list { padding: 6px 8px 10px; }
.move-row {
  display: flex; align-items: center; gap: 9px;
  width: 100%; padding: 10px 12px; border-radius: 9px;
  font-size: 14px; color: var(--text); text-align: left;
}
.move-row:hover { background: #f2f6ff; }
.move-row.sel { background: #e6efff; color: #1f6ae0; font-weight: 600; }
.move-row.disabled { opacity: .38; cursor: not-allowed; }
.move-row .move-ic { width: 21px; height: 21px; flex: none; }
.move-row .move-ic svg { width: 100%; height: 100%; }
.move-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.move-check { color: #2f7cf6; font-weight: 700; opacity: 0; }
.move-row.sel .move-check { opacity: 1; }

/* ============================================================
   预览：导航 / 序号 / 编辑
============================================================ */
.viewer-name { flex: 0 1 auto; }
.viewer-index { font-size: 12.5px; color: rgba(255,255,255,.6); margin-left: 2px; }
.viewer-nav { width: 40px; height: 40px; }
.viewer-nav svg { width: 24px; height: 24px; }
.viewer-edit-btn {
  background: rgba(255,255,255,.14); color: #fff;
  border: 1px solid rgba(255,255,255,.28);
}
.viewer-edit-btn:hover { background: rgba(255,255,255,.24); }
.viewer-editor {
  width: 100%; height: 100%;
  border: none; outline: none; resize: none;
  border-radius: 8px; padding: 18px;
  background: #fff; color: var(--text);
  font-size: 14.5px; line-height: 1.75;
  font-family: ui-monospace, "Cascadia Code", Consolas, "PingFang SC", monospace;
  user-select: text; -webkit-user-select: text;
}

/* ============================================================
   排序按钮 / 保存失败状态 / 工具栏按钮
============================================================ */
#dSortBtn svg { flex: none; }
.save-state.error { color: #e0443b; cursor: pointer; text-decoration: underline; }

/* 上传中禁用 */
.icon-btn:disabled, .btn:disabled { opacity: .55; pointer-events: none; }

/* ============================================================
   浏览器窗口
============================================================ */
.browser-bar {
  flex: none; display: flex; align-items: center; gap: 5px;
  padding: 8px 10px; border-bottom: 1px solid var(--line); background: #f8f9fb;
}
.br-btn {
  width: 30px; height: 30px; border-radius: 7px; flex: none;
  display: flex; align-items: center; justify-content: center; color: #4a5468;
}
.br-btn:hover:not(:disabled) { background: #e8edf6; }
.br-btn:disabled { opacity: .32; cursor: default; }
.br-url {
  flex: 1; min-width: 100px;
  border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 12px; font-size: 13px; font-family: inherit;
  outline: none; background: #fff; color: var(--text);
  user-select: text; -webkit-user-select: text;
}
.br-url:focus { border-color: #9dbdf7; box-shadow: 0 0 0 3px rgba(47,124,246,.12); }
.browser-view { flex: 1; position: relative; background: #fff; overflow: hidden; }
.browser-view iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: none; background: #fff; }
.br-loadbar { position: absolute; top: 0; left: 0; right: 0; height: 3px; overflow: hidden; z-index: 3; display: none; }
.br-loadbar.on { display: block; }
.br-loadbar::after {
  content: ''; position: absolute; top: 0; left: -40%; width: 40%; height: 100%;
  background: linear-gradient(90deg, rgba(47,124,246,0), #2f7cf6);
  animation: brLoad 1s linear infinite;
}
@keyframes brLoad { to { left: 105%; } }

/* 浏览器主页 */
.br-home {
  position: absolute; inset: 0; overflow-y: auto;
  display: flex; flex-direction: column; align-items: center;
  padding: 40px 22px 20px; gap: 26px;
  background: linear-gradient(180deg, #f6f9ff 0%, #eef3fb 100%);
}
.br-logo { display: flex; align-items: center; gap: 12px; font-size: 22px; font-weight: 700; color: #2b3240; }
.br-search { display: flex; gap: 8px; width: min(560px, 100%); }
.br-search input {
  flex: 1; border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 16px; font-size: 14px; font-family: inherit; outline: none; background: #fff;
  color: var(--text); box-shadow: 0 2px 10px rgba(30,50,90,.06);
  user-select: text; -webkit-user-select: text;
}
.br-search input:focus { border-color: #9dbdf7; box-shadow: 0 0 0 3px rgba(47,124,246,.14); }
.br-links { display: grid; grid-template-columns: repeat(4, 88px); gap: 16px 12px; justify-content: center; }
.br-link { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 8px 2px; border-radius: 10px; }
.br-link:hover { background: rgba(47,124,246,.08); }
.br-tile {
  width: 46px; height: 46px; border-radius: 12px; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; font-weight: 700; box-shadow: 0 4px 10px rgba(20,30,80,.14);
}
.br-link-name { font-size: 12px; color: #4a5468; }
.br-note { margin-top: auto; font-size: 12px; color: var(--sub); text-align: center; }

/* ============================================================
   访问锁屏（六位密码）
============================================================ */
.lock-screen {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(70% 55% at 80% 10%, rgba(120,170,255,.55) 0%, rgba(120,170,255,0) 60%),
    radial-gradient(60% 50% at 15% 85%, rgba(170,110,255,.45) 0%, rgba(170,110,255,0) 60%),
    linear-gradient(140deg, #0e2a6e 0%, #1c3f8f 40%, #4a2f96 100%);
  opacity: 0; transition: opacity .25s;
  color: #fff;
}
.lock-screen.show { opacity: 1; }
.lock-card { text-align: center; width: min(320px, 88vw); }
.lock-screen.shake .lock-card { animation: lockShake .4s; }
@keyframes lockShake {
  20% { transform: translateX(-9px); }
  40% { transform: translateX(9px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}
.lock-logo svg { width: 54px; height: 54px; filter: drop-shadow(0 4px 10px rgba(0,0,0,.3)); }
.lock-title { margin: 12px 0 24px; font-size: 21px; font-weight: 700; letter-spacing: 3px; text-shadow: 0 2px 6px rgba(0,0,0,.3); }
.lock-dots { display: flex; justify-content: center; gap: 10px; margin-bottom: 14px; }
.lock-dots i {
  width: 40px; height: 48px; border-radius: 10px; font-style: normal;
  border: 1.5px solid rgba(255,255,255,.35); background: rgba(255,255,255,.1);
  font-size: 20px; line-height: 48px; text-align: center;
  transition: border-color .15s, background .15s, transform .15s;
}
.lock-dots i.cur { border-color: rgba(255,255,255,.95); background: rgba(255,255,255,.18); transform: translateY(-2px); }
.lock-dots i.fill { background: rgba(255,255,255,.24); }
.lock-input { position: absolute; width: 1px; height: 1px; opacity: .01; border: none; }
.lock-msg { min-height: 22px; font-size: 13.5px; color: #ffb4ab; }
.lock-hint { font-size: 12.5px; color: rgba(255,255,255,.55); letter-spacing: 1px; }

