/* ==========================================================
   反馈助手 · Darkroom
   设计意图：外壳完全无彩色，截图与标注是唯一亮面与高饱和色；
   交互参考 PureRef——无限画布、拖拽平移、滚轮缩放、Tab 隐藏界面。
   ========================================================== */
/* 亮暗双主题：灰色底板 = 暗色主题（:root 默认）；白色底板 = 亮色主题（html[data-theme="white"]）。
   切换由 js/ui.js 的 toggleBg 同步设置 documentElement.dataset.theme，画布悬浮件走 --hud。 */
:root {
  --stage: #08090B;
  --shell: #0B0C0F;
  --panel: #101216;
  --panel-2: #15181E;
  --raised: #1A1E25;
  --raised-2: #232831;

  /* 画布悬浮控件（工具轨 / 缩放条 / 图例）与弹层 / 悬停面 */
  --hud: rgba(16, 18, 22, .94);
  --float: #1D2129;
  --hover: #171B22;
  --hover-2: #12151A;
  --input-focus: #14171D;

  --line: rgba(255, 255, 255, .075);
  --line-2: rgba(255, 255, 255, .13);
  --line-3: rgba(255, 255, 255, .26);

  --text-1: #EDEFF3;
  --text-2: #9BA3AF;
  --text-3: #6A7280;
  --text-inv: #0B0C0F;

  --paper: #E9EDF5;
  --paper-hover: #FFFFFF;
  --paper-line: rgba(11, 12, 15, .12);

  --danger: #FF5C4D;
  --brand: #0052D9;
  --warn: #FF9A2E;
  --ok: #2FD08A;
  --info: #4B7BFF;

  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;

  --topbar-h: 48px;
  --panel-w: 384px;

  --ease: cubic-bezier(.16, 1, .3, 1);
  --t-fast: 140ms;
  --t-base: 200ms;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
}

/* —— 亮色主题（白色底板模式）：外壳统一 15% 灰度（浅灰 + 深色文字），整体提亮 —— */
html[data-theme="white"] {
  --stage: #FFFFFF;
  --shell: #DCDCDC;
  --panel: #DCDCDC;
  --panel-2: #D0D0D0;
  --raised: #E4E4E4;
  --raised-2: #EDEDED;

  --hud: rgba(220, 220, 220, .96);
  --float: #E2E2E2;
  --hover: #C8C8C8;
  --hover-2: #CFCFCF;
  --input-focus: #D4D4D4;

  --line: rgba(0, 0, 0, .10);
  --line-2: rgba(0, 0, 0, .16);
  --line-3: rgba(0, 0, 0, .30);

  --text-1: #1B1D22;
  --text-2: #4B515B;
  --text-3: #7A808A;
  --text-inv: #FFFFFF;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-1);
  background: var(--shell);
  /* 全屏画布应用：禁止页面级滚动。
     hidden 只挡用户滚动，scrollIntoView / 焦点管理仍可编程滚动；
     clip 连程序化滚动一并禁止，浮层延伸出视口时页面绝不会被拖偏。 */
  overflow: hidden;
  overflow: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; padding: 0; }
input, textarea { outline: none; }
img { display: block; }
::selection { background: rgba(233, 237, 245, .22); color: #fff; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 18px; height: 18px; fill: none; flex-shrink: 0; }
.ic-sm { width: 15px; height: 15px; }
.ic-xs { width: 12px; height: 12px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .12);
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .22); background-clip: padding-box; }

/* ============================ 骨架 ============================ */
.app {
  height: 100vh;
  min-width: 960px;
  display: flex;
  flex-direction: column;
  background: var(--shell);
}

.topbar {
  height: var(--topbar-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 16px 0 20px;
  background: var(--shell);
  border-bottom: 1px solid var(--line);
  z-index: 40;
}

/* brand 允许收缩（min-width:0）：群组很多时标签栏在内部横向滚动，
   而不是把整个顶栏撑破、将文档撑出横向滚动区 */
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; margin-right: auto; }
.brand-mark, .brand-name, .mode-chip { flex: none; }
/* 品牌 LOGO：3D OK 手势蓝色圆角图标（assets/logo.png，图自带底色与圆角） */
.brand-mark {
  width: 26px; height: 26px;
  flex: none;
  border-radius: 7px;
}
.brand-mark img {
  display: block;
  width: 100%; height: 100%;
  object-fit: contain;
}
.brand-name { font-size: 13px; font-weight: 600; letter-spacing: .01em; }
.mode-chip {
  margin-left: 2px;
  padding: 2px 6px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .06em;
  color: var(--text-3);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 4px;
}
.app[data-mode="view"] .mode-chip { color: var(--warn); border-color: rgba(255, 154, 46, .28); }

.doc-head { display: flex; align-items: center; gap: 16px; }
.title-input {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.005em;
  color: var(--text-1);
  background: transparent;
  border: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-base) var(--ease);
}
.title-input::placeholder { color: var(--text-3); font-weight: 400; }
.title-input:hover { border-bottom-color: var(--line); }
.title-input:focus { border-bottom-color: var(--line-3); }
.title-input[readonly] { cursor: default; }
.title-input[readonly]:hover { border-bottom-color: transparent; }

