/* 私人网盘 —— 经典桌面软件风格。无动画、无阴影、无圆角。 */

:root {
  --face: #d4d0c8;
  --hilight: #ffffff;
  --light: #d4d0c8;
  --shadow: #808080;
  --dkshadow: #404040;
  --window: #ffffff;
  --text: #000000;
  --graytext: #808080;
  --select-bg: #0a246a;
  --select-fg: #ffffff;
  --title-a: #0a246a;
  --title-b: #a6caf0;
  --desktop: #3a6ea5;
  --info-bg: #ffffe1;
  /* 窗口和应用控件共用同一组平滑的中英文字体。 */
  --font: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", "Noto Sans SC", "Segoe UI", system-ui, sans-serif;

  /* 立体边框 */
  --raised: inset 1px 1px var(--hilight), inset -1px -1px var(--dkshadow), inset 2px 2px var(--light), inset -2px -2px var(--shadow);
  --pressed: inset 1px 1px var(--dkshadow), inset -1px -1px var(--hilight), inset 2px 2px var(--shadow), inset -2px -2px var(--light);
  --sunken: inset 1px 1px var(--shadow), inset -1px -1px var(--hilight), inset 2px 2px var(--dkshadow), inset -2px -2px var(--light);
  --window-edge: inset 1px 1px var(--light), inset -1px -1px var(--dkshadow), inset 2px 2px var(--hilight), inset -2px -2px var(--shadow);
  --thin-raised: inset 1px 1px var(--hilight), inset -1px -1px var(--shadow);
  --thin-sunken: inset 1px 1px var(--shadow), inset -1px -1px var(--hilight);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
/* 禁用浏览器的手势（16.1）：触摸板左右滑动前进 / 后退、下拉刷新、双指 / 双击缩放、长按弹出的菜单。
   Ctrl + 滚轮（触摸板双指缩放）、鼠标侧键和右键菜单在 common.js 中取消。 */
html, body { overscroll-behavior: none; }
html { touch-action: pan-x pan-y; -webkit-touch-callout: none; }
body {
  font: 12px/1.4 var(--font);
  color: var(--text);
  background: var(--face);
  -webkit-text-size-adjust: 100%;
  /* 与 Windows 相同：界面（图标、列表、菜单、对话框、标题栏……）里的字不能拖选，只有文本区域可以 */
  user-select: none;
  -webkit-user-select: none;
}
input, textarea, [contenteditable], .text-view, .md-view, .help-body {
  user-select: text;
  -webkit-user-select: text;
}
/* 图片不能单独拖走（否则拖动列表行时拖的是图标图片，落点会当成从本机拖来的文件） */
img { -webkit-user-drag: none; }
button, input, select, textarea { font: inherit; color: inherit; margin: 0; }
p { margin: 0 0 8px; }
code { font-family: "Courier New", SimSun, monospace; background: var(--window); padding: 0 2px; }
u { text-decoration: underline; }
img.icon16 { width: 16px; height: 16px; flex: none; vertical-align: middle; }
img.icon32 { width: 32px; height: 32px; flex: none; }
:focus-visible { outline: 1px dotted #000; outline-offset: -2px; }

/* 窗口内的页面跳转（同源整页加载）：保留旧画面直到新页面渲染好再直接切换，不做动画，避免中间出现空白帧。 */
@view-transition { navigation: auto; }
::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none; }

/* ---------------------------------------------------------------- 窗口 */

.window {
  background: var(--face);
  padding: 3px;
  box-shadow: var(--window-edge);
}
.title-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 18px;
  padding: 0 3px;
  color: #fff;
  font-weight: bold;
  background: linear-gradient(90deg, var(--title-a), var(--title-b));
  white-space: nowrap;
  overflow: hidden;
  flex: none;
}
.title-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* 对话框标题栏右端的关闭按钮（字形是下面的 SVG） */
.title-close {
  flex: none;
  width: 16px;
  height: 14px;
  padding: 0;
  border: 0;
  font: 9px/12px var(--font);
  text-align: center;
  color: #000;
  background-color: var(--face);
  box-shadow: inset 1px 1px var(--hilight), inset -1px -1px var(--dkshadow), inset -2px -2px var(--shadow);
  cursor: default;
}
.title-close:active:not(:disabled) {
  box-shadow: inset 1px 1px var(--dkshadow), inset -1px -1px var(--hilight), inset 2px 2px var(--shadow);
  background-position: 1px 1px;
}
.title-close:disabled { color: var(--graytext); text-shadow: 1px 1px var(--hilight); }
/* 关闭按钮的字形：像素风格的叉 */
.title-close { font-size: 0 !important; color: transparent !important; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='14' shape-rendering='crispEdges'%3E%3Cpath fill='%23000' d='M4 3h2v1H4zM10 3h2v1h-2zM5 4h2v1H5zM9 4h2v1H9zM6 5h4v1H6zM7 6h2v1H7zM6 7h4v1H6zM5 8h2v1H5zM9 8h2v1H9zM4 9h2v1H4zM10 9h2v1h-2z'/%3E%3C/svg%3E") !important; background-repeat: no-repeat !important; }
.title-close:disabled { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='14' shape-rendering='crispEdges'%3E%3Cpath fill='%23808080' d='M4 3h2v1H4zM10 3h2v1h-2zM5 4h2v1H5zM9 4h2v1H9zM6 5h4v1H6zM7 6h2v1H7zM6 7h4v1H6zM5 8h2v1H5zM9 8h2v1H9zM4 9h2v1H4zM10 9h2v1h-2z'/%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='14' shape-rendering='crispEdges'%3E%3Cpath fill='%23fff' d='M4 3h2v1H4zM10 3h2v1h-2zM5 4h2v1H5zM9 4h2v1H9zM6 5h4v1H6zM7 6h2v1H7zM6 7h4v1H6zM5 8h2v1H5zM9 8h2v1H9zM4 9h2v1H4zM10 9h2v1h-2z'/%3E%3C/svg%3E") 1px 1px !important; }
.window-body { padding: 10px; }

/* ---------------------------------------------------------------- 按钮与输入框 */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 75px;
  height: 23px;
  padding: 0 10px;
  border: 0;
  background: var(--face);
  color: #000;
  box-shadow: var(--raised);
  text-decoration: none;
  white-space: nowrap;
  cursor: default;
}
.btn:active:not(:disabled) { box-shadow: var(--pressed); padding: 1px 9px 0 11px; }
.btn:focus-visible { outline: 1px dotted #000; outline-offset: -5px; }
.btn.default {
  box-shadow: inset 0 0 0 1px #000, inset 2px 2px var(--hilight), inset -2px -2px var(--dkshadow),
              inset 3px 3px var(--light), inset -3px -3px var(--shadow);
}
.btn.default:active:not(:disabled) { box-shadow: inset 0 0 0 1px #000, inset 0 0 0 2px var(--shadow); }
.btn:disabled { color: var(--graytext); text-shadow: 1px 1px var(--hilight); }
.btn-small { min-width: 0; height: 22px; padding: 0 6px; }
.btn-small:active:not(:disabled) { padding: 1px 5px 0 7px; }

.field {
  height: 21px;
  padding: 2px 4px;
  border: 0;
  background: var(--window);
  box-shadow: var(--sunken);
  border-radius: 0;
  outline: none;
}
.field:disabled { background: var(--face); color: var(--graytext); }

.groupbox {
  margin: 10px 0 0;
  padding: 6px 10px 8px;
  border: 1px solid var(--shadow);
  box-shadow: 1px 1px 0 var(--hilight), inset 1px 1px 0 var(--hilight);
}
.groupbox legend { padding: 0 3px; }

.plain-list { margin: 0; padding: 0 0 0 16px; }

/* ---------------------------------------------------------------- 对话框页面（登录、消息框） */

body.desktop {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--desktop);
}
.dialog { width: 420px; max-width: 100%; }
.dialog .window-body { padding: 12px 12px 10px; }
.message-box { width: 380px; }
.dialog-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -12px -12px 12px;
  padding: 10px 14px;
  background: var(--window);
  border-bottom: 1px solid var(--shadow);
  box-shadow: 0 1px 0 var(--hilight);
}
.banner-title { font-size: 16px; font-weight: bold; color: var(--title-a); }
.banner-sub { color: var(--graytext); }
.msg { display: flex; gap: 14px; align-items: flex-start; }
.msg p { margin-top: 2px; }
.msg-text { min-width: 0; overflow-wrap: anywhere; }
.msg-details { margin: 0; padding-left: 16px; color: #333; }
.form-grid {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px 10px;
  align-items: center;
  margin: 12px 0 4px 46px;
}
.dialog-buttons { display: flex; justify-content: flex-end; gap: 6px; margin-top: 14px; }
.dialog-buttons.center { justify-content: center; }
.notice {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  margin: 8px 0 0 46px;
  padding: 5px 6px;
  background: var(--info-bg);
  border: 1px solid #000;
  overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------- 主窗口布局 */

body.app { height: 100vh; height: 100dvh; overflow: hidden; }
.app-window { display: flex; flex-direction: column; height: 100%; }

/* 帮助页是独立文档，样式需放在帮助页也加载的公共样式表中。 */
.help-window { min-height: 0; overflow: hidden; }
.help-body { flex: 1; min-width: 0; min-height: 0; overflow: auto; padding: 10px 14px; background: var(--window); box-shadow: var(--thin-sunken); font-size: 13px; line-height: 1.7; }
.help-body h1 { margin: 0 0 8px; font-size: 16px; }
.help-body h2 { margin: 14px 0 4px; font-size: 13px; }
.help-body ul { margin: 0 0 6px; padding-left: 20px; }
.help-body li { margin: 2px 0; }
.help-keys { border-collapse: collapse; margin: 4px 0 8px; }
.help-keys th, .help-keys td { border: 1px solid var(--shadow); padding: 2px 8px; text-align: left; }
.help-note { margin-top: 12px; color: var(--graytext); }

.menubar {
  display: flex;
  flex-wrap: wrap;
  flex: none;
  padding: 1px 0;
  border-bottom: 1px solid var(--shadow);
  box-shadow: 0 1px 0 var(--hilight);
  margin-bottom: 1px;
}
.menu { position: relative; }
.menu-title {
  padding: 1px 6px;
  border: 1px solid transparent;
  background: none;
  cursor: default;
}
.menu-title:hover { border-color: var(--hilight) var(--shadow) var(--shadow) var(--hilight); }
.menu.open > .menu-title { border-color: var(--shadow) var(--hilight) var(--hilight) var(--shadow); }
.menu-dropdown {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  z-index: 100;
  min-width: 170px;
  padding: 3px;
  background: var(--face);
  box-shadow: var(--window-edge);
}
.menu.open > .menu-dropdown { display: block; }
.menu-item {
  display: flex;
  align-items: center;
  width: 100%;
  height: 17px; /* Win2000：菜单项 17 像素高，文字从左边 18 像素处开始 */
  padding: 0 17px 0 18px;
  border: 0;
  background: none;
  color: #000;
  line-height: 17px;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  cursor: default;
  position: relative;
}
.menu-item:hover, .menu-item:focus { background: var(--select-bg); color: var(--select-fg); outline: none; }
.menu-item.disabled, .menu-item:disabled { color: var(--graytext); text-shadow: 1px 1px var(--hilight); }
.menu-item.disabled:hover, .menu-item:disabled:hover { background: none; color: var(--graytext); }
.menu-item.checked::before { content: "\2022"; position: absolute; left: 7px; font-weight: bold; }
.menu-item .shortcut { margin-left: auto; padding-left: 24px; }
.menu-sep { margin: 3px 0 4px; border-top: 1px solid var(--shadow); border-bottom: 1px solid var(--hilight); }
.menu-form { margin: 0; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  flex: none;
  gap: 1px;
  padding: 2px;
  border-bottom: 1px solid var(--shadow);
  box-shadow: 0 1px 0 var(--hilight);
  margin-bottom: 1px;
}
.tb-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 6px;
  border: 1px solid transparent;
  background: transparent;
  color: #000;
  text-decoration: none;
  white-space: nowrap;
  cursor: default;
}
.tb-btn:hover:not(:disabled) { border-color: var(--hilight) var(--shadow) var(--shadow) var(--hilight); }
.tb-btn:active:not(:disabled) { border-color: var(--shadow) var(--hilight) var(--hilight) var(--shadow); padding: 1px 5px 0 7px; }
.tb-btn:disabled { color: var(--graytext); text-shadow: 1px 1px var(--hilight); }
.tb-btn:disabled img, .tb-btn.disabled img { opacity: 0.4; filter: grayscale(1); }
.tb-sep { flex: none; width: 2px; height: 18px; margin: 0 3px; border-left: 1px solid var(--shadow); border-right: 1px solid var(--hilight); }
.toolbar > .tb-sep:first-child { display: none; } /* 工具栏开头不画分隔线（各组按钮前面都带一条） */

.addressbar {
  display: flex;
  align-items: center;
  flex: none;
  gap: 4px;
  padding: 2px 3px 3px;
  margin: 0;
}
.addressbar label { white-space: nowrap; }
.addr-field { flex: 1; display: flex; align-items: center; gap: 3px; height: 22px; min-width: 0; padding: 0 4px; }
.addr-field input { flex: 1; min-width: 0; height: 18px; padding: 0; border: 0; outline: none; background: transparent; }
/* 各级文件夹（网盘 › 照片 › 2026）。输入地址时（.editing）换成输入框；输入框平时缩成 0 宽，仍然可以用 Alt+D 聚焦 */
.addr-crumbs { flex: 1; display: flex; align-items: center; min-width: 0; height: 100%; overflow: hidden; white-space: nowrap; cursor: text; }
.addr-crumbs[hidden] { display: none; }
.addr-field:not(.editing) .addr-crumbs ~ input { flex: 0 0 0; width: 0; opacity: 0; }
.addr-field.editing .addr-crumbs { display: none; }
/* 每一级上下各留 1 像素、左右留 6 像素，悬浮的边框不贴着输入框的边和文字 */
.addr-crumbs .crumb { flex: none; height: 16px; line-height: 14px; padding: 0 6px; border: 1px solid transparent; color: inherit; text-decoration: none; cursor: default; user-select: none; -webkit-user-select: none; }
.addr-crumbs .crumb:hover { border-color: var(--hilight) var(--shadow) var(--shadow) var(--hilight); }
.addr-crumbs .crumb:active { border-color: var(--shadow) var(--hilight) var(--hilight) var(--shadow); padding: 1px 5px 0 7px; }
.addr-crumbs .crumb.drop-target { background: var(--select-bg); color: var(--select-fg); border-color: var(--select-bg); }
.addr-crumbs .crumb-sep { flex: none; width: 0; height: 0; margin: 0 3px; border: 3.5px solid transparent; border-left: 4px solid currentColor; border-right: 0; }

/* ---------------------------------------------------------------- 工具条（Win2000 的 Rebar，14.2 第 4 条）

   外框是一个刻线矩形；每条高 22 像素，条与条之间是一条刻线；每条左边有一个凸起的把手。
   以上尺寸都是从 Windows 2000 虚拟机截图中逐像素量出来的。 */
.rebar {
  flex: none;
  margin: 0 0 3px;
  padding: 1px;
  border: 1px solid;
  border-color: var(--shadow) var(--hilight) var(--hilight) var(--shadow);
  box-shadow: inset 1px 1px var(--hilight), inset -1px -1px var(--shadow);
}
.band {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 22px;
  padding: 0 0 0 9px;
}
.band::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  bottom: 2px;
  width: 3px;
  box-shadow: inset 1px 1px var(--hilight), inset -1px -1px var(--shadow);
}
.band + .band { border-top: 1px solid var(--shadow); box-shadow: inset 0 1px var(--hilight); padding-top: 1px; }
.band + .band::before { top: 3px; }
.band .menubar, .band .toolbar, .band .addressbar, .band.addressbar {
  margin: 0;
  border: 0;
  box-shadow: none;
}
.band .menubar { flex: 1; min-width: 0; padding: 0; }
.band + .band.addressbar { padding: 1px 0 0 9px; }
.band.search-panel { display: grid; padding: 4px 6px 5px 14px; }
.band.search-panel::before { bottom: 3px; }
/* 菜单栏右端的程序标志：一条刻线，后面是程序图标 */
.brand {
  flex: none;
  align-self: stretch;
  width: 28px;
  margin-left: auto;
  background:
    url("../icons/app.svg") 8px center no-repeat,
    linear-gradient(90deg, var(--shadow) 0 1px, var(--hilight) 1px 2px, transparent 2px);
}
.band .toolbar { flex: 1; min-width: 0; flex-wrap: nowrap; overflow: hidden; gap: 0; padding: 0; }
.band .tb-btn { height: 22px; min-width: 23px; justify-content: center; gap: 3px; padding: 0 3px; }
.band .tb-btn.has-text { padding: 0 5px 0 3px; }
.band .tb-btn:active:not(:disabled), .band .tb-btn.pressed { padding-top: 1px; padding-left: 4px; }
.band .tb-btn.has-text:active:not(:disabled), .band .tb-btn.has-text.pressed { padding-right: 4px; }
/* 选择性文字在右侧：没有 has-text 的按钮只显示图案（文字作为提示） */
.toolbar.selective-text .tb-btn:not(.has-text) > span { display: none; }
/* 整个按钮都是下拉的按钮（查看）：图案右边一个小黑三角 */
.tb-btn.dropdown::after {
  content: "";
  margin-left: 1px;
  border: 3px solid transparent;
  border-top: 3px solid #000;
  border-bottom: 0;
}
.tb-btn.dropdown:disabled::after { border-top-color: var(--shadow); }
/* 地址栏：组合框（下拉按钮）+ 平面的“转到”按钮 */
.band.addressbar { gap: 4px; padding-right: 2px; }
.band .addr-field { height: 22px; padding: 0 0 0 4px; }
.combo-btn {
  flex: none;
  align-self: stretch;
  width: 16px;
  margin: 2px 2px 2px 0;
  padding: 0;
  border: 0;
  font-size: 0;
  background: var(--face) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='7' height='4'%3E%3Cpath d='M0 0h7L3.5 3.5z'/%3E%3C/svg%3E") center no-repeat;
  box-shadow: var(--raised);
  cursor: default;
}
.combo-btn:active, .combo-btn.open { box-shadow: inset 0 0 0 1px var(--shadow); padding: 1px 0 0 1px; }
.go-icon { width: 16px; height: 16px; flex: none; background: url("../icons/go.svg") no-repeat; }
.addr-list {
  position: fixed;
  z-index: 950;
  max-height: 60vh;
  overflow: auto;
  padding: 0;
  background: var(--window);
  border: 1px solid #000;
}
.addr-list .addr-item { display: flex; align-items: center; gap: 4px; height: 18px; padding-right: 8px; white-space: nowrap; cursor: default; }
.addr-list .addr-item:hover, .addr-list .addr-item.hot { background: var(--select-bg); color: var(--select-fg); }

.main { flex: 1; display: flex; min-height: 0; }
/* 凹下的框里是文件列表（窗口不出现任何侧边栏） */
.view-pane {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  padding: 2px;
  background: var(--window);
  box-shadow: var(--sunken);
  container-type: inline-size;
}
.list-pane { flex: 1; min-width: 0; overflow: auto; background: var(--window); }

/* 资源管理器独立表头：回弹只发生在文件内容中，不移动列标题。 */
.explorer-app .main { min-width: 0; }
.explorer-app .view-pane { flex-direction: column; min-height: 0; overflow: hidden; }
.explorer-app .list-pane { min-height: 0; overscroll-behavior: none; overflow-anchor: none; }
.explorer-header { flex: none; min-width: 0; overflow: hidden; background: var(--face); }
.explorer-header th { position: relative; top: auto; }

.statusbar { display: flex; flex: none; gap: 2px; padding-top: 3px; }
.sb-panel {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 4px;
  box-shadow: var(--thin-sunken);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sb-main { flex: 1; min-width: 0; display: block; line-height: 20px; }
.sb-size { width: 90px; flex: none; }
.sb-free { width: 160px; flex: none; }
.sb-user { width: 110px; flex: none; }
.sb-zone { width: 140px; flex: none; }
.sb-pos { width: 150px; flex: none; }

/* ---------------------------------------------------------------- 目录树（“浏览文件夹”对话框） */

.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree li { position: relative; white-space: nowrap; line-height: 16px; } /* Win2000：每行 16 像素 */
.tree ul { margin-left: 9px; }
.tree ul > li { padding-left: 19px; }
.tree ul > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-left: 1px dotted var(--shadow);
}
.tree ul > li:last-child::before { bottom: auto; height: 8px; }
.tree ul > li::after {
  content: "";
  position: absolute;
  left: 1px;
  top: 8px;
  width: 16px;
  border-top: 1px dotted var(--shadow);
}
.tree li.collapsed > ul { display: none; }
.tree .toggle {
  position: absolute;
  z-index: 1;
  left: -4px;
  top: 4px;
  width: 9px;
  height: 9px;
  padding: 0;
  border: 1px solid var(--shadow);
  background: var(--window);
  cursor: default;
}
.tree .toggle::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 3px;
  width: 5px;
  height: 1px;
  background: #000;
}
.tree li.collapsed > .toggle::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 1px;
  width: 1px;
  height: 5px;
  background: #000;
}
.tree li.leaf > .toggle { display: none; }
.tree .node {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 16px;
  padding: 0 2px;
  color: #000;
  text-decoration: none;
  vertical-align: top;
}
.tree .node span { padding: 0 2px; }
.tree .node.current span { background: var(--select-bg); color: var(--select-fg); }
.tree .node:focus-visible { outline: none; }
.tree .node:focus-visible span { outline: 1px dotted #000; }
.tree li.more { color: var(--graytext); }

/* ---------------------------------------------------------------- 文件列表（详细信息视图） */

.listview { width: 100%; min-width: 560px; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.listview th.col-size { width: 90px; }
.listview th.col-type { width: 150px; }
.listview th.col-mtime { width: 130px; }
.listview th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 0;
  font-weight: normal;
  text-align: left;
  background: var(--face);
  box-shadow: var(--raised); /* Win2000 的列标题：18 像素高的凸起按钮 */
  white-space: nowrap;
}
.listview th a { display: block; height: 18px; padding: 0 6px; line-height: 18px; color: #000; text-decoration: none; overflow: hidden; text-overflow: ellipsis; }
.listview th a:active { box-shadow: inset 1px 1px var(--shadow), inset -1px -1px var(--shadow); padding: 1px 5px 0 7px; }
/* 排序标记：Win2000 画的是空心的立体三角（左边暗、右边和底边亮） */
.listview th.sorted a::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 7px;
  margin-left: 6px;
  vertical-align: -1px;
  background: no-repeat center / 8px 7px;
}
.listview th.sorted.asc a::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='7' shape-rendering='crispEdges'%3E%3Cpath d='M3 0h1v1H3zM2 1h1v2H2zM1 3h1v2H1zM0 5h1v2H0z' fill='%23808080'/%3E%3Cpath d='M4 1h1v2H4zM5 3h1v2H5zM6 5h1v1H6zM1 6h7v1H1z' fill='%23fff'/%3E%3C/svg%3E");
}
.listview th.sorted.desc a::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='7' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h7v1H0zM1 1h1v2H1zM2 3h1v2H2zM3 5h1v2H3z' fill='%23808080'/%3E%3Cpath d='M6 1h1v1H6zM5 2h1v2H5zM4 4h1v2H4z' fill='%23fff'/%3E%3C/svg%3E");
}
.listview th.col-size { text-align: right; }
/* 列标题右边缘的拖动区（listview.js 调整列宽）；col-fill 是固定列宽后补在最后的空白表头 */
.listview .col-grip { position: absolute; top: 0; right: 0; bottom: 0; width: 5px; touch-action: none; cursor: col-resize; }
.listview th.col-fill { width: auto; }
.col-resizing, .col-resizing * { cursor: col-resize !important; user-select: none; }
.listview td { height: 17px; padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: default; }
.listview td.col-size { text-align: right; }
.listview tbody tr:first-child td { padding-top: 1px; }
.cell-name { display: flex; align-items: center; gap: 2px; min-width: 0; }
.listview td.col-name { padding-left: 2px; } /* Win2000：图标距左边 2 像素，名称紧跟图标 */
.cell-name .label { overflow: hidden; text-overflow: ellipsis; padding: 0 1px; }
.listview a.label { color: inherit; text-decoration: none; }
.icon-wrap { position: relative; display: inline-flex; flex: none; }
.link-overlay { position: absolute; left: 0; top: 0; }
/* 选中效果按 Win2000（14.2 第 8 条）：只高亮名称，图标叠蓝色网点（listview.js 的 .sel-tint）；
   列表没有焦点（窗口不是活动窗口，或焦点在地址栏、对话框中）时名称变成灰底，图标不叠网点。 */
