/* ============================================================
   components.css —— 目录树 / 菜单 / 弹窗 / 通知 / 进度条
   ============================================================ */

/* ==================== 目录树 ==================== */
.tree { user-select: none; }

.tree-node { position: relative; }

.tree-row {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 27px;
  /* 高亮只包内容（方框+图标+文件名），不对齐整行；缩进由 --indent 行内变量提供 */
  width: fit-content;
  max-width: 100%;
  margin-left: var(--indent, 0px);
  padding-right: 7px;
  border-radius: var(--r-sm);
  cursor: pointer;
  color: var(--c-text-2);
  font-size: 12.5px;
  transition: background .1s var(--ease), color .1s var(--ease);
  position: relative;
}
/* 高亮背景画在 ::before（从图标左缘 +20px 起，不盖方框与连接线区）；文字色仍在行上 */
.tree-row::before {
  content: '';
  position: absolute;
  left: 20px;
  right: 0;
  top: 0;
  bottom: 0;
  border-radius: var(--r-sm);
  pointer-events: none;
}
.tree-row > * { position: relative; } /* 内容绘制在 ::before 背景之上 */
.tree-row:hover { color: var(--c-text); }
.tree-row:hover::before { background: var(--c-bg-hover); }
.tree-row.active { color: var(--c-accent); font-weight: 500; }
.tree-row.active::before { background: var(--c-accent-soft); }
.tree-row.active .tree-icon { color: var(--c-accent); }
/* 拖入目录高亮：与 hover/active 同画在 ::before，起点一致（不盖方框与连接线区） */
.tree-row.drop-into::before {
  background: var(--c-accent-soft);
  box-shadow: inset 0 0 0 1.5px var(--c-accent);
}
.tree-row .dim { color: var(--c-text-3); }

.tree-arrow {
  width: 15px;
  height: 15px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-text-3);
  transition: transform var(--dur) var(--ease);
  border-radius: 3px;
  position: relative; /* 连接线伪元素锚点 */
}
.tree-arrow:hover { background: var(--c-bg-active); }
.tree-arrow.empty { pointer-events: none; } /* 叶子占位：无开关，不响应悬停（否则出现悬空方块） */
/* ⊞/⊟ 开关：展开时隐藏竖杠（+ → −） */
.tree-node.open > .tree-row .tree-arrow .tv,
.tree-module.open > .tree-row .tree-arrow .tv { display: none; }
.tree-arrow .box-bg { fill: var(--c-bg-elev); stroke: currentColor; stroke-width: 1; }
.tree-arrow .box-stroke { fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; }

.tree-icon { flex: none; display: flex; color: var(--c-text-3); }
.tree-row.active .tree-icon { color: var(--c-accent); }
.tree-icon.module { color: var(--c-accent); }
/* 文件夹双态：默认关闭，展开显示打开 */
.tree-icon .f-open { display: none; }
.tree-node.open > .tree-row .tree-icon .f-closed,
.tree-module.open > .tree-row .tree-icon .f-closed { display: none; }
.tree-node.open > .tree-row .tree-icon .f-open,
.tree-module.open > .tree-row .tree-icon .f-open { display: block; }

.tree-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.tree-badge {
  font-size: 10px;
  color: var(--c-text-3);
  background: var(--c-bg-sunken);
  padding: 1px 5px;
  border-radius: 4px;
  flex: none;
  font-variant-numeric: tabular-nums;
}
.tree-row.active .tree-badge { background: rgba(10, 132, 255, .16); color: var(--c-accent); }