.doc-meta { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.topbar-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

.sync {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 6px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .04em;
  color: var(--text-3);
  white-space: nowrap;
}
.sync i { width: 5px; height: 5px; border-radius: 50%; background: var(--text-3); transition: background var(--t-base) var(--ease); }
.sync[data-state="saved"] i { background: var(--ok); }
.sync[data-state="saving"] i { background: var(--warn); animation: pulse 1s infinite; }
.sync[data-state="live"] i { background: var(--info); }
.sync[data-state="offline"] i { background: var(--danger); }

.icon-btn {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  color: var(--text-2);
  border-radius: var(--radius-sm);
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.icon-btn:hover { color: var(--text-1); background: var(--panel-2); }
.icon-btn:disabled { color: #3A4049; background: none; cursor: not-allowed; }

.workspace { flex: 1; display: flex; min-height: 0; }

/* ============================ 画布 ============================ */
.stage {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  background: #FFFFFF;
  transition: background var(--t-base) var(--ease);
}

/* 底板主题：PureRef 式可切换底色（30% 灰 / 白） */
.stage[data-bg="gray"] { background: #4D4D4D; }
.stage[data-bg="white"] { background: #FFFFFF; }
.stage[data-bg="gray"] .stage-empty { color: var(--text-1); }
.stage[data-bg="white"] .stage-empty { color: #17191E; }
.stage[data-bg="white"] .empty-inner h1 { color: #17191E; }
.stage[data-bg="white"] .empty-inner p { color: #565D68; }
/* 悬浮控件（工具轨 / 缩放条 / 图例）统一 30% 灰，不随底板切换 */

#board {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: crosshair;
  outline: none;
}
.stage.is-panning #board { cursor: grabbing; }
.stage[data-tool="select"] #board { cursor: default; }
.stage[data-tool="text"] #board { cursor: text; }
.stage.is-panning[data-tool="select"] #board { cursor: grabbing; }

.stage.is-dropping::after {
  content: "松手，把图片放到画布";
  position: absolute;
  inset: 16px;
  z-index: 12;
  display: grid;
  place-items: center;
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--text-1);
  background: rgba(8, 9, 11, .72);
  border: 1px dashed var(--line-3);
  border-radius: var(--radius-lg);
  pointer-events: none;
}

/* 空状态 */
.stage-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 6;
  pointer-events: none;
  transition: opacity var(--t-base) var(--ease);
}
.stage-empty.is-hidden { opacity: 0; visibility: hidden; }
.empty-inner { text-align: center; pointer-events: auto; }
.keycap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 20px;
  padding: 9px 14px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .12em;
  color: var(--text-2);
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-bottom-width: 3px;
  border-radius: var(--radius);
}
.keycap em { font-style: normal; color: var(--text-3); }
.empty-inner h1 { margin: 0 0 6px; font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
.empty-inner p { margin: 0 0 22px; font-size: 12.5px; color: var(--text-3); }
.empty-actions { display: flex; gap: 8px; justify-content: center; }

/* 工具轨：PureRef 式横向浮动条，画布顶部居中；竖线分隔功能分组 */
.rail {
  position: absolute;
  left: 50%;
  top: 12px;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  max-width: calc(100% - 24px);
  overflow-x: auto;
  background: var(--hud);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
  transition: opacity var(--t-base) var(--ease), transform var(--t-base) var(--ease);
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail-tools { display: flex; flex-direction: row; align-items: center; gap: 2px; }
.rail-btn {
  width: 32px; height: 32px;
  flex: none;
  display: grid; place-items: center;
  color: var(--text-3);
  border-radius: var(--radius-sm);
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease);
}
.rail-btn:hover { color: var(--text-1); background: var(--raised); }
.rail-btn:active { transform: translateY(.5px); }
.rail-btn.is-active { color: #FFFFFF; background: var(--brand, #0052D9); }
/* 禁用按钮保留 hover 事件（自定义 tooltip 依赖），仅视觉置灰；click 事件浏览器本就不派发 */
.rail-btn[disabled] { opacity: .32; }

/* 工具槽：一个按钮承载同一类的两种样式（直线/虚线、矩形/圆形），右下角小箭头切换 */
.rail-slot { position: relative; display: flex; flex: none; }
.rail-caret {
  position: absolute;
  right: 2px; bottom: 2px;
  width: 9px; height: 9px;
  padding: 0;
  display: grid; place-items: center;
  border-radius: 2px;
  color: var(--text-3);
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.rail-caret::after {
  content: '';
  width: 0; height: 0;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  border-top: 3.5px solid currentColor;
  transform: translateY(.5px);
}
.rail-caret:hover { color: var(--text-1); background: var(--raised); }
.rail-slot .rail-btn.is-active + .rail-caret { color: rgba(255, 255, 255, .85); }
.rail-slot .rail-btn.is-active + .rail-caret:hover { color: #FFF; background: rgba(255, 255, 255, .22); }
.rail-sep { flex: none; width: 1px; height: 20px; background: var(--line-2); }

/* 停靠手柄：拖动可在顶部 / 左侧之间切换 */
.rail-grip {
  flex: none;
  width: 18px; height: 32px;
  display: grid; place-items: center;
  color: var(--text-3);
  cursor: grab;
  border-radius: var(--radius-sm);
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.rail-grip:hover { color: var(--text-1); background: var(--raised); }
.rail-grip:active { cursor: grabbing; }
.rail.is-dragging { transition: none; opacity: .92; }

/* 左侧停靠：纵向排列（PureRef 式） */
.stage[data-dock="left"] .rail {
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  flex-direction: column;
  max-width: none;
  max-height: calc(100% - 24px);
  overflow-x: visible;
  overflow-y: auto;
}
.stage[data-dock="left"] .rail-tools { flex-direction: column; }
.stage[data-dock="left"] .rail-grip { width: 32px; height: 18px; }
.stage[data-dock="left"] .rail-sep { width: 20px; height: 1px; }
.stage[data-dock="left"] .rail-colors { flex-direction: column; }
.stage[data-dock="left"] .rail-widths { flex-direction: column; }

/* 工具轨悬停提示（自绘，禁用按钮也可触发） */
.rail-tip {
  position: fixed;
  z-index: 960;
  max-width: 280px;
  padding: 5px 9px;
  font-size: 11.5px;
  line-height: 1.55;
  color: #F2F5FA;
  background: rgba(24, 27, 34, .94);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(8, 9, 11, .28);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(2px);
  transition: opacity 140ms var(--ease), transform 140ms var(--ease), visibility 140ms;
}
.rail-tip.is-show { opacity: 1; visibility: visible; transform: translateY(0); }
.rail-colors { display: flex; flex-direction: row; align-items: center; gap: 6px; padding: 0 2px; }
.swatch {
  width: 18px; height: 18px;
  flex: none;
  border-radius: 50%;
  background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.swatch:hover { transform: scale(1.12); }
.swatch.is-active { box-shadow: 0 0 0 2px var(--panel), 0 0 0 3px var(--c); }
.rail-widths { display: flex; flex-direction: row; gap: 1px; }
.width-btn {
  width: 26px; height: 32px;
  flex: none;
  display: grid; place-items: center;
  border-radius: 5px;
  transition: background var(--t-fast) var(--ease);
}
.width-btn span { display: block; width: 14px; background: var(--text-3); border-radius: 999px; transition: background var(--t-fast) var(--ease); }
.width-btn:hover { background: var(--raised); }
.width-btn.is-active span { background: var(--text-1); }

/* 图例 */
.legend {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 9;
  display: flex;
  align-items: center;
  gap: 2px;
  height: 32px;
  padding: 0 10px 0 8px;
  background: var(--hud);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: opacity var(--t-base) var(--ease);
}
.legend-title {
  margin-right: 8px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .12em;
  color: var(--text-3);
  text-transform: uppercase;
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 6px;
  border-radius: 5px;
  transition: background var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease);
}
.legend-item:hover { background: var(--raised); }
.legend-item i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.legend-item b { font-family: var(--mono); font-size: 10px; font-weight: 500; color: var(--text-3); }
.legend-item.is-off { opacity: .35; }
.legend-item.is-off i { background: transparent; box-shadow: inset 0 0 0 1px var(--c); }

/* 缩放 */
.zoombar {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 9;
  display: flex;
  align-items: center;
  gap: 1px;
  padding: 3px;
  background: var(--hud);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: opacity var(--t-base) var(--ease);
}
.zoom-btn {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  color: var(--text-3);
  border-radius: 5px;
}
.zoom-btn:hover { color: var(--text-1); background: var(--raised); }
.zoom-value {
  min-width: 46px; height: 26px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-2);
  border-radius: 5px;
}
.zoom-value:hover { color: var(--text-1); background: var(--raised); }
.zoom-sep { width: 1px; height: 14px; margin: 0 3px; background: var(--line); }

.stage-hint {
  position: absolute;
  right: 16px;
  bottom: 56px;
  z-index: 8;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .06em;
  color: #4C535E;
  pointer-events: none;
  transition: opacity var(--t-base) var(--ease);
}

/* 选择工具快捷键提示：常驻左下角（图例之上），只在选择工具激活时出现 */
.select-hint {
  position: absolute;
  left: 16px;
  bottom: 58px;
  z-index: 9;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--hud);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .02em;
  color: var(--text-3);
  pointer-events: none;
  animation: fade-in var(--t-base) var(--ease);
}
.select-hint[hidden] { display: none; }
.select-hint .sh-item { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.select-hint .sh-item em { font-style: normal; color: var(--text-2); }

/* 文本工具编辑覆盖层：画布渲染跳过编辑中的文本，由这块透明 textarea 接管输入。
   字体/字号/行高/颜色由 JS 按「世界尺寸 × 当前缩放」实时写入，保证所见即所得 */
.text-editor-overlay {
  position: absolute;
  z-index: 30;
  margin: 0;
  padding: 2px 4px;
  border: 1.5px dashed rgba(0, 82, 217, .85);
  border-radius: 4px;
  outline: none;
  background: transparent;
  resize: none;
  overflow: hidden;
  white-space: pre;
  caret-color: #0052D9;
  font-family: -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
}
.text-editor-overlay::selection { background: rgba(0, 82, 217, .25); }
.select-hint .sh-key {
  display: inline-flex;
  align-items: center;
  height: 16px;
  padding: 0 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--raised-2);
  color: var(--text-1);
  font-size: 10px;
  line-height: 1;
}
.select-hint .sh-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); }
.app.is-immersive .select-hint { display: none; }

/* ============================ 侧栏（说明栏） ============================ */
.panel {
  width: var(--panel-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--panel);
  border-left: 1px solid var(--line);
}

/* 标题区：品牌蓝左肩条 + 微着色底，明确框出"当前反馈"的范围与位置。
   参考资源管理器文件头的做法——一眼可辨，又不与页签抢层级 */
.panel-title {
  position: relative;
  flex-shrink: 0;
  padding: 14px 16px 6px 19px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--brand) 5%, var(--panel));
}
.panel-title::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--brand);
}
.panel-title .doc-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0 10px;
}
/* 标题未命名时同样给占位弱化，命名后即成为面板内最重的文字 */
.title-input { font-size: 16px; }

.tabs {
  flex-shrink: 0;
  display: flex;
  align-items: stretch;
  height: 44px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
}
.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  font-size: 13px;
  color: var(--text-3);
  transition: color var(--t-fast) var(--ease);
}
.tab:hover { color: var(--text-2); }
.tab.is-active { color: var(--text-1); font-weight: 500; }
.tab.is-active::after {
  content: "";
  position: absolute;
  left: 10px; right: 10px; bottom: -1px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--brand);   /* 页签选中态用品牌蓝，与文本层级明确区分 */
}
.tab b {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  padding: 1px 4px;
  color: var(--text-3);
  background: var(--panel-2);
  border-radius: 4px;
}
.tab.is-active b { color: var(--text-2); background: var(--raised); }

.panel-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 16px 24px; }

.panel-foot {
  flex-shrink: 0;
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  background: var(--panel);
  border-top: 1px solid var(--line);
}

/* ============================ 标注列表 ============================ */
.anno-list { display: flex; flex-direction: column; gap: 8px; }

.anno-card {
  position: relative;
  padding: 12px 12px 10px 14px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.anno-card::before {
  content: "";
  position: absolute;
  left: 0; top: 10px; bottom: 10px;
  width: 2px;
  border-radius: 2px;
  background: var(--c);
  opacity: .55;
  transition: opacity var(--t-fast) var(--ease);
}
.anno-card:hover { border-color: var(--line-2); background: var(--hover); }
/* 选中态与未选中用明显不同的颜色区分：品牌蓝底 + 蓝描边（未选中为深灰面板色） */
.anno-card.is-active {
  border-color: rgba(75, 123, 255, .62);
  background: rgba(0, 82, 217, .16);
  box-shadow: 0 0 0 1px rgba(75, 123, 255, .25) inset;
}
.anno-card.is-active::before { opacity: 1; }
.anno-card.is-dim { opacity: .4; }

.anno-head { display: flex; align-items: center; gap: 8px; }
.badge {
  width: 20px; height: 20px;
  flex-shrink: 0;
  display: grid; place-items: center;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  color: #08090B;
  background: var(--c);
  border-radius: 50%;
}
.anno-type { font-size: 11.5px; color: var(--text-2); }
.anno-type em { font-style: normal; color: var(--text-3); }
.anno-actions { margin-left: auto; display: flex; gap: 2px; opacity: 0; transition: opacity var(--t-fast) var(--ease); }
.anno-card:hover .anno-actions, .anno-card.is-active .anno-actions { opacity: 1; }
.anno-act {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  color: var(--text-3);
  border-radius: 4px;
}
.anno-act:hover { color: var(--text-1); background: var(--raised); }
.anno-act.danger:hover { color: var(--danger); }

.anno-note {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 0;
  min-height: 20px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-1);
  background: transparent;
  border: none;
  resize: none;
  overflow: hidden;
}
.anno-note::placeholder { color: var(--text-3); }
.anno-note[readonly] { cursor: default; color: var(--text-2); }
.anno-note-text { margin: 8px 0 0; font-size: 12.5px; line-height: 1.65; color: var(--text-1); white-space: pre-wrap; word-break: break-word; }
.anno-note-text.is-empty { color: var(--text-3); }

.panel-empty {
  padding: 40px 16px;
  text-align: center;
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.9;
}

/* --- 手动添加标注入口 --- */
.anno-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 2px 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}
.anno-tools-hint { font-size: 11px; color: var(--text-3); margin-left: auto; }

