/* ============================================================
   Adobe Photoshop 2026 网页复刻 —— 像素几何来自真机参考图量测
   参考：docs/reference/surfaces/main-1920x1080.png（1920x1080, 100%）
   分区：菜单栏 0..27 / 选项栏 28..63 / 文档标签栏 64..93 / 主区 94..1014
         状态栏 1015..1030 / 窗口底边 1031 / OS 任务栏 1032..1079
   ============================================================ */

:root {
  --chrome: #535353;            /* 菜单/选项栏/工具栏/面板底色 */
  --panel-header: #424242;      /* 面板标签条 */
  --workspace: #282828;         /* 画布工作区 */
  --list-bg: #4d4d4d;           /* 图层面板列表底 */
  --status-bg: #4a4a4a;         /* 状态栏底色 */
  --border: #383838;
  --divider: #3a3a3a;
  --text: #f0f0f0;              /* 菜单文字 */
  --text-tab: #d6d6d6;
  --text-dim: #b8b8b8;
  --text-disabled: #6f6f6f;
  --field-bg: #454545;
  --field-border: #6a6a6a;
  --combo-bg: #454545;
  --selected-bg: #696969;
  --hover: #5f5f5f;
  --accent: #2d7ff9;
  --font: "Microsoft YaHei", "Microsoft YaHei UI", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #1e1e1e;
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  user-select: none;
  cursor: default;
}

button {
  font-family: var(--font);
  cursor: default;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--chrome);
  border-bottom: 1px solid var(--border);
}

body.frame-ref #app { height: calc(100% - 48px); }
body:not(.frame-ref) #os-strip { display: none; }
#os-strip { height: 48px; width: 100%; background: #1e1e1e; }