/* ---- 展开 / 折叠动画（复刻旧项目 zTree 的 slideDown 观感）----
   旧项目是 zTree 默认 view.expandSpeed:'fast' → jQuery slideDown/slideUp，
   即子容器【高度 0 ⇄ 自然高】的 200ms 动画（所以下方内容被逐层推下去）。
   这里用 grid-template-rows 0fr→1fr 复刻。实证（Chrome）：该属性真插值，
   seek 50% 高度 = 60.17/75、90% = 74.56/75，与 ease 曲线完全吻合。
   ★ 三条约束，缺一条就失效：
     1) .tree-children 里只能有【一个】直接子元素 —— grid 容器会把每个直接子元素
        各排一行，多余元素会变成额外的行。故内容统一收进 .tree-box（tree.js 里懒建）。
     2) .tree-box 必须 min-height:0 + overflow:hidden，否则 grid item 的
        min-height:auto 不收缩 → 折叠不掉（实证闭合高仍等于自然高）。
     3) ★★ 必须把 hidden 属性压掉（下面那条 !important）：base.css:295 有全局重置
        `[hidden] { display: none !important; }`，而 tree.js 的 toggle() 在折叠时
        会同步写 host.hidden = true —— 若让它生效，元素当场变 display:none，
        而【display:none 的元素无法启动 CSS 过渡】（展开时从 none→grid 也不会补过渡），
        实测展开/折叠的 getAnimations() 都返回 0 个动画 = 彻底硬切。
        所以这里用更高特异性的 .tree-children[hidden] + !important 把它顶回去，
        让显隐【唯一由 .open 类经 0fr/1fr 决定】。两条声明同为 !important 时比特异性，
        (0,2,0) > (0,1,0)，故本条胜出；已在真实 Chrome 实测生效。
        注意：tree.js 里仍会写 host.hidden（与 .open 始终同步，见各处调用），
        但对布局已无作用，仅为兼容既有断言保留，勿依赖它判断显隐。 */
.tree-children {
  overflow: hidden;
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .2s ease; /* 200ms ease = 旧项目 zTree 同款 */
}
.tree-node.open > .tree-children,
.tree-module.open > .tree-children { grid-template-rows: 1fr; }
.tree-children[hidden] { display: grid !important; } /* 见上方第 3 条 */
.tree-children > .tree-box { min-height: 0; overflow: hidden; }

/* ---- zTree 风格连接虚线 ----
   竖线 = 每层 .tree-children 一条连续虚线（::before，x 由行内 --vline-x 提供，随层级变化，
   末行中线截止不出悬空线）——不能用每行一段拼接，相位逐行重排会断续。
   横肘 = 挂在 .tree-arrow::before，坐标以箭头自身为基准（与缩进层级无关）：
   父级竖线在箭头左缘 -18.5px 处，图标左缘在 +20px。
   ★ 点线一律用 repeating-linear-gradient 短划纹理，禁用 1px dotted border ——
     dotted 在 Windows 125% DPI 下每点跨 1.25 物理px、半数点被稀释，视觉断续。
   ★ 线色 = var(--c-text-3) @ opacity .85（原来 --c-border-strong @ .6，叠白底显示 #e1e1e5
     几乎看不见）。现在叠白底 = #9c9ca3，深色主题下 --c-text-3 自动变 #7c7c85，无需写两套。
     注意：只想加深时调 opacity 没有空间，必须换更深的色源。 */
.tree-children {
  position: relative;
}
.tree-children::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 13.5px;
  left: var(--vline-x, 13.5px);
  width: 1px;
  background-image: repeating-linear-gradient(to bottom, var(--c-text-3) 0 2px, transparent 2px 5px);
  opacity: .85;
  pointer-events: none;
}
/* 有【后继兄弟】时，竖线一直画到容器底（贴住下一个兄弟行的上沿）——旧项目 ul.line 就是满高。
   否则相邻两个目录的展开区之间会空出 13.5px(上面那条 bottom 截断) + 6px(下一行方框上方留白)
   ≈ 20px 的断口，实测视觉上就是"线没连上"。末个兄弟保持默认 bottom:13.5px —— 线停在末行中线，
   不产生悬空线。结构依据：模块 = #tree > .tree-module，嵌套目录 = .tree-children > .tree-box > .tree-node。 */