/* --- 笔迹计数（与标注统计严格分离） --- */
.mark-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 4px 0 8px;
  border: 1px dashed var(--line-2);
  border-radius: 999px;
  color: var(--text-3);
  font-size: 11px;
  white-space: nowrap;
}
.mark-clear {
  height: 18px;
  padding: 0 6px;
  border: 0;
  border-radius: 999px;
  background: var(--raised-2);
  color: var(--text-2);
  font-size: 10.5px;
  cursor: pointer;
  transition: color var(--t-fast), background var(--t-fast);
}
.mark-clear:hover { color: var(--text-1); background: var(--raised-2); filter: brightness(1.15); }

/* 放置模式：画布光标 */
.stage.is-placing { cursor: crosshair; }
.stage.is-placing #board { cursor: crosshair; }
.anno-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 52px 16px; }
.anno-empty b { color: var(--text-2); font-weight: 500; font-size: 13px; }
.anno-empty-hint { font-size: 11.5px; color: var(--text-3); }
.anno-empty-keys { font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* --- 添加模式引导条 --- */
.add-hint {
  position: fixed;
  top: 72px; left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 14px;
  background: var(--raised);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .45);
  color: var(--text-1);
  font-size: 12px;
  z-index: 88;
  animation: addHintIn var(--t-base) var(--ease);
}
.add-hint[hidden] { display: none !important; }
.add-hint-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(47, 208, 138, .16);
  animation: addPulse 1.6s var(--ease) infinite;
}
.add-hint-tools { color: var(--text-3); font-size: 11px; }
.add-hint-tools kbd {
  display: inline-block; padding: 0 4px; margin-right: 2px;
  font-family: var(--mono); font-size: 10px; color: var(--text-2);
  border: 1px solid var(--line-2); border-radius: 4px;
}
.add-hint .btn { margin-left: 2px; }
@keyframes addHintIn { from { opacity: 0; transform: translate(-50%, -6px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes addPulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

/* --- 删除确认弹窗 --- */
.modal-quote {
  margin: 0 0 8px;
  padding: 10px 12px;
  background: var(--panel-2);
  border-left: 2px solid var(--line-3);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.7;
}
.modal-note { margin: 0; color: var(--text-3); font-size: 11.5px; }
.panel-empty kbd {
  display: inline-block;
  padding: 1px 5px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-2);
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 4px;
}

/* ============================ 详情 ============================ */
.detail { display: flex; flex-direction: column; gap: 20px; }
.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-3);
}

.input, .textarea {
  display: block;
  width: 100%;
  padding: 9px 10px;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--text-1);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.input:hover, .textarea:hover { border-color: var(--line-2); }
.input:focus, .textarea:focus { border-color: var(--line-3); background: var(--input-focus); }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.textarea { resize: vertical; min-height: 84px; }
.input[readonly], .textarea[readonly] { background: transparent; border-color: transparent; padding-left: 0; }
.input[readonly]:hover, .textarea[readonly]:hover { border-color: transparent; }

/* 详情页文本区的使用/未使用状态（Windows 文件标签思路：未用=后退，已用=抬升）：
   未填写 → 虚线框 + 透明底，明显"待填"；已填写 → 实线框 + 抬升底色，
   填充后内容成为区块视觉重心。悬停/聚焦态保持通用规则。 */
.detail .textarea:placeholder-shown {
  border-style: dashed;
  border-color: var(--line-2);
  background: transparent;
}
.detail .textarea:not(:placeholder-shown) {
  border-color: var(--line-2);
  background: var(--panel-2);
  box-shadow: inset 2px 0 0 0 color-mix(in srgb, var(--brand) 55%, transparent);
}
.detail .textarea:focus { background: var(--input-focus); }
.detail .textarea[readonly] { border-style: solid; border-color: transparent; box-shadow: none; }

.cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 84px;
  font-size: 11.5px;
  color: var(--text-3);
  background: transparent;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
}
.dropzone:hover, .dropzone.is-dragover { color: var(--text-1); border-color: var(--line-3); background: var(--panel-2); }
.dropzone kbd {
  padding: 1px 4px;
  font-family: var(--mono);
  font-size: 9.5px;
  border: 1px solid var(--line-2);
  border-radius: 3px;
}

.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; margin-top: 8px; }
.thumbs:empty { display: none; }
.thumb {
  position: relative;
  height: 68px;
  overflow: hidden;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: zoom-in;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-del {
  position: absolute;
  top: 3px; right: 3px;
  width: 18px; height: 18px;
  display: grid; place-items: center;
  color: #fff;
  background: rgba(8, 9, 11, .7);
  border-radius: 50%;
  opacity: 0;
  transition: opacity var(--t-fast) var(--ease);
}
.thumb:hover .thumb-del { opacity: 1; }
.thumb-del:hover { background: var(--danger); }

/* 参考图片区块的使用状态：空 = 大块拖放区提示"未使用"；
   已有图 = 拖放区降噪为紧凑的"继续添加"次级行，缩略图抬升为主角 */
.detail section.has-att .dropzone {
  height: 40px;
  flex-direction: row;
  gap: 8px;
  border-color: var(--line);
  font-size: 11px;
}
.detail section.has-att .dropzone .ic { width: 14px; height: 14px; }
.detail section.has-att .dropzone kbd { display: none; }
.detail section.has-att .thumb {
  border-color: var(--line-2);
  background: var(--raised);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
}

.meta-list { display: flex; flex-direction: column; }
.meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  font-size: 11.5px;
  border-top: 1px solid var(--line);
}
.meta-row span:first-child { color: var(--text-3); }
.meta-row span:last-child { color: var(--text-2); font-variant-numeric: tabular-nums; }

/* ============================ 讨论 ============================ */
/* --- 讨论成员条：页签顶部头像堆叠，悬停浮出名字与角色 --- */
.discuss-members {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  margin-bottom: 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.dm-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
}
.dm-label .ic-xs { width: 12px; height: 12px; color: var(--text-3); }
.dm-label b {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-2);
  padding: 0 5px;
  background: var(--raised);
  border-radius: 999px;
  line-height: 16px;
}
.dm-avatars { display: flex; align-items: center; }
.dm-ava {
  position: relative;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600;
  color: var(--text-1);
  background: var(--raised-2);
  border: 2px solid var(--panel-2);
  border-radius: 50%;
  margin-left: -7px;
  cursor: default;
  transition: transform var(--t-fast) var(--ease);
}
.dm-ava:first-child { margin-left: 0; }
.dm-ava img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.dm-ava:hover { transform: translateY(-2px); z-index: 3; }
.dm-ava.is-self { box-shadow: 0 0 0 1.5px var(--brand); }
/* 悬停名字提示：成员条位于面板顶部，向下浮出不会被滚动容器裁切 */
.dm-ava::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%; top: calc(100% + 7px);
  transform: translateX(-50%) translateY(-3px);
  padding: 4px 9px;
  border-radius: 5px;
  background: var(--float);
  border: 1px solid var(--line-2);
  color: var(--text-1);
  font-size: 11px; font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .3);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
  z-index: 40;
}
.dm-ava:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }
/* 左端头像的名字提示居中会溢出面板左缘，改为左对齐 */
.dm-ava:first-child::after { left: 0; transform: translateY(-3px); }
.dm-ava:first-child:hover::after { transform: translateY(0); }

/* 成员条末尾的圆形加号：规格与成员头像一致，点击从联系人添加成员 */
.dm-ava.dm-add {
  cursor: pointer;
  margin-left: 3px;
  background: transparent;
  border: 1.5px dashed var(--line-2);
  color: var(--text-3);
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
    background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.dm-ava.dm-add::after { display: none; }  /* 无 data-tip，关闭空的悬停气泡 */
.dm-ava.dm-add:hover {
  color: var(--brand);
  border-color: var(--brand);
  background: var(--hover);
  z-index: 3;
}

.thread { display: flex; flex-direction: column; gap: 14px; padding-bottom: 8px; }
.comment { display: flex; gap: 9px; }
.avatar {
  width: 24px; height: 24px;
  flex-shrink: 0;
  display: grid; place-items: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--raised);
  border: 1px solid var(--line-2);
  border-radius: 50%;
}
.comment-main { flex: 1; min-width: 0; }
.comment-meta { display: flex; align-items: baseline; gap: 6px; margin-bottom: 3px; }
.comment-meta b { font-size: 11.5px; font-weight: 600; color: var(--text-1); }
.comment-meta time { font-family: var(--mono); font-size: 9.5px; color: var(--text-3); }
.comment-meta .role {
  padding: 0 4px;
  font-size: 9px;
  color: var(--text-3);
  border: 1px solid var(--line-2);
  border-radius: 3px;
}
.comment-body { font-size: 12.5px; line-height: 1.65; color: var(--text-2); white-space: pre-wrap; word-break: break-word; }
.comment-body .ref {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px; height: 16px;
  padding: 0 3px;
  margin-right: 4px;
  font-family: var(--mono);
  font-size: 9.5px;
  color: #08090B;
  background: var(--c);
  border-radius: 4px;
  vertical-align: 1px;
}

.composer { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.composer textarea {
  width: 100%;
  min-height: 64px;
  padding: 9px 10px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-1);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  resize: vertical;
}
.composer textarea:focus { border-color: var(--line-3); }
.composer-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.composer-hint { flex: 1; font-family: var(--mono); font-size: 9.5px; color: var(--text-3); }

