/* ============================================================
   设置与界面外壳域（FUNCTION-PARITY-9，17 条）样式
   9-01 窗口状态 / 9-04 搜索面板 / 9-05 登录与头像 / 9-09 停靠布局 /
   9-11 设置对话框 / 9-14 深色主题 / 9-15 字体字号 / 9-16 快捷键
   默认首屏不加可见层（像素基线不变）；交互层只在用户动作/浏览器门时显示。
   ============================================================ */

/* ---------------- 9-15 字体设置作用到真实 DOM（默认值与 app.css 一致） ---------------- */
#cmdwin .cmd-line,
#cmdwin #cmd-input,
#cmdwin #cmd-prompt {
  font-family: var(--cmd-font-family, var(--font-mono));
  font-size: var(--cmd-font-size, 13px);
}
#editor-dock .ed-input,
#editor-dock .ed-highlight {
  font-family: var(--editor-font-family, var(--font-mono));
  font-size: var(--editor-font-size, 13px);
}
/* 界面字体/字号（设置对话框自身按 --ui-font-size 缩放，验证「界面字体」生效） */
.settings-dialog, .shell-dialog {
  font-family: var(--ui-font-family, var(--font-ui));
  font-size: var(--ui-font-size, 12px);
}

/* ---------------- 9-01 窗口状态机（最大化/还原/最小化/关闭） ---------------- */
#app.win-minimized, #app.win-closed { display: none; }
/* 还原态：整窗按 1600x902 缩放展示（transform 保留内部绝对坐标的命中测试，
 * 否则 1600 宽会把标题栏右侧按钮裁掉，真鼠标点不到） */
#app.win-restored {
  transform: translate(160px, 60px) scale(0.83333);
  transform-origin: top left;
  border: 1px solid #7d7d7d;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.45);
}
.tb-active.inactive { opacity: 0.75; }
.tb-active.inactive::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: #8a8a8a;
}