.tree > .tree-module:not(:last-child) > .tree-children::before,
.tree-box > .tree-node:not(:last-child) > .tree-children::before {
  bottom: 0;
}
/* 兜底：行内 --vline-x 缺失时（如浏览器缓存旧 JS），按 data-depth 定位，防错位 */
.tree-children[data-depth="2"]::before { left: 39.5px; }
.tree-children[data-depth="3"]::before { left: 65.5px; }
.tree-children[data-depth="4"]::before { left: 91.5px; }
.tree-children[data-depth="5"]::before { left: 117.5px; }
.tree-children .tree-arrow::before {
  content: '';
  position: absolute;
  left: -18.5px;
  top: 50%;
  width: 38.5px;
  height: 1px;
  margin-top: -.5px;
  background-image: repeating-linear-gradient(to right, var(--c-text-3) 0 2px, transparent 2px 5px);
  opacity: .85;
  pointer-events: none;
}
/* 展开目录/模块的方框向下补一小段竖线，线从方框底部引出（旧项目同款）
   ★ 三个值都不能按直觉写：
     left —— 不能算 --indent。::after 的定位基准是 .tree-row，而行自己已经带
       margin-left: var(--indent)（见上面 .tree-row 第 18 行），行内再加一次 = 缩进算两遍。
       实测（真实 Chrome，DPR=1）补线落到"方框中心 + indent"：模块 indent=6px 时
       偏 +6.5px、二级目录 32px 时偏 +32.5px → 线从方框【右边缘之内】斜着出来再接回
       左边竖线，视觉上就是"连接处拐了个弯"（层级越深拐得越明显）。
       方框宽 15px、中心即 7.5px，所以正确值就是 7.5px（与容器竖线列重合）。
     top —— 必须跟着 left 一起改。只把 left 摆正的话，线会从方框【中心】（− 符号处）
       往下穿过方框内部；top: 50% + 方框半高 7.5px = 21px，正好是方框底缘。
     bottom —— 取代原来的 height: 13.5px：一直画到行底，才能接上子容器的竖线
       （实测原来在行底之后留有 14px / 35px 空白）。行高变化时也不用再同步这个值。 */
.tree-node.open > .tree-row::after,
.tree-module.open > .tree-row::after {
  content: '';
  position: absolute;
  left: 7.5px;
  top: calc(50% + 7.5px);
  bottom: 0;
  width: 1px;
  background-image: repeating-linear-gradient(to bottom, var(--c-text-3) 0 2px, transparent 2px 5px);
  opacity: .85;
  pointer-events: none;
}

/* 重命名内联输入 */
.tree-rename-input {
  height: 22px;
  font-size: 12.5px;
  padding: 0 6px;
  flex: 1;
  min-width: 0;
}

/* 过滤高亮 */
mark { background: rgba(255, 214, 10, .5); color: inherit; border-radius: 2px; padding: 0 1px; }
:root[data-theme="dark"] mark { background: rgba(255, 214, 10, .32); }