/* ============================ 按钮 ============================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.btn:active { transform: translateY(.5px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.grow { flex: 1; }
/* 主按钮底色 --paper 恒为浅色，文字恒用深色（不随主题反转） */
.btn-primary { color: #0B0C0F; background: var(--paper); }
.btn-primary:hover:not(:disabled) { background: var(--paper-hover); }
.btn-ghost { color: var(--text-2); background: transparent; border-color: var(--line); }
.btn-ghost:hover:not(:disabled) { color: var(--text-1); background: var(--panel-2); border-color: var(--line-2); }
.btn-danger { color: var(--danger); background: transparent; border-color: rgba(255, 92, 77, .28); }
.btn-danger:hover { background: rgba(255, 92, 77, .1); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 11.5px; }

/* ============================ 菜单 ============================ */
.menu {
  position: fixed;
  z-index: 120;
  min-width: 196px;
  padding: 5px;
  background: var(--float);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .6);
  animation: menu-in 120ms var(--ease);
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 30px;
  padding: 0 8px;
  font-size: 12px;
  color: var(--text-2);
  border-radius: 5px;
  text-align: left;
}
.menu-item:hover { color: var(--text-1); background: var(--raised); }
.menu-item .ic { color: var(--text-3); }
.menu-item:hover .ic { color: var(--text-2); }
.menu-item kbd {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--text-3);
}
.menu-item.is-checked::after {
  content: "";
  width: 5px; height: 5px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--text-1);
}
.menu-sep { height: 1px; margin: 5px 4px; background: var(--line); }
.menu-label {
  padding: 6px 8px 4px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* ============================ 弹窗 ============================ */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(3, 4, 6, .72);
  animation: fade-in 160ms var(--ease);
}
.modal-root[hidden] { display: none; }
.modal {
  width: 100%;
  max-width: 460px;
  max-height: 84vh;
  display: flex;
  flex-direction: column;
  background: var(--input-focus);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .7);
  animation: modal-in 220ms var(--ease);
}
.modal-wide { max-width: 560px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 20px 12px; }
.modal-title { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: -.005em; }
.modal-desc { margin: 4px 0 0; font-size: 11.5px; color: var(--text-3); line-height: 1.6; }
.modal-close { width: 26px; height: 26px; display: grid; place-items: center; color: var(--text-3); border-radius: 5px; }
.modal-close:hover { color: var(--text-1); background: var(--raised); }
.modal-body { padding: 4px 20px 18px; overflow-y: auto; font-size: 12.5px; color: var(--text-2); }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }

/* 分享弹窗 */
.share-link { display: flex; gap: 6px; margin-bottom: 16px; }
.share-link input {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-2);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.channel-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.channel-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 14px 8px;
  font-size: 11.5px;
  color: var(--text-2);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: all var(--t-fast) var(--ease);
}
.channel-btn:hover { color: var(--text-1); border-color: var(--line-2); background: var(--raised); }
.channel-btn:disabled { opacity: .45; cursor: not-allowed; }
.channel-mark {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  font-size: 11px;
  font-weight: 600;
  color: #0B0C0F;
  border-radius: 7px;
  background: var(--c, var(--text-2));
}
.share-note {
  margin: 16px 0 0;
  padding: 10px 12px;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--text-3);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.share-note b { color: var(--text-2); font-weight: 500; }

.acc-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin-top: 14px;
  padding: 8px 0 0;
  font-size: 11.5px;
  color: var(--text-3);
  border-top: 1px solid var(--line);
}
.acc-trigger:hover { color: var(--text-2); }
.acc-trigger .ic { transition: transform var(--t-fast) var(--ease); }
.acc-trigger.is-open .ic { transform: rotate(180deg); }
.acc-body { display: none; padding-top: 10px; }
.acc-body.is-open { display: block; }
.acc-field { margin-bottom: 10px; }
.acc-field label { display: block; margin-bottom: 5px; font-size: 10.5px; color: var(--text-3); }
.acc-field input {
  width: 100%;
  height: 32px;
  padding: 0 9px;
  font-family: var(--mono);
  font-size: 10.5px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.acc-field input:focus { border-color: var(--line-3); }

/* ============================ 提示 ============================ */
.toasts {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 12px;
  color: var(--text-1);
  background: var(--float);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .55);
  animation: toast-in 180ms var(--ease);
}
.toast::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--text-3); }
.toast.success::before { background: var(--ok); }
.toast.warn::before { background: var(--warn); }
.toast.error::before { background: var(--danger); }
.toast.is-out { animation: toast-out 160ms var(--ease) forwards; }

/* ============================ 沉浸模式 ============================ */
.app.is-immersive .topbar,
.app.is-immersive .panel,
.app.is-immersive .rail,
.app.is-immersive .stage-hint { display: none; }

.hud {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 60;
  display: none;
  align-items: center;
  gap: 10px;
  height: 32px;
  padding: 0 6px 0 12px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .04em;
  color: var(--text-3);
  background: var(--hud);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.app.is-immersive .hud { display: flex; }
.hud b { color: var(--text-2); font-weight: 500; }
.hud button { height: 24px; padding: 0 8px; font-family: var(--font); font-size: 11px; color: var(--text-2); border-radius: 999px; }
.hud button:hover { color: var(--text-1); background: var(--raised); }

/* 画布上的浮动说明（沉浸/查看时点图钉出现） */
.note-pop {
  position: fixed;
  z-index: 70;
  width: 240px;
  padding: 10px 12px;
  background: var(--float);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .6);
  animation: menu-in 140ms var(--ease);
}
.note-pop-head { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.note-pop p { margin: 0; font-size: 12px; line-height: 1.65; color: var(--text-2); white-space: pre-wrap; }

/* ============================ 动效 ============================ */
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
@keyframes fa-spin { to { transform: rotate(360deg); } }
.icon-btn.is-spinning .ic { animation: fa-spin .8s linear infinite; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ============================ 响应式 ============================ */
@media (max-width: 1440px) { :root { --panel-w: 364px; } }
@media (max-width: 1200px) {
  :root { --panel-w: 336px; }
  .doc-meta .status-chip { display: none; }
  .brand-name { display: none; }
  .stage-hint { display: none; }
}

/* 窄视口（平板 / 小窗口）：应用适配视口宽度，不再强制 960px 最小宽 */
@media (max-width: 960px) {
  .app { min-width: 0; }
  .topbar { gap: 10px; padding: 0 10px; }
  .topbar-actions { gap: 2px; }
  .sync { display: none; }                    /* 同步状态收起（窄屏看画布为主） */
  #undoBtn, #redoBtn { display: none; }       /* 快捷键可替代；重要操作在更多菜单 */
  .org-chip #orgName { display: none; }       /* 组织只留图标 */
  .panel { width: min(42vw, var(--panel-w)); }
}

/* 手机视口：右侧面板变为浮层，右下角按钮开关 */
@media (max-width: 640px) {
  .workspace { position: relative; }
  .panel {
    position: absolute;
    right: 0; top: 0; bottom: 0;
    width: min(88vw, var(--panel-w));
    z-index: 60;
    box-shadow: -16px 0 40px rgba(0, 0, 0, .32);
  }
  .app:not(.panel-open) .panel { display: none; }
}
.panel-fab {
  display: none;
  position: fixed;
  right: 14px; bottom: 20px;
  z-index: 59;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--brand, #0052D9);
  color: #fff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .3);
}
.panel-fab .ic { width: 20px; height: 20px; }
@media (max-width: 640px) {
  .panel-fab { display: flex; }
}

/* ==========================================================
   v3 账号 · 群组 · 反馈广场
   ========================================================== */
.topbar-sep { width: 1px; height: 20px; background: var(--line-2); margin: 0 2px; }

/* --- 顶栏：群组选择器 / 用户 --- */
/* --- 群组文件夹标签：常驻顶栏，当前标签与内容区相连 --- */
.group-tabs {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 100%;
  margin-left: 8px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.group-tabs::-webkit-scrollbar { display: none; }

.group-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  margin-bottom: -1px; /* 压住顶栏下边框，形成「标签连着内容区」的文件夹形状 */
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 9px 9px 0 0;
  color: var(--text-2);          /* 未选中由 text-3 提亮一档，一眼可读 */
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.group-tab:hover { color: var(--text-1); background: var(--raised); }
.group-tab .gt-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gc, var(--text-3));
  flex: none;
  opacity: .8;                   /* 身份色圆点常亮可见，未选中不再黯淡 */
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .06);
}
.group-tab .gt-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; }

/* 标签右侧 ⋮ 操作点：常显弱色保证可发现，悬停强化；横排点旋转为竖排 */
.group-tab .gt-more {
  display: grid; place-items: center;
  width: 16px; height: 16px;
  margin-right: -6px;
  border-radius: 4px;
  color: var(--text-3);
  opacity: .72;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease);
}
.group-tab .gt-more svg { transform: rotate(90deg); }
.group-tab .gt-more:hover {
  color: var(--text-1);
  background: var(--hover);
  opacity: 1;
}
.group-tab.is-active .gt-more { color: var(--text-2); }

.group-tab.is-active {
  color: var(--text-1);
  background: var(--panel-2);    /* 选中标签整体抬升，与顶栏底色拉开层级 */
  border-color: var(--line-2);   /* 描边加强一档 */
  font-weight: 600;
}
.group-tab.is-active .gt-dot { opacity: 1; box-shadow: none; }
.group-tab.is-active .gt-bar {
  position: absolute;
  left: 12px; right: 12px; bottom: 0;
  height: 2.5px;
  border-radius: 2.5px 2.5px 0 0;
  background: var(--gc, var(--brand));
}

.group-tab-add {
  color: var(--text-3);
  padding: 0 10px;
}
.group-tab-add:hover { color: var(--text-1); }

/* --- 画布标签：多画布切换（群组看板 / 本地画布共用同一组样式） --- */
.canvas-tabs {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 100%;
  margin-left: 6px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.canvas-tabs::-webkit-scrollbar { display: none; }

.ctab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  margin-bottom: -1px;
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 9px 9px 0 0;
  color: var(--text-2);
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.ctab:hover { color: var(--text-1); background: var(--raised); }
.ctab .ctab-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }

/* 画布身份色圆点：与群组标签同一语言，不同画布一眼可辨 */
.ctab .ct-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--cc, var(--text-3));
  flex: none;
  opacity: .75;
}
.ctab:hover .ct-dot, .ctab.is-active .ct-dot { opacity: 1; }