.listview tr.selected td.col-name .label { background: var(--select-bg); color: var(--select-fg); }
html.list-unfocused .listview tr.selected td.col-name .label { background: var(--face); color: var(--text); }
.listview tr.focused td.col-name .label { outline: 1px dotted currentColor; }
.listview tr.unavailable td { color: var(--graytext); }
.listview tr.selected.unavailable td.col-name .label { color: #c0c0c0; }
.sel-tint {
  display: none;
  position: absolute;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='2' height='2'%3E%3Crect width='1' height='1' fill='%230a246a'/%3E%3Crect x='1' y='1' width='1' height='1' fill='%230a246a'/%3E%3C/svg%3E");
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}
.listview tr.selected .sel-tint { display: block; }
html.list-unfocused .listview tr.selected .sel-tint, .listview.thumbs .sel-tint { display: none; }
.listview tr.empty td { color: var(--graytext); padding: 8px 6px; }
.listview:focus { outline: none; }
.pager { display: flex; align-items: center; gap: 6px; padding: 6px 4px; }
/* 拉框选择的虚线框（listview.js）：放在列表窗格里，坐标随内容滚动 */
.list-pane { position: relative; }
.marquee { position: absolute; z-index: 1; box-sizing: border-box; border: 1px dotted var(--text); pointer-events: none; }

/* ---------------------------------------------------------------- 缩略图视图（同一个表格，换一种排列方式） */

.listview.thumbs { display: block; min-width: 0; }
.listview.thumbs thead { display: none; }
.listview.thumbs tbody {
  display: grid;
  grid-template-columns: repeat(auto-fill, 106px); /* 100 像素的缩略图框，两边各留 3 像素 */
  gap: 8px 4px;
  padding: 6px 4px;
}
.listview.thumbs tr { display: block; }
.listview.thumbs td { display: none; }
.listview.thumbs td.col-name { display: block; height: auto; padding: 0; overflow: visible; white-space: normal; }
.listview.thumbs tbody tr:first-child td { padding-top: 0; }
.listview.thumbs .cell-name { flex-direction: column; gap: 3px; }
.thumb-box {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 100px;
  height: 100px;
  background: var(--window);
  border: 1px solid #c0c0c0;
}
.thumb-box img.thumb { display: block; max-width: 96px; max-height: 96px; }
.thumb-box .link-overlay { left: 2px; top: auto; bottom: 2px; }
.listview.thumbs .cell-name .label {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  max-width: 104px;
  overflow: hidden;
  line-height: 15px;
  text-align: center;
  white-space: normal;
  word-break: break-all;
}
.listview.thumbs tr.selected td { background: none; color: inherit; }
.listview.thumbs tr.selected .label { background: var(--select-bg); color: var(--select-fg); }
.listview.thumbs tr.selected .thumb-box { border-color: var(--select-bg); box-shadow: 0 0 0 1px var(--select-bg); }
.listview.thumbs tr.unavailable .label { color: var(--graytext); }
.listview.thumbs tr.empty { grid-column: 1 / -1; }
.listview.thumbs tr.empty td { display: block; }

/* ---------------------------------------------------------------- 大图标视图 */

.listview.icons { display: block; min-width: 0; }
.listview.icons thead { display: none; }
.listview.icons tbody {
  display: grid;
  /* 42 像素的图标，每项 64 像素宽：名称一行最多 5 个汉字（12px × 5 + 左右各 1px 内边距），放不下时换成两行 */
  grid-template-columns: repeat(auto-fill, 64px);
  gap: 0 2px;
  padding: 4px 2px;
  align-items: start;
}
.listview.icons tr { display: block; }
.listview.icons td { display: none; }
.listview.icons td.col-name { display: block; height: auto; padding: 0; overflow: visible; white-space: normal; }
.listview.icons tbody tr:first-child td { padding-top: 0; }
.listview.icons .cell-name { flex-direction: column; gap: 3px; }
.listview.icons .icon-box { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; height: 42px; }
/* 图标是 SVG（16 像素的画放大），直接按 42 像素显示；快捷方式的箭头叠在图标的左下角 */
.listview.icons .icon-box > img { width: 42px; height: 42px; }
.listview.icons .icon-box > .link-overlay { left: calc(50% - 21px); top: 0; }
.listview.icons .cell-name .label {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  max-width: 100%;
  overflow: hidden;
  line-height: 15px;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere; /* 优先在空格、连字符、汉字之间换行，放不下的长英文单词才从中间断开 */
}
.listview.icons tr.selected td { background: none; color: inherit; }
.listview.icons tr.selected .label { background: var(--select-bg); color: var(--select-fg); }
html.list-unfocused .listview.icons tr.selected .label { background: var(--face); color: var(--text); }
.listview.icons tr.unavailable .label { color: var(--graytext); }
.listview.icons tr.empty { grid-column: 1 / -1; }
.listview.icons tr.empty td { display: block; }

/* ---------------------------------------------------------------- 平铺、内容视图
   平铺：一格一项，左边大图标，右边三行（名称 / 类型 / 大小）；内容：一行一项、整宽，名称和类型在左，
   修改日期和大小在右，项目之间有分隔线。名称以外的文字（.item-line）由 explorer.html / explorer-nav.js 生成。 */

.listview.tiles, .listview.content { display: block; min-width: 0; }
.listview.tiles thead, .listview.content thead { display: none; }
.listview.tiles tr, .listview.content tr { display: block; }
.listview.tiles td, .listview.content td { display: none; }
.listview.tiles td.col-name,
.listview.content td.col-name { display: block; height: auto; overflow: hidden; white-space: nowrap; }
.listview.tiles .cell-name, .listview.content .cell-name { position: relative; }
.listview.tiles .icon-box,
.listview.content .icon-box { position: relative; display: flex; flex: none; align-items: center; justify-content: center; }
.item-text { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.item-text .label { max-width: 100%; }
.item-line { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 1px; line-height: 16px; }
.item-key { color: var(--graytext); }
/* 选中时整块高亮（名称连同类型、大小、修改日期），不只是名称；底色上看不出图标的蓝色网点，不叠网点。
   列表没有焦点时和其他视图一样变成灰底 */
.listview.tiles tr.selected td.col-name,
.listview.content tr.selected td.col-name { background: var(--select-bg); color: var(--select-fg); }
html.list-unfocused .listview.tiles tr.selected td.col-name,
html.list-unfocused .listview.content tr.selected td.col-name { background: var(--face); color: var(--text); }
.listview.tiles tr.selected td.col-name .label,
.listview.content tr.selected td.col-name .label,
.listview.tiles tr.selected .item-line,
.listview.content tr.selected .item-line,
.listview.tiles tr.selected .item-key,
.listview.content tr.selected .item-key { background: none; color: inherit; }
.listview.tiles .sel-tint, .listview.content .sel-tint { display: none !important; }
.listview.tiles tr.focused td.col-name .label,
.listview.content tr.focused td.col-name .label { outline: none; }
.listview.tiles tr.focused td.col-name,
.listview.content tr.focused td.col-name { outline: 1px dotted currentColor; outline-offset: -1px; }
.listview.tiles tr.empty td, .listview.content tr.empty td { display: block; }

.listview.tiles tbody {
  display: grid;
  grid-template-columns: repeat(auto-fill, 220px);
  gap: 6px 8px;
  padding: 6px 4px;
}
.listview.tiles td.col-name,
.listview.tiles tbody tr:first-child td.col-name { padding: 2px; }
.listview.tiles .cell-name { gap: 6px; }
.listview.tiles .icon-box { width: 48px; height: 48px; }
.listview.tiles .icon-box > img { width: 42px; height: 42px; }
.listview.tiles .icon-box > .link-overlay { left: 3px; top: 3px; }
.listview.tiles .item-line { color: var(--graytext); }
.listview.tiles tr.empty { grid-column: 1 / -1; }

.listview.content tbody { display: block; padding: 0 4px; }
.listview.content tr { border-bottom: 1px solid #e4e2dc; }
.listview.content td.col-name,
.listview.content tbody tr:first-child td.col-name { padding: 5px 4px; }
.listview.content .cell-name { gap: 8px; }
.listview.content .icon-box { width: 36px; height: 36px; }
.listview.content .icon-box > img { width: 32px; height: 32px; }
.listview.content .icon-box > .link-overlay { left: 2px; top: 2px; }
.listview.content .item-text { flex: 1; }
.listview.content .item-text .label { font-size: 13px; line-height: 18px; }
.listview.content .item-side { display: flex; flex: 0 1 220px; flex-direction: column; min-width: 0; }
.listview.content tr.empty { border-bottom: 0; }

/* 搜索窗口（M6）：筛选框、结果列表、提示 */
/* 筛选框是三行对齐的网格：名称 | 类型 | 按钮 / 位置（跨到按钮前）/ 大小 | 修改时间 */
.search-panel {
  display: grid;
  grid-template-columns: auto minmax(150px, 440px) auto auto auto;
  justify-content: start;
  align-items: center;
  gap: 4px 6px;
  flex: none;
  margin: 0;
}
.search-panel .sp-label { white-space: nowrap; }
.search-panel .sp-label2 { padding-left: 8px; }
.sp-field { display: flex; align-items: center; gap: 4px; min-width: 0; white-space: nowrap; }
.sp-field .field { min-width: 0; padding: 1px 4px; }
.sp-name .q, .sp-type select, .sp-scope select { flex: 1; }
.sp-scope { grid-column: 2 / 5; }
.sp-scope select { max-width: 420px; }
.sp-field input.num { width: 64px; text-align: right; }
.sp-field input.date { width: 118px; }
.sp-buttons { grid-column: 5; grid-row: 1 / 3; align-self: start; display: flex; flex-direction: column; gap: 4px; padding-left: 6px; }
.sp-buttons .btn { justify-content: center; min-width: 88px; }
/* 窗口太窄放不下两列条件时，改成“标签 | 输入框”两列，按钮放到最后 */
@media (max-width: 700px) {
  .search-panel { grid-template-columns: auto minmax(0, 1fr); }
  .search-panel .sp-label2 { padding-left: 0; }
  .sp-scope { grid-column: auto; }
  .sp-buttons { order: 1; grid-column: 1 / -1; grid-row: auto; flex-direction: row; padding-left: 0; }
}
.search-hint { padding: 14px 16px; color: var(--text); }
.search-hint p { margin: 0 0 8px; }
.search-hint .muted { color: var(--graytext); }
.search-note { padding: 4px 6px; color: var(--graytext); }
.listview.search-list th.col-location { width: 190px; }

/* ---------------------------------------------------------------- 预览窗口 */

.viewer-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 2px;
  overflow: hidden;
  background: var(--window);
  box-shadow: var(--sunken);
}
.infobar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 3px 6px;
  background: var(--info-bg);
  border-bottom: 1px solid var(--shadow);
  overflow-wrap: anywhere;
}
.tb-btn.pressed {
  border-color: var(--shadow) var(--hilight) var(--hilight) var(--shadow);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='2' height='2'%3E%3Crect width='1' height='1' fill='%23fff'/%3E%3Crect x='1' y='1' width='1' height='1' fill='%23fff'/%3E%3C/svg%3E");
}
.tb-field { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 4px; white-space: nowrap; }
.tb-field select.field { height: 21px; padding: 0 2px; }
.menu-label { padding: 3px 20px 1px; color: var(--graytext); white-space: nowrap; cursor: default; }
.menu-item.ticked::before { content: "\2713"; position: absolute; left: 6px; }
.sb-dims { width: 196px; flex: none; }
.sb-zoom { width: 64px; flex: none; }
.sb-enc { width: 180px; flex: none; }
.sb-time { width: 120px; flex: none; }

/* 图片：没有脚本时按窗口大小显示；脚本接管后（zoomable）支持缩放、旋转、拖动 */
.image-stage { position: relative; flex: 1; min-height: 0; display: flex; overflow: auto; background: #808080; }
.image-canvas { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; margin: auto; }
.image-canvas img { max-width: 100%; max-height: 100%; }
.image-stage.zoomable .image-canvas { position: relative; display: block; flex: none; width: auto; height: auto; }
.image-stage.zoomable .image-canvas img { position: absolute; left: 50%; top: 50%; max-width: none; max-height: none; }
.image-stage.pannable { cursor: grab; }
.image-stage.dragging { cursor: grabbing; }
.image-stage.loading { cursor: progress; }

/* 音视频 */
.media-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; background: #000; }
.media-stage video { display: block; width: 100%; height: 100%; background: #000; }
.audio-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 16px; overflow: auto; background: var(--face); }
.audio-panel { width: 480px; max-width: 100%; padding: 12px; background: var(--face); box-shadow: var(--window-edge); }
.audio-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.audio-text { min-width: 0; }
.audio-title { font-weight: bold; overflow-wrap: anywhere; }
.audio-sub { color: #555; overflow-wrap: anywhere; }
.audio-panel audio { display: block; width: 100%; }

/* PDF */
.pdf-frame { flex: 1; min-height: 0; width: 100%; border: 0; background: var(--window); }
.viewer-message { flex: 1; display: flex; align-items: center; justify-content: center; padding: 16px; }
.viewer-message .msg { max-width: 460px; }
.viewer-message .dialog-buttons { justify-content: flex-start; }

/* 文本：每行一个 .l，不显示行号（16.1） */
.text-view {
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 2px 4px;
  overflow: auto;
  font: 12px/16px NSimSun, "新宋体", "Courier New", monospace;
  white-space: pre;
  tab-size: 4;
  outline: none;
}
.text-view .l { min-height: 16px; }
.text-view.wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.text-view.empty { padding: 8px; color: var(--graytext); font-family: var(--font); }

/* 语法高亮（配色参照 Visual Studio） */
.t-c, .t-c1, .t-ch, .t-cm, .t-cs, .t-sd { color: #008000; }
.t-cp, .t-cpf { color: #0000ff; }
.t-k, .t-kc, .t-kd, .t-kn, .t-kp, .t-kr, .t-kt, .t-ow, .t-bp { color: #0000ff; }
.t-s, .t-s1, .t-s2, .t-sa, .t-sb, .t-sc, .t-dl, .t-sh, .t-si, .t-sx, .t-sr, .t-ss { color: #a31515; }
.t-se, .t-esc { color: #ee0000; }
.t-m, .t-mb, .t-mf, .t-mh, .t-mi, .t-mo, .t-il, .t-ld { color: #098658; }
.t-nc, .t-nn, .t-ne { color: #267f99; }
.t-nt { color: #800000; }
.t-na { color: #e50000; }
.t-nb, .t-no { color: #0070c1; }
.t-nv, .t-vc, .t-vg, .t-vi, .t-vm { color: #001080; }
.t-nd, .t-ni, .t-nl { color: #808080; }
.t-gh, .t-gu { color: #000080; font-weight: bold; }
.t-gd { color: #a31515; background: #ffe6e6; }
.t-gi { color: #098658; background: #e6ffe6; }
.t-ge { font-style: italic; }
.t-gs { font-weight: bold; }
.t-gr, .t-gt { color: #e50000; }
.t-go, .t-gp { color: #808080; }

/* Markdown */
.md-view { flex: 1; min-height: 0; overflow: auto; padding: 14px 20px 24px; outline: none; }
.markdown-body { max-width: 880px; margin: 0 auto; font-size: 13px; line-height: 1.65; overflow-wrap: break-word; }
.markdown-body > :first-child { margin-top: 0; }
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4, .markdown-body h5, .markdown-body h6 {
  margin: 18px 0 8px;
  line-height: 1.3;
}
.markdown-body h1, .markdown-body h2 { padding-bottom: 4px; border-bottom: 1px solid var(--shadow); }
.markdown-body h1 { font-size: 22px; }
.markdown-body h2 { font-size: 18px; }
.markdown-body h3 { font-size: 15px; }
.markdown-body h4, .markdown-body h5, .markdown-body h6 { font-size: 13px; }
.markdown-body p, .markdown-body ul, .markdown-body ol, .markdown-body blockquote, .markdown-body table, .markdown-body pre {
  margin: 0 0 10px;
}
.markdown-body ul, .markdown-body ol { padding-left: 26px; }
.markdown-body li > ul, .markdown-body li > ol { margin-bottom: 0; }
.markdown-body a { color: #0000ee; }
.markdown-body a:visited { color: #551a8b; }
.markdown-body code { padding: 0 3px; font: 12px NSimSun, "新宋体", "Courier New", monospace; background: #f0f0f0; border: 1px solid #dcdcdc; }
.markdown-body pre { padding: 6px 8px; overflow: auto; background: #fafafa; border: 1px solid #c0c0c0; line-height: 16px; }
.markdown-body pre code { padding: 0; background: none; border: 0; }
.markdown-body blockquote { padding: 0 12px; color: #555; border-left: 4px solid #c0c0c0; }
.markdown-body table { display: block; max-width: 100%; overflow: auto; border-collapse: collapse; }
.markdown-body th, .markdown-body td { padding: 3px 8px; border: 1px solid #a0a0a0; }
.markdown-body th { background: var(--face); }
.markdown-body .align-left { text-align: left; }
.markdown-body .align-center { text-align: center; }
.markdown-body .align-right { text-align: right; }
.markdown-body img { max-width: 100%; }
.markdown-body hr { height: 0; margin: 14px 0; border: 0; border-top: 1px solid var(--shadow); border-bottom: 1px solid var(--hilight); }

/* 不能预览的文件：显示文件信息 */
.file-info { flex: 1; min-height: 0; display: flex; justify-content: center; align-items: flex-start; padding: 32px 16px; overflow: auto; background: var(--face); }
.file-info-box { width: 440px; max-width: 100%; padding: 12px; background: var(--face); box-shadow: var(--window-edge); }
.file-info-reason {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 10px;
  padding: 5px 6px;
  background: var(--info-bg);
  border: 1px solid #000;
  overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------- 回收站列表 */

.listview .th-label { display: block; height: 18px; padding: 0 6px; line-height: 18px; white-space: nowrap; }
.trash-list th.col-origin { width: 28%; }
.trash-list th.col-mtime { width: 130px; }
.trash-list th.col-size { width: 90px; }
.trash-list th.col-type { width: 140px; }

/* ---------------------------------------------------------------- 离线下载任务列表 */

.offline-list th.col-size { width: 80px; }
.offline-list th.col-progress { width: 150px; }
.offline-list th.col-speed { width: 90px; text-align: right; }
.offline-list th.col-status { width: 180px; }
.offline-list th.col-dest { width: 16%; }
.offline-list th.col-mtime { width: 112px; }
.offline-list td.col-speed { text-align: right; }
.cell-progress { display: flex; align-items: center; gap: 6px; }
.progress.mini { flex: 1; min-width: 40px; height: 13px; margin: 0; padding: 1px; border: 1px solid var(--shadow); box-shadow: none; }
.cell-progress .pct { flex: none; width: 56px; text-align: right; }
.listview tr.failed td.col-status { color: #a00000; }
.listview tr.selected.failed td.col-status { color: #ffd2d2; }

.offline-form { display: grid; gap: 6px; }
.offline-form textarea.field {
  width: 100%;
  height: 120px;
  min-height: 60px;
  padding: 3px 4px;
  resize: vertical;
  font-family: var(--font);
  white-space: pre;
  overflow-wrap: normal;
}
.offline-row { display: flex; align-items: center; gap: 6px; }
.offline-row label { width: 4.5em; flex: none; }
.offline-row .field { flex: 1; min-width: 0; }
.offline-hint { color: #555; }

/* ---------------------------------------------------------------- 列表中的重命名、拖放提示 */

/* .rename-input 是 textarea：详细资料视图中单行不换行；大图标、缩略图视图中见下面 */
.rename-input {
  flex: 1;
  min-width: 80px;
  height: 17px;
  padding: 0 2px;
  border: 1px solid #000;
  background: var(--window);
  color: #000;
  font: inherit;
  line-height: 15px;
  white-space: pre;
  overflow: hidden;
  resize: none;
  outline: none;
}
/* 大图标、缩略图视图：盖在名称上（top 由 explorer.js 设置），自动换行，高度随内容增长，浮在下方的项目之上 */
.listview.icons .cell-name,
.listview.thumbs .cell-name { position: relative; }
.listview.icons .rename-input,
.listview.thumbs .rename-input {
  position: absolute;
  left: 0;
  z-index: 2;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0 1px;
  text-align: center;
  white-space: pre-wrap;
  overflow-wrap: anywhere; /* 优先在空格、汉字之间换行，放不下的长英文单词才从中间断开 */
}
/* 行高要容得下 12px 的雅黑（约 16px），否则多行时上下两行的文字和选中底色叠在一起 */
.listview.icons .rename-input,
.listview.thumbs .rename-input { line-height: 17px; }
.drop-hint {
  position: absolute;
  inset: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--select-bg);
  background: rgba(255, 255, 255, 0.88);
  color: var(--select-bg);
  font-weight: bold;
  pointer-events: none;
}

/* ---------------------------------------------------------------- 对话框（页面内） */

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}
.modal { width: 380px; max-width: 100%; max-height: 100%; overflow: auto; }
.modal .title-bar { cursor: default; touch-action: none; }
.msg-text p { margin: 2px 0 6px; overflow-wrap: anywhere; }
.dialog-buttons { flex-wrap: wrap; }

.progress-box { min-width: 0; }
.progress-text, .progress-detail, .progress-info { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 17px; }
.progress-detail { color: #333; }
.progress-info { color: #555; }
.progress { height: 18px; margin: 8px 0 4px; padding: 2px; background: var(--window); box-shadow: var(--thin-sunken); }
.progress-fill {
  width: 0;
  height: 100%;
  background: repeating-linear-gradient(90deg, var(--select-bg) 0 8px, transparent 8px 10px);
}
.progress.indeterminate .progress-fill {
  width: 100% !important;
  background: repeating-linear-gradient(90deg, #a6caf0 0 8px, transparent 8px 10px);
}

.conflict-box { display: grid; gap: 8px; margin: 8px 0 0 46px; }
.conflict-item { display: flex; align-items: center; gap: 10px; }

.sessions-note { margin: 0 0 6px; overflow-wrap: anywhere; }
.sessions-list { height: 200px; padding: 2px; }
.sessions-list .listview { min-width: 0; }
.sessions-list th.col-dest { width: 26%; }
.sessions-list th.col-done { width: 170px; }
.sessions-list th.col-mtime { width: 112px; }

.picker-tree { height: 240px; margin: 4px 0 6px; padding: 3px 2px; }
.picker-location { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker .tree .node { cursor: default; }

.props-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 8px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--shadow);
  box-shadow: 0 1px 0 var(--hilight);
}
.props-name { overflow-wrap: anywhere; }
table.props { width: 100%; border-collapse: collapse; }
/* 属性对话框：Win2000 的选项卡（只有“常规”一页）和名称文本框 */
.prop-tabs { display: flex; padding-left: 2px; }
.prop-tab {
  position: relative;
  z-index: 1;
  margin-bottom: -2px;
  padding: 3px 8px 4px;
  background: var(--face);
  box-shadow: inset 1px 1px var(--hilight), inset -1px 0 var(--dkshadow), inset -2px 0 var(--shadow);
}
.prop-page { padding: 10px 10px 8px; box-shadow: var(--raised); }
.props-name-input { flex: 1; min-width: 0; }
.props-name-input[readonly] { background: var(--face); box-shadow: none; border: 0; }
.props-opener { display: inline-flex; align-items: center; gap: 4px; }
table.props th { width: 1%; }
table.props th { padding: 3px 12px 3px 0; font-weight: normal; text-align: left; white-space: nowrap; vertical-align: top; width: 1%; }
table.props td { padding: 3px 0; overflow-wrap: anywhere; }
table.props tr.props-sep td { padding: 0; height: 8px; border-top: 1px solid var(--shadow); box-shadow: inset 0 1px 0 var(--hilight); }

/* ---------------------------------------------------------------- 右键菜单 */

/* .context-menu：页面里的右键菜单。 */
.context-menu {
  position: fixed;
  z-index: 900;
  min-width: 170px;
  padding: 3px;
  background: var(--face);
  box-shadow: var(--window-edge);
}
.context-menu .default-item { font-weight: bold; }
.context-menu .menu-item.has-sub,
.menu-dropdown .menu-item.has-sub { padding-right: 26px; }
.context-menu .menu-item.has-sub::after,
.menu-dropdown .menu-item.has-sub::after { content: "\25B8"; position: absolute; right: 8px; }
.context-menu .sub-menu,
.menu-dropdown .sub-menu {
  display: none;
  position: absolute;
  left: 100%;
  top: -4px;
  min-width: 140px;
  padding: 3px;
  background: var(--face);
  box-shadow: var(--window-edge);
  z-index: 10;
}
/* 子菜单由 listview.js 控制展开（.open），鼠标移出后仍保持展开，其标题保持高亮（.active） */
.context-menu .menu-item.has-sub.open > .sub-menu { display: block; }
.context-menu .menu-item.has-sub.active { background: var(--select-bg); color: var(--select-fg); }
/* 菜单栏下拉菜单里的子菜单（“文件 → 新建 ▶”）由 common.js 控制展开（.open），展开时标题保持高亮 */
.menu-dropdown .menu-item.has-sub.open > .sub-menu { display: block; }
.menu-dropdown .menu-item.has-sub.open { background: var(--select-bg); color: var(--select-fg); }

/* 非模态对话框（记事本的查找 / 替换 / 转到，11.5）：不遮挡页面，只让对话框自己接收鼠标 */
.modal-layer.floating { pointer-events: none; align-items: flex-start; justify-content: flex-end; padding: 6px; }
.modal-layer.floating > .window { pointer-events: auto; }

/* ---------------------------------------------------------------- 滚动条（Chrome / Edge / Safari） */

::-webkit-scrollbar { width: 16px; height: 16px; }
::-webkit-scrollbar-track {
  background-color: var(--face);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='2' height='2'%3E%3Crect width='1' height='1' fill='%23fff'/%3E%3Crect x='1' y='1' width='1' height='1' fill='%23fff'/%3E%3C/svg%3E");
}
::-webkit-scrollbar-thumb { background: var(--face); box-shadow: var(--raised); }
::-webkit-scrollbar-corner { background: var(--face); }
::-webkit-scrollbar-button:single-button {
  display: block;
  width: 16px;
  height: 16px;
  background-color: var(--face);
  background-repeat: no-repeat;
  background-position: center;
  box-shadow: var(--raised);
}
::-webkit-scrollbar-button:single-button:active { box-shadow: var(--thin-sunken); }
::-webkit-scrollbar-button:single-button:vertical:decrement {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='7' height='4'%3E%3Cpath d='M0 4h7L3.5 0.5z'/%3E%3C/svg%3E");
}
::-webkit-scrollbar-button:single-button:vertical:increment {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='7' height='4'%3E%3Cpath d='M0 0h7L3.5 3.5z'/%3E%3C/svg%3E");
}
::-webkit-scrollbar-button:single-button:horizontal:decrement {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='7'%3E%3Cpath d='M4 0v7L0.5 3.5z'/%3E%3C/svg%3E");
}
::-webkit-scrollbar-button:single-button:horizontal:increment {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='7'%3E%3Cpath d='M0 0v7L3.5 3.5z'/%3E%3C/svg%3E");
}

/* ---------------------------------------------------------------- 窄屏（手机） */

/* 手机 / 窄屏（14.3）。 */
@media (max-width: 720px) {
html {
  .tb-btn > span, .addressbar label, .addressbar .btn span { display: none; }
  .brand { display: none; }
  .listview { min-width: 0; }
  .listview .col-type { display: none; }
  .listview th.col-mtime { width: 112px; }
  .listview th.col-size { width: 72px; }
  .sb-size, .sb-user { display: none; }
  .sb-free { width: auto; }
  .form-grid, .notice, .conflict-box { margin-left: 0; }
  .listview .col-origin { display: none; }
  .listview .col-location { display: none; }
  .sessions-list .col-dest, .sessions-list .col-mtime { display: none; }
  .sessions-list th.col-done { width: 120px; }
  .offline-list .col-speed, .offline-list .col-dest, .offline-list .col-mtime, .offline-list .col-size { display: none; }
  .offline-list th.col-progress { width: 110px; }
  .offline-list th.col-status { width: 96px; }
  .cell-progress .pct { width: 44px; }
  .listview.thumbs tbody { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); justify-items: center; }
  .listview.tiles tbody { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  /* 窄屏放不下“修改日期: 2026-10-19 20:24”：右边只留日期和大小本身 */
  .listview.content .item-side { flex: none; }
  .listview.content .item-side .item-key { display: none; }
  .viewer .sb-time, .viewer .sb-dims, .viewer .sb-enc { display: none; }
  .viewer .sb-size { display: flex; }
  .tb-field { padding: 0 2px; }
  .md-view { padding: 10px 12px 20px; }
}
}

@media (max-width: 720px), (pointer: coarse) {
  body.explorer-app .listview td { height: 32px; }
  body.explorer-app .tb-btn { min-width: 32px; min-height: 32px; }
  body.explorer-app .band .toolbar { overflow-x: auto; scrollbar-width: none; }
  body.explorer-app .menu-title,
  body.explorer-app .menu-item,
  body.explorer-app .addr-item { min-height: 32px; }
  body.explorer-app .addr-field,
  body.explorer-app .combo-btn { min-height: 32px; }
  body.explorer-app .combo-btn { min-width: 32px; }
  body.explorer-app .context-menu { max-height: calc(100dvh - 8px); overflow-y: auto; }
  body.explorer-app .context-menu .has-sub,
  body.explorer-app .menu-dropdown .has-sub { display: block; height: auto; line-height: 32px; }
  body.explorer-app .context-menu .has-sub::after { top: 8px; }
  body.explorer-app .menu-dropdown .has-sub::after { top: 0; }
  body.explorer-app .context-menu .sub-menu,
  body.explorer-app .menu-dropdown .sub-menu { position: static; margin-top: 4px; min-width: 0; }
  body.explorer-app .listview.icons td,
  body.explorer-app .listview.thumbs td,
  body.explorer-app .listview.tiles td,
  body.explorer-app .listview.content td { height: auto; }
}

/* 剪切的项目显示为半透明（5.24）；拖放的目标行加选中底色 */
.cut { opacity: 0.5; }
tr.drop-target { background: var(--select-bg); color: var(--select-fg); }
tr.drop-target .label { color: var(--select-fg); }

/* ---------------------------------------------------------------- 登录与关机画面（5.26） */

.login-dialog { width: 413px; max-width: 96vw; }
/* 登录横幅：程序图标 + 名称，深蓝渐变底 */
.login-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 72px;
  margin: -12px -12px 10px;
  padding: 0 20px;
  color: #fff;
  background: linear-gradient(90deg, var(--title-a), #3a6ea5);
}
.login-banner-name { font-size: 22px; font-weight: bold; letter-spacing: 2px; }
/* 第二步（两步验证）的说明文字 */
.login-step-title { margin: 2px 0 4px; font-size: 14px; font-weight: bold; }
.login-step-note { margin: 0 0 4px; line-height: 1.6; overflow-wrap: anywhere; }
.login-step-hint { margin: 0 0 12px; line-height: 1.6; color: #555; }

/* 分享对话框（share.js） */
.share-dialog { margin: 0 0 6px; }
.share-dialog .share-hint { margin: 0 0 10px; line-height: 1.6; overflow-wrap: anywhere; }
.share-row { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.share-row > label, .share-row-label { flex: 0 0 72px; }
.share-row .field { flex: 1; min-width: 0; }
.share-row select.field { flex: 0 0 auto; height: 21px; }
.share-code-choice { align-items: flex-start; }
.share-choices { display: flex; flex-direction: column; gap: 4px; }
.share-radio { display: flex; align-items: center; gap: 4px; }
.share-radio .field.share-code { width: 120px; flex: none; margin-left: 4px; }
.share-dialog .share-code { font-family: Consolas, "Courier New", monospace; letter-spacing: 1px; }
.share-dialog .share-error { margin: 6px 0 0; color: #a00000; }
.share-dialog .share-status { margin: 4px 0 0; min-height: 1.4em; color: #006000; }

/* ---------------------------------------------------------------- Win2000 细节（5.27） */

.explorer-state { position: absolute; z-index: 2; top: 4px; right: 6px; max-width: calc(100% - 12px); padding: 4px 8px; background: var(--face); border: 1px solid var(--shadow); box-shadow: var(--thin-raised); }
.explorer-state .btn { margin-left: 8px; }
.explorer-pending .listview { cursor: progress; }
.explorer-pending .listview .label { cursor: progress; }

/* 光标：使用浏览器自带的光标 */
.image-stage.loading { cursor: progress; }
.help-body { cursor: help; }

/* 工具提示（#FFFFE1，5.27） */
.tooltip {
  position: fixed;
  z-index: 300000;
  max-width: 320px;
  padding: 2px 6px;
  color: var(--text);
  background: var(--info-bg);
  border: 1px solid #000;
  box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

/* ---------------------------------------------------------------- 通用文件对话框（打开 / 另存为，5.19）：记事本、媒体播放器、设置窗口选壁纸都用它（wp.fileDialog） */

.filedialog { display: flex; flex-direction: column; gap: 4px; width: 460px; max-width: 100%; }
.filedialog .row { display: flex; align-items: center; gap: 4px; }
.filedialog .row label { flex: none; }
.filedialog .row input[type="text"], .filedialog .row select { flex: 1; min-width: 0; height: 20px; }
.filedialog .row select.lookin, .filedialog .row select.ftype { flex: none; width: 210px; }
.filedialog .row select.encoding { flex: none; width: 140px; }
.filedialog-toolbar { display: flex; align-items: center; gap: 2px; padding: 1px; box-shadow: var(--thin-raised); }
.filedialog-toolbar .fb-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 22px;
  padding: 0 5px;
  border: 1px solid transparent;
  background: none;
  cursor: default;
  white-space: nowrap;
}
.filedialog-toolbar .fb-btn:hover:not(:disabled) { border-color: var(--hilight) var(--shadow) var(--shadow) var(--hilight); }
.filedialog-toolbar .fb-btn:disabled { color: var(--graytext); text-shadow: 1px 1px var(--hilight); }
.filedialog-toolbar .fb-btn:disabled img { opacity: 0.4; filter: grayscale(1); }
.filedialog-locations { display: flex; flex-wrap: wrap; gap: 2px; }
.filedialog-locations .loc-btn {
  height: 20px;
  padding: 0 6px;
  border: 1px solid transparent;
  background: none;
  cursor: default;
  white-space: nowrap;
}
.filedialog-locations .loc-btn:hover { border-color: var(--hilight) var(--shadow) var(--shadow) var(--hilight); }
.filedialog-list {
  height: 210px;
  overflow: auto;
  background: var(--window);
  box-shadow: var(--sunken);
  padding: 2px;
}
.filedialog-list table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.filedialog-list td { height: 19px; padding: 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.filedialog-list td.fd-size { width: 78px; text-align: right; color: #000; }
.filedialog-list td.fd-type { width: 130px; }
.filedialog-list tr { cursor: default; }
.filedialog-list tr.selected td { background: var(--select-bg); color: var(--select-fg); }
.filedialog-list tr.unavailable td { color: var(--graytext); }
.filedialog-list .cell { display: flex; align-items: center; gap: 4px; }

/* ---------------------------------------------------------------- 程序窗口（wm.js、bridge.js）

   网盘主页面上的程序窗口：可以移动、改变大小、最小化、最大化、关闭；底部是已打开窗口的窗口条。
   资源管理器本身是整页窗口，不能改变大小。 */

:root { --wm-bar-h: 30px; }
.wm-layer { position: fixed; left: 0; top: 0; right: 0; bottom: 0; z-index: 50; pointer-events: none; overflow: hidden; }
body.wm-has-windows .wm-layer { bottom: var(--wm-bar-h); }
body.app.wm-has-windows { padding-bottom: var(--wm-bar-h); }
.wm-win { position: absolute; display: flex; flex-direction: column; min-width: 0; pointer-events: auto; }
.wm-win.maximized { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; }
.wm-title { cursor: default; touch-action: none; user-select: none; -webkit-user-select: none; }
.wm-win.inactive .wm-title { background: linear-gradient(90deg, #808080, #c0c0c0); color: var(--face); }
.wm-buttons { display: flex; flex: none; margin-left: 2px; }
.wm-body { display: flex; flex: 1; min-height: 0; margin-top: 2px; }
.wm-body iframe { display: block; flex: 1; width: 100%; height: 100%; border: 0; background: var(--face); }
/* 拖动、改变大小时 iframe 不接收鼠标，否则指针移进窗口内容就丢失 */
body.wm-dragging iframe { pointer-events: none; }
body.wm-dragging { user-select: none; -webkit-user-select: none; }

/* 最小化、最大化、向下还原的字形（像素风格，与关闭按钮一致） */
.title-close.title-min { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='14' shape-rendering='crispEdges'%3E%3Cpath fill='%23000' d='M4 9h6v2H4z'/%3E%3C/svg%3E") !important; }
.title-close.title-max { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='14' shape-rendering='crispEdges'%3E%3Cpath fill='%23000' d='M3 2h9v2H3zM3 4h1v6H3zM11 4h1v6h-1zM3 10h9v1H3z'/%3E%3C/svg%3E") !important; }
.title-close.title-max.title-restore { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='14' shape-rendering='crispEdges'%3E%3Cpath fill='%23000' d='M5 1h6v2H5zM10 3h1v5h-1zM5 3h1v1H5zM9 7h1v1H9zM3 4h6v2H3zM3 6h1v4H3zM8 6h1v4H8zM3 10h6v1H3z'/%3E%3C/svg%3E") !important; }

/* 改变大小的边框 */
.wm-rz { position: absolute; z-index: 1; }
.wm-rz-n, .wm-rz-s { left: 8px; right: 8px; height: 6px; cursor: ns-resize; }
.wm-rz-n { top: -2px; }
.wm-rz-s { bottom: -2px; }
.wm-rz-w, .wm-rz-e { top: 8px; bottom: 8px; width: 6px; cursor: ew-resize; }
.wm-rz-w { left: -2px; }
.wm-rz-e { right: -2px; }
.wm-rz-nw, .wm-rz-ne, .wm-rz-sw, .wm-rz-se { width: 10px; height: 10px; }
.wm-rz-nw { left: -2px; top: -2px; cursor: nwse-resize; }
.wm-rz-se { right: -2px; bottom: -2px; cursor: nwse-resize; }
.wm-rz-ne { right: -2px; top: -2px; cursor: nesw-resize; }
.wm-rz-sw { left: -2px; bottom: -2px; cursor: nesw-resize; }
.wm-win.maximized .wm-rz, body.mobile .wm-rz { display: none; }
body[data-wm-resize="n"] *, body[data-wm-resize="s"] * { cursor: ns-resize !important; }
body[data-wm-resize="w"] *, body[data-wm-resize="e"] * { cursor: ew-resize !important; }
body[data-wm-resize="nw"] *, body[data-wm-resize="se"] * { cursor: nwse-resize !important; }
body[data-wm-resize="ne"] *, body[data-wm-resize="sw"] * { cursor: nesw-resize !important; }

/* 窗口条：每个已打开的窗口一个按钮，单击切换激活 / 最小化 */
.wm-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: none;
  align-items: center;
  gap: 3px;
  height: var(--wm-bar-h);
  padding: 3px 3px 2px;
  overflow-x: auto;
  background: var(--face);
  box-shadow: inset 0 1px var(--light), inset 0 2px var(--hilight);
}
body.wm-has-windows .wm-bar { display: flex; }
.wm-task {
  display: flex;
  flex: 0 1 170px;
  align-items: center;
  gap: 4px;
  min-width: 64px;
  height: 24px;
  padding: 0 6px;
  border: 0;
  font: inherit;
  color: var(--text);
  text-align: left;
  background: var(--face);
  box-shadow: var(--raised);
  cursor: default;
}
.wm-task img { flex: none; }
.wm-task-title { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.wm-task.pressed {
  font-weight: bold;
  box-shadow: var(--pressed);
  background: repeating-conic-gradient(var(--hilight) 0 25%, var(--face) 0 50%) 0 0 / 2px 2px;
  padding: 1px 5px 0 7px;
}
.wm-task:focus-visible { outline: 1px dotted #000; outline-offset: -4px; }

/* 窗口里的页面：标题栏由窗口提供，页面铺满窗口 */
html.embedded .app-window { padding: 0; box-shadow: none; }
html.embedded .app-window > .title-bar { display: none; }