/* ==================== 下拉菜单 / 右键菜单 ==================== */
.ctx-layer {
  position: fixed;
  inset: 0;
  z-index: 8000;
}
.dropdown {
  position: absolute;
  min-width: 188px;
  padding: 5px;
  background: var(--c-bg-elev);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  animation: menuIn .13s var(--ease);
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
@keyframes menuIn {
  from { opacity: 0; transform: translateY(-5px) scale(.985); }
  to { opacity: 1; transform: none; }
}

.menu-row {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 29px;
  padding: 0 9px;
  border-radius: var(--r-sm);
  color: var(--c-text);
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .1s var(--ease);
  position: relative;
}
.menu-row:hover, .menu-row.hover { background: var(--c-bg-hover); }
.menu-row.disabled { opacity: .38; cursor: not-allowed; }
.menu-row.disabled:hover { background: none; }
.menu-row.danger { color: var(--c-danger); }
.menu-row.danger:hover { background: var(--c-danger-soft); }
.menu-row .mi { flex: none; display: flex; color: var(--c-text-2); width: 15px; justify-content: center; }
.menu-row.danger .mi { color: var(--c-danger); }
.menu-row.selected .mi { color: var(--c-accent); }
.menu-label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.menu-key {
  font-size: 10.5px;
  color: var(--c-text-3);
  font-family: var(--font-ui);
  flex: none;
  padding-left: 14px;
}
.menu-arrow { flex: none; color: var(--c-text-3); display: flex; }

.menu-sep {
  height: 1px;
  background: var(--c-border);
  margin: 4px 7px;
}
.menu-title {
  padding: 7px 9px 5px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--c-text-3);
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* 子菜单 */
.menu-row.has-sub > .dropdown { display: none; }
.menu-row.has-sub.hover > .dropdown { display: block; }

/*
 * ★ 带子菜单的父菜单不能裁剪溢出。
 *   .dropdown 默认有 `overflow-y: auto`（用于长菜单滚动）；按 CSS 规范，
 *   当 overflow-y 为 auto 时 overflow-x 会被提升为 auto —— 结果是作为子元素的
 *   子菜单（left:100% 探出父级右边界）会被【裁剪掉】，表现为「子菜单不展开」。
 *   所以含子菜单的菜单改为 overflow: visible，其自身高度由 JS 设的 max-height 兜底。
 *
 *   两条规则等价，双写是为了兼容：.sn-has-sub 由 buildMenu() 在 JS 里打标，
 *   :has() 作为纯 CSS 声明式方案（Chrome 105+ / Safari 15.4+ / Firefox 121+ 支持）。
 */
.dropdown:has(> .menu-row.has-sub) { overflow: visible; }
.dropdown.sn-has-sub { overflow: visible; }

/* ==================== 弹窗 ==================== */
.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 8500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, .3);
  backdrop-filter: blur(2px);
  animation: fadeIn .16s var(--ease);
  overflow-y: auto;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: 100%;
  background: var(--c-bg-elev);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-lg);
  display: flex;
  flex-direction: column;
  max-height: 100%;
  animation: modalIn .2s var(--ease);
  overflow: hidden;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.modal.sm { max-width: 380px; }
.modal.md { max-width: 520px; }
.modal.lg { max-width: 760px; }
.modal.xl { max-width: 1060px; }
.modal.full { max-width: 1300px; height: 100%; }

.modal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--c-border);
  flex: none;
}
.modal-title { font-size: 14px; font-weight: 600; flex: 1; letter-spacing: .2px; }
.modal-close {
  width: 26px; height: 26px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--c-text-3);
  font-size: 19px;
  line-height: 1;
  flex: none;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.modal-close:hover { background: var(--c-bg-hover); color: var(--c-text); }

.modal-body {
  padding: 18px;
  overflow: auto;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.modal-body.tight { padding: 0; gap: 0; }
.modal-message { font-size: 13px; color: var(--c-text-2); line-height: 1.7; }
.modal-message b { color: var(--c-text); font-weight: 600; }

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 13px 18px;
  border-top: 1px solid var(--c-border);
  flex: none;
  background: var(--c-bg-elev);
}
.modal-foot .spacer { flex: 1; }

/* 表单网格 */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-row { display: flex; gap: 10px; align-items: flex-end; }

/* 提示块 */
.callout {
  font-size: 12px;
  padding: 9px 12px;
  border-radius: var(--r-md);
  line-height: 1.6;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.callout.info { background: var(--c-accent-soft); color: var(--c-accent); }
.callout.warn { background: rgba(255, 149, 0, .12); color: #b26a00; }
.callout.danger { background: var(--c-danger-soft); color: var(--c-danger); }
:root[data-theme="dark"] .callout.warn { color: var(--c-warning); }

/* ==================== 通知 ==================== */
.toast-layer {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9500;
  display: flex;
  flex-direction: column-reverse;
  gap: 9px;
  pointer-events: none;
  max-width: 340px;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 14px;
  background: var(--c-bg-elev);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  font-size: 12.5px;
  color: var(--c-text);
  line-height: 1.55;
  pointer-events: auto;
  animation: toastIn .26s var(--ease);
  word-break: break-word;
}
.toast.out { animation: toastOut .22s var(--ease) forwards; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(24px) scale(.97); }
  to { opacity: 1; transform: none; }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateX(20px) scale(.97); }
}
.toast-icon { flex: none; margin-top: 1px; }
.toast.success .toast-icon { color: var(--c-success); }
.toast.error .toast-icon { color: var(--c-danger); }
.toast.warn .toast-icon { color: var(--c-warning); }
.toast.info .toast-icon { color: var(--c-accent); }
.toast-text { flex: 1; }