/* 关闭点：默认隐藏，悬停本标签或激活时显现，避免视觉噪音 */
.ctab .ctab-close {
  display: grid; place-items: center;
  width: 14px; height: 14px;
  margin-right: -5px;
  border-radius: 4px;
  color: var(--text-3);
  opacity: 0;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease);
}
.ctab:hover .ctab-close, .ctab.is-active .ctab-close { opacity: .72; }
.ctab .ctab-close:hover { color: var(--text-1); background: var(--hover); opacity: 1; }

.ctab.is-active {
  color: var(--text-1);
  background: var(--panel-2);
  border-color: var(--line-2);
  font-weight: 600;
}
.ctab.is-active .ctab-close { color: var(--text-2); }
.ctab.is-active .gt-bar {
  position: absolute;
  left: 10px; right: 10px; bottom: 0;
  height: 2.5px;
  border-radius: 2.5px 2.5px 0 0;
  background: var(--cc, var(--brand));
}

.ctab-add {
  color: var(--text-3);
  padding: 0 10px;
}
.ctab-add:hover { color: var(--text-1); }

/* 本地画布恢复入口：虚线边框区别于普通云画布标签，角标显示待恢复数量 */
.ctab-local {
  color: var(--text-2);
  padding: 0 10px;
  border: 1px dashed var(--line-2);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
}
.ctab-local:hover { color: var(--text-1); background: var(--hover); }
.ctab-local .ctab-badge {
  min-width: 17px; height: 17px; padding: 0 4px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--warn); color: #fff;
  font-size: 10.5px; font-weight: 700; font-style: normal;
  border-radius: 999px;
}

.user-chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 30px; padding: 0 12px 0 5px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px;
  color: var(--text-2); font-size: 12px; cursor: pointer;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.user-chip:hover { color: var(--text-1); border-color: var(--line-2); }

/* 组织体系按钮：顶栏「联系人从哪来」的入口，胶囊样式与用户条一致 */
.org-chip {
  display: inline-flex; align-items: center; gap: 6px;
  max-width: 200px;
  height: 30px; padding: 0 10px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px;
  color: var(--text-2); font-size: 12px; cursor: pointer;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.org-chip .ic-sm { width: 14px; height: 14px; flex: none; color: var(--text-3); }
.org-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-chip:hover { color: var(--text-1); border-color: var(--line-2); }
.org-chip:hover .ic-sm { color: var(--text-2); }

.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--raised-2); color: var(--text-1); font-size: 13px;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.avatar-sm { width: 20px; height: 20px; font-size: 11px; background: var(--raised-2); }
.avatar-xs { width: 16px; height: 16px; font-size: 10px; background: var(--raised-2); color: var(--text-2); }

/* --- 更换头像弹窗 --- */
.ava-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px;
  max-height: 320px; overflow-y: auto; padding: 2px;
}
.ava-item {
  padding: 0; border: 2px solid transparent; border-radius: 10px;
  background: none; cursor: pointer; line-height: 0;
  transition: border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.ava-item img { width: 100%; height: auto; display: block; border-radius: 8px; }
.ava-item:hover { transform: translateY(-2px); border-color: var(--line-3); }
.ava-item.is-cur { border-color: var(--brand); }
.ava-note { margin: 12px 0 0; font-size: 11.5px; color: var(--text-3); }

/* --- 品牌英文名徽标 --- */
.brand-en {
  margin-left: 7px; padding: 1px 7px;
  font-size: 10.5px; font-weight: 500; letter-spacing: .04em;
  color: var(--text-3); border: 1px solid var(--line); border-radius: 999px;
  vertical-align: 1px;
}

/* --- 登录 / 注册浮层 --- */
.auth-overlay {
  position: fixed; inset: 0; z-index: 220;
  display: grid; place-items: center;
  background: rgba(4, 5, 8, .72);
  opacity: 0; pointer-events: none;
  transition: opacity var(--t-base);
}
.auth-overlay.is-open { opacity: 1; pointer-events: auto; }

.auth-card {
  position: relative; width: 348px; max-width: calc(100vw - 32px);
  padding: 28px 28px 24px;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius-lg);
}
.auth-brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 600; color: var(--text-1); margin-bottom: 20px;
}
.auth-brand .brand-mark { width: 30px; height: 30px; }
.auth-tabs {
  display: flex; gap: 4px; padding: 3px;
  background: var(--panel-2); border-radius: var(--radius-sm); margin-bottom: 16px;
}
.auth-tabs button {
  flex: 1; height: 30px; border: 0; border-radius: 5px;
  background: transparent; color: var(--text-3); font-size: 12.5px; cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.auth-tabs button.is-active { background: var(--raised-2); color: var(--text-1); }
.auth-note { margin: -6px 0 14px; font-size: 12px; line-height: 1.6; color: var(--text-2); }
.field { display: block; margin-bottom: 12px; }
.field > span {
  display: block; margin-bottom: 6px;
  font-size: 11px; letter-spacing: .02em; color: var(--text-3);
}
.auth-err { min-height: 18px; margin: 2px 0 8px; font-size: 12px; color: var(--danger); }
.auth-close { position: absolute; top: 12px; right: 12px; }

/* --- 广场 --- */
.link-btn {
  border: 0; background: none; padding: 2px 4px;
  color: var(--text-2); font-size: 12px; cursor: pointer; border-radius: 4px;
  transition: color var(--t-fast);
}
.link-btn:hover { color: var(--text-1); }

.plaza-head { display: flex; align-items: center; justify-content: flex-end; margin-bottom: 12px; }
.plaza-tools { display: flex; gap: 2px; flex: none; }

.pf-list { display: flex; flex-direction: column; gap: 8px; }
.pf-item {
  padding: 12px 14px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius);
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast);
}
.pf-item:hover { border-color: var(--line-2); background: var(--raised); transform: translateY(-1px); }
/* 正在查看的反馈：品牌蓝高亮，与未打开的卡片明显区分 */
.pf-item.is-active {
  border-color: rgba(75, 123, 255, .62);
  background: rgba(0, 82, 217, .16);
}
.pf-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pf-title {
  flex: 1; min-width: 0; font-size: 13px; color: var(--text-1);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pf-meta { display: flex; align-items: center; gap: 6px; margin-top: 9px; font-size: 11.5px; color: var(--text-3); }
.pf-meta em { font-style: normal; }
.pf-nums { margin-left: auto; }

/* --- 发布弹窗：发送到人 / 发送到群组 两个选项 --- */
/* 站内联系人选择（发布反馈 · 发送到人） */
.pub-contacts { display: flex; flex-direction: column; gap: 8px; }
.pub-contacts-head { display: flex; align-items: baseline; justify-content: space-between; }
.pub-contacts-title { font-size: 12.5px; font-weight: 600; color: var(--text-1); }
.pub-contacts-hint { font-size: 11.5px; color: var(--text-3); }
.pub-contacts-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
  padding: 2px;
}
.pub-contact {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text-1);
  cursor: pointer;
  text-align: left;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.pub-contact:hover { border-color: var(--line-3); background: var(--hover-2); }