/* ---------------- 9-04 搜索面板（Ctrl+Shift+Space） ---------------- */
.shell-search-layer {
  position: absolute; left: 1362px; top: 51px; width: 350px; z-index: 76;
  background: #ffffff; border: 1px solid #7d7d7d;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}
.shell-search-layer[hidden] { display: none; }
.shell-search-input {
  width: 100%; height: 24px; border: 0; border-bottom: 1px solid #d0d0d0;
  padding: 0 6px; outline: none; background: #ffffff;
  font-family: var(--font-ui); font-size: 12px; color: #1a1a1a;
}
.shell-search-results { max-height: 330px; overflow: auto; }
.shell-search-item {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 24px; padding: 0 6px;
  text-align: left; background: transparent; border: 0;
}
.shell-search-item.selected { background: #cce8ff; }
.shell-search-kind { flex: 0 0 30px; font-size: 11px; color: #0a58a5; }
.shell-search-label { flex: 0 0 auto; font-size: 12px; color: #1a1a1a; }
.shell-search-hint {
  flex: 1 1 auto; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  font-size: 11px; color: #7a7a7a;
}
.shell-search-empty { padding: 8px; font-size: 12px; color: #666; }

/* ---------------- 9-05 登录对话框 + 用户头像 ---------------- */
.shell-dialog-layer { position: absolute; inset: 0; z-index: 88; }
.shell-dialog-layer[hidden] { display: none; }
.shell-dialog {
  position: absolute; left: 750px; top: 340px; width: 420px; height: 260px;
  background: #f5f5f5; border: 1px solid #7d7d7d;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.shell-dialog-title {
  position: absolute; left: 0; top: 0; width: 100%; height: 30px;
  background: #e6e6e6; border-bottom: 1px solid #b8b8b8; box-sizing: border-box;
  font-size: 12px; color: #1a1a1a; line-height: 30px; padding-left: 10px;
}
.shell-dialog-close {
  position: absolute; right: 6px; top: 4px; width: 22px; height: 22px;
  font-size: 12px; color: #333; background: transparent;
}
.shell-dialog-close:hover { background: #e81123; color: #ffffff; }
.shell-dialog-body {
  position: absolute; left: 12px; right: 12px; top: 40px; bottom: 52px;
  background: #ffffff; border: 1px solid #d0d0d0; padding: 4px 12px;
}
.shell-field-label { margin-top: 10px; margin-bottom: 4px; font-size: 12px; color: #333333; }
.shell-input {
  width: 100%; height: 22px; padding: 0 4px; background: #ffffff;
  border: 1px solid #7d7d7d; font-size: 12px; color: #1a1a1a;
}
.shell-dialog-status { margin-top: 10px; min-height: 14px; font-size: 11px; color: #a31515; }
.shell-dialog-footer {
  position: absolute; left: 0; bottom: 0; width: 100%; height: 46px;
  display: flex; align-items: center; gap: 8px; padding: 0 12px;
  background: #f5f5f5; border-top: 1px solid #d0d0d0;
}
.shell-dialog-spacer { flex: 1; }
.shell-btn {
  height: 24px; min-width: 84px; padding: 0 10px;
  font-size: 12px; color: #1a1a1a; background: #f0f0f0;
  border: 1px solid #7d7d7d; border-radius: 2px;
}
.shell-btn:hover { background: #e0e0e0; }
.shell-btn.primary { border: 2px solid #005a9e; background: #f8fbff; }
.shell-btn.disabled { opacity: 0.55; }
.shell-avatar {
  position: absolute; left: 1859px; top: 4px; width: 20px; height: 20px;
  border-radius: 50%; background: #0a58a5; color: #ffffff;
  font-family: var(--font-latin); font-size: 11px; line-height: 20px; text-align: center;
  z-index: 6;
}
.shell-avatar[hidden] { display: none; }

/* ---------------- 9-09 面板停靠：折叠 / 浮动 / 拖动 ---------------- */
/* 左侧竖栏两个面板开关（index.html 里是普通 button，inline left/top 需 position:absolute 才生效；
 * 且必须压在 #rail-box 白底之上，否则真鼠标点击被盒子挡住） */
.rail-btn {
  position: absolute; z-index: 6;
  background: transparent; border-radius: 4px;
}
.rail-btn:hover { background: rgba(0, 0, 0, 0.08); }

/* 面板标题左「折叠」与右「⋮ 菜单」热区（index.html 里是 0 尺寸空按钮，需按参考图图标位给尺寸） */
.panel-title .title-hit {
  position: absolute; left: 3px; top: 2px; width: 22px; height: 18px;
  background: transparent; z-index: 4;
}
.panel-title .title-hit:hover { background: #e5e5e5; }
.panel-title .title-dots-hit {
  position: absolute; left: 418px; top: 2px; width: 22px; height: 18px;
  background: transparent; z-index: 4;
}
.panel-title .title-dots-hit:hover { background: #e5e5e5; }
.panel.collapsed .colheader,
.panel.collapsed .body,
.panel.collapsed #vscroll,
.panel.collapsed .title-dots-hit { display: none; }
.panel.floating {
  z-index: 55; border: 1px solid #7d7d7d;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
.panel.floating .panel-title { cursor: move; background: #ffffff; }
.panel.floating #vscroll { height: 310px; }
.panel.floating .body { height: 310px; }

/* ---------------- 9-11 设置对话框（真机量测 898x648 @ 511,204） ---------------- */
.settings-layer { position: absolute; inset: 0; z-index: 92; }
.settings-layer[hidden] { display: none; }
.settings-dialog {
  position: absolute; left: 511px; top: 204px; width: 898px; height: 648px;
  background: #f5f5f5; border: 1px solid #7d7d7d;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.35);
  font-family: var(--font-ui);
}
.settings-title-bar {
  position: absolute; left: 0; top: 0; width: 100%; height: 30px;
  background: #e6e6e6; border-bottom: 1px solid #b8b8b8; box-sizing: border-box;
}
.settings-title { position: absolute; left: 10px; top: 9px; font-size: 12px; color: #1a1a1a; }
.settings-close {
  position: absolute; right: 6px; top: 4px; width: 22px; height: 22px;
  font-size: 12px; color: #333; background: transparent;
}
.settings-close:hover { background: #e81123; color: #ffffff; }
.settings-body {
  position: absolute; left: 10px; right: 10px; top: 40px; bottom: 70px;
  background: #ffffff; border: 1px solid #b8b8b8; display: flex;
}
.settings-tree {
  flex: 0 0 230px; width: 230px; background: #f7f7f7;
  border-right: 1px solid #d0d0d0; overflow: auto; padding-top: 4px;
}
.settings-tree-header { padding: 6px 10px 4px; font-size: 11px; color: #666666; }
.settings-tree-item {
  display: flex; align-items: center; gap: 6px; width: 100%; height: 24px; padding: 0 8px;
  text-align: left; background: transparent; border: 0;
}
.settings-tree-item:hover { background: #e8e8e8; }
.settings-tree-item.selected { background: #cce8ff; }
.settings-tree-icon { flex: 0 0 16px; text-align: center; font-size: 12px; color: #0a58a5; }
.settings-tree-label { font-size: 12px; color: #1a1a1a; }
.settings-content { flex: 1 1 auto; padding: 12px 16px; overflow: auto; }
.settings-content-header { margin-bottom: 10px; font-size: 13px; color: #1a1a1a; }
.settings-row {
  display: flex; align-items: center; gap: 10px; min-height: 28px;
  border-bottom: 1px solid #f0f0f0;
}
.settings-label { flex: 0 0 220px; width: 220px; font-size: 12px; color: #333333; }
.settings-check { width: 14px; height: 14px; }
.settings-select, .settings-text, .settings-number {
  height: 22px; padding: 0 4px; background: #ffffff;
  border: 1px solid #a0a0a0; font-size: 12px; color: #1a1a1a;
}
.settings-number { width: 80px; }
.settings-text { width: 280px; }
.settings-select { min-width: 140px; }
.settings-reset { height: 20px; font-size: 11px; color: #0a58a5; background: transparent; }
.settings-shortcut-row {
  display: flex; align-items: center; gap: 10px; min-height: 28px;
  border-bottom: 1px solid #f0f0f0;
}
.settings-shortcut-label { flex: 0 0 220px; width: 220px; font-size: 12px; color: #333333; }
.settings-shortcut-combo {
  min-width: 150px; padding: 2px 6px; background: #f0f0f0;
  border: 1px solid #d0d0d0; font-family: var(--font-mono); font-size: 12px; color: #1a1a1a;
}
.settings-hint { margin-top: 8px; font-size: 11px; color: #666666; }
.settings-status {
  position: absolute; left: 12px; right: 12px; bottom: 48px; height: 16px;
  font-size: 11px; color: #333333; overflow: hidden; white-space: nowrap;
}
.settings-footer {
  position: absolute; left: 0; bottom: 0; width: 100%; height: 46px;
  display: flex; align-items: center; gap: 8px; padding: 0 12px;
  background: #f5f5f5; border-top: 1px solid #d0d0d0;
}

/* ---------------- 9-14 深色主题（应用后生效；默认浅色 = 像素基线） ---------------- */
body.theme-dark #app { background: #2b2b2b; }
body.theme-dark #ribbon,
body.theme-dark #panels,
body.theme-dark #files-panel,
body.theme-dark #ws-panel,
body.theme-dark #files-panel .body,
body.theme-dark #ws-panel .body { background: #2b2b2b; color: #e8e8e8; }
body.theme-dark .panel-title { background: #333333; color: #e8e8e8; border-bottom-color: #4a4a4a; }
body.theme-dark .panel-title .title-text { color: #e8e8e8; }
body.theme-dark .colheader { background: #3a3a3a; border-bottom-color: #4a4a4a; }
body.theme-dark .col-label, body.theme-dark .group-label { color: #cfcfcf; }
body.theme-dark #cmdwin #cmd-body { background: #1e1e1e; }
body.theme-dark .cmd-line, body.theme-dark #cmd-input, body.theme-dark #cmd-prompt { color: #e8e8e8; }
body.theme-dark #cmd-banner { background: #5a4a12; }
body.theme-dark #statusbar { background: #333333; border-top-color: #4a4a4a; }
body.theme-dark #statusbar #status-ready { color: #e8e8e8; }
body.theme-dark .file-row .row-name { color: #cfcfcf; }
body.theme-dark .file-row:hover { background: #3a3a3a; }
body.theme-dark #ft-body { background: #1e1e1e; }
body.theme-dark #ft-nav-bg { background: #2b2b2b; }
body.theme-dark .path-text, body.theme-dark .path-sep { color: #e8e8e8; }