/* ==================== 全局进度条 ==================== */
.progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 9800;
  pointer-events: none;
}
.progress > i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--c-accent);
  box-shadow: 0 0 6px var(--c-accent);
  transition: width .2s var(--ease), opacity .3s var(--ease);
}
.progress.done > i { opacity: 0; }

/* ==================== 文件列表（标签右侧下拉） ==================== */
.file-list-panel {
  width: 300px;
  max-height: 420px;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
.file-list-search {
  padding: 8px;
  border-bottom: 1px solid var(--c-border);
  flex: none;
}
.file-list-search input { height: 27px; font-size: 12px; }
.file-list-items { overflow-y: auto; padding: 5px; flex: 1; min-height: 0; }
.file-list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 29px;
  padding: 0 9px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 12.5px;
  color: var(--c-text-2);
}
.file-list-item:hover { background: var(--c-bg-hover); color: var(--c-text); }
.file-list-item.active { background: var(--c-accent-soft); color: var(--c-accent); }
.file-list-item .fli-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.file-list-item .fli-path { font-size: 10.5px; color: var(--c-text-3); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; max-width: 45%; }
.file-list-empty { padding: 22px; text-align: center; color: var(--c-text-3); font-size: 12px; }

/* ==================== 搜索结果列表 ==================== */
.result-list { overflow-y: auto; max-height: 52vh; }
.result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: var(--r-md);
  cursor: pointer;
  font-size: 12.5px;
  color: var(--c-text-2);
  transition: background var(--dur) var(--ease);
}
.result-item:hover, .result-item.active { background: var(--c-bg-hover); color: var(--c-text); }
.result-item.active { background: var(--c-accent-soft); }
.result-item .ri-icon { flex: none; color: var(--c-text-3); display: flex; }
.result-item.active .ri-icon { color: var(--c-accent); }
.result-item .ri-main { flex: 1; min-width: 0; }
.result-item .ri-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-item .ri-path { font-size: 11px; color: var(--c-text-3); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-empty { padding: 34px; text-align: center; color: var(--c-text-3); font-size: 12.5px; }

/* ==================== 快捷键面板 ==================== */
.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 26px 34px;
}
.shortcut-group h4 {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--c-text-3);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 11px;
}
.shortcut-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 5.5px 0;
  font-size: 12.5px;
  color: var(--c-text-2);
}
.shortcut-keys { display: flex; gap: 3px; flex: none; }

/* ==================== 版本历史 ==================== */
.history-toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--c-border);
  background: var(--c-bg-sunken);
  flex: none;
}
.history-toolbar .ht-info { flex: 1; font-size: 12px; color: var(--c-text-3); }
.history-toolbar .ht-info b { color: var(--c-text-2); }