.pub-contact.is-sel {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 10%, transparent);
}
.pub-contact-main { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.pub-contact-main b { font-size: 12px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pub-contact-main i { font-size: 10.5px; font-style: normal; color: var(--text-3); }
.pub-contact-check {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--line-3);
  flex: none;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.pub-contact.is-sel .pub-contact-check {
  background: var(--brand);
  border-color: var(--brand);
  position: relative;
}
.pub-contact.is-sel .pub-contact-check::after {
  content: "";
  position: absolute;
  left: 3.5px; top: 1.5px;
  width: 4px; height: 7px;
  border: solid #fff;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.pub-contacts-empty { grid-column: 1 / -1; padding: 16px; text-align: center; color: var(--text-3); font-size: 12px; }
#pubSendBtn:disabled { opacity: .5; cursor: not-allowed; }
.share-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 4px 0;
  font-size: 11px; color: var(--text-3);
}
.share-divider::before, .share-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}

.pub-opt {
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  overflow: hidden;
  transition: border-color var(--t-fast) var(--ease);
}
.pub-opt.is-open { border-color: var(--line-2); }
.pub-opt-head {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 11px 12px;
  text-align: left;
  color: var(--text-2);
  transition: background var(--t-fast) var(--ease);
}
.pub-opt-head:hover { background: var(--raised); }
.pub-opt-icon {
  width: 28px; height: 28px;
  flex: none;
  display: grid; place-items: center;
  color: var(--c, var(--text-2));
  background: color-mix(in srgb, var(--c, #666) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--c, #666) 34%, transparent);
  border-radius: 7px;
}
.pub-opt-name { flex: none; font-size: 13px; font-weight: 600; color: var(--text-1); }
.pub-opt-sub { flex: 1; min-width: 0; font-size: 11px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pub-opt-caret { flex: none; transform: rotate(0deg); transition: transform var(--t-base) var(--ease); opacity: .7; }
.pub-opt.is-open .pub-opt-caret { transform: rotate(180deg); }
.pub-opt-body { display: none; padding: 2px 12px 12px; }
.pub-opt.is-open .pub-opt-body { display: block; }

.gs-row { display: flex; gap: 8px; margin-top: 8px; }
.gs-row .input { flex: 1; height: 36px; }
.gs-note { margin: 8px 0 0; font-size: 11.5px; color: var(--text-3); }
.share-sep { height: 1px; background: var(--line); margin: 16px 0; }

.invite-code {
  padding: 20px 12px; margin-bottom: 12px; text-align: center;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius);
  font-family: var(--mono); font-size: 30px; letter-spacing: .32em; text-indent: .32em;
  color: var(--text-1);
}

/* --- 成员管理 --- */
.member-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.member-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-sm);
}
.member-row:hover { background: var(--panel-2); }

/* 画布成员勾选器（新建画布 / 发布画布共用） */
.pick-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 210px;
  overflow: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
}
.pick-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--t-fast, .12s) var(--ease);
}
.pick-row:hover { background: var(--raised); }
.pick-row input { flex: none; width: 14px; height: 14px; accent-color: var(--brand); cursor: pointer; }
.pick-row .pick-name { flex: 1; font-size: 13px; color: var(--text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-row .pick-role { flex: none; font-size: 11px; color: var(--text-3); }
.pick-empty {
  padding: 16px 6px;
  text-align: center;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-3);
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
}
.trace-time { flex: none; width: 92px; font-family: var(--mono); font-size: 11px; color: var(--text-3); }
/* ×N：连续同类操作的合并计数徽标 */
.trace-n {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--brand-50, #E6F1FB);
  color: var(--brand, #0052D9);
  font-size: 11px;
  font-style: normal;
  line-height: 18px;
}
.member-main { flex: 1; min-width: 0; }
.member-main b { display: block; font-size: 13px; color: var(--text-1); }
.member-main span { display: block; font-size: 11px; color: var(--text-3); }
/* 长 ID / 长昵称截断：防止溢出压到右侧角色徽标与按钮下方（修复重叠） */
.member-main b, .member-main span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.member-role { flex: none; font-size: 11px; color: var(--text-3); }
.member-row .btn, .member-row .icon-btn { flex: none; }
.member-role.is-owner { color: var(--warn); }

/* --- 编号徽标编辑（计数调整） --- */
.badge-btn {
  cursor: pointer;
  border: none;
  font: inherit;
  transition: transform var(--t-fast) var(--ease);
}
.badge-btn:hover { transform: scale(1.1); }
.badge-num-input {
  width: 46px; height: 22px;
  padding: 0 2px;
  background: var(--raised-2);
  border: 1px solid var(--line-3);
  border-radius: 999px;
  color: var(--text-1);
  font: 600 11px/1 var(--mono);
  text-align: center;
  outline: none;
  -moz-appearance: textfield;
}
.badge-num-input::-webkit-outer-spin-button,
.badge-num-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* --- 自定义色盘 --- */
.swatch-custom {
  display: grid;
  place-items: center;
  color: var(--text-2);
  background:
    conic-gradient(#FF3B30, #FF9500, #00E676, #1E88FF, #C158FF, #FF3B30);
  box-shadow: inset 0 0 0 3px var(--panel);
}
.swatch-custom .ic { position: relative; z-index: 1; transition: opacity var(--t-fast) var(--ease); }
.swatch-custom:hover { color: var(--text-1); }
/* 吸取的自定义颜色生效时：隐藏加号，让吸取色完整露出 */
.swatch-custom.is-active .ic { opacity: 0; }
.swatch-custom.is-active { box-shadow: inset 0 0 0 2px var(--panel), 0 0 0 2px var(--panel), 0 0 0 3.5px var(--c); }
.sr-only-input {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* --- 线宽指示条（滚轮调节反馈） --- */
.width-chip {
  position: fixed;
  left: 50%; bottom: 72px;
  transform: translate(-50%, 8px);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--raised);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  color: var(--text-1);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-base) var(--ease), transform var(--t-base) var(--ease);
  z-index: 90;
}
.width-chip.is-show { opacity: 1; transform: translate(-50%, 0); }
.width-chip .width-bar {
  display: inline-block;
  width: 26px;
  background: var(--text-1);
  border-radius: 999px;
}
.width-chip em {
  font-style: normal;
  color: var(--text-3);
  font-size: 11px;
}
/* --- 颜色反馈条（吸取/切换颜色后显示当前色值） --- */
.color-chip {
  position: fixed;
  left: 50%; bottom: 72px;
  transform: translate(-50%, 8px);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--raised);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  color: var(--text-1);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-base) var(--ease), transform var(--t-base) var(--ease);
  z-index: 90;
}
.color-chip.is-show { opacity: 1; transform: translate(-50%, 0); }
.color-chip .color-dot {
  display: inline-block;
  width: 16px; height: 16px;
  flex: none;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .3);
}
.color-chip b { font-family: var(--mono); font-weight: 600; letter-spacing: .04em; }
.color-chip em {
  font-style: normal;
  color: var(--text-3);
  font-size: 11px;
}
.note-pop-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }

/* ==========================================================
   关联参考（标注卡片 / 图钉浮层 / 选择器 / 对照查看器）
   ========================================================== */
.stage[data-tool="eraser"] #board { cursor: none; }

/* --- 标注卡片内的参考缩略 --- */
.anno-refs { margin-top: 8px; }
.ref-list { display: flex; flex-wrap: wrap; gap: 6px; }

.ref-thumb {
  position: relative;
  width: 54px; height: 36px;
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid var(--line-2);
  background: #0C0E12;
  display: grid; place-items: center;
  color: var(--text-2);
  transition: border-color var(--t-fast), transform var(--t-fast);
}
.ref-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ref-thumb:hover { border-color: var(--line-3); transform: translateY(-1px); }
.ref-thumb.is-link { color: var(--text-1); background: var(--input-focus); }
.ref-thumb.is-missing { opacity: .5; border-style: dashed; }
.ref-thumb .ref-idx {
  position: absolute; left: 2px; bottom: 2px;
  min-width: 12px; height: 12px; padding: 0 2px;
  font-family: var(--mono); font-size: 8.5px; line-height: 12px;
  text-align: center; font-style: normal;
  color: var(--text-1);
  background: rgba(8, 9, 11, .82);
  border-radius: 3px;
}
.ref-thumb .ref-del {
  position: absolute; right: 1px; top: 1px;
  width: 14px; height: 14px;
  display: none; place-items: center;
  border-radius: 3px;
  background: rgba(8, 9, 11, .86);
  color: var(--text-2);
}
.ref-thumb:hover .ref-del { display: grid; }
.ref-thumb .ref-del:hover { color: var(--danger); }

.ref-add {
  margin-top: 6px;
  width: 100%; height: 26px;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  font-size: 11px; color: var(--text-2);
  border: 1px dashed var(--line-2); border-radius: 5px;
  transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}
.ref-add:hover { color: var(--text-1); border-color: var(--line-3); background: rgba(255, 255, 255, .03); }

/* --- 图钉浮层里的参考行 --- */
.note-pop-refs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px;
  margin-top: 8px; padding-top: 8px;
  border-top: 1px solid var(--line);
}
.note-pop-refs .ref-thumb { width: 46px; height: 30px; }
.note-pop-refs .ref-more { font-size: 10px; color: var(--text-3); }
.note-pop-open {
  margin-left: auto;
  font-size: 10.5px; color: var(--text-1);
  padding: 3px 6px; border-radius: 4px;
  background: rgba(255, 255, 255, .06);
}
.note-pop-open:hover { background: rgba(255, 255, 255, .12); }