/* ================= 菜单栏 (28px) ================= */
#menubar {
  position: relative;
  height: 28px;
  flex: 0 0 28px;
  background: var(--chrome);
}
#app-logo {
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 16px;
}
#app-logo img { display: block; width: 18px; height: 16px; }
#menu-items {
  position: absolute;
  left: 28px;
  top: 0;
  height: 28px;
  display: flex;
  align-items: center;
}
.menu-item {
  height: 24px;
  padding: 0 7px;
  font-size: 13px;
  line-height: 24px;
  color: var(--text);
  white-space: nowrap;
}
.menu-item:hover, .menu-item.open { background: #4a4a4a; }
#window-controls {
  position: absolute;
  right: 2px;
  top: 0;
  height: 28px;
  display: flex;
}
.wc { width: 46px; height: 28px; display: flex; align-items: center; justify-content: center; }
.wc:hover { background: #4a4a4a; }
.wc-close:hover { background: #c42b1c; }
.wc-min { width: 10px; height: 1px; background: #bfbfbf; display: block; }
.wc-max { width: 9px; height: 8px; border: 1px solid #bfbfbf; display: block; }
.wc-x { position: relative; width: 10px; height: 10px; display: block; }
.wc-x::before, .wc-x::after {
  content: ""; position: absolute; left: 0; top: 4.5px; width: 10px; height: 1px; background: #bfbfbf;
}
.wc-x::before { transform: rotate(45deg); }
.wc-x::after { transform: rotate(-45deg); }

/* ================= 选项栏 (36px) ================= */
#optionsbar {
  position: relative;
  height: 36px;
  flex: 0 0 36px;
  background: var(--chrome);
}
#options-content { position: absolute; left: 0; top: 0; right: 110px; height: 36px; }
#options-right {
  position: absolute;
  right: 6px;
  top: 0;
  height: 36px;
  display: flex;
  align-items: center;
  gap: 13px;
}
.opt-icon { width: 17px; height: 17px; display: flex; align-items: center; justify-content: center; }
.opt-icon:hover { background: #4a4a4a; }
.opt-caret { width: 9px; }

.opt-el { position: absolute; top: 0; }
.opt-sep { position: absolute; width: 1px; background: #464646; top: 8px; height: 21px; }

.opt-home {
  position: absolute; left: 20px; top: 10px; width: 16px; height: 16px;
}
.opt-marquee { position: absolute; left: 60px; top: 10px; width: 18px; height: 16px; }
.opt-marquee-caret { position: absolute; left: 85px; top: 16px; width: 8px; height: 6px; }

.opt-modes { position: absolute; left: 102px; top: 5px; height: 26px; display: flex; }
.opt-mode {
  width: 27px; height: 26px; display: flex; align-items: center; justify-content: center;
  border-radius: 3px;
}
.opt-mode.active { background: #454545; }
.opt-mode:hover { background: #4a4a4a; }

.opt-group { position: absolute; top: 0; height: 36px; display: flex; align-items: center; }
.opt-label { font-size: 12px; color: #dcdcdc; white-space: nowrap; }
.opt-label.dim { color: var(--text-disabled); }
.opt-field {
  height: 22px; background: var(--field-bg); border: 1px solid var(--field-border);
  border-radius: 2px; display: flex; align-items: center; padding: 0 6px;
  font-size: 12px; color: #e4e4e4; min-width: 0;
}
.opt-field .unit { color: #9a9a9a; padding-left: 3px; }
.opt-combo {
  height: 23px; background: var(--field-bg); border: 1px solid var(--field-border);
  border-radius: 2px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 6px 0 7px; font-size: 12px; color: #e4e4e4;
}
.opt-combo .combo-caret { width: 7px; height: 5px; background: #cfcfcf; clip-path: polygon(0 0, 100% 0, 50% 100%); }
.opt-checkbox {
  width: 12px; height: 12px; background: #3c3c3c; border: 1px solid #6f6f6f; border-radius: 2px;
}
.opt-btn {
  height: 25px; padding: 0 12px; border: 1px solid #7a7a7a; border-radius: 13px;
  font-size: 12px; color: #e6e6e6; display: flex; align-items: center;
}
.opt-btn:hover { background: #4a4a4a; }
.opt-swap { position: absolute; left: 646px; top: 12px; width: 18px; height: 12px; }

/* ================= 文档标签栏 (30px) ================= */
#tabbar {
  position: relative;
  height: 30px;
  flex: 0 0 30px;
  background: var(--panel-header);
}
#tabbar-left { position: absolute; left: 0; top: 0; width: 41px; height: 30px; }
#tab-scroll { position: absolute; left: 9px; top: 2px; width: 14px; height: 10px; display: flex; align-items: center; justify-content: center; }
.tab-dots {
  position: absolute; left: 13px; top: 15px; width: 25px; height: 9px;
  background: repeating-linear-gradient(90deg, #8a8a8a 0 1px, transparent 1px 3px);
  opacity: .8;
}
#doc-tab {
  position: absolute; left: 41px; top: 1px; width: 166px; height: 28px;
  background: var(--chrome); border-radius: 3px 3px 0 0;
  display: flex; align-items: center;
}
#doc-tab.active { background: #565656; }
#doc-tab-title {
  position: absolute; left: 11px; top: 0; line-height: 28px;
  font-size: 11px; color: var(--text-tab); white-space: nowrap;
}
#doc-tab-dirty { position: absolute; left: 12px; top: 0; line-height: 28px; font-size: 11px; color: #e8e8e8; }
#doc-tab-close {
  position: absolute; right: 8px; top: 8px; width: 12px; height: 12px;
  font-size: 13px; line-height: 11px; color: #cfcfcf; text-align: center;
}
#doc-tab-close:hover { color: #ffffff; }
#tabbar-fill { position: absolute; left: 207px; right: 0; top: 0; height: 30px; }

/* ================= 主区域 ================= */
/* 真机结构：左列 = 标签栏 + (工具栏 | 工作区) + 状态栏；右列 = 面板区（一直延伸到底） */
#main { position: relative; flex: 1 1 auto; min-height: 0; display: flex; }
#left-col { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; padding-bottom: 16px; }
#doc-area { position: relative; flex: 1 1 auto; min-height: 0; display: flex; }

/* ---- 工具栏 (39px) ---- */
#toolbar {
  position: relative;
  width: 39px;
  flex: 0 0 39px;
  background: var(--chrome);
  overflow: hidden;
}
.tool-hit {
  position: absolute; left: 0; width: 39px; height: 26px;
}
.tool-hit:hover { background: #5d5d5d; }
.tool-hit.sel { background: transparent; }
.tool-icon { position: absolute; display: block; pointer-events: none; }
.tool-highlight {
  position: absolute; left: 3px; width: 33px; height: 26px;
  background: #383838; border-radius: 3px; display: none;
}
.tool-cell-label { display: none; }

/* ---- 工作区 / 画布 ---- */
#workspace {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  background: var(--workspace);
  display: flex;
}
#canvas-host { position: relative; flex: 1 1 auto; min-width: 0; overflow: hidden; }
#canvas-view { position: absolute; left: 0; top: 0; display: block; }
#v-scrollbar { position: relative; width: 16px; flex: 0 0 16px; background: var(--status-bg); }
/* 真机量测：轨道两端各有一枚 8x4 墨迹的抗锯齿翻页箭头（距端 8px，x 偏移 5px）；
   箭头形状改为参考图单个控件裁剪的官方位图（rect 1543,101,10,6 / 1543,1002,10,6，
   sha256 见 docs/reference/ps-ref-assets.json 的 ctx-scroll-arrow-*） */
#v-scrollbar::before, #v-scrollbar::after {
  content: "";
  position: absolute;
  left: 4px;
  width: 10px;
  height: 6px;
  background: center / 10px 6px no-repeat;
}
#v-scrollbar::before {
  top: 7px;
  background-image: url("../assets/ref/ctx-scroll-arrow-up.png");
}
#v-scrollbar::after {
  bottom: 7px;
  background-image: url("../assets/ref/ctx-scroll-arrow-down.png");
}
/* 真机量测：滑块 12x348（x=1541，y=380..727；轨道自 y=94 起算 top=286），顶部 1px 圆角 */
#v-thumb {
  position: absolute; left: 2px; width: 12px; top: 286px; height: 348px;
  background: var(--selected-bg); border-radius: 1px 1px 0 0;
}

/* 上下文任务栏（画布下方浮动条）：真机量测 x=576..1003 (428x32), y=919..950，圆角 4px */
#context-taskbar {
  position: absolute;
  left: 537px;
  top: 825px;
  width: 428px;
  height: 32px;
  background: var(--chrome);
  border: 1px solid #474747;
  border-radius: 4px;
  z-index: 5;
}
/* 真机量测：左端 x=580..584 是 6 段 5x3 拖动握把（段距 4px，色 #f0f0f0）；
   6 段握把整组按参考图单个控件裁剪为官方位图（rect 579,922,7,25），不再用 SVG 图案近似 */
#context-taskbar::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 7px;
  height: 25px;
  background: url("../assets/ref/ctx-taskbar-grip.png") 0 0 / 7px 25px no-repeat;
}
/* 真机量测：三个按钮 x=596/710/877，宽 108/161/93，y=923 高 24，1px 边框圆角 4 */
.ctx-btn {
  position: absolute;
  top: 3px;
  height: 24px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 0 0 6px;
  border: 1px solid #7a7a7a;
  border-radius: 4px;
  font-size: 13px;
  color: #f0f0f0;
  white-space: nowrap;
}
.ctx-btn[data-test="ctx-add-device"] { left: 19px; width: 108px; }
.ctx-btn[data-test="ctx-free-assets"] { left: 133px; width: 161px; }
.ctx-btn[data-test="ctx-generate"] { left: 300px; width: 93px; border-color: #616161; color: #878787; }
/* 真机墨迹：按钮文字比几何居中高 2px（13px 雅黑在真机上的墨迹基线） */
.ctx-btn span { position: relative; top: -2px; }
/* 真机参考图里这排 13px 文字是**无抗锯齿 1-bit 渲染**（文字区域只有底色 #535353 与文字色两种像素），
   Chrome 无法用 text-rendering 关掉文字抗锯齿：由 canvasview.js 在 body.ctx-text-sharp 时挂同文档
   SVG alpha 阈值滤镜（feComponentTransfer slope=100/intercept=-60，覆盖率 >60% 保留），把字重与边缘
   对齐真机墨迹；滤镜没装上时退回普通抗锯齿文字，不会出现文字不可见。
   真机每字推进量≈10pt（13.3px），故补 0.3px 字距并按墨迹量测逐标签微调半像素字位；文字仍是真实 DOM 文本。 */
body.ctx-text-sharp .ctx-btn[data-test="ctx-add-device"] span,
body.ctx-text-sharp .ctx-btn[data-test="ctx-free-assets"] span {
  filter: url("#ctx-text-1bit");
  letter-spacing: 0.3px;
}
body.ctx-text-sharp .ctx-btn[data-test="ctx-add-device"] span { left: 0.5px; }
body.ctx-text-sharp .ctx-btn[data-test="ctx-free-assets"] span { left: 0.75px; }
/* 三个按钮图标改为参考图单个控件裁剪的官方位图（18x18，按原图坐标 1:1 贴回；rect + sha256 见
   docs/reference/ps-ref-assets.json 的 ctx-icon-*）；原手绘 SVG 只隐藏、保留占位与 9px 间距，文字位置不变。 */
.ctx-btn svg { visibility: hidden; }
.ctx-btn::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 18px;
  height: 18px;
  background-repeat: no-repeat;
  background-position: 0 0;
  background-size: 18px 18px;
}
.ctx-btn[data-test="ctx-add-device"]::before { background-image: url("../assets/ref/ctx-icon-add-device.png"); }
.ctx-btn[data-test="ctx-free-assets"]::before { background-image: url("../assets/ref/ctx-icon-free-assets.png"); }
.ctx-btn[data-test="ctx-generate"]::before { background-image: url("../assets/ref/ctx-icon-generate.png"); }
.ctx-btn:hover { background: #5f5f5f; }
/* 真机量测：右端三点菜单 x=980..994、y=933..936（三点直径≈4px、间距 5.2px、色 #f0f0f0）；
   三点整组按参考图单个控件裁剪为官方位图（rect 979,932,17,6），不再用 CSS 圆点近似 */
.ctx-more { position: absolute; left: 399px; top: 3px; width: 20px; height: 24px; }
.ctx-more svg { display: none; }
.ctx-more::before {
  content: "";
  position: absolute; left: 3px; top: 9px; width: 17px; height: 6px;
  background: url("../assets/ref/ctx-taskbar-more.png") 0 0 / 17px 6px no-repeat;
}
.ctx-more:hover { background: #5f5f5f; }

/* ---- 侧边面板 (364px) ---- */
#sidebar {
  position: relative;
  width: 364px;
  flex: 0 0 364px;
  background: var(--panel-header);
  border-left: 1px solid var(--border);
  display: flex;
  min-height: 0;
}
#panel-rail {
  position: relative;
  width: 39px;
  flex: 0 0 39px;
  background: var(--chrome);
}
.rail-btn {
  position: absolute; left: 5px; width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
}
.rail-btn[data-test="rail-layers"] { top: 25px; }
.rail-btn[data-test="rail-comment"] { top: 57px; }
.rail-btn:hover { background: #4a4a4a; }

#panel-groups { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; border-top: 1px solid var(--border); }
.panel-group { display: flex; flex-direction: column; min-height: 0; }
#group-color { flex: 0 0 175px; }
#group-props { flex: 0 0 368px; }
#group-layers { flex: 1 1 auto; }
.panel-group + .panel-group { border-top: 3px solid #3a3a3a; }

.panel-tabs {
  position: relative;
  height: 27px;
  flex: 0 0 27px;
  background: var(--panel-header);
  display: flex;
  align-items: center;
  padding-left: 2px;
}
#group-color > .panel-tabs { height: 39px; flex: 0 0 39px; align-items: flex-end; padding-bottom: 5px; }
.ptab {
  padding: 0 9px; height: 20px; font-size: 11px; line-height: 20px;
  color: #c9c9c9; border-radius: 2px;
}
.ptab.active { color: #f0f0f0; }
.ptab:hover { color: #ffffff; }
.panel-menu {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 14px; display: flex; align-items: center; justify-content: center;
}
.panel-menu:hover { background: #4a4a4a; }

.panel-body { flex: 1 1 auto; position: relative; background: var(--chrome); min-height: 0; overflow: hidden; }
#color-body { height: 136px; flex: 0 0 136px; }
#color-ramp { position: absolute; left: 0; top: 0; width: 323px; height: 136px; display: block; }

.swatches-grid { position: absolute; inset: 0; padding: 4px 6px; display: grid; grid-template-columns: repeat(12, 1fr); gap: 2px; }
.swatch { width: 100%; padding-top: 100%; border: 1px solid #2c2c2c; }
.gradient-gallery { position: absolute; inset: 4px 8px; display: flex; flex-direction: column; gap: 4px; }
.gradient-item { height: 18px; border: 1px solid #333; }
.pattern-gallery { position: absolute; inset: 4px 8px; display: grid; grid-template-columns: repeat(6, 1fr); gap: 3px; }
.pattern-item { padding-top: 100%; border: 1px solid #333; background-color: #fff; }

/* ---- 属性面板（行高/控件位置按真机量测：270..607 共 338px） ---- */
.props-body { background: var(--chrome); display: flex; flex-direction: column; position: relative; }
.props-row { display: flex; align-items: center; padding-left: 8px; }
.doc-row { height: 34px; padding-left: 19px; gap: 9px; }
.doc-badge { width: 13px; height: 13px; display: flex; align-items: center; }
.props-label { font-size: 11px; color: #e0e0e0; }
.props-divider { height: 1px; background: #3d3d3d; }
.section-head { height: 36px; display: flex; align-items: center; padding-left: 9px; gap: 8px; flex: 0 0 36px; }
.section-head .caret { font-size: 9px; color: #c8c8c8; width: 8px; }
.section-head .section-title { font-size: 11px; color: #e0e0e0; }
.ruler-head { height: 62px; flex: 0 0 62px; align-items: flex-start; padding-top: 11px; }
.wh-row { height: 30px; padding-left: 53px; gap: 0; }
.props-key { font-size: 11px; color: #d0d0d0; }
.wh-row .props-key { width: 17px; flex: 0 0 17px; }
.mini-field {
  height: 20px; background: var(--field-bg); border: 1px solid #5f5f5f; border-radius: 2px;
  display: flex; align-items: center; padding: 0 4px; font-size: 11px; color: #e4e4e4;
  width: 56px; flex: 0 0 56px; white-space: nowrap; overflow: hidden;
}
.mini-field .num { color: #e8e8e8; }
.mini-field .unit { color: #b6b6b6; padding-left: 3px; }
.mini-field.dim { background: #3f3f3f; }
.mini-field.dim .num { color: #9e9e9e; }
.mini-field.dim .unit { color: #8a8a8a; }
.wh-row .xkey { width: 29px; flex: 0 0 29px; padding-left: 16px; }
.wh-row .ykey { width: 29px; flex: 0 0 29px; padding-left: 16px; }
.props-link { position: absolute; left: 21px; top: 84px; width: 12px; height: 12px; }
.orient-row { height: 30px; padding-left: 75px; display: flex; align-items: center; gap: 4px; }
.orient-btn {
  width: 24px; height: 24px; border-radius: 3px; display: flex; align-items: center; justify-content: center;
}
.orient-btn.active { background: #454545; }
.center-row { height: 25px; flex: 0 0 25px; padding-left: 73px; }
.center-row .props-text { font-size: 11px; color: #dcdcdc; }
.field-row { height: 30px; flex: 0 0 30px; padding-left: 0; }
.field-row.opt-mode { height: 30px; }
.field-row.opt-bits { height: 27px; flex: 0 0 27px; }
.field-row.opt-fill { height: 32px; flex: 0 0 32px; }
.field-row .props-key { width: 41px; flex: 0 0 41px; padding-left: 41px; }  /* label 落在 x=41 */
.field-row .props-key + .combo { margin-left: 31px; }
.combo {
  height: 20px; background: var(--combo-bg); border: 1px solid #5f5f5f; border-radius: 2px;
  display: flex; align-items: center; justify-content: space-between; padding: 0 5px;
  font-size: 11px; color: #e4e4e4; width: 140px; flex: 0 0 140px;
}
.combo.indent { margin-left: 72px; }
.combo.with-chip { gap: 6px; justify-content: flex-start; }
.combo-caret { width: 7px; height: 5px; background: #cfcfcf; clip-path: polygon(0 0, 100% 0, 50% 100%); flex: 0 0 7px; }
.combo.with-chip .combo-caret { margin-left: auto; }
.fill-chip { width: 12px; height: 12px; background: #fff; border: 1px solid #888; display: block; flex: 0 0 12px; }
.orient-row .orient-btn:first-child { margin-left: 0; }
/* 面板滚动条 */
.panel-scrollbar { position: absolute; right: 0; top: 0; bottom: 0; width: 16px; background: var(--status-bg); }
.panel-scroll-thumb { position: absolute; left: 2px; width: 12px; background: var(--selected-bg); border-radius: 6px; }
.props-thumb { top: 53px; height: 141px; }
.layers-thumb { top: 28px; height: 227px; }

/* ---- 图层面板 ---- */
.layers-body { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; background: var(--chrome); }
.layers-filter { height: 33px; display: flex; align-items: center; padding: 0 8px; gap: 6px; }
.search-field {
  height: 20px; background: var(--field-bg); border: 1px solid #5a5a5a; border-radius: 2px;
  display: flex; align-items: center; padding: 0 5px; gap: 5px; width: 96px; flex: 0 0 96px;
}
.search-text { font-size: 11px; color: #9a9a9a; flex: 1 1 auto; }
.filter-icons { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.filter-btn { width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; border-radius: 2px; }
.filter-btn.active { background: #454545; }
.filter-btn:hover { background: #5f5f5f; }

.layer-mode-row, .layer-lock-row {
  height: 29px; display: flex; align-items: center; padding: 0 8px; gap: 6px;
  border-top: 1px solid #3f3f3f;
}
.layer-mode-row { height: 29px; }
.layer-lock-row { height: 30px; }
.layer-blend { width: 118px; flex: 0 0 118px; height: 21px; }
.lock-label { font-size: 11px; color: #cfcfcf; }
.opacity-field {
  height: 21px; background: var(--field-bg); border: 1px solid #5a5a5a; border-radius: 2px;
  display: flex; align-items: center; padding: 0 5px; font-size: 11px; color: #e4e4e4;
  width: 78px; flex: 0 0 78px; margin-left: auto;
}
.opacity-field.fill-field { width: 62px; flex: 0 0 62px; margin-left: 0; }
.layer-lock-row .lock-btn { width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; }
.lock-btn:hover { background: #5f5f5f; border-radius: 2px; }
.fill-label { margin-left: 6px; }
.fill-lock { margin-left: auto; }

.layer-list-wrap { position: relative; flex: 1 1 auto; min-height: 0; display: flex; }
.layer-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; background: var(--list-bg); margin-right: 16px; }
.panel-scrollbar.list-scrollbar { top: 0; }
.layer-row {
  position: relative; height: 33px; display: flex; align-items: center;
  padding-left: 10px; background: transparent;
}
.layer-row:hover { background: #555; }
.layer-row.active { background: var(--selected-bg); }
.layer-row .eye {
  width: 22px; height: 20px; display: flex; align-items: center; justify-content: center; flex: 0 0 22px;
}
.layer-row .thumb {
  width: 30px; height: 30px; background: #fff; border: 1px solid #2f2f2f; margin-left: 6px; flex: 0 0 30px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.layer-row .thumb img { width: 30px; height: 30px; display: block; }
.layer-row .name {
  margin-left: 10px; font-size: 11px; color: #e6e6e6; flex: 1 1 auto;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; height: 33px; line-height: 33px;
}
.layer-row .name input {
  font: 11px var(--font); color: #fff; background: #2b2b2b; border: 1px solid #7a7a7a;
  height: 18px; width: 120px; padding: 0 3px; outline: none;
}
.layer-row .lock-icon { width: 26px; flex: 0 0 26px; display: flex; align-items: center; justify-content: center; margin-right: 8px; }

.layer-footer {
  height: 24px; display: flex; align-items: center; justify-content: flex-end;
  gap: 12px; padding-right: 24px; background: var(--chrome);
}
.lf-btn { width: 16px; height: 18px; display: flex; align-items: center; justify-content: center; }
.lf-btn:hover { background: #4a4a4a; }
.empty-hint { padding: 14px; font-size: 11px; color: #9a9a9a; line-height: 2; text-align: center; }
.empty-hint span { color: #7a7a7a; }

/* ================= 状态栏 (16px) ================= */
#statusbar {
  position: absolute;
  left: 39px;
  bottom: 0;
  width: calc(100% - 364px - 39px);
  height: 16px;
  background: var(--status-bg);
}
#zoom-readout {
  position: absolute; left: 3px; top: 1px; width: 48px; height: 14px;
  background: var(--field-bg); color: #d6d6d6; font-size: 11px; line-height: 14px; text-align: center;
}
#zoom-readout:hover { background: #505050; }
#doc-size-readout {
  position: absolute; left: 51px; top: 1px; width: 168px; height: 14px;
  background: var(--chrome); color: #d6d6d6; font-size: 11px; line-height: 14px; text-align: left;
  padding-left: 7px; overflow: hidden; white-space: nowrap;
}
.status-arrow { position: absolute; top: 1px; height: 14px; font-size: 11px; line-height: 14px; color: #b0b0b0; }
.status-arrow.left { left: 225px; }
.status-arrow.right { left: 1488px; }
#h-scrollbar { position: absolute; left: 247px; top: 1px; width: 1240px; height: 14px; }
#h-thumb { position: absolute; left: 621px; top: 1px; width: 493px; height: 12px; background: var(--selected-bg); border-radius: 6px; }

/* ================= 下拉菜单 ================= */
#menu-layer { position: absolute; inset: 0; pointer-events: none; z-index: 60; }
.menu-popup {
  position: absolute; min-width: 190px; background: #3a3a3a; border: 1px solid #2a2a2a;
  padding: 4px 0; box-shadow: 0 6px 18px rgba(0,0,0,.55); pointer-events: auto;
}
.menu-entry {
  display: flex; align-items: center; justify-content: space-between;
  height: 22px; padding: 0 22px 0 24px; font-size: 12px; color: #e6e6e6; width: 100%;
  text-align: left;
}
.menu-entry:hover:not(.disabled) { background: #2d6cdf; color: #fff; }
.menu-entry.disabled { color: #7c7c7c; }
.menu-entry .shortcut { color: #9a9a9a; padding-left: 28px; font-size: 11px; }
.menu-entry:hover:not(.disabled) .shortcut { color: #e0e0e0; }
.menu-sep { height: 1px; background: #2f2f2f; margin: 4px 0; }
.menu-check { width: 14px; display: inline-block; margin-left: -16px; color: #dcdcdc; }

/* ================= 对话框 ================= */
#dialog-layer { position: absolute; inset: 0; z-index: 80; pointer-events: none; }
.dialog-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,.28); pointer-events: auto;
  display: flex; align-items: center; justify-content: center;
}
.dialog {
  background: #454545; border: 1px solid #232323; box-shadow: 0 18px 48px rgba(0,0,0,.6);
  pointer-events: auto; display: flex; flex-direction: column;
}
.dialog-titlebar {
  height: 40px; display: flex; align-items: center; padding: 0 14px;
  border-bottom: 1px solid #333;
}
.dialog-title { font-size: 13px; color: #ededed; flex: 1 1 auto; }
.dialog-close { width: 22px; height: 22px; font-size: 15px; color: #cfcfcf; }
.dialog-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.dialog-row { display: flex; align-items: center; gap: 10px; }
.dialog-label { width: 76px; font-size: 12px; color: #dcdcdc; }
.dialog-input {
  height: 26px; background: #383838; border: 1px solid #6c6c6c; border-radius: 2px;
  color: #f0f0f0; font: 12px var(--font); padding: 0 8px; width: 140px; outline: none;
}
.dialog-input:focus { border-color: #7ba7e8; }
.dialog-select {
  height: 26px; background: #383838; border: 1px solid #6c6c6c; border-radius: 2px;
  color: #f0f0f0; font: 12px var(--font); padding: 0 6px; width: 110px;
}
.dialog-unit { width: 110px; }
.dialog-preview {
  font-size: 11px; color: #a8a8a8; border-top: 1px solid #333; padding-top: 10px;
}
.dialog-footer { padding: 10px 18px 16px; display: flex; justify-content: flex-end; gap: 10px; }
.dialog-btn {
  height: 28px; min-width: 84px; padding: 0 16px; border-radius: 14px;
  border: 1px solid #7a7a7a; font-size: 12px; color: #e8e8e8;
}
.dialog-btn.primary { background: #2d7ff9; border-color: #2d7ff9; color: #fff; }
.dialog-btn:hover { filter: brightness(1.12); }
.dialog-note { font-size: 11px; color: #9a9a9a; }
.dialog-tabs { display: flex; gap: 4px; padding: 6px 12px 0; border-bottom: 1px solid #333; }
.dialog-tab { padding: 6px 10px; font-size: 12px; color: #a8a8a8; }
.dialog-tab.active { color: #f0f0f0; border-bottom: 2px solid #e0e0e0; }

/* ================= 隐藏的测试通道 ================= */
#selftest-output { display: none; }
.hidden-file { display: none; }