.commit-list { overflow-y: auto; flex: 1; min-height: 0; }
.commit-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--c-border);
  cursor: pointer;
  transition: background var(--dur) var(--ease);
}
.commit-item:hover { background: var(--c-bg-hover); }
.commit-item.checked { background: var(--c-accent-soft); }
.commit-item input[type="checkbox"] {
  width: 15px; height: 15px; margin-top: 2px;
  accent-color: var(--c-accent); flex: none; cursor: pointer;
}
.commit-main { flex: 1; min-width: 0; }
.commit-msg { font-size: 12.5px; color: var(--c-text); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.commit-meta { display: flex; gap: 12px; margin-top: 4px; font-size: 11px; color: var(--c-text-3); flex-wrap: wrap; }
.commit-sha { font-family: var(--font-mono); font-size: 10.5px; }

/* diff 视图 */
.diff-view {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.65;
  overflow: auto;
  flex: 1;
  min-height: 0;
  background: var(--c-bg-elev);
}
.diff-line { display: flex; min-height: 19.5px; white-space: pre; }
.diff-line:hover { background: var(--c-bg-hover); }
.diff-ln {
  flex: none;
  width: 46px;
  padding: 0 9px;
  text-align: right;
  color: var(--c-text-3);
  background: var(--c-bg-sunken);
  border-right: 1px solid var(--c-border);
  user-select: none;
  font-size: 11px;
}
.diff-code { flex: 1; padding: 0 12px; min-width: 0; }
.diff-line.add { background: rgba(52, 199, 89, .14); }
.diff-line.add .diff-code { color: #1a7f37; }
:root[data-theme="dark"] .diff-line.add .diff-code { color: #5fd97e; }
.diff-line.del { background: rgba(255, 59, 48, .12); }
.diff-line.del .diff-code { color: #c62828; }
:root[data-theme="dark"] .diff-line.del .diff-code { color: #ff7b72; }
.diff-line.hunk { background: var(--c-accent-soft); }
.diff-line.hunk .diff-code { color: var(--c-accent); font-weight: 600; }
.diff-empty { padding: 40px; text-align: center; color: var(--c-text-3); font-size: 12.5px; }

/* ==================== 上传拖拽区 ==================== */
.dropzone {
  border: 1.5px dashed var(--c-border-strong);
  border-radius: var(--r-lg);
  padding: 30px 20px;
  text-align: center;
  color: var(--c-text-3);
  font-size: 12.5px;
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.dropzone:hover, .dropzone.over {
  border-color: var(--c-accent);
  background: var(--c-accent-soft);
  color: var(--c-accent);
}
.dropzone .dz-icon { display: flex; justify-content: center; margin-bottom: 10px; color: var(--c-accent); }

/* 整个工作区拖拽提示 */
.drag-overlay {
  position: fixed;
  inset: 0;
  z-index: 7000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 132, 255, .08);
  backdrop-filter: blur(1.5px);
  pointer-events: none;
}
.drag-overlay-inner {
  padding: 26px 40px;
  border-radius: var(--r-xl);
  border: 2px dashed var(--c-accent);
  background: var(--c-bg-elev);
  color: var(--c-accent);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--sh-lg);
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ==================== 表格 / 文件信息 ==================== */
.info-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.info-table tr { border-bottom: 1px solid var(--c-border); }
.info-table tr:last-child { border-bottom: none; }
.info-table th {
  text-align: left;
  font-weight: 500;
  color: var(--c-text-3);
  padding: 9px 0;
  width: 104px;
  vertical-align: top;
  font-size: 12px;
}
.info-table td { padding: 9px 0; color: var(--c-text); word-break: break-all; }
.info-table td.mono { font-family: var(--font-mono); font-size: 11.5px; }

/* ==================== 图片浮层查看器 ==================== */
/* 层级 9400：盖住 modal-layer(8500)，低于 toast(9500)/progress(9800)，看图时提示仍可见 */
.img-viewer {
  position: fixed;
  inset: 0;
  z-index: 9400;
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, .78);
  backdrop-filter: blur(3px);
  animation: fadeIn .16s var(--ease);
  user-select: none;
}

.img-viewer-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: zoom-out;
}

.img-viewer-img {
  max-width: none;
  max-height: none;
  transform-origin: center center;
  cursor: zoom-in;
  will-change: transform;
  transition: transform .12s var(--ease);
  -webkit-user-drag: none;
}
.img-viewer-img.grabbing {
  cursor: grabbing;
  transition: none;
}

.img-viewer-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 7px 12px;
  background: rgba(28, 28, 30, .86);
  border-top: 1px solid rgba(255, 255, 255, .1);
  backdrop-filter: blur(12px);
}

.img-viewer-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 28px;
  padding: 0 6px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: rgba(255, 255, 255, .72);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  flex: none;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.img-viewer-btn:hover { background: rgba(255, 255, 255, .14); color: #fff; }

.img-viewer-sep {
  width: 1px;
  height: 16px;
  margin: 0 5px;
  background: rgba(255, 255, 255, .16);
  flex: none;
}
.img-viewer-spacer { flex: 1; }

.img-viewer-zoom {
  font-size: 11.5px;
  color: rgba(255, 255, 255, .6);
  font-variant-numeric: tabular-nums;
  margin-right: 6px;
  flex: none;
}