/* --- 关联选择器 --- */
.refpick { display: flex; flex-direction: column; gap: 16px; padding: 6px 0 2px; }
.refpick-sec { display: flex; flex-direction: column; gap: 8px; }
.refpick-sec .field-label { margin: 0; }
.refpick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.refpick-item {
  position: relative;
  border: 1px solid var(--line-2); border-radius: 6px;
  background: #0C0E12; overflow: hidden; padding: 0;
  text-align: left;
}
.refpick-item img { width: 100%; height: 68px; object-fit: cover; opacity: .85; }
.refpick-item span {
  display: block; padding: 5px 7px;
  font-size: 10.5px; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.refpick-item:hover { border-color: var(--line-3); }
.refpick-item.is-on { border-color: var(--paper); }
.refpick-item.is-on img { opacity: 1; }
.refpick-check {
  position: absolute; right: 6px; top: 6px;
  width: 16px; height: 16px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--paper); color: var(--ink, #0B0C0F);
}
.refpick-list { display: flex; flex-direction: column; gap: 6px; }
.refpick-row {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 8px;
  border: 1px solid var(--line); border-radius: 6px;
  background: #0E1014;
}
.refpick-idx { font-family: var(--mono); font-size: 10px; color: var(--text-3); width: 12px; }
.refpick-ico { width: 30px; height: 22px; display: grid; place-items: center; color: var(--text-2); }
.refpick-thumb { width: 42px; height: 26px; object-fit: cover; border-radius: 3px; }
.refpick-info { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.refpick-info b { font-size: 11.5px; font-weight: 500; color: var(--text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.refpick-info span { font-size: 10px; color: var(--text-3); }
.refpick-del { margin-left: auto; width: 22px; height: 22px; display: grid; place-items: center; color: var(--text-3); border-radius: 4px; }
.refpick-del:hover { color: var(--danger); background: rgba(255, 92, 77, .1); }
.refpick-link { display: flex; gap: 6px; }
.refpick-link .input { flex: 1 1 0; min-width: 0; }
.refpick-link .input:last-of-type { flex: 0 0 150px; }
.refpick-link .btn { flex: 0 0 auto; }

/* --- 对照查看器 --- */
.refview { position: fixed; inset: 0; z-index: 210; display: grid; place-items: center; }
.refview-mask { position: absolute; inset: 0; background: rgba(3, 4, 6, .8); backdrop-filter: blur(4px); }
.refview-panel {
  position: relative;
  width: min(1080px, 92vw);
  height: min(760px, 88vh);
  display: flex; flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  box-shadow: 0 40px 100px rgba(0, 0, 0, .65);
  overflow: hidden;
  animation: refview-in 220ms var(--ease);
}
@keyframes refview-in { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }

.refview-head {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
}
.refview-title { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.refview-title b { font-size: 12.5px; font-weight: 600; color: var(--text-1); }
.refview-sub {
  font-size: 11.5px; color: var(--text-2);
  max-width: 760px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.refview-close { margin-left: auto; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 5px; color: var(--text-2); }
.refview-close:hover { background: rgba(255, 255, 255, .07); color: var(--text-1); }

.refview-body { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; gap: 8px; padding: 14px 8px; }
.refview-stage {
  flex: 1 1 auto; height: 100%; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
}
.refview-img {
  max-width: 100%; max-height: calc(100% - 22px);
  object-fit: contain;
  border-radius: 6px;
  background: #08090B;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .5);
}
.refview-cap { font-family: var(--mono); font-size: 10.5px; color: var(--text-3); }
.refview-nav {
  flex: 0 0 auto; width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 50%; color: var(--text-2);
  background: rgba(255, 255, 255, .05);
}
.refview-nav:hover { color: var(--text-1); background: rgba(255, 255, 255, .1); }
.refview-nav.is-prev .ic { transform: none; }
.refview-nav.is-next .ic { transform: rotate(180deg); }
.refview-nav[disabled] { opacity: .3; cursor: default; }

.refview-linkcard {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  max-width: 520px; padding: 30px 36px;
  border: 1px solid var(--line-2); border-radius: var(--radius-lg);
  background: var(--hover-2); text-decoration: none;
  transition: border-color var(--t-fast), transform var(--t-fast);
}
.refview-linkcard:hover { border-color: var(--line-3); transform: translateY(-1px); }
.refview-linkico { color: var(--text-2); }
.refview-linkcard b { font-size: 14px; color: var(--text-1); }
.refview-linkurl { font-family: var(--mono); font-size: 10.5px; color: var(--text-3); word-break: break-all; text-align: center; }
.refview-linkcard em { font-style: normal; font-size: 11px; color: var(--text-2); }

.refview-missing {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--text-3); text-align: center;
}
.refview-missing b { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.refview-missing span { font-size: 11px; }

.refview-foot {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px 14px;
  border-top: 1px solid var(--line);
}
.refview-thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 2px; min-width: 0; }
.refview-thumb {
  position: relative; flex: 0 0 auto;
  width: 78px; height: 52px;
  border-radius: 6px; overflow: hidden;
  border: 1px solid var(--line);
  background: #0B0D11;
  display: grid; place-items: center;
  color: var(--text-2);
  opacity: .62;
  transition: opacity var(--t-fast), border-color var(--t-fast);
}
.refview-thumb img { width: 100%; height: 100%; object-fit: cover; }
.refview-thumb i {
  position: absolute; left: 3px; bottom: 3px;
  font-style: normal; font-family: var(--mono); font-size: 9px;
  padding: 0 3px; border-radius: 3px;
  background: rgba(8, 9, 11, .82); color: var(--text-1);
}
.refview-thumb:hover { opacity: 1; }
.refview-thumb.is-active { opacity: 1; border-color: var(--paper); }
.refview-thumb.is-link { color: var(--text-1); }
.refview-actions { margin-left: auto; display: flex; gap: 8px; flex: 0 0 auto; }

/* ==========================================================
   群组共享看板（顶栏状态 / 列表 / 修改历史 / 版本详情）
   深色底 + 无彩色外壳：编辑留痕用白色层级区分，不用语义色抢标注
   ========================================================== */
.board-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 8px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .07);
  font-size: 11px; color: var(--text-1);
  transition: background var(--t-fast), border-color var(--t-fast);
}
.board-chip:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .2); }
.board-chip .ic { opacity: .72; }
.bc-ver { font-family: var(--mono); font-size: 10px; color: var(--text-2); }
.bc-by { font-weight: 500; max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bc-time { font-style: normal; font-size: 10.5px; color: var(--text-3); }
.bc-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #E37318;                       /* warning：有他人更新 */
}
.board-chip[data-flag="conflict"] { border-color: rgba(213, 73, 65, .5); }
.board-chip[data-flag="conflict"] .bc-dot { background: #D54941; }

/* --- 群组面板分段 --- */
.plaza-segs { display: flex; gap: 4px; padding: 0 12px 8px; }
.pseg {
  height: 26px; padding: 0 10px; border-radius: 6px;
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; color: var(--text-2);
  transition: background var(--t-fast), color var(--t-fast);
}
.pseg b { font-family: var(--mono); font-size: 10px; font-weight: 400; color: var(--text-3); }
.pseg:hover { color: var(--text-1); background: rgba(255, 255, 255, .05); }
.pseg.is-active { color: var(--text-1); background: rgba(255, 255, 255, .09); }
.pseg.is-active b { color: var(--text-2); }

/* --- 看板列表 --- */
.bd-list { display: flex; flex-direction: column; gap: 6px; padding: 0 12px 12px; }
.bd-item {
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0E1014;
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast);
}
.bd-item:hover { border-color: var(--line-3); background: var(--hover-2); transform: translateY(-1px); }
.bd-item.is-open {
  border-color: rgba(75, 123, 255, .62);
  background: rgba(0, 82, 217, .14);
}
.bd-top { display: flex; align-items: center; gap: 7px; }

/* 看板操作按钮（打开 / 重命名 / 删除）：常显弱色保证可发现，悬停强化 */
.bd-more {
  display: grid;
  place-items: center;
  width: 22px; height: 22px;
  flex: none;
  margin-left: auto;
  border-radius: 5px;
  color: var(--text-3);
  opacity: .72;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease);
}
.bd-more:hover { color: var(--text-1); background: var(--hover); opacity: 1; }
.bd-item:hover .bd-more { opacity: 1; }
.bd-title {
  flex: 1 1 auto; min-width: 0;
  font-size: 12.5px; font-weight: 500; color: var(--text-1);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bd-mine {
  flex: 0 0 auto; padding: 0 4px;
  font-size: 9.5px; color: var(--text-3);
  border: 1px solid var(--line-2); border-radius: 4px;
}
.bd-ver {
  flex: 0 0 auto; padding: 1px 5px;
  font-family: var(--mono); font-size: 10px; color: var(--text-2);
  background: rgba(255, 255, 255, .08); border-radius: 4px;
}
.bd-meta { display: flex; align-items: center; gap: 6px; margin-top: 7px; min-width: 0; font-size: 11px; color: var(--text-2); }
.bd-meta em { font-style: normal; font-size: 10.5px; color: var(--text-3); white-space: nowrap; }
.bd-by { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 74px; }
.bd-nums { margin-left: auto; font-size: 10.5px; color: var(--text-3); white-space: nowrap; }
.bd-empty-sub { display: block; margin-top: 6px; font-size: 11px; line-height: 1.6; color: var(--text-3); }

/* --- 修改历史时间线 --- */
.bdhist {
  position: relative; list-style: none; margin: 0;
  padding: 2px 2px 2px 16px;
  max-height: min(460px, 52vh); overflow: auto;
}
.bdhist::before {
  content: ''; position: absolute; left: 6px; top: 10px; bottom: 10px;
  width: 1px; background: var(--line-2);
}
.bdhist-row {
  position: relative;
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 2px 9px 0;
  border-bottom: 1px solid var(--line);
}
.bdhist-row:last-child { border-bottom: 0; }
.bdhist-dot {
  position: absolute; left: -14px; top: 15px;
  width: 7px; height: 7px; border-radius: 50%;
  background: #3A414B; border: 1px solid #0B0D11;
}
.bdhist-row.is-current .bdhist-dot { background: var(--paper); }
.bdhist-main { flex: 1 1 auto; min-width: 0; }
.bdhist-head { display: flex; align-items: center; gap: 7px; font-size: 11.5px; }
.bdhist-head b { font-family: var(--mono); font-size: 10.5px; font-weight: 500; color: var(--text-2); }
.bdhist-who { color: var(--text-1); font-weight: 500; }
.bdhist-head em { font-style: normal; font-size: 10.5px; color: var(--text-3); }
.bdhist-tag {
  font-style: normal; font-size: 9.5px; padding: 0 4px;
  border-radius: 3px; background: rgba(255, 255, 255, .1); color: var(--text-2);
}
.bdhist-sum { margin: 3px 0 0; font-size: 11.5px; line-height: 1.55; color: var(--text-2); }
.bdhist-stats { margin-top: 3px; font-family: var(--mono); font-size: 10px; color: var(--text-3); }
.bdhist-open { flex: 0 0 auto; font-size: 10.5px; color: var(--text-2); }
.bdhist-open:hover { color: var(--text-1); }
.bdhist-empty { padding: 20px; text-align: center; font-size: 11.5px; color: var(--text-3); }

/* --- 版本详情 --- */
.bdrev { display: flex; flex-direction: column; gap: 10px; }
.bdrev-meta { display: flex; align-items: center; gap: 8px; }
.bdrev-meta .badge { width: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; }
.bdrev-meta b { font-size: 12.5px; font-weight: 500; color: var(--text-1); }
.bdrev-meta em { font-style: normal; font-family: var(--mono); font-size: 10.5px; color: var(--text-3); }
.bdrev-sum { margin: 0; font-size: 12px; color: var(--text-2); }
.bdrev-nums { display: flex; gap: 12px; font-family: var(--mono); font-size: 10.5px; color: var(--text-3); }
.bdrev-annos {
  list-style: none; margin: 0; padding: 8px 0 0;
  border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 6px;
  max-height: 260px; overflow: auto;
}
.bdrev-annos li { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-2); }
.bdrev-annos i {
  flex: 0 0 auto; width: 16px; height: 16px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--c, #666); color: #08090B;
  font-style: normal; font-family: var(--mono); font-size: 9.5px;
}
.bdrev-annos span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bdrev-annos em { font-style: normal; font-size: 10px; color: var(--text-3); }
.bdrev-annos li.is-more { font-size: 10.5px; color: var(--text-3); }

/* --- 发布弹窗 / 卡片作者署名 --- */
.bd-pub { display: flex; flex-direction: column; gap: 8px; padding: 4px 0 2px; }
.bd-pub .input { width: 100%; }
.anno-by {
  display: flex; align-items: center; gap: 5px;
  margin-top: 8px; padding-top: 7px;
  border-top: 1px dashed var(--line);
  font-size: 10.5px; color: var(--text-3);
}
.anno-by b { color: var(--text-2); font-weight: 500; }
.anno-by .ic { opacity: .6; }

/* --- 标注卡片下的回复 --- */
.anno-replies {
  margin-top: 9px; padding-top: 8px;
  border-top: 1px dashed var(--line);
  display: flex; flex-direction: column; gap: 8px;
}
.anno-replies-head {
  display: flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .06em;
  color: var(--text-3);
}
.anno-replies-head .ic { opacity: .6; }
.anno-reply { display: flex; gap: 7px; }
.anno-reply .avatar { width: 18px; height: 18px; font-size: 10px; flex: none; }
.reply-main { flex: 1; min-width: 0; }
.reply-meta { display: flex; align-items: baseline; gap: 6px; margin-bottom: 2px; }
.reply-meta b { font-size: 11px; font-weight: 600; color: var(--text-1); }
.reply-meta time { font-family: var(--mono); font-size: 9px; color: var(--text-3); }
.reply-body { font-size: 12px; line-height: 1.6; color: var(--text-2); white-space: pre-wrap; word-break: break-word; }
.reply-composer { display: flex; align-items: flex-end; gap: 6px; }
.reply-composer textarea {
  flex: 1; min-width: 0; resize: none;
  background: var(--raised-1); color: var(--text-1);
  border: 1px solid var(--line); border-radius: 6px;
  font: inherit; font-size: 11.5px; line-height: 1.5;
  padding: 5px 8px;
}
.reply-composer textarea:focus { outline: none; border-color: var(--line-3); }
.reply-composer textarea::placeholder { color: var(--text-3); }

/* ============================ 桌面端宽屏适配 ============================ */
/* 目标环境为桌面浏览器 / 桌面客户端外壳：宽屏优先，窄窗口保底不挤碎 */
@media (min-width: 1440px) {
  :root { --panel-w: 420px; }
}

/* 关于弹窗（帮助 → 关于反馈助手）：品牌行 + 版权/开发者信息行 */
.about-thread { padding: 4px 0; }
.about-brand {
  display: flex; flex-direction: column; gap: 2px;
  padding: 4px 2px 14px;
}
.about-brand b { font-size: 16px; color: var(--text-1); letter-spacing: .5px; }
.about-brand em { font-style: normal; font-size: 12px; color: var(--text-3); }
.about-thread .meta-row { display: flex; justify-content: space-between; gap: 16px; padding: 7px 2px; }
.about-thread .meta-row span:first-child { color: var(--text-3); font-size: 12px; }
.about-thread .meta-row span:last-child { color: var(--text-1); font-size: 12.5px; }

/* ============================ 新手引导（js/tour.js） ============================ */html.tour-lock { overflow: hidden; }
.tour-wrap { position: fixed; inset: 0; z-index: 400; pointer-events: none; }
/* 整屏压暗（居中卡片步骤） */
.tour-dim { position: fixed; inset: 0; background: rgba(4, 5, 7, .72); }
/* 聚光灯：矩形外全暗、矩形内透明（超大 box-shadow 实现挖孔） */
.tour-spot {
  position: fixed; border-radius: 10px; pointer-events: none;
  box-shadow: 0 0 0 2000px rgba(4, 5, 7, .72);
  outline: 2px solid var(--brand); outline-offset: 3px;
  transition: left .22s var(--ease), top .22s var(--ease),
              width .22s var(--ease), height .22s var(--ease);
}
.tour-card {
  position: fixed; width: 372px; max-width: calc(100vw - 24px);
  background: var(--panel); border: 1px solid var(--line-2);
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, .5);
  padding: 18px 18px 14px;
  pointer-events: auto;
  opacity: 0; transform: translateY(6px);
  transition: opacity .18s var(--ease), transform .18s var(--ease);
}
.tour-card.is-in { opacity: 1; transform: none; }
.tour-close {
  position: absolute; top: 10px; right: 10px;
  width: 26px; height: 26px; border: 0; border-radius: 6px;
  background: transparent; color: var(--text-3); cursor: pointer;
  display: grid; place-items: center;
}
.tour-close:hover { background: var(--hover); color: var(--text-1); }
.tour-title { font-size: 15px; font-weight: 600; color: var(--text-1); margin-bottom: 8px; }
.tour-body {
  font-size: 12.5px; line-height: 1.7; color: var(--text-2);
  white-space: normal; word-break: break-word;
}
.tour-body b { color: var(--text-1); font-weight: 600; }
.tour-body kbd {
  display: inline-block; padding: 1px 5px; margin: 0 1px;
  font-family: var(--mono); font-size: 10.5px; line-height: 1.6;
  color: var(--text-1); background: var(--raised-2);
  border: 1px solid var(--line-2); border-radius: 4px;
}
.tour-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
.tour-dots { display: flex; gap: 5px; }
.tour-dots i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--line-3); transition: background var(--t-fast) var(--ease), width var(--t-fast) var(--ease);
}
.tour-dots i.is-on { background: var(--brand); width: 16px; border-radius: 3px; }
.tour-actions { display: flex; gap: 8px; }

/* 组织弹窗：角色权限说明块（方案1 成员管理补强） */
.org-note {
  display: flex; align-items: flex-start; gap: 6px;
  padding: 8px 10px; margin-bottom: 12px;
  font-size: 12px; line-height: 1.6; color: var(--text-2);
  background: var(--raised-2); border: 1px solid var(--line-2); border-radius: 8px;
}
.org-note .ic { flex: none; margin-top: 2px; color: var(--text-3); }
.org-note span { flex: 1; }
.member-row [data-org-mremove] { margin-left: auto; }
.member-row .icon-btn { margin-left: 6px; }

/* 评论译文气泡（方案2 翻译） */
.c-tr {
  margin-left: auto; padding: 0 6px; height: 18px;
  font-size: 10.5px; line-height: 16px; color: var(--text-3);
  background: transparent; border: 1px solid var(--line-2); border-radius: 4px;
  cursor: pointer;
}
.c-tr:hover { color: var(--brand); border-color: var(--brand); }
.comment-tr {
  margin-top: 6px; padding: 6px 8px;
  font-size: 12px; line-height: 1.6; color: var(--text-2);
  background: var(--raised-2); border-left: 2px solid var(--brand);
  border-radius: 0 6px 6px 0; word-break: break-word;
}
.tr-btn { flex: none; }

/* 画笔工具辨识度（方案3）：绘制类工具与选择/形状类工具拉开层次——
   图标常驻品牌蓝，激活态整钮反白，一眼可辨「这是画画用的」 */
.rail-btn--draw .ic { color: var(--brand, #0052D9); }
.rail-btn--draw:hover .ic { color: var(--brand, #0052D9); filter: brightness(1.15); }
.rail-btn--draw.is-active { background: var(--brand, #0052D9); }
.rail-btn--draw.is-active .ic { color: #FFFFFF; filter: none; }

/* Ctrl+滚轮透明度 HUD（方案4）：跟随缩放气泡，短暂显示百分比后淡出 */
#alphaHud {
  position: absolute;
  left: 50%; top: 14px;
  transform: translate(-50%, -4px);
  padding: 4px 12px;
  font-size: 12px; line-height: 1.4;
  color: var(--text-1);
  background: var(--raised, rgba(23, 25, 30, .92));
  border: 1px solid var(--line-2);
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-fast, 120ms) ease-out, transform var(--t-fast, 120ms) ease-out;
  z-index: 30;
}
#alphaHud.is-show { opacity: 1; transform: translate(-50%, 0); }

/* 管理员角色徽标（方案2）：与创建者(橙)/成员(灰)三态区分，品牌蓝描边胶囊 */
.member-role.is-admin {
  padding: 1px 8px;
  font-weight: 600;
  color: var(--brand, #0052D9);
  background: color-mix(in srgb, var(--brand, #0052D9) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand, #0052D9) 45%, transparent);
  border-radius: 999px;
}

/* 自动翻译开关（方案1 增强）：飞书式小型 switch，位于 composer 行内 */
.auto-tr {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text-3);
  cursor: pointer; user-select: none;
  margin-right: 4px; white-space: nowrap;
}
.auto-tr:hover { color: var(--text-2); }
.auto-tr input { position: absolute; opacity: 0; width: 0; height: 0; }
.auto-tr-track {
  flex: none;
  width: 26px; height: 16px;
  border-radius: 999px;
  background: var(--line-2);
  position: relative;
  transition: background var(--t-fast, 120ms) ease-out;
}
.auto-tr-track::after {
  content: '';
  position: absolute; top: 2px; left: 2px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
  transition: transform var(--t-fast, 120ms) ease-out;
}
.auto-tr input:checked + .auto-tr-track { background: var(--brand, #0052D9); }
.auto-tr input:checked + .auto-tr-track::after { transform: translateX(10px); }
.auto-tr input:focus-visible + .auto-tr-track { outline: 2px solid var(--brand, #0052D9); outline-offset: 1px; }

/* 自动翻译气泡：比手动「译」气泡更轻一层（em 说明弱化） */
.comment-tr.auto em { font-style: normal; font-size: 10.5px; color: var(--text-3); margin-left: 4px; }

/* 翻译服务未配置：开关仍可见（可发现性）但置灰不可用，悬停提示原因 */
.auto-tr.is-off { opacity: .5; cursor: not-allowed; }
.auto-tr.is-off:hover { color: var(--text-3); }

/* 标注说明自动翻译气泡：比正文轻一层，与讨论译文气泡同一视觉语言 */
.anno-tr {
  margin-top: 4px;
  padding: 6px 8px;
  font-size: 12px;
  color: var(--text-2);
  background: var(--panel-2);
  border-left: 2px solid var(--line-2);
  border-radius: 4px;
  line-height: 1.5;
  word-break: break-word;
}
.anno-tr em { font-style: normal; font-size: 10.5px; color: var(--text-3); margin-left: 4px; white-space: nowrap; }
.anno-tr-loading { font-style: normal; color: var(--text-3); }

/* 收件箱未读角标（顶栏邮件图标）：有新消息时显示数量，查看后清除 */
#inboxBtn { position: relative; }
.inbox-dot {
  position: absolute; top: -3px; right: -4px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px;
  background: var(--danger, #FF5C4D);
  color: #fff;
  font-size: 10px; line-height: 16px; font-weight: 600;
  text-align: center;
  box-shadow: 0 0 0 2px var(--panel-1, #fff);
  pointer-events: none;
}
