/* ---------------------------------------------------------------- tokens */
:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f7f8fc;
  --surface-3: #e5e9f3;
  --text: #1b2233;
  --text-2: #46506a;
  --muted: #7b8499;
  --line: #e4e8f1;
  --line-strong: #d4dae8;
  --primary: #1b9aee;
  --primary-ink: #1382cb;
  --primary-soft: #e8f5fe;
  --danger: #e5484d;
  --danger-soft: #fdecec;
  --warn: #dd8a12;
  --warn-soft: #fdf3e2;
  --ok: #1f9d68;
  --ok-soft: #e7f6ef;
  --purple: #9b51e0;
  --shadow-sm: 0 1px 2px rgba(20, 30, 60, 0.06);
  --shadow-md: 0 10px 30px -10px rgba(20, 30, 60, 0.22);
  --shadow-card: 0 10px 10px -10px rgba(20, 30, 60, 0.22);
  --shadow-lg: 0 24px 60px -20px rgba(15, 23, 45, 0.35);
  --radius: 12px;
  --radius-sm: 8px;
  --topbar-h: 62px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f131c;
    --surface: #161b26;
    --surface-2: #1c2230;
    --surface-3: #242b3b;
    --text: #e9edf6;
    --text-2: #b6bfd1;
    --muted: #8791a5;
    --line: #262e3f;
    --line-strong: #333c50;
    --primary: #4ab3f4;
    --primary-ink: #82cbf8;
    --primary-soft: #10273a;
    --danger: #ff6b6f;
    --danger-soft: #3a1e22;
    --warn: #f0b04a;
    --warn-soft: #362a17;
    --ok: #4ecb94;
    --ok-soft: #14301f;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 12px 32px -12px rgba(0, 0, 0, 0.65);
    --shadow-card: 0 12px 10px -12px rgba(0, 0, 0, 0.65);
    --shadow-lg: 0 28px 70px -24px rgba(0, 0, 0, 0.75);
  }
}

/* ---------------------------------------------------------------- base */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; padding: 0; }
a { color: var(--primary); text-decoration: none; }
svg { display: block; }
::selection { background: rgba(27, 154, 238, 0.22); }
.muted { color: var(--muted); }
.spacer { flex: 1; }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 8px; }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; }
*::-webkit-scrollbar-track { background: transparent; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-ink); border-color: var(--primary-ink); color: #fff; }
.btn-white { background: #fff; border-color: var(--line-strong); color: #1b2233; }
.btn-white:hover { background: #f4f6fb; border-color: var(--line-strong); color: #1b2233; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { color: var(--danger); border-color: transparent; background: transparent; }
.btn-danger:hover { background: var(--danger-soft); color: var(--danger); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
  flex: none;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.small { width: 24px; height: 24px; }
.icon-btn svg { width: 17px; height: 17px; }

/* 项目管理入口：顶栏右侧的圆形齿轮按钮 */
.pm-entry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex: none;
  background: var(--primary-soft);
  color: var(--primary-ink);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 18%, transparent);
  transition: background 0.15s, color 0.15s, transform 0.1s;
}
.pm-entry:hover {
  background: var(--primary);
  color: var(--surface);
}
.pm-entry:active { transform: scale(0.94); }
.pm-entry svg { width: 17px; height: 17px; }

/* ---------------------------------------------------------------- avatars */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  flex: none;
  user-select: none;
  letter-spacing: 0;
}
.avatar-xs { width: 16px; height: 16px; font-size: 8px; }
.avatar-sm { width: 22px; height: 22px; font-size: 11px; }
.avatar-lg { width: 34px; height: 34px; font-size: 14px; }
.avatar-xl { width: 64px; height: 64px; font-size: 22px; }
.avatar-img { overflow: hidden; }
.avatar-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -6px; border: 2px solid var(--surface); }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* ---------------------------------------------------------------- layout */
.layout { display: flex; height: 100vh; overflow: hidden; }

.brand-mark {
  width: 34px;
  height: 34px;
  flex: none;
  display: block;
}
.brand-mark svg { display: block; width: 100%; height: 100%; }

.project-dot {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  flex: none;
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--surface); }

.topbar {
  height: var(--topbar-h);
  flex: none;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  z-index: 20;
}
/* 顶栏左上角品牌图标：点击回到项目列表首页 */
.topbar-brand {
  display: inline-flex;
  align-items: center;
  flex: none;
  border-radius: 8px;
  transition: opacity 0.15s;
}
.topbar-brand:hover { opacity: 0.8; }
.topbar-brand .brand-mark { width: 28px; height: 28px; }

/* 项目等内页左上角的返回按钮：回到项目列表 */
.topbar-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  flex: none;
  color: var(--text-2);
  transition: background 0.15s, color 0.15s;
}
.topbar-back:hover { background: var(--surface-2); color: var(--text); }
.topbar-back svg { width: 20px; height: 20px; }

/* 顶栏右侧账户入口：头像 + 昵称 */
.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  max-width: 170px;
  padding: 0 12px 0 5px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 600;
  flex: none;
  transition: background 0.15s, color 0.15s;
}
.user-pill:hover { background: var(--surface-3); color: var(--text); }
.user-pill .avatar { width: 24px; height: 24px; font-size: 11px; }
.user-pill-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------------- home */
/* 项目列表在宽屏下水平居中 */
.home-page { margin: 0 auto; }
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(264px, 1fr));
  gap: 14px;
}
.project-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 144px;
  padding: 18px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.project-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.pc-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pc-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  user-select: none;
}
.pc-name {
  font-size: 14.5px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pc-desc {
  flex: 1;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 20px;
}
.pc-foot { display: flex; align-items: center; gap: 10px; }
.pc-progress {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--muted);
}
.pc-bar { flex: 1; height: 5px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.pc-bar i { display: block; height: 100%; border-radius: 3px; background: var(--ok); transition: width 0.3s ease; }
.pc-count { flex: none; font-weight: 600; }
.pc-members { flex: none; }
.pc-members .avatar { width: 20px; height: 20px; font-size: 9px; margin-left: -5px; border: 2px solid var(--surface); }
.pc-members .avatar:first-child { margin-left: 0; }
.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
/* 页面切换器右侧：搜索、视图切换、筛选 */
.topbar-tools { display: flex; align-items: center; gap: 10px; min-width: 0; margin-left: 4px; }
.crumb { display: flex; align-items: center; gap: 8px; min-width: 0; }
.crumb-project { font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb-sub { color: var(--muted); font-size: 12px; }

.tabs { position: relative; display: flex; align-items: center; gap: 2px; background: var(--surface-2); padding: 3px; border-radius: 10px; }
.tab {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.15s;
  white-space: nowrap;
  -webkit-user-drag: none;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); }
/* 高亮块由单独的指示层渲染，切换页签时滑动过去而不是瞬移 */
.tab-indicator {
  position: absolute;
  top: 3px;
  left: 0;
  z-index: 0;
  height: 30px;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  pointer-events: none;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), width 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
@media (prefers-reduced-motion: reduce) {
  .tab-indicator { transition: none; }
}
.tab svg { width: 15px; height: 15px; }

/* 顶栏任务搜索：输入即筛选当前看板 / 列表（参考 Teambition）
   图标按钮与输入框共用同一容器，展开 / 收起靠类切换触发宽度过渡 */
.task-search {
  display: flex;
  align-items: center;
  height: 32px;
  width: 32px;
  padding: 0 2px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 9px;
  overflow: hidden;
  transition: width 0.2s ease, padding 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.task-search.open {
  width: 210px;
  padding: 0 5px 0 2px;
  border-color: var(--primary);
  background: var(--surface);
}
.task-search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  color: var(--muted);
  flex: none;
}
.task-search-btn:hover { background: var(--surface-2); color: var(--text); }
.task-search-btn svg { width: 15px; height: 15px; }
.task-search input {
  border: none;
  outline: none;
  background: transparent;
  width: 0;
  min-width: 0;
  padding: 0;
  opacity: 0;
  font-size: 13px;
  transition: width 0.2s ease, opacity 0.16s ease, margin 0.2s ease;
}
.task-search.open input {
  width: 148px;
  margin: 0 2px 0 6px;
  opacity: 1;
}
.task-search input::placeholder { color: var(--muted); }
.task-search-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  color: var(--muted);
  flex: none;
  transition: opacity 0.15s ease;
}
.task-search-clear svg { width: 12px; height: 12px; }
.task-search-clear:hover { background: var(--surface-2); color: var(--text); }

.content {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: var(--bg);
}
.content.view-board { overflow: hidden; display: flex; flex-direction: column; }
/* 视图缓存：每个页面一个常驻面板，切换页签只切显隐，DOM / iframe 不销毁 */
.view-pane { display: contents; }
.view-pane:not(.is-active) { display: none; }
.page { padding: 26px 24px 48px; max-width: 1120px; }
.page.page-docs { max-width: none; }
.page-list { margin: 0 auto; padding-top: 20px; }

/* list header row: sticky, count + create button in the title column */
.page-list .task-table thead th {
  position: sticky;
  top: 20px;
  z-index: 3;
  background: var(--bg);
  box-shadow: 0 -20px 0 var(--bg), 0 8px 0 var(--bg), inset 0 -1px 0 var(--line);
}
.page-list .task-table thead th.cell-title { color: var(--text); }
.list-head { display: inline-flex; align-items: center; gap: 8px; }
.list-count { font-size: 11.5px; font-weight: 600; letter-spacing: 0.03em; }
.list-add {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  transition: background 0.12s, transform 0.12s;
}
.list-add:hover { background: var(--primary-ink); }
.list-add:active { transform: scale(0.94); }
.list-add svg { width: 12px; height: 12px; }

.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; }
.page-title { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
.page-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* ---------------------------------------------------------------- login */
.login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}
.login-card {
  width: 420px;
  max-width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 38px 36px 30px;
  box-shadow: var(--shadow-lg);
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.login-brand .brand-mark { width: 42px; height: 42px; }
.login-title { font-size: 21px; font-weight: 700; }
.login-tagline { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-field label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.login-field input,
.login-field select {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  outline: none;
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.login-field input:focus,
.login-field select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.login-submit { height: 42px; margin-top: 6px; font-size: 14px; border-radius: 10px; }
.login-error {
  display: none;
  padding: 9px 12px;
  border-radius: 9px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 12.5px;
}
.login-error.show { display: block; }
.login-switch {
  width: 100%;
  margin-top: 14px;
  background: transparent;
  border: 1px dashed var(--line-strong);
  color: var(--text-2);
  font-size: 13px;
}
.login-switch:hover { border-color: var(--primary); color: var(--primary); }
.login-note {
  margin-top: 16px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: 10px;
  padding: 10px 13px;
}
.login-demo {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}
.login-demo code {
  background: var(--surface-2);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 11.5px;
  color: var(--text-2);
}

/* ---------------------------------------------------------------- board */
.board-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; --board-pad-x: 24px; --board-inset: 0px; }
.board {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: flex-start;
  justify-content: safe center;
  gap: 16px;
  padding: 20px var(--board-pad-x) 8px;
  overflow-x: auto;
  overflow-y: hidden;
}
.column {
  width: 302px;
  flex: none;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  background: color-mix(in srgb, var(--col-color, var(--surface-2)) 10%, transparent);
  border-radius: 14px;
  border: 1px solid transparent;
  transition: border-color 0.15s, background 0.15s;
}
.column.drop-target { border-color: color-mix(in srgb, var(--primary) 45%, transparent); background: var(--primary-soft); }
/* 分组移动模式：iOS 编辑态式虚线边框，整卡即拖拽热区（已禁用抖动动画） */
.board.move-mode .column {
  border: 1px dashed color-mix(in srgb, var(--col-color, var(--text)) 50%, transparent);
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.board.move-mode .column > * { pointer-events: none; }
.board.move-mode .column.dragging {
  position: relative;
  z-index: 5;
  cursor: grabbing;
  border-color: color-mix(in srgb, var(--col-color, var(--primary)) 72%, transparent);
  box-shadow: var(--shadow-md);
  opacity: 0.92;
}
.board.move-mode .board-add-group { display: none; }
.group-move-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 22px;
  width: max-content;
  margin: 0 auto;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 7px 8px 7px 16px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 88%, transparent);
  color: var(--surface);
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  animation: popIn 0.15s ease;
}
.group-move-done {
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
}
.group-move-done:hover { background: var(--surface-2); }
.column-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 14px 9px;
}
.col-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.col-name { font-size: 13.5px; font-weight: 650; letter-spacing: 0.01em; }
.col-count {
  min-width: 20px;
  height: 19px;
  padding: 0 6px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--col-color, var(--muted)) 14%, transparent);
  color: color-mix(in srgb, var(--col-color, var(--muted)) 60%, var(--text));
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.col-menu { margin-left: auto; opacity: 0; transition: opacity 0.15s; }
.column:hover .col-menu { opacity: 1; }
.col-tasks {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 2px 10px 10px;
  overflow-y: auto;
  min-height: 12px;
  flex: 1;
}
.col-add {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 2px 10px 10px;
  padding: 8px 10px;
  border-radius: 9px;
  color: color-mix(in srgb, var(--col-color, var(--muted)) 55%, var(--text));
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.col-add:hover {
  background: color-mix(in srgb, var(--col-color, var(--text)) 16%, transparent);
  color: color-mix(in srgb, var(--col-color, var(--text)) 72%, var(--text));
}
.col-add svg { width: 15px; height: 15px; }

.composer { margin: 0 10px 10px; background: var(--surface); border-radius: 10px; box-shadow: var(--shadow-md); padding: 8px; }
.composer textarea {
  width: 100%;
  min-height: 54px;
  resize: vertical;
  border: none;
  outline: none;
  background: transparent;
  font-size: 13.5px;
  line-height: 1.5;
}
.composer-actions { display: flex; align-items: center; gap: 8px; margin-top: 4px; }

.task-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px 10px;
  box-shadow: var(--shadow-sm);
  cursor: grab;
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s;
  user-select: none;
}
.task-card:hover { z-index: 1; border-color: color-mix(in srgb, var(--primary) 35%, var(--line)); box-shadow: var(--shadow-card); }
.task-card:active { cursor: grabbing; }
.task-card.dragging { opacity: 0.35; transform: scale(0.98); }
.task-card.is-done .card-title { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); }
.card-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 7px; }
/* 优先级标签紧随标签之后左对齐，不再推到行尾 */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 19px;
  padding: 0 7px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 550;
  background: color-mix(in srgb, var(--tag-color, #8b93a7) 14%, transparent);
  color: color-mix(in srgb, var(--tag-color, #8b93a7) 78%, var(--text));
  white-space: nowrap;
}
.card-head { display: flex; align-items: flex-start; gap: 7px; }
.card-head .card-title { flex: 1; min-width: 0; }
.card-check {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  padding: 0;
  border: 1.5px solid color-mix(in srgb, var(--muted) 55%, transparent);
  border-radius: 50%;
  background: transparent;
  color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}
.card-check svg { width: 10px; height: 10px; }
.task-card:hover .card-check { border-color: color-mix(in srgb, var(--ok) 60%, transparent); color: var(--ok); }
.card-check:hover { background: color-mix(in srgb, var(--ok) 14%, transparent); }
.card-check.is-checked { background: var(--ok); border-color: var(--ok); color: #fff; }
.card-title { font-size: 13.5px; font-weight: 550; line-height: 1.45; word-break: break-word; }
.priority-pill {
  height: 18px;
  padding: 0 6px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  letter-spacing: 0.03em;
}
.priority-pill.p-high { background: var(--danger-soft); color: var(--danger); }
.priority-pill.p-mid { background: var(--warn-soft); color: var(--warn); }
.priority-pill.p-low { background: var(--surface-3); color: var(--muted); }
.card-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 9px;
  min-height: 22px;
}
.card-meta .due {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11.5px;
  color: var(--muted);
}
.card-meta .due svg { width: 12px; height: 12px; }
.card-meta .due.overdue { color: var(--danger); font-weight: 600; }
.card-meta .due.soon { color: var(--warn); font-weight: 600; }
.card-count { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; color: var(--muted); }
.card-count svg { width: 13px; height: 13px; }
.card-meta-right { margin-left: auto; display: inline-flex; align-items: center; gap: 9px; }
.card-meta .avatar { width: 22px; height: 22px; font-size: 10.5px; }
/* 创建人头像：位于卡片右下角，比负责人头像略小 */
.card-meta .card-creator {
  width: 16px;
  height: 16px;
  font-size: 8.5px;
}
.card-meta { gap: 7px; }
.card-meta-right { gap: 7px; }
.card-meta .due { white-space: nowrap; }
.board-add-group {
  flex: none;
  width: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 46px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--muted);
  font-size: 13px;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.board-add-group:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

/* ---------------------------------------------------------------- list view */
.list-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.task-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.task-table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.03em;
  padding: 11px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  user-select: none;
}
.task-table th.sortable { cursor: pointer; }
.task-table th.sortable:hover { color: var(--text); }
.task-table th .sort-arrow { opacity: 0.6; margin-left: 2px; }
.task-table td { padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
.task-table tr:last-child td { border-bottom: none; }
.task-table tbody tr { cursor: pointer; transition: background 0.12s; }
.task-table tbody tr:hover { background: var(--surface-2); }
.task-table tr.row-done .cell-title { color: var(--muted); text-decoration: line-through; }
.cell-title { font-weight: 550; max-width: 380px; }
.cell-check-row { display: flex; align-items: flex-start; gap: 7px; }
.cell-check-row > span { flex: 1; min-width: 0; }
.cell-check-row .card-check { margin-top: 3px; }
.task-table tbody tr:hover .card-check { border-color: color-mix(in srgb, var(--ok) 60%, transparent); color: var(--ok); }
.cell-title .sub-mark { color: var(--muted); font-weight: 400; font-size: 11.5px; margin-right: 4px; }
.group-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--surface-2);
  font-size: 11.5px;
  color: var(--text-2);
}
.group-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.prio-text { font-size: 12px; font-weight: 600; }
.prio-text.p-high { color: var(--danger); }
.prio-text.p-mid { color: var(--warn); }
.prio-text.p-low { color: var(--muted); }
.due-text { font-size: 12.5px; color: var(--muted); }
.due-text.overdue { color: var(--danger); font-weight: 600; }
.due-text.soon { color: var(--warn); }

/* ---------------------------------------------------------------- work view */
.work-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px 26px;
  margin-bottom: 22px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  flex-wrap: wrap;
}
.work-greeting { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
.work-date { color: var(--muted); font-size: 13px; margin-top: 3px; }
.work-stats { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.stat-chip {
  min-width: 92px;
  padding: 10px 14px;
  border-radius: 11px;
  background: var(--surface-2);
}
.stat-chip .num { font-size: 20px; font-weight: 700; line-height: 1.15; }
.stat-chip .label { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.stat-chip.danger .num { color: var(--danger); }
.stat-chip.warn .num { color: var(--warn); }

.work-section { margin-bottom: 26px; }
.work-section-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.work-section-title { font-size: 14px; font-weight: 650; }
.work-section-count { font-size: 12px; color: var(--muted); }
.work-list { display: flex; flex-direction: column; gap: 1px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.work-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  background: var(--surface);
  cursor: pointer;
  transition: background 0.12s;
  border-bottom: 1px solid var(--line);
}
.work-item:last-child { border-bottom: none; }
.work-item:hover { background: var(--surface-2); }
.work-check {
  width: 19px;
  height: 19px;
  border-radius: 50%;
  border: 1.6px solid var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  color: transparent;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.work-check svg { width: 11px; height: 11px; }
.work-check:hover { border-color: var(--ok); color: var(--ok); }
.work-check.checked { background: var(--ok); border-color: var(--ok); color: #fff; }
.work-main { min-width: 0; flex: 1; }
.work-title { font-size: 13.5px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work-item.done .work-title { color: var(--muted); text-decoration: line-through; }
.work-sub { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); margin-top: 2px; flex-wrap: wrap; }
.proj-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--text-2);
  white-space: nowrap;
}
.proj-chip .dot { width: 7px; height: 7px; border-radius: 2px; flex: none; }
.work-side { display: flex; align-items: center; gap: 10px; flex: none; }
.work-due { font-size: 12px; color: var(--muted); white-space: nowrap; }
.work-due.overdue { color: var(--danger); font-weight: 600; }
.work-due.soon { color: var(--warn); }
.mini-progress { font-size: 11px; color: var(--muted); display: inline-flex; gap: 4px; align-items: center; }
.mini-progress .bar { width: 40px; height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.mini-progress .bar i { display: block; height: 100%; background: var(--ok); border-radius: 2px; }

/* ---------------------------------------------------------------- overview */
.overview-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
}
.stat-card .stat-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.stat-card .stat-value { font-size: 26px; font-weight: 700; margin-top: 4px; letter-spacing: -0.02em; }
.stat-card .stat-value small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.stat-card.accent { background: #3f57d6; border-color: transparent; color: #fff; }
.stat-card.accent .stat-label { color: rgba(255, 255, 255, 0.75); }
.stat-card.accent .stat-value small { color: rgba(255, 255, 255, 0.75); }

.overview-cols { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.panel-head h3 { margin: 0; font-size: 14px; font-weight: 650; }
.panel-head .muted { font-size: 12px; }
.bar-row { margin-bottom: 13px; }
.bar-row-top { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; margin-bottom: 5px; }
.bar-row-top .name { display: flex; align-items: center; gap: 7px; font-weight: 550; }
.bar-row-top .name .dot { width: 8px; height: 8px; border-radius: 50%; }
.bar-row-top .val { color: var(--muted); font-size: 12px; }
.bar { height: 7px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 4px; background: var(--primary); transition: width 0.4s ease; }
.member-load { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.member-load:last-child { border-bottom: none; }
.member-load .ml-name { font-size: 13px; font-weight: 550; }
.member-load .ml-meta { font-size: 11.5px; color: var(--muted); }
.member-load .ml-count { margin-left: auto; font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.activity-list { display: flex; flex-direction: column; }
.activity-item { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  margin-top: 7px;
  flex: none;
  opacity: 0.7;
}
.activity-text { font-size: 13px; line-height: 1.5; }
.activity-text b { font-weight: 600; }
.activity-time { font-size: 11.5px; color: var(--muted); margin-top: 1px; }

/* ---------------------------------------------------------------- activity timeline */
.timeline { position: relative; padding-left: 20px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 1.5px;
  background: var(--line);
}
.timeline-day { font-size: 12px; font-weight: 650; color: var(--muted); margin: 18px 0 8px; letter-spacing: 0.02em; }
.timeline-day:first-child { margin-top: 0; }
.timeline-item { position: relative; display: flex; gap: 12px; padding: 8px 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -19px;
  top: 15px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--primary);
  opacity: 0.85;
}
.timeline-body { min-width: 0; }
.timeline-text { font-size: 13.5px; line-height: 1.5; }
.timeline-text b { font-weight: 600; }
.timeline-meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ---------------------------------------------------------------- search */
mark { background: color-mix(in srgb, var(--primary) 22%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }

/* ---------------------------------------------------------------- drawer */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 18, 32, 0.42);
  z-index: 60;
  opacity: 0;
  animation: fadeIn 0.18s ease forwards;
  backdrop-filter: blur(2px);
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(680px, 100vw);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  z-index: 61;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideIn 0.22s cubic-bezier(0.2, 0.8, 0.3, 1);
}
@keyframes slideIn { from { transform: translateX(36px); opacity: 0.6; } to { transform: none; opacity: 1; } }
@keyframes fadeIn { to { opacity: 1; } }
.drawer-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.drawer-crumb { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); min-width: 0; }
.drawer-crumb .crumb-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; }
.drawer-crumb .dot { width: 7px; height: 7px; border-radius: 2px; }
.drawer-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 0 24px 40px; }
.task-title-input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.35;
  padding: 2px 4px;
  margin: 0 -4px 14px;
  border-radius: 8px;
  transition: background 0.15s;
}
.task-title-input:hover { background: var(--surface-2); }
.task-title-input:focus { background: var(--surface-2); }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; margin-bottom: 18px; }
.field { min-width: 0; }
.field > label { display: block; font-size: 11.5px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.field select, .field input[type="date"], .field input[type="text"] {
  width: 100%;
  height: 34px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}
.field select:focus, .field input:focus { border-color: var(--primary); }
.field .select-wrap { position: relative; }
.field-tag-list { display: flex; flex-wrap: wrap; gap: 5px; min-height: 26px; align-items: center; }
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 23px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 550;
  background: color-mix(in srgb, var(--tag-color) 14%, transparent);
  color: color-mix(in srgb, var(--tag-color) 76%, var(--text));
  flex: none;
  white-space: nowrap;
}
.tag-chip .tag-x { opacity: 0.5; cursor: pointer; display: inline-flex; }
.tag-chip .tag-x:hover { opacity: 1; }
.tag-chip svg { width: 11px; height: 11px; }
.add-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 23px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  font-size: 11.5px;
  flex: none;
  white-space: nowrap;
}
.add-chip:hover { color: var(--primary); border-color: var(--primary); }

.section { border-top: 1px solid var(--line); padding: 18px 0 4px; }
.section-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.section-head h4 { margin: 0; font-size: 13px; font-weight: 650; }
.section-head .count { font-size: 11.5px; color: var(--muted); }
.section-head .actions { margin-left: auto; display: flex; gap: 6px; }
.desc-view, .desc-edit {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 62px;
  color: var(--text-2);
}
.desc-edit { resize: vertical; outline: none; border-color: var(--line); background: var(--surface); min-height: 110px; white-space: pre-wrap; }
.desc-edit:focus { border-color: var(--primary); }
.desc-view:hover { background: var(--surface-2); cursor: text; }
.desc-placeholder { color: var(--muted); }
.save-hint { font-size: 11px; color: var(--muted); margin-left: 8px; }

/* 描述富文本编辑器（wangEditor），主题变量映射到站点配色 */
.desc-editor {
  --w-e-textarea-bg-color: transparent;
  --w-e-textarea-color: var(--text-2);
  --w-e-textarea-border-color: var(--line-strong);
  --w-e-textarea-slight-border-color: var(--line);
  --w-e-textarea-slight-color: var(--muted);
  --w-e-textarea-slight-bg-color: var(--surface-2);
  --w-e-textarea-selected-border-color: var(--primary-soft);
  --w-e-textarea-handler-bg-color: var(--primary);
  --w-e-toolbar-color: var(--muted);
  --w-e-toolbar-bg-color: var(--surface-2);
  --w-e-toolbar-active-color: var(--text);
  --w-e-toolbar-active-bg-color: var(--surface-3);
  --w-e-toolbar-disabled-color: var(--line-strong);
  --w-e-toolbar-border-color: var(--line);
  --w-e-modal-button-bg-color: var(--surface-2);
  --w-e-modal-button-border-color: var(--line-strong);
  position: relative;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  transition: border-color 0.15s;
}
.desc-editor:focus-within { border-color: var(--primary); }
.desc-editor .save-hint {
  position: absolute;
  right: 12px;
  bottom: 6px;
  margin: 0;
  pointer-events: none;
}
.desc-toolbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 34px;
  padding: 2px;
}
.desc-insert-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.desc-insert-btn svg { width: 14px; height: 14px; }
.desc-insert-btn:hover { background: var(--surface-3); color: var(--text); }
.desc-editor .desc-editor-toolbar {
  border-bottom: 1px solid var(--line);
  border-radius: 10px 10px 0 0;
  background: var(--surface-2);
}
.desc-empty {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: calc(100% + 20px);
  min-height: 36px;
  margin: 0 -10px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  text-align: left;
  cursor: text;
  transition: background 0.15s, color 0.15s;
}
.desc-empty svg { width: 14px; height: 14px; }
.desc-empty:hover { background: var(--surface-3); color: var(--text-2); }
.desc-preview {
  position: relative;
  padding: 2px 0;
  border-radius: 8px;
}
.desc-edit-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 0;
  padding: 1px 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.desc-edit-link svg { width: 12px; height: 12px; }
.desc-edit-link:hover { color: var(--text-2); background: var(--surface-3); }
.desc-edit-link[hidden] { display: none; }
.desc-preview-body {
  position: relative;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text-2);
  overflow: hidden;
  word-break: break-word;
}
.desc-preview:not(.is-expanded) .desc-preview-body { max-height: 360px; }
.desc-preview.is-clamped:not(.is-expanded) .desc-preview-body {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 72px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 72px), transparent);
}
.desc-preview-body p { margin: 6px 0; }
.desc-preview-body ul, .desc-preview-body ol { margin: 6px 0; padding-left: 22px; }
.desc-preview-body li { margin: 3px 0; }
.desc-preview-body blockquote {
  margin: 8px 0;
  padding: 4px 12px;
  border-left: 3px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
}
.desc-preview-body pre {
  margin: 8px 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface);
  overflow-x: auto;
  font-size: 12.5px;
}
.desc-preview-body code {
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--surface);
  font-size: 12.5px;
}
.desc-preview-body pre code { padding: 0; background: transparent; }
.desc-preview-body table { margin: 8px 0; max-width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.desc-preview-body th, .desc-preview-body td { padding: 4px 10px; border: 1px solid var(--line); }
.desc-preview-body img { max-width: 100%; border-radius: 6px; }
.desc-preview-body video { display: block; max-width: 100%; margin: 8px 0; border-radius: 6px; }
.desc-media-zoom { cursor: zoom-in; }
/* 预览态图片 / 视频的大图查看层 */
.media-viewer {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 40px 40px;
  background: rgba(10, 13, 20, 0.86);
  backdrop-filter: blur(3px);
  animation: fadeIn 0.15s ease;
}
.media-viewer-img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  cursor: zoom-out;
}
.media-viewer-video {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  background: #000;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}
.media-viewer-close {
  position: fixed;
  top: 16px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
}
.media-viewer-close:hover { background: rgba(255, 255, 255, 0.22); }
.media-viewer-close svg { width: 18px; height: 18px; }
.desc-preview-body a { color: var(--primary); text-underline-offset: 2px; word-break: break-all; }
.desc-preview-body hr { margin: 12px 0; border: 0; border-top: 1px solid var(--line); }
.desc-more {
  display: flex;
  align-items: center;
  gap: 2px;
  width: max-content;
  margin: 4px auto 0;
  padding: 2px 8px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  transition: color 0.12s, background 0.12s;
}
.desc-more svg { width: 13px; height: 13px; transition: transform 0.15s; }
.desc-more:hover { background: var(--surface-3); }
.desc-more.is-expanded svg { transform: rotate(180deg); }
.desc-more[hidden] { display: none; }
/* 展开全文后，「收起」固定在可视区底部，长内容滚动时始终可点 */
.desc-preview.is-expanded .desc-more {
  position: sticky;
  bottom: 12px;
  z-index: 4;
  width: fit-content;
  margin: 10px auto 0;
  padding: 6px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}
.desc-preview.is-expanded .desc-more:hover { background: var(--surface-3); }
.desc-editor .w-e-toolbar { padding: 0 4px; border: 0; background: transparent; }
.desc-editor .w-e-bar-item { height: 34px; padding: 2px; }
.desc-editor .w-e-bar-item button { height: 28px; padding: 0 6px; border-radius: 6px; }
.desc-editor .w-e-bar-divider { height: 22px; align-self: center; }
.desc-editor .w-e-text-container { background: transparent; color: var(--text-2); }
.desc-editor .w-e-text-container .w-e-scroll { min-height: 140px; max-height: 46vh; overflow-y: auto; }
.desc-editor .w-e-text-container [data-slate-editor] {
  min-height: 140px;
  padding: 10px 12px 24px;
  font-size: 13.5px;
  line-height: 1.7;
}
.desc-editor .w-e-text-container [data-slate-editor] p { margin: 6px 0; }
.desc-editor .w-e-text-container [data-slate-editor] li { margin: 3px 0; }
.desc-editor .w-e-text-container [data-slate-editor] a { color: var(--primary); }
.desc-editor .w-e-text-placeholder {
  top: 11px;
  left: 12px;
  right: 12px;
  width: auto;
  font-size: 13.5px;
  line-height: 1.7;
  font-style: normal;
}
.desc-editor .w-e-select-list,
.desc-editor .w-e-drop-panel,
.desc-editor .w-e-modal {
  border-radius: 8px;
  box-shadow: var(--shadow-md);
}
.desc-editor .w-e-text-container [data-slate-editor] blockquote { border-radius: 6px; }
.desc-editor .w-e-text-container [data-slate-editor] img,
.desc-editor .w-e-text-container [data-slate-editor] video { max-width: 100%; }
.desc-editor .w-e-text-container [data-slate-editor] a { color: var(--primary); }

.subtask {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 8px;
  margin: 0 -8px;
}
.subtask:hover { background: var(--surface-2); }
.subtask.done .subtask-title { color: var(--muted); text-decoration: line-through; }
.subtask-title { font-size: 13px; }
.subtask .avatar { margin-left: auto; }
.subtask .sub-due { font-size: 11.5px; color: var(--muted); }
.subtask-input {
  width: 100%;
  height: 32px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 0 10px;
  background: transparent;
  font-size: 12.5px;
  outline: none;
  margin-top: 6px;
}
.subtask-input:focus { border-color: var(--primary); border-style: solid; }

.attachment-list { display: flex; flex-direction: column; gap: 6px; }
.attachment {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 12.5px;
}
.attachment .att-icon { color: var(--muted); display: flex; }
.attachment .att-icon svg { width: 16px; height: 16px; }
.attachment .att-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.attachment .att-size { color: var(--muted); font-size: 11px; }
.attachment .icon-btn { opacity: 0; }
.attachment:hover .icon-btn { opacity: 1; }

.info-card .info-attach { margin-top: 14px; }
.link-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.link-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 10px;
}
.link-col-head { display: flex; align-items: center; gap: 6px; }
.link-col-name { font-size: 12px; font-weight: 650; color: var(--text-2); }
.link-col-head .count { font-size: 11px; color: var(--muted); }
.link-col-head .link-add { margin-left: auto; background: var(--surface); }
.link-col-head .link-add:hover { background: var(--surface-3); }
.link-col-list { display: flex; flex-direction: column; gap: 6px; }
.link-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.link-row .link-icon { display: flex; flex: none; color: var(--muted); }
.link-row .link-icon svg { width: 15px; height: 15px; }
.link-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.link-title { font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-title:hover { color: var(--primary); }
.link-meta { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-row .icon-btn { flex: none; opacity: 0; }
.link-row:hover .icon-btn { opacity: 1; }
.link-empty { font-size: 12.5px; padding: 2px 0; }
.link-source-hint { font-size: 12px; color: var(--muted); min-height: 18px; }
@media (max-width: 700px) {
  .link-cols { grid-template-columns: minmax(0, 1fr); }
}

.comment { display: flex; gap: 10px; padding: 10px 0; }
.comment-body { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: baseline; gap: 8px; }
.comment-name { font-size: 12.5px; font-weight: 650; }
.comment-time { font-size: 11px; color: var(--muted); }
.comment-content { font-size: 13px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; margin-top: 2px; color: var(--text-2); }
.comment-del { font-size: 11px; color: var(--muted); opacity: 0; }
.comment:hover .comment-del { opacity: 1; }
.comment-del:hover { color: var(--danger); }
.comment-compose {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}
.comment-compose textarea {
  flex: 1;
  min-height: 60px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  outline: none;
  font-size: 13px;
  line-height: 1.55;
  background: var(--surface);
}
.comment-compose textarea:focus { border-color: var(--primary); }
.comment-compose .compose-actions { display: flex; flex-direction: column; gap: 6px; justify-content: flex-end; }

/* ---------------------------------------------------------------- popover & modal */
.popover {
  position: fixed;
  z-index: 120;
  min-width: 190px;
  max-width: 300px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: var(--shadow-md);
  padding: 6px;
  animation: popIn 0.12s ease;
  max-height: 60vh;
  overflow: auto;
}
@keyframes popIn { from { transform: translateY(-4px); opacity: 0; } to { transform: none; opacity: 1; } }
.popover-title { font-size: 11px; color: var(--muted); font-weight: 600; padding: 6px 9px 4px; }
.popover-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 9px;
  border-radius: 7px;
  font-size: 12.5px;
  text-align: left;
  color: var(--text-2);
}
.popover-item:hover { background: var(--surface-2); color: var(--text); }
.popover-item.danger { color: var(--danger); }
.popover-item.danger:hover { background: var(--danger-soft); }
.popover-sep { height: 1px; background: var(--line); margin: 5px 4px; }
.popover-empty { padding: 10px; text-align: center; color: var(--muted); font-size: 12px; }

/* date picker (参考 Teambition) */
.popover.datepicker-pop {
  width: 296px;
  min-width: 296px;
  max-width: 296px;
  max-height: none;
  padding: 12px;
  border-radius: 14px;
  border-color: transparent;
  box-shadow: var(--shadow-lg);
  overflow: visible;
}
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dp-title { font-size: 13.5px; font-weight: 650; color: var(--text); letter-spacing: 0.01em; }
.dp-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}
.dp-nav-btn:hover { background: var(--surface-2); color: var(--text); }
.dp-nav-btn svg { width: 14px; height: 14px; }
.dp-quick-row { display: flex; gap: 6px; margin-bottom: 9px; }
.dp-quick {
  flex: 1;
  height: 26px;
  padding: 0 2px;
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 11.5px;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.dp-quick:hover { background: var(--primary-soft); color: var(--primary); }
.dp-quick:disabled { opacity: 0.4; cursor: not-allowed; background: var(--surface-2); color: var(--text-2); }
.dp-quick.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.dp-week { display: grid; grid-template-columns: repeat(7, 1fr); margin-bottom: 3px; }
.dp-week span { text-align: center; font-size: 11px; font-weight: 600; color: var(--muted); }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-day {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 33px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  transition: background 0.12s, color 0.12s;
}
.dp-day:hover { background: var(--primary-soft); color: var(--primary); }
.dp-day:disabled { color: var(--muted); opacity: 0.35; cursor: not-allowed; background: none; }
.dp-day.other { color: var(--muted); opacity: 0.55; }
.dp-day.today { color: var(--primary); font-weight: 700; }
.dp-day.selected,
.dp-day.selected:hover { background: var(--primary); color: #fff; font-weight: 650; }
.dp-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.dp-clear {
  height: 30px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}
.dp-clear:hover { background: var(--surface-2); color: var(--text); }
.dp-ok {
  height: 30px;
  padding: 0 18px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  transition: background 0.15s, opacity 0.15s;
}
.dp-ok:hover { background: var(--primary-ink); }
.dp-ok:disabled { opacity: 0.4; cursor: default; }
.popover-item.status-item .pref-radio { width: 16px; height: 16px; }
.popover-item.status-item .pref-radio svg { width: 10px; height: 10px; }
.popover-item.status-item.active .pref-radio { background: var(--primary); border-color: var(--primary); color: #fff; }
.status-text { display: flex; flex-direction: column; gap: 1px; }
.status-text small { font-size: 11px; color: var(--muted); font-weight: 400; }
/* 分组菜单的二级菜单 */
.popover.group-menu-pop { overflow: visible; }
.popover-submenu-wrap { position: relative; }
.popover-item.has-submenu .submenu-tail {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
}
.popover-item.has-submenu .submenu-tail svg { width: 13px; height: 13px; }
.popover-submenu-wrap > .popover-submenu {
  display: none;
  position: absolute;
  left: calc(100% - 2px);
  top: -6px;
  min-width: 220px;
  max-height: none;
  z-index: 121;
}
.popover-submenu-wrap.flip > .popover-submenu { left: auto; right: calc(100% - 2px); }
.popover-submenu-wrap:hover > .popover-submenu,
.popover-submenu-wrap:focus-within > .popover-submenu { display: block; }
/* 分组颜色二级菜单 */
.popover-submenu.color-submenu { min-width: 0; width: max-content; padding: 10px 12px; }
.color-submenu .color-swatches { flex-wrap: nowrap; gap: 8px; }
.color-submenu .swatch { width: 22px; height: 22px; border-radius: 7px; flex: none; }
.popover-item.has-submenu .submenu-tail .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
}
.check-item { cursor: pointer; }
.check-item .check-box {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  border: 1.5px solid var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  color: transparent;
}
.check-item .check-box svg { width: 10px; height: 10px; }
.check-item.on .check-box { background: var(--primary); border-color: var(--primary); color: #fff; }
.check-item .ci-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.check-item .ci-pos { font-size: 11px; color: var(--muted); margin: 0 2px; white-space: nowrap; }
.popover.checklist-pop { min-width: 240px; max-width: 280px; }
.picker-search {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  margin: 2px 3px 6px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.picker-search > svg { width: 13px; height: 13px; color: var(--muted); flex: none; }
.picker-search input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  padding: 0;
  font-size: 12px;
  color: var(--text);
}
.picker-search input::placeholder { color: var(--muted); }
.picker-search:focus-within { border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 3px var(--primary-soft); }
.picker-list { max-height: 232px; overflow-y: auto; }
.popover-input-row { display: flex; gap: 6px; padding: 5px 4px 3px; }
.popover-input-row input {
  flex: 1;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 9px;
  font-size: 12px;
  outline: none;
  background: var(--surface);
  min-width: 0;
}
.popover-input-row input:focus { border-color: var(--primary); }
.popover-foot { display: flex; justify-content: flex-end; gap: 6px; padding: 5px 4px 3px; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 18, 32, 0.45);
  z-index: 90;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 9vh 16px 16px;
  animation: fadeIn 0.15s ease;
  backdrop-filter: blur(2px);
}
.modal {
  width: 460px;
  max-width: 100%;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  animation: popIn 0.16s ease;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
}
.modal-wide { width: 640px; }
.modal-head { display: flex; align-items: center; padding: 18px 22px 0; }
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 700; }
.modal-head .icon-btn { margin-left: auto; }
.modal-body { padding: 16px 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 22px 20px; }
.form-field { margin-bottom: 14px; }
.form-field label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.form-field input, .form-field textarea, .form-field select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 9px 11px;
  outline: none;
  font-size: 13px;
  background: var(--surface);
}
.form-field input:focus, .form-field textarea:focus, .form-field select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.form-field textarea { min-height: 74px; resize: vertical; }
.color-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  border: 2px solid transparent;
  transition: transform 0.15s;
}
.swatch:hover { transform: scale(1.08); }
.swatch.active { transform: scale(1.02); }
.swatch.active::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 9px;
  height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  border-radius: 1px;
  transform: translate(-50%, -60%) rotate(-45deg);
  filter: drop-shadow(0 0 1px rgba(15, 23, 42, 0.45));
  pointer-events: none;
}
.swatch:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.danger-zone { border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--line)); border-radius: 10px; padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.danger-zone .dz-text { flex: 1; }
.danger-zone .dz-title { font-size: 13px; font-weight: 600; color: var(--danger); }
.danger-zone .dz-sub { font-size: 11.5px; color: var(--muted); }
.member-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.member-row:last-child { border-bottom: none; }
.member-row .mr-name { font-size: 13px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member-row .mr-handle { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.role-pill { flex: none; white-space: nowrap; font-size: 10.5px; padding: 1px 7px; border-radius: 10px; background: var(--surface-2); color: var(--muted); }
.role-pill.admin { background: var(--primary-soft); color: var(--primary-ink); }
.role-pill.demo { background: var(--warn-soft, #fdf0dd); color: var(--warn-ink, #9a6a1f); }
.owner-select {
  height: 30px;
  max-width: 190px;
  border: 0;
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 12.5px;
  padding: 0 8px;
  outline: none;
  text-overflow: ellipsis;
}
.owner-select:focus { box-shadow: 0 0 0 3px var(--primary-soft); }
.pos-select { width: 116px; }
.modal-sep { height: 1px; background: var(--line); margin: 14px 0; }
.member-add { display: flex; gap: 8px; }
.member-add select { flex: 1; }

/* ---------------------------------------------------------------- create task modal（参考 Teambition） */
.create-task-modal { width: 640px; }
.create-task-modal .modal-head { padding: 16px 24px 0; }
.create-task-modal .modal-head h3 { font-size: 15px; }
.create-task-modal .modal-body { padding: 0 24px 18px; }
.create-task-modal .modal-foot { align-items: center; padding: 0 24px 20px; }
.ctm-title {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 22px;
  font-weight: 600;
  padding: 22px 0 12px;
}
.ctm-title::placeholder { color: color-mix(in srgb, var(--muted) 68%, transparent); font-weight: 500; }
.ctm-chips { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 16px; }
.ctm-chip-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-height: 30px; }
.ctm-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  max-width: 260px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.ctm-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctm-chip > svg { width: 14px; height: 14px; color: var(--muted); flex: none; }
.ctm-chip:hover { border-color: var(--line-strong); background: var(--surface-2); }
.ctm-chip:disabled { cursor: default; opacity: 1; }
.ctm-chip:disabled:hover { border-color: var(--line); background: var(--surface); }
.ctm-chip.is-set { color: var(--text); border-color: color-mix(in srgb, var(--primary) 28%, var(--line)); background: var(--primary-soft); }
.ctm-chip.is-set > svg { color: var(--primary-ink); }
.ctm-chip .avatar-xs { width: 18px; height: 18px; font-size: 9px; }
.ctm-chip-ghost {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px dashed var(--line-strong);
  background: var(--surface-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  flex: none;
}
.ctm-chip-ghost svg { width: 10px; height: 10px; }
.ctm-divider { height: 1px; background: var(--line); margin: 0 -24px 16px; }
.ctm-section { margin-bottom: 10px; }
.ctm-section-label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.ctm-count { color: var(--muted); font-weight: 500; }
.ctm-help {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: none;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  position: relative;
}
.ctm-help::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(2px);
  background: #1e2534;
  color: #fff;
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.4;
  padding: 6px 10px;
  border-radius: 7px;
  box-shadow: 0 6px 18px rgba(13, 18, 32, 0.22);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
  z-index: 5;
}
.ctm-help:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }
.ctm-participants { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; min-height: 28px; }
.ctm-avatar { width: 28px; height: 28px; font-size: 12px; }
.ctm-add-participant {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px color-mix(in srgb, var(--primary) 35%, transparent);
}
.ctm-add-participant svg { width: 14px; height: 14px; }
.ctm-add-participant:hover { filter: brightness(1.06); }
.popover-item .ci-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------------- empty & toast */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 56px 20px;
  text-align: center;
  color: var(--muted);
}
.empty .empty-icon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.empty .empty-icon svg { width: 24px; height: 24px; }
.empty-title { font-size: 14px; font-weight: 600; color: var(--text-2); }
.empty-sub { font-size: 12.5px; }

#toast-root {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  animation: toastIn 0.2s ease;
  max-width: 70vw;
}
.toast-icon { width: 15px; height: 15px; flex: none; color: var(--primary); }
.toast.ok .toast-icon { color: var(--ok); }
.toast.error .toast-icon { color: var(--danger); }
.toast-text { min-width: 0; }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1024px) {
  .overview-grid { grid-template-columns: repeat(2, 1fr); }
  .overview-cols { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .task-search.open { width: 156px; }
  .task-search.open input { width: 90px; }
  .topbar {
    height: auto;
    min-height: var(--topbar-h);
    flex-wrap: wrap;
    padding: 8px 12px;
    row-gap: 8px;
    gap: 8px 10px;
  }
  .topbar-left { flex: 1 1 auto; min-width: 0; }
  .topbar-right { margin-left: auto; }
  .crumb { display: none; }
  .user-pill { padding: 0; width: 34px; justify-content: center; }
  .user-pill-name { display: none; }
  .pc-members { display: none; }
  .tabs { order: 3; flex-basis: 100%; }
  .tabs .tab span { display: none; }
  .tabs .tab { padding: 0 10px; }
  .page { padding: 20px 16px 40px; }
  .board-wrap { --board-pad-x: 14px; }
  .board { padding: 14px var(--board-pad-x) 8px; }
  .column { width: 82vw; max-width: 320px; }
  .field-grid { grid-template-columns: 1fr; }
  .work-stats { margin-left: 0; width: 100%; }
  .cell-title { max-width: 200px; }
  .task-table th:nth-child(4), .task-table td:nth-child(4),
  .task-table th:nth-child(6), .task-table td:nth-child(6) { display: none; }
}

/* ---------------------------------------------------------------- extras */
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger-solid:hover { background: color-mix(in srgb, var(--danger) 86%, black); border-color: color-mix(in srgb, var(--danger) 86%, black); color: #fff; }
.crumb-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--muted);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.crumb-chip .dot { width: 7px; height: 7px; border-radius: 2px; flex: none; }
.crumb-chip.link { cursor: pointer; }
.crumb-chip.link:hover { color: var(--primary); }
.drawer .work-check { width: 22px; height: 22px; }
.drawer .work-check svg { width: 12px; height: 12px; }
.drawer-head .work-check { margin-right: 2px; }
.subtask-title { cursor: pointer; }
.subtask-title:hover { color: var(--primary); }
.member-add select {
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 9px;
  background: var(--surface);
  font-size: 12.5px;
  outline: none;
  min-width: 0;
}
.member-add select:focus { border-color: var(--primary); }
#d-participants { min-width: 0; }
#d-participants .avatar { width: 20px; height: 20px; font-size: 10px; }
.btn svg { width: 15px; height: 15px; flex: none; }
.popover-item svg { width: 15px; height: 15px; flex: none; }

/* ---------------------------------------------------------------- bento layout */
/* 便当盒：以卡片底色、圆角与间距区隔信息，尽量去掉分隔线。 */
.topbar { background: var(--surface); border-bottom: none; backdrop-filter: none; }

.btn:not(.btn-primary):not(.btn-danger-solid):not(.btn-danger):not(.btn-ghost):not(.btn-white) {
  border-color: transparent;
  background: var(--surface-2);
}
.btn:not(.btn-primary):not(.btn-danger-solid):not(.btn-danger):not(.btn-ghost):not(.btn-white):hover {
  background: var(--surface-3);
}
.btn-ghost { background: transparent; }


.task-card { border: none; }
.task-card:hover { border: none; }
.board-add-group { border: none; background: var(--surface-2); }
.board-add-group:hover { background: var(--surface-3); border: none; color: var(--primary); }

.login-card { border: none; }
.login-field input,
.login-field select { border-color: transparent; background: var(--surface-2); }
.login-field input:focus,
.login-field select:focus { border-color: var(--primary); background: var(--surface); }
.login-demo {
  margin-top: 20px;
  padding: 11px 13px;
  border-top: none;
  background: var(--surface-2);
  border-radius: 10px;
  align-items: center;
}
.login-demo .btn-ghost {
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 8px;
  font-weight: 500;
}
.login-demo .btn-ghost:hover { background: var(--primary-soft, var(--surface)); color: var(--primary); }

.form-field input, .form-field textarea, .form-field select {
  border-color: transparent;
  background: var(--surface-2);
}
.form-field input:focus, .form-field textarea:focus, .form-field select:focus {
  border-color: var(--primary);
  background: var(--surface);
}
.member-add select { border: none; background: var(--surface-2); }
.member-add select:focus { background: var(--surface); }
.popover { border: none; }

.add-chip { border: 1px dashed var(--line-strong); background: transparent; }
.add-chip:hover { color: var(--primary); border-color: var(--primary); background: transparent; }
.add-chip svg { width: 12px; height: 12px; flex: none; }

/* work: bento totals */
.work-top {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 26px;
  align-items: stretch;
}
.work-hero { margin-bottom: 0; border: none; box-shadow: var(--shadow-sm); }
.work-stats {
  margin-left: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.stat-card { border: none; box-shadow: var(--shadow-sm); }
.stat-card.mini { padding: 12px 16px; display: flex; flex-direction: column; justify-content: center; }
.stat-card.mini .stat-value { font-size: 23px; margin-top: 1px; }
.stat-card.mini .stat-label { font-size: 11.5px; }
.stat-value.warn { color: var(--warn); }
.stat-value.danger { color: var(--danger); }
.panel { border: none; box-shadow: var(--shadow-sm); }

.work-list { display: flex; flex-direction: column; gap: 8px; background: none; border: none; border-radius: 0; overflow: visible; }
.work-item {
  background: var(--surface);
  border-bottom: none;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  padding: 12px 16px;
}
.work-item:hover { background: var(--surface); box-shadow: var(--shadow-md); }
.work-item:last-child { border-bottom: none; }

/* list: card rows instead of dividers */
.task-table {
  border-collapse: separate;
  border-spacing: 0 8px;
  margin-top: -8px;
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
}
.task-table th { background: transparent; border-bottom: none; padding: 8px 16px; }
.task-table td { background: var(--surface); border-bottom: none; padding: 12px 16px; }
.task-table td:first-child { border-radius: 12px 0 0 12px; }
.task-table td:last-child { border-radius: 0 12px 12px 0; }
.task-table tbody tr:hover { background: transparent; }
.task-table tbody tr:hover td { background: var(--surface-2); }
.task-table tr:last-child td { border-bottom: none; }

/* activity & member rows as pills */
.activity-item { border-bottom: none; background: var(--surface-2); border-radius: 10px; padding: 9px 12px; margin-bottom: 6px; }
.activity-item:last-child { border-bottom: none; margin-bottom: 0; }
.member-load { border-bottom: none; background: var(--surface-2); border-radius: 10px; padding: 9px 12px; margin-bottom: 6px; }
.member-load:last-child { border-bottom: none; margin-bottom: 0; }

/* timeline as stacked cards */
.timeline { padding-left: 0; }
.timeline::before { display: none; }
.timeline-day { margin: 18px 0 8px; }
.timeline-item { background: var(--surface); border-radius: 12px; padding: 12px 16px; margin-bottom: 8px; box-shadow: var(--shadow-sm); }
.timeline-item::before { display: none; }

/* drawer: field tiles and section cards */
.drawer-head { border-bottom: none; }
.field-grid { gap: 10px; }
.field { background: var(--surface-2); border-radius: 11px; padding: 9px 11px 11px; }
.field select, .field input[type="date"], .field input[type="text"] {
  background: var(--surface);
  border-color: transparent;
}
.field select:focus, .field input:focus { border-color: var(--primary); }
.section {
  border-top: none;
  background: var(--surface-2);
  border-radius: 14px;
  padding: 16px 16px 8px;
  margin-top: 12px;
}
.section-head { margin-bottom: 10px; }
.desc-edit { border-color: transparent; background: var(--surface); }
.desc-edit:focus { border-color: var(--primary); }
.desc-view:hover { background: var(--surface); }
.subtask { border-radius: 9px; }
.subtask:hover { background: var(--surface); }
.subtask-input { border: 1px solid transparent; background: var(--surface); }
.subtask-input:focus { border-color: var(--primary); }
.attachment { background: var(--surface); border: none; }
.comment { background: var(--surface); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.comment-compose { border-top: none; padding-top: 0; margin-top: 12px; }
.comment-compose textarea { border-color: transparent; background: var(--surface); }
.comment-compose textarea:focus { border-color: var(--primary); }

/* members modal */
.member-row { border-bottom: none; background: var(--surface-2); border-radius: 10px; padding: 9px 12px; margin-bottom: 6px; }
.member-row:last-child { border-bottom: none; margin-bottom: 0; }
.modal-sep { height: 12px; background: transparent; margin: 0; }

@media (max-width: 900px) {
  .work-top { grid-template-columns: 1fr; }
  .work-stats { width: 100%; }
}

/* list cells should not wrap into vertical text */
.task-table td { white-space: nowrap; }
.task-table td.cell-title { white-space: normal; min-width: 220px; }
.task-table td .row { white-space: nowrap; }
.group-chip { white-space: nowrap; }
.due-text, .prio-text { white-space: nowrap; }
.board-add-group svg { width: 16px; height: 16px; flex: none; }
.popover-sep { height: 8px; background: transparent; margin: 0; }

/* ---------------------------------------------------------------- task detail modes & activity feed */
.drawer.mode-drawer { width: min(980px, 100vw); }
.drawer.mode-modal {
  top: 50%;
  left: 50%;
  right: auto;
  bottom: auto;
  transform: translate(-50%, -50%);
  width: min(1120px, calc(100vw - 64px));
  height: min(880px, calc(100vh - 64px));
  border-radius: 18px;
  animation: modalPop 0.22s cubic-bezier(0.2, 0.8, 0.3, 1);
}
@keyframes modalPop {
  from { opacity: 0; transform: translate(-50%, -48%) scale(0.98); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.detail-cols { display: grid; grid-template-columns: minmax(0, 1fr) 352px; gap: 22px; align-items: start; }
.detail-main { min-width: 0; }

.feed-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-self: stretch;
  height: auto;
  max-height: none;
  min-height: 0;
  background: var(--surface-2);
  border-radius: 16px;
  padding: 14px;
}
.feed-head { display: flex; align-items: center; gap: 8px; padding: 0 2px; flex: none; }
.feed-head h4 { margin: 0; font-size: 13px; font-weight: 650; }
.feed-count { font-size: 11.5px; color: var(--muted); }
.participants-btn {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  min-width: 0;
  padding: 2px 6px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.participants-btn:hover { background: var(--surface); color: var(--primary); }
.feed-composer { display: flex; gap: 9px; align-items: flex-start; flex: none; }
.feed-compose-box { flex: 1; min-width: 0; background: var(--surface); border-radius: 12px; padding: 8px; }
.feed-compose-box textarea {
  width: 100%;
  min-height: 52px;
  resize: vertical;
  border: none;
  outline: none;
  background: transparent;
  font-size: 12.5px;
  line-height: 1.55;
}
.feed-compose-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.feed-compose-actions .muted { font-size: 10.5px; }
.feed-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  flex: 1 1 auto;
  padding-right: 10px;
  scrollbar-gutter: stable;
}
.log-item {
  border-radius: 12px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  column-gap: 9px;
  align-items: start;
}
.log-comment { padding: 5px 2px; }
.log-comment > .avatar { justify-self: center; align-self: start; margin-top: 1px; }
.log-head-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.log-head-line .log-time { margin-left: auto; white-space: nowrap; }
.log-name { font-size: 12px; font-weight: 650; }
.log-pos { font-size: 11px; color: var(--muted); margin-left: 6px; }
.log-time { font-size: 10.5px; color: var(--muted); }
.log-content {
  margin-top: 5px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-2);
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--surface);
  border-radius: 10px;
  padding: 8px 10px;
  box-shadow: var(--shadow-sm);
}
.log-comment .comment-del { margin-left: auto; }
.log-system { padding: 5px 2px; }
.log-icon {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.log-icon svg { width: 13px; height: 13px; }
.log-body { min-width: 0; }
.log-text { font-size: 12px; line-height: 1.5; color: var(--text-2); margin-top: 2px; }
.action-completed { color: var(--ok); }
.action-created { color: var(--primary); }
.action-moved { color: var(--primary); }
.action-reopened { color: var(--primary); }
.action-attached { color: var(--warn); }
.action-assigned { color: var(--purple); }

@media (max-width: 880px) {
  .detail-cols { grid-template-columns: minmax(0, 1fr); }
  .feed-panel { position: static; height: auto; max-height: none; }
  .feed-list { overflow: visible; }
}
@media (max-width: 700px) {
  .drawer.mode-modal {
    top: 0;
    left: 0;
    right: auto;
    bottom: auto;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    transform: none;
    animation: fadeIn 0.18s ease;
  }
  .detail-cols { gap: 14px; }
  .feed-panel { padding: 12px; }
}
.log-comment .comment-del { opacity: 0; }
.log-comment:hover .comment-del { opacity: 1; }

/* ---------------------------------------------------------------- task info card (方案 A) */
.info-card { background: var(--surface-2); border-radius: 14px; padding: 15px 18px; margin-bottom: 14px; }
.info-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 30px; }
.info-row { min-width: 0; display: flex; align-items: center; gap: 10px; }
.info-row > label { flex: none; width: 72px; display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 500; color: var(--muted); margin-bottom: 0; }
.info-row > label > svg { width: 13px; height: 13px; flex: none; stroke-width: 1.7; }
.info-control { position: relative; display: flex; align-items: center; gap: 6px; min-height: 24px; min-width: 0; flex: 1; }
.info-control select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-height: 24px;
  border: 0;
  background: transparent;
  padding: 0 20px 0 0;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  outline: none;
  cursor: pointer;
}
.info-control select:hover { background: color-mix(in srgb, var(--surface) 62%, transparent); }
.info-control select.is-done { color: var(--ok); font-weight: 600; }
.info-control select:focus-visible { box-shadow: 0 0 0 3px var(--primary-soft); }
.info-control input[type="date"] {
  width: 100%;
  min-height: 24px;
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 13.5px;
  color: var(--text);
  outline: none;
}
.info-control input[type="date"]:focus-visible { box-shadow: 0 0 0 3px var(--primary-soft); border-radius: 6px; }
.date-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 24px;
  padding: 1px 6px;
  margin-left: -6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  text-align: left;
  transition: background 0.15s, color 0.15s;
}
.date-trigger svg { width: 14px; height: 14px; color: var(--muted); flex: none; }
.date-trigger span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.date-trigger:hover { background: color-mix(in srgb, var(--surface) 62%, transparent); }
.date-trigger:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-soft); }
.date-trigger.is-empty { color: var(--muted); font-weight: 400; }
.date-trigger.is-empty svg { color: var(--muted); }
.info-chev {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  color: var(--muted);
  pointer-events: none;
}
.info-chev svg { width: 13px; height: 13px; }
.info-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  padding: 0 20px 0 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 13.5px;
  cursor: pointer;
}
.info-button:hover { color: var(--primary); }
.info-button .avatar { width: 20px; height: 20px; font-size: 10px; }
.info-card .field-tag-list { margin-top: 13px; }
.content-card { background: var(--surface-2); border-radius: 14px; padding: 18px; }
/* 长描述滚动时「描述」标题行吸顶，并在富文本下方预留一段空间给「子任务」 */
.desc-section { padding-bottom: 20px; }
.desc-section .section-head {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: -10px 0 8px;
  padding: 10px 0;
  background: var(--surface-2);
}
.content-section + .content-section { margin-top: 22px; }
.content-section .section-head { margin-bottom: 8px; }
@media (max-width: 900px) {
  .info-grid { grid-template-columns: minmax(0, 1fr); }
}
.content-card [data-act="upload"] { background: var(--surface); }
.content-card [data-act="upload"]:hover { background: var(--surface-3); }

/* 标题与操作同排，右侧动态面板与左栏等高 */
.detail-top { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.detail-top .task-title-input { flex: 1; min-width: 0; margin: 0; }
.detail-top .drawer-actions { margin-left: 0; flex: none; padding-top: 2px; }
.parent-crumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  width: fit-content;
  align-self: flex-start;
  margin: 2px 0 12px;
  padding: 2px 4px 2px 0;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--primary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s;
}
.parent-crumb:hover { color: var(--primary-ink); }
.parent-crumb-icon { width: 14px; height: 14px; flex: none; }
.parent-crumb-title { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.parent-crumb-badge {
  flex: none;
  padding: 1px 6px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary-ink);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.detail-cols { align-items: stretch; }

/* 操作按钮单独一行，标题独占整行；宽屏下内容向下填满详情高度 */
.detail-actions { display: flex; justify-content: flex-end; align-items: center; gap: 4px; margin-bottom: 4px; flex: none; }
.detail-actions .work-check { width: 22px; height: 22px; }

/* 标题与操作按钮同一行：标题靠左，操作靠最右；滚动时固定在顶部 */
.detail-head-row {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: none;
  margin: 0 -24px 14px;
  padding: 20px 24px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.detail-head-row .task-title-input { flex: 1; min-width: 0; margin: 0; }
.detail-head-row .drawer-actions { display: flex; align-items: center; gap: 4px; flex: none; padding-top: 2px; }

/* 宽屏：标题固定在顶部，左栏独立滚动，右栏动态卡片自适应填满剩余高度 */
@media (min-width: 881px) {
  .drawer-body { display: flex; flex-direction: column; overflow: hidden; padding-bottom: 24px; }
  .detail-head-row { position: static; }
  .detail-cols { flex: 1; min-height: 0; grid-auto-rows: minmax(0, 1fr); }
  .detail-main { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; padding-bottom: 8px; border-radius: 16px; }
  .content-card { flex: 1 0 auto; }
  .feed-list { min-height: 0; }
}

/* ---------------------------------------------------------------- MVP hardening */
.popover-item:disabled { opacity: 0.4; cursor: default; pointer-events: none; }
.owner-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
/* 需压过 .form-field select 的 width/padding/font-size，否则高度被撑裂、文字重叠 */
.owner-row .owner-select {
  flex: 0 1 auto;
  width: auto;
  min-width: 100px;
  height: 32px;
  max-width: 190px;
  border: 0;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 12.5px;
  padding: 0 8px;
  text-overflow: ellipsis;
  outline: none;
}
.owner-row .owner-select:focus { border: 0; background: var(--surface); box-shadow: 0 0 0 3px var(--primary-soft); }
.owner-row .btn { flex: none; white-space: nowrap; }
.team-create {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  align-items: end;
}
.team-create .form-field { margin: 0; }
.team-admin-check {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-2);
}
.team-admin-check input { accent-color: var(--primary); }
.team-create #nu-create { grid-column: 1 / -1; justify-self: start; }
.team-row { margin-bottom: 6px; flex-wrap: wrap; row-gap: 8px; }
.team-row .mr-info { flex: 1 1 150px; min-width: 150px; }
.team-row .mr-actions { flex: none; display: flex; align-items: center; gap: 6px; margin-left: auto; }
.team-row .mr-actions .muted { white-space: nowrap; }
.team-row .pos-select { flex: none; }
.team-row .btn { flex: none; white-space: nowrap; }
.team-list { display: flex; flex-direction: column; }
.trash-item .work-title { color: var(--text); text-decoration: none; }
.trash-item .work-side { gap: 6px; }
@media (max-width: 1300px) {
  .tabs .tab span { display: none; }
  .tabs .tab { padding: 0 10px; }
}
@media (max-width: 600px) {
  .team-create { grid-template-columns: 1fr; }
}
.team-create .team-password { grid-column: 1 / -1; }
.icon-btn.active-soft { background: var(--primary-soft); color: var(--primary-ink); }

/* ---------------------------------------------------------------- notifications */
.notify-btn { position: relative; }
.notify-badge {
  position: absolute;
  top: -3px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--surface);
}
.notify-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px 8px;
  font-size: 12.5px;
  font-weight: 650;
}
.notify-read-all {
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}
.notify-list { display: flex; flex-direction: column; gap: 2px; max-height: 420px; overflow-y: auto; }
.notify-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  padding: 9px 8px;
  border-radius: 9px;
  text-align: left;
  color: var(--text-2);
}
.notify-item:hover { background: var(--surface-2); }
.notify-item.unread { background: color-mix(in srgb, var(--primary) 7%, transparent); }
.notify-dot { width: 6px; height: 6px; border-radius: 50%; background: transparent; margin-top: 8px; flex: none; }
.notify-item.unread .notify-dot { background: var(--primary); }
.notify-icon { width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.notify-icon svg { width: 12px; height: 12px; }
.notify-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.notify-text { font-size: 12.5px; line-height: 1.45; }
.notify-time { font-size: 10.5px; color: var(--muted); }

/* ---------------------------------------------------------------- comment mentions & edit */
.mention {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  border-radius: 4px;
  padding: 0 2px;
  font-weight: 550;
}
.comment-actions { display: flex; align-items: center; gap: 8px; opacity: 0; flex: none; }
.log-comment:hover .comment-actions { opacity: 1; }
.comment-edit { font-size: 11px; color: var(--muted); }
.comment-edit:hover { color: var(--primary); }
.comment-actions .comment-del { margin-left: 0; }

/* ---------------------------------------------------------------- filters */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: none;
}
.board-wrap > .filter-bar { padding: 12px var(--board-pad-x) 0 calc(var(--board-pad-x) + var(--board-inset)); }
.page > .filter-bar { margin-bottom: 12px; }

/* 快捷筛选：所有任务 / 我负责的 / 我创建的 / 我参与的（参考 Teambition） */
.quick-filters { display: flex; align-items: center; gap: 4px; flex: none; flex-wrap: wrap; }
.quick-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.quick-filter:hover { background: var(--surface-2); color: var(--text); }
.quick-filter.active { background: var(--primary-soft); color: var(--primary-ink); font-weight: 600; }
.quick-filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.quick-filter.active .quick-filter-count { background: color-mix(in srgb, var(--primary) 16%, transparent); color: var(--primary-ink); }
.board-wrap > .quick-filters { padding: 12px var(--board-pad-x) 0 calc(var(--board-pad-x) + var(--board-inset)); }
.page > .quick-filters { margin-bottom: 14px; }
.filter-bar-label { font-size: 11px; font-weight: 600; color: var(--muted); margin-right: 2px; }
.filter-chip-conn { font-size: 12px; font-weight: 600; color: var(--muted); padding: 0 1px; }
.filter-chip-conn.is-or { color: var(--primary); }
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 4px 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-2);
  font-size: 12px;
  white-space: nowrap;
}
.filter-chip-x {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.filter-chip-x:hover { background: var(--surface-3); color: var(--text); }
.filter-chip-x svg { width: 10px; height: 10px; }

/* 条件筛选面板（参考 Teambition：字段 + 运算符 + 值，逐行组合） */
/* 顶部搜索按钮弹出的实时搜索面板（参考 Teambition：边输入边出结果） */

.filter-panel-pop {
  width: 760px;
  max-width: calc(100vw - 24px);
  max-height: none;
  overflow: visible;
  padding: 14px 16px 10px;
  border-radius: 12px;
}
.filter-panel { display: flex; flex-direction: column; gap: 8px; }
.filter-row { display: flex; align-items: center; gap: 8px; }
.filter-lead { flex: none; width: 34px; font-size: 12.5px; font-weight: 650; color: var(--text); }
.filter-lead-wrap { flex: none; width: 34px; }
.filter-lead-btn {
  width: 34px;
  height: 26px;
  border-radius: 7px;
  text-align: left;
  padding: 0 5px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--text);
  transition: background 0.15s, color 0.15s;
}
.filter-lead-btn:hover { background: var(--surface-2); }
.filter-lead-btn.is-or { color: var(--primary); }
.filter-cell-wrap { position: relative; flex: none; }
.filter-cell-wrap.filter-cell-grow { flex: 1; min-width: 0; }
.filter-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 12.5px;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.filter-cell:hover { background: var(--surface-2); border-color: var(--line-strong); color: var(--text); }
.filter-cell > svg { width: 14px; height: 14px; flex: none; }
.filter-cell .filter-chev { width: 12px; height: 12px; color: var(--muted); }
.filter-values { width: 100%; justify-content: flex-start; overflow: hidden; }
.filter-values .filter-chev-end { margin-left: auto; }
.filter-ph { color: var(--muted); }

.filter-val {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 4px 0 6px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12px;
  max-width: 180px;
  overflow: hidden;
  white-space: nowrap;
  flex: none;
}
.filter-val.v-high { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.filter-val.v-mid { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.filter-val.v-low { color: var(--muted); }
.filter-val-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.filter-val .avatar { width: 16px; height: 16px; font-size: 8px; margin-left: -2px; }
.filter-val-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  opacity: 0.55;
  cursor: pointer;
}
.filter-val-x:hover { opacity: 1; background: color-mix(in srgb, currentColor 16%, transparent); }
.filter-val-x svg { width: 8px; height: 8px; }

.filter-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 6;
  min-width: 176px;
  max-width: 260px;
  max-height: 264px;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  padding: 5px;
  animation: popIn 0.12s ease;
}
.filter-menu-title { font-size: 11px; color: var(--muted); font-weight: 600; padding: 5px 8px 3px; }
.filter-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 8px;
  border-radius: 7px;
  font-size: 12.5px;
  color: var(--text-2);
  text-align: left;
}
.filter-menu-item:hover { background: var(--surface-2); color: var(--text); }
.filter-menu-item.on { color: var(--primary); }
.filter-menu-item > svg { width: 14px; height: 14px; flex: none; }
.fm-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-sub { margin-left: 6px; font-size: 11px; color: var(--muted); }
.filter-menu-conn { min-width: 130px; }
.fm-check { display: inline-flex; color: var(--primary); }
.fm-check svg { width: 13px; height: 13px; }
.filter-menu-item .check-box {
  width: 15px;
  height: 15px;
  border-radius: 4px;
  border: 1.5px solid var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  flex: none;
}
.filter-menu-item .check-box svg { width: 9px; height: 9px; }
.filter-menu-item.on .check-box { background: var(--primary); border-color: var(--primary); color: #fff; }
.fm-avatar { margin-left: auto; }
.fm-dot { width: 7px; height: 7px; border-radius: 50%; margin-left: auto; flex: none; }
.filter-menu-empty { padding: 10px; text-align: center; color: var(--muted); font-size: 12px; }

.filter-panel-foot { display: flex; align-items: center; gap: 18px; padding: 4px 2px 2px; }
.filter-add {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 2px;
  border-radius: 6px;
  color: var(--primary);
  font-size: 12.5px;
  font-weight: 550;
}
.filter-add:hover { color: var(--primary-ink); }
.filter-add svg { width: 14px; height: 14px; }
.filter-quick-clear { margin-left: auto; font-size: 12px; color: var(--muted); }
.filter-quick-clear:hover { color: var(--text); }
.filter-empty { font-size: 12.5px; color: var(--muted); padding: 6px 2px; }
.filter-row-x {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.filter-row-x:hover { background: var(--surface-2); color: var(--danger); }
.filter-row-x svg { width: 14px; height: 14px; }

/* 顶栏筛选按钮上的条件数角标 */
.icon-btn { position: relative; }
.filter-count {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 650;
  line-height: 15px;
  text-align: center;
  pointer-events: none;
}

/* ---------------------------------------------------------------- card quick menu */
.card-menu-btn {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.15s, background 0.15s, color 0.15s;
  z-index: 1;
}
.card-menu-btn svg { width: 14px; height: 14px; }
.task-card:hover .card-menu-btn,
.card-menu-btn:focus-visible { opacity: 1; }
.card-menu-btn:hover { background: var(--surface-2); color: var(--text); }
.card-head { padding-right: 44px; }
@media (hover: none) {
  .card-menu-btn { opacity: 1; }
  .comment-actions { opacity: 1; }
}

.notify-list { width: 288px; }
@media (hover: none) {
  .comment-actions .comment-del { opacity: 1; }
}

/* ---------------------------------------------------------------- settings dialog */
.settings-layout {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 20px;
  min-height: 360px;
}
.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-right: 16px;
  border-right: 1px solid var(--line);
}
.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 34px;
  padding: 0 10px;
  border-radius: 9px;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}
.settings-nav-item:hover { background: var(--surface-2); color: var(--text); }
.settings-nav-item.active { background: var(--primary-soft); color: var(--primary-ink); }
.settings-nav-item svg { width: 16px; height: 16px; flex: none; }
.settings-body { min-height: 0; min-width: 0; }
@media (max-width: 560px) {
  .settings-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; min-height: 0; }
  .settings-nav {
    flex-direction: row;
    gap: 6px;
    padding-right: 0;
    padding-bottom: 10px;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .settings-nav-item { flex: 1; justify-content: center; }
}
.settings-block { padding: 14px 0; border-top: 1px solid var(--line); }
.settings-block:first-child { border-top: none; padding-top: 0; }
.settings-label { font-size: 13px; font-weight: 700; }
.settings-field-head { display: flex; align-items: center; gap: 8px; }
.settings-field-head label { margin-bottom: 0; }
.settings-field-head .ps-save-status { margin-left: auto; }
.btn-ghost.btn-primary-ghost { color: var(--primary); }
.btn-ghost.btn-primary-ghost:hover { background: var(--primary-soft); color: var(--primary-ink); }
.settings-desc { font-size: 12px; color: var(--muted); margin-top: 3px; }
.ps-save-status { margin-left: 8px; font-size: 12px; font-weight: 400; color: var(--muted); transition: opacity 0.2s; }
.ps-save-status.is-error { color: var(--danger); }
.settings-avatar-row { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.settings-avatar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.settings-inline { display: flex; gap: 8px; margin-top: 10px; }
.settings-inline input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 9px 11px;
  outline: none;
  font-size: 13px;
  background: var(--surface);
}
.settings-inline input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.pref-options { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.pref-option {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.pref-option:hover { border-color: var(--primary); }
.pref-option.active {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.pref-option:disabled { opacity: 0.6; cursor: default; }
.pref-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  color: #fff;
}
.pref-radio svg { width: 12px; height: 12px; }
.pref-option.active .pref-radio { background: var(--primary); border-color: var(--primary); }
.pref-text { display: flex; flex-direction: column; gap: 2px; }
.pref-name { font-size: 13px; font-weight: 600; }
.pref-desc { font-size: 12px; color: var(--muted); }

/* 团队成员 / 角色权限（设置弹窗） */
.team-toolbar { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; flex-wrap: wrap; }
.team-toolbar input {
  flex: 1 1 180px;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 8px 11px;
  font-size: 13px;
  background: var(--surface);
  outline: none;
}
.team-toolbar input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.team-toolbar .btn { flex: none; }
.team-self {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--primary-ink);
  background: var(--primary-soft);
  border-radius: 8px;
  padding: 1px 6px;
  margin-left: 4px;
}
.team-row-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.team-row .role-select { width: 92px; }
.team-members { width: 100%; border-collapse: collapse; }
.team-members th {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}
.team-members td { padding: 9px 10px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
.team-members tr:last-child td { border-bottom: none; }
.team-members tbody tr:hover { background: var(--surface-2); }
.team-members .who { display: flex; align-items: center; gap: 9px; min-width: 0; }
.team-members .who-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.team-members .who-name { display: flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; }
.team-members .who-handle {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.team-members .col-joined { color: var(--muted); white-space: nowrap; }
.team-members .col-action { width: 104px; text-align: right; white-space: nowrap; }
.team-members .row-disabled { opacity: 0.72; }
.team-ghost {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  height: 28px;
  padding: 0 8px;
  margin-left: -8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  text-align: left;
  transition: border-color 0.12s, background 0.12s;
}
.team-ghost:hover,
.team-ghost:focus-visible {
  border-color: var(--line-strong);
  background: var(--surface-2);
}
.team-ghost.is-empty { color: var(--muted); }
.team-ghost.is-admin { color: var(--primary-ink); font-weight: 600; }
.team-ghost.is-static { cursor: default; }
.team-ghost.is-static:hover { border-color: transparent; background: transparent; }
.team-ghost-arrow {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  opacity: 0;
  transform: translateX(-2px);
  transition: opacity 0.12s, transform 0.12s;
}
.team-ghost-arrow svg { width: 12px; height: 12px; }
.team-ghost:hover .team-ghost-arrow,
.team-ghost:focus-visible .team-ghost-arrow { opacity: 1; transform: none; }
.popover-item.is-current { color: var(--primary-ink); font-weight: 600; }
.popover-item svg { width: 14px; height: 14px; flex: none; }
.popover-note { padding: 2px 9px 8px; font-size: 12px; line-height: 1.6; color: var(--muted); }
.popover.team-pos-pop { max-height: 252px; }
@media (hover: none) {
  .team-ghost-arrow { opacity: 0.55; transform: none; }
}
.team-remove {
  height: 26px;
  padding: 0 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-2);
  font-size: 12px;
}
.team-remove:hover { background: var(--surface-3); color: var(--danger); }
.team-restore {
  height: 26px;
  padding: 0 8px;
  border: 0;
  border-radius: 7px;
  background: var(--primary-soft);
  color: var(--primary-ink);
  font-size: 12px;
  font-weight: 600;
}
.team-restore:hover { filter: brightness(0.97); }
.tiny-note { font-size: 11px; color: var(--muted); white-space: nowrap; }
.team-empty { padding: 22px 0; text-align: center; color: var(--muted); font-size: 12.5px; }
@media (max-width: 720px) {
  .team-members .col-joined { display: none; }
  .team-members .col-action { width: 84px; }
}
.perm-overview { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.perm-role-count { white-space: nowrap; }
.perm-section { margin-top: 16px; }
.perm-section-head { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.perm-scroll { overflow-x: auto; }
.perm-table { width: 100%; min-width: 340px; border-collapse: collapse; font-size: 12px; }
.perm-table th {
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  padding: 7px 6px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.perm-table td { padding: 7px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.perm-table tr:last-child td { border-bottom: none; }
.perm-table .perm-col { text-align: center; width: 64px; white-space: nowrap; }
.perm-yes { display: inline-flex; color: var(--ok); }
.perm-yes svg { width: 14px; height: 14px; }
.perm-no { color: var(--muted); }
.perm-note { margin-top: 14px; font-size: 11.5px; line-height: 1.8; color: var(--muted); }

.subnav {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  margin-bottom: 14px;
  background: var(--surface-2);
  border-radius: 10px;
}
.subnav-item {
  height: 28px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}
.subnav-item:hover { color: var(--text); }
.subnav-item.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

@media (max-width: 560px) {
  .settings-nav { flex-wrap: wrap; }
  .settings-nav-item { flex: 1 1 calc(50% - 6px); }
  .subnav { display: flex; width: 100%; }
  .subnav-item { flex: 1; text-align: center; }
}

/* ---------------------------------------------------------------- prototypes */
.proto-back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 12.5px;
  margin-bottom: 6px;
}
.proto-back-link:hover { color: var(--primary); }
.proto-back-link svg { width: 13px; height: 13px; }


/* docs（项目文档：文件夹 + 原型） */
.doc-crumb {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 6px;
  font-size: 12.5px;
  color: var(--muted);
}
.doc-crumb a { color: var(--muted); }
.doc-crumb a:hover { color: var(--primary); }
.doc-crumb .crumb-sep { color: var(--line-strong); }
.doc-crumb span:last-child { color: var(--text-2); font-weight: 600; }
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.doc-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.doc-card:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.doc-card-icon {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.doc-card-icon svg { width: 18px; height: 18px; }
.doc-card-icon.folder { background: var(--warn-soft); color: var(--warn); }
.doc-card-icon.proto { background: var(--primary-soft); color: var(--primary); }
.doc-card-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.doc-card-name {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.doc-card-meta { font-size: 12px; color: var(--muted); }
.doc-card .icon-btn { flex: none; }


.proto-upload-pick { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.proto-upload-hint {
  font-size: 12.5px;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: 9px;
  padding: 10px 12px;
  line-height: 1.6;
}
.proto-upload-hint.warn { color: var(--warn); background: var(--warn-soft); }
.proto-upload-progress { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.proto-upload-progress .bar { flex: 1; height: 6px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.proto-upload-progress .bar i { display: block; height: 100%; width: 0; background: var(--primary); border-radius: 4px; transition: width 0.15s; }
.proto-upload-progress .pct { font-size: 12px; color: var(--muted); width: 42px; text-align: right; }

.proto-page { padding: 18px 24px 28px; }
.proto-head { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.proto-head-main { flex: 1; min-width: 260px; }
.proto-head-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.proto-head-top .proto-back-link { margin-bottom: 0; flex: none; }
.proto-title { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proto-head-actions { display: flex; gap: 8px; align-items: center; }

.proto-viewer { display: flex; gap: 12px; align-items: stretch; }
.proto-pages {
  width: 190px;
  flex: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  max-height: calc(100vh - 240px);
  overflow: auto;
}
.proto-pages-title { font-size: 11.5px; font-weight: 600; color: var(--muted); letter-spacing: 0.03em; padding: 2px 8px 8px; }
.proto-page-item {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  text-align: left;
  padding: 7px 9px;
  border-radius: 7px;
  font-size: 12.5px;
  color: var(--text-2);
  white-space: nowrap;
}
.proto-page-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.proto-page-item:hover { background: var(--surface-2); color: var(--text); }
.proto-page-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.proto-page-copy,
.docs-page-copy {
  width: 20px;
  height: 20px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 5px;
  color: var(--muted);
  opacity: 0;
}
.proto-page-copy svg,
.docs-page-copy svg { width: 13px; height: 13px; }
.proto-page-item:hover .proto-page-copy,
.proto-page-item.active .proto-page-copy,
.docs-page-row:hover .docs-page-copy { opacity: 1; }
.proto-page-copy:hover,
.docs-page-copy:hover { background: var(--surface); color: var(--text); }
.proto-frame {
  flex: 1;
  min-width: 0;
  height: calc(100vh - 240px);
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

/* 文档 · 文件夹详情：左侧「文档 + 页面」两段列表，右侧原型预览（平铺 + 线条分隔） */
body.docs-immersive .topbar { display: none; }
.content.view-docs { overflow: hidden; display: flex; flex-direction: column; }
.page.page-docs.docs-detail {
  flex: 1;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0;
  max-width: none;
}
.docs-detail-body { flex: 1; min-height: 0; display: flex; }
.docs-aside {
  width: 272px;
  flex: none;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--surface);
  border-right: 1px solid var(--line);
}
.docs-topbar {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  height: 52px;
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.docs-topbar-left { display: flex; align-items: center; gap: 6px; min-width: 0; }
.docs-topbar-title {
  max-width: calc(50vw - 150px);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.docs-topbar-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border-radius: 9px;
  background: var(--surface-2);
}
.docs-topbar-right { margin-left: auto; width: 0; }
.docs-zoom { display: flex; align-items: center; gap: 2px; }
.docs-tool {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--text-2);
}
.docs-tool svg { width: 15px; height: 15px; }
.docs-tool:hover { background: var(--surface); }
.docs-tool.is-active { background: var(--surface); color: var(--primary); }
.docs-tool:disabled { opacity: 0.4; cursor: default; }
.docs-tool:disabled:hover { background: none; }
.docs-zoom-val {
  min-width: 48px;
  height: 28px;
  padding: 0 4px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.docs-zoom-val:hover { background: var(--surface); }
.docs-zoom-val:disabled { opacity: 0.4; cursor: default; }
.docs-zoom-val:disabled:hover { background: none; }
.docs-topbar-sep { width: 1px; height: 16px; background: var(--line-strong); margin: 0 3px; }
.docs-aside-back {
  width: 24px;
  height: 24px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: var(--muted);
}
.docs-aside-back svg { width: 15px; height: 15px; }
.docs-aside-back:hover { background: var(--surface-2); color: var(--text-2); }
.docs-search {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  margin: 12px 12px 4px;
  padding: 0 10px;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--muted);
}
.docs-search svg { width: 15px; height: 15px; flex: none; }
.docs-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  color: var(--text);
  font-size: 12.5px;
}
.docs-search:focus-within { box-shadow: inset 0 0 0 1px var(--primary); }
.docs-search input:disabled { cursor: default; }
.docs-side-scroll { flex: 1; min-height: 0; overflow: auto; padding: 0 0 12px; }
.docs-side-label {
  display: flex;
  align-items: baseline;
  gap: 4px;
  padding: 12px 16px 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.docs-side-label em { font-style: normal; font-weight: 600; opacity: 0.75; }
.docs-side-label-pages {
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.docs-doc-row,
.docs-page-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--text-2);
  text-align: left;
  font-size: 12.5px;
}
.docs-doc-row:hover,
.docs-page-row:hover { background: var(--surface-2); }
.docs-doc-row.is-active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.docs-doc-icon {
  width: 22px;
  height: 22px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 6px;
}
.docs-doc-icon svg { width: 13px; height: 13px; }
.docs-doc-icon.axure { background: var(--primary-soft); color: var(--primary); }
.docs-doc-icon.html { background: color-mix(in srgb, var(--purple) 14%, var(--surface)); color: var(--purple); }
.docs-doc-name,
.docs-page-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.docs-page-row { padding-left: 18px; }
.docs-page-row > svg { width: 14px; height: 14px; flex: none; color: var(--muted); opacity: 0.8; }
.docs-page-row.is-active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.docs-page-row.is-active > svg { color: var(--primary); opacity: 1; }

/* 页面树：Axure sitemap 的文件夹与子页面按层级缩进，箭头可折叠 */
.docs-page-toggle,
.proto-page-toggle {
  width: 16px;
  height: 16px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 4px;
  color: var(--muted);
  opacity: 0.75;
}
.docs-page-toggle svg,
.proto-page-toggle svg { width: 12px; height: 12px; transition: transform 0.15s ease; }
.docs-page-toggle.is-collapsed svg,
.proto-page-toggle.is-collapsed svg { transform: rotate(-90deg); }
.docs-page-toggle.is-empty { visibility: hidden; }
.docs-page-toggle:hover,
.proto-page-toggle:hover { background: var(--surface); color: var(--text); opacity: 1; }
.docs-page-folder,
.proto-page-folder { font-weight: 500; color: var(--text-2); }
.docs-page-folder > svg,
.proto-page-folder > svg { width: 14px; height: 14px; flex: none; color: var(--muted); }
.docs-side-empty { padding: 8px 16px; font-size: 12px; color: var(--muted); }
.docs-add-doc {
  margin-left: auto;
  width: 20px;
  height: 20px;
  flex: none;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--muted);
}
.docs-add-doc svg { width: 13px; height: 13px; }
.docs-add-doc:hover { background: var(--primary-soft); color: var(--primary); }
.docs-doc-more {
  width: 20px;
  height: 20px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.12s, background 0.12s, color 0.12s;
}
.docs-doc-more svg { width: 14px; height: 14px; }
.docs-doc-row:hover .docs-doc-more { opacity: 1; }
.docs-doc-more:hover { background: var(--surface); color: var(--text); }
.docs-main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; background: var(--surface); position: relative; }
.docs-canvas {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: #fff;
  display: flex;
  align-items: safe center;
  justify-content: safe center;
}
.docs-pan-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.docs-main.is-pan .docs-pan-layer { display: block; }
.docs-pan-layer.is-dragging { cursor: grabbing; }
.docs-detail.is-expanded {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--surface);
}
/* 画布铺满视口：隐藏侧栏，顶栏变成悬浮操作条 */
.docs-detail.is-expanded .docs-aside { display: none; }
.docs-detail.is-expanded .docs-topbar {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  height: auto;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: var(--shadow-md);
  z-index: 6;
}
.docs-detail.is-expanded .docs-topbar-left,
.docs-detail.is-expanded .docs-topbar-right { display: none; }
.docs-detail.is-expanded .docs-topbar-center { position: static; transform: none; }
.docs-detail.is-expanded .docs-detail-body { min-height: 0; }
.docs-stage { position: relative; overflow: hidden; flex: none; }
.docs-frame {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
  transform-origin: 0 0;
}
.docs-frame[hidden] { display: none; }
.docs-doc-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px;
  text-align: center;
  background: var(--surface);
}
.docs-doc-empty[hidden] { display: none; }
.docs-empty {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px;
  text-align: center;
  background: var(--surface);
}
.docs-empty-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  margin-bottom: 6px;
}
.docs-empty-icon svg { width: 24px; height: 24px; }
.docs-empty-title { font-size: 15px; font-weight: 600; }
.docs-empty-sub { font-size: 12.5px; color: var(--muted); max-width: 340px; line-height: 1.7; }
.docs-empty .btn { margin-top: 10px; }

.proto-picker { min-height: 300px; }
.proto-picker-list {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 380px;
  overflow: auto;
}
.proto-picker-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; text-align: left; }
.proto-picker-item:hover { background: var(--surface-2); }
.proto-picker-icon {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 8px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
}
.proto-picker-icon svg { width: 15px; height: 15px; }
.proto-picker-main { display: flex; flex-direction: column; min-width: 0; }
.proto-picker-name { font-size: 13px; font-weight: 600; }
.proto-picker-meta { font-size: 11.5px; color: var(--muted); }
.proto-picker-empty { padding: 18px 10px; font-size: 12.5px; }
.proto-picker-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; min-width: 0; }
.proto-picker-back { display: inline-flex; align-items: center; gap: 2px; padding: 4px 8px 4px 4px; border-radius: 7px; font-size: 12.5px; color: var(--muted); flex: none; }
.proto-picker-back:hover { background: var(--surface-2); color: var(--text); }
.proto-picker-back svg { width: 13px; height: 13px; }
.proto-picker-current { font-size: 12.5px; font-weight: 600; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proto-picker-all { margin-left: auto; flex: none; padding: 4px 8px; border-radius: 7px; font-size: 12.5px; color: var(--primary); }
.proto-picker-all:hover { background: var(--primary-soft); }
.proto-picker-item.is-selected { background: var(--primary-soft); }
.proto-picker-item.is-selected .proto-picker-name { color: var(--primary); }
.proto-picker-check {
  margin-left: auto;
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 5px;
  border: 1.5px solid var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.proto-picker-check svg { width: 11px; height: 11px; }
.proto-picker-item.is-selected .proto-picker-check { background: var(--primary); border-color: var(--primary); }
.proto-picker-count {
  margin-left: auto;
  flex: none;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.link-col-head { flex-wrap: wrap; }
.link-col-head .link-add { margin-left: 0; }
.link-col-head .link-add:first-of-type { margin-left: auto; }
.link-add-proto { background: var(--primary-soft) !important; border-color: transparent !important; color: var(--primary) !important; }
.link-add-proto:hover { background: var(--primary) !important; color: #fff !important; }

.crumb-sep { color: var(--muted); margin: 0 6px; }
.crumb-sub {
  font-weight: 500;
  color: var(--text-2);
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.token-create { display: flex; gap: 8px; margin: 12px 0; }
.token-create input {
  flex: 1;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  outline: none;
  font-size: 13px;
}
.token-create input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.token-fresh {
  margin: 10px 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--ok-soft);
  border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent);
}
.token-fresh-label { font-size: 12px; font-weight: 600; color: var(--ok); margin-bottom: 6px; }
.token-fresh-value { display: flex; align-items: center; gap: 8px; }
.token-fresh-value code {
  flex: 1;
  font-size: 12px;
  background: var(--surface);
  border-radius: 6px;
  padding: 5px 8px;
  overflow: auto;
  white-space: nowrap;
}
.token-fresh-ai {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.token-list { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.token-row { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.token-row:last-child { border-bottom: none; }
.token-row-main { flex: 1; min-width: 0; }
.token-name { font-size: 13px; font-weight: 600; }
.token-meta { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.token-empty { font-size: 12.5px; padding: 10px 2px; }

@media (max-width: 900px) {
  .proto-viewer { flex-direction: column; }
  .proto-pages { width: 100%; max-height: 160px; }
  .proto-frame { height: 62vh; }
  .content.view-docs { overflow: auto; }
  .page.page-docs.docs-detail { height: auto; min-height: 100%; padding: 0; }
  .docs-detail-body { flex-direction: column; }
  .docs-aside { width: 100%; max-height: 36vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .docs-canvas { min-height: 68vh; }
  .docs-empty { min-height: 42vh; height: auto; }
  .docs-topbar { padding: 0 10px; }
  .docs-topbar-title { display: none; }
}

/* ---------------------------------------------------------------- 项目版本 */
.version-manager-modal { width: 780px; height: 520px; }
.version-manager-modal .modal-body { flex: 1; min-height: 0; }
.version-manager-head { display: flex; align-items: center; justify-content: flex-end; margin-bottom: 14px; }
.version-grid { display: flex; flex-direction: column; gap: 10px; }
.version-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.version-card-main { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 10px; }
.version-name { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; white-space: nowrap; }
.version-status { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.version-status.planning { color: var(--muted); background: var(--surface-2); }
.version-status.developing { color: var(--primary); background: var(--primary-soft); }
.version-status.testing { color: var(--warn); background: var(--warn-soft); }
.version-status.released { color: var(--ok); background: var(--ok-soft); }
.version-desc { flex: 1; min-width: 0; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.version-progress { flex: none; width: 140px; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.version-bar { flex: 1; height: 6px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.version-bar i { display: block; height: 100%; background: var(--primary); border-radius: 4px; }
.version-actions { flex: none; display: flex; gap: 8px; align-items: center; }
@media (max-width: 640px) {
  .version-card { flex-wrap: wrap; row-gap: 8px; }
  .version-card-main { flex-basis: 100%; }
  .version-progress { flex: 1; width: auto; }
}
.version-detail-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.version-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-2);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 1px 8px;
  white-space: nowrap;
}
.version-pill svg { width: 11px; height: 11px; }


/* ---------------------------------------------------------------- 任务详情（Teambition 布局） */
.drawer.mode-drawer { width: min(1280px, 100vw); }
.drawer.mode-modal {
  width: min(1240px, calc(100vw - 48px));
  height: min(900px, calc(100vh - 48px));
}

.drawer-body { display: flex; flex-direction: column; overflow: hidden; padding: 0; }

/* 顶栏：左侧「任务详情」标题，右侧操作 */
.tb-top {
  flex: none;
  display: flex;
  align-items: center;
  height: 56px;
  padding: 0 16px 0 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.tb-tab {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.tb-top .drawer-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.tb-top .drawer-actions .icon-btn { width: 34px; height: 34px; border-radius: 8px; color: var(--muted); }
.tb-top .drawer-actions .icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* 左右分栏 */
.tb-split {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(400px, 43%);
}
.tb-left { min-width: 0; display: flex; flex-direction: column; background: var(--surface); }
.tb-left-scroll { flex: 1; overflow-y: auto; padding: 18px 40px 48px 32px; }

.task-title-input {
  width: calc(100% + 12px);
  margin: 0 -6px 4px;
  padding: 4px 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.4;
  color: var(--text);
  outline: none;
}
.task-title-input:hover,
.task-title-input:focus { background: var(--surface-2); }

.tb-parent {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  margin: 0 0 4px;
  padding: 2px 6px 2px 2px;
  border: 0;
  border-radius: 5px;
  background: none;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
}
.tb-parent:hover { color: var(--primary-ink); background: var(--surface-2); }
.tb-parent svg { width: 13px; height: 13px; flex: none; }
.tb-parent span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 字段行 */
.tb-fields { display: flex; flex-direction: column; margin-top: 10px; }
.tb-field {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 38px;
  padding: 2px 0;
  border-radius: 8px;
}
.tb-field-desc { align-items: flex-start; padding-top: 8px; }
.tb-field-desc .tb-f-label { padding-top: 2px; }
.tb-f-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text);
}
.tb-f-label svg { width: 16px; height: 16px; color: #8f99a8; stroke-width: 1.6; flex: none; }
.tb-f-value {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  font-size: 13.5px;
  color: var(--text-2);
}

.tb-avatar-ghost {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--muted);
  flex: none;
}
.tb-avatar-ghost svg { width: 12px; height: 12px; }
.tb-field .avatar-xs { width: 22px; height: 22px; font-size: 10px; }

.tb-inline-select {
  appearance: none;
  -webkit-appearance: none;
  min-width: 0;
  max-width: 100%;
  padding: 3px 2px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  outline: none;
}
.tb-inline-select:hover { color: var(--primary-ink); }
.tb-inline-select:focus-visible { box-shadow: 0 0 0 3px var(--primary-soft); }
.tb-inline-select.is-dim { color: var(--muted); font-weight: 400; }

.tb-time { gap: 6px; }
.tb-date {
  padding: 3px 4px;
  margin: 0 -4px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  font-size: 13.5px;
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
}
.tb-date:hover { background: var(--surface-2); color: var(--text); }
.tb-date.is-empty { color: var(--muted); }
.tb-date.overdue { color: var(--danger); font-weight: 550; }
.tb-dash { color: var(--line-strong); }

.tb-project { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); }
.tb-project i { width: 18px; height: 18px; border-radius: 5px; flex: none; }

.tb-pill-select {
  appearance: none;
  -webkit-appearance: none;
  height: 24px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: transparent;
  font: inherit;
  font-size: 12.5px;
  color: var(--text-2);
  cursor: pointer;
  outline: none;
}
.tb-pill-select:hover { border-color: var(--primary); color: var(--primary-ink); }

.tb-tags { gap: 6px; }

.tb-desc-value { display: flex; align-items: flex-start; gap: 8px; width: 100%; }
.tb-desc-value #d-desc-mount { flex: 1; min-width: 0; }
.tb-desc-value .desc-empty {
  width: auto;
  margin: 0;
  min-height: 0;
  padding: 2px 0;
  color: var(--muted);
  font-size: 13.5px;
}
.tb-desc-value .desc-empty:hover { color: var(--primary-ink); background: transparent; }
.tb-desc-value .desc-preview {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  cursor: text;
}
.tb-desc-value .desc-preview:hover { border-color: var(--line-strong); }
.tb-desc-value .desc-preview a,
.tb-desc-value .desc-preview img,
.tb-desc-value .desc-preview video { cursor: pointer; }
.tb-desc-value .desc-preview-body { font-size: 13.5px; line-height: 1.75; color: var(--text-2); }
.tb-desc-value .desc-editor { width: 100%; }
.tb-desc-value .save-hint { font-size: 11px; }

.tb-divider { height: 1px; background: var(--line); margin: 18px 0 20px; }

.tb-sec-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}
.tb-sec-count { font-size: 12px; font-weight: 400; color: var(--muted); }

.tb-sub-list { list-style: none; margin: 0 0 10px; padding: 0; }
.tb-sub { display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 3px 4px; border-radius: 6px; }
.tb-sub:hover { background: var(--surface-2); }
.tb-sub-check {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  background: none;
  color: #fff;
  cursor: pointer;
  flex: none;
  transition: background .12s, border-color .12s;
}
.tb-sub-check svg { width: 10px; height: 10px; stroke-width: 3; }
.tb-sub-check:hover { border-color: var(--primary); }
.tb-sub.is-done .tb-sub-check { background: var(--primary); border-color: var(--primary); }
.tb-sub-title {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 13.5px;
  color: var(--text-2);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tb-sub.is-done .tb-sub-title { color: var(--muted); text-decoration: line-through; }
.tb-sub .avatar { width: 20px; height: 20px; font-size: 9.5px; flex: none; }

.tb-add-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--primary-ink);
  transition: border-color .14s;
}
.tb-add-sub:hover, .tb-add-sub:focus-within { border-color: color-mix(in srgb, var(--primary) 45%, var(--line)); }
.tb-add-sub svg { width: 14px; height: 14px; flex: none; }
.tb-add-sub input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: none;
  font: inherit;
  font-size: 13.5px;
  color: var(--text);
}
.tb-add-sub input::placeholder { color: var(--muted); }

/* 右侧动态栏 */
.tb-right {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-left: 1px solid var(--line);
}
.tb-right-top { flex: none; padding: 16px 20px 12px; }
.tb-part-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.tb-part-count { color: var(--muted); font-weight: 500; }
.tb-part-avatars {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.tb-part-avatars .avatar { width: 26px; height: 26px; font-size: 11px; }
.tb-part-plus {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  transition: color .14s, border-color .14s;
}
.tb-part-avatars:hover .tb-part-plus { color: var(--primary-ink); border-color: var(--primary); }
.tb-part-plus svg { width: 13px; height: 13px; }

.tb-feed-tabs {
  flex: none;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 20px 8px;
  border-bottom: 1px solid var(--line);
}
.tb-feed-tabs button {
  padding: 6px 10px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text-2);
  font-size: 12.5px;
  cursor: pointer;
}
.tb-feed-tabs button:hover { background: var(--surface-3); }
.tb-feed-tabs button.is-on {
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary-ink);
  font-weight: 600;
}

.tb-feed { flex: 1; overflow-y: auto; padding: 10px 20px 18px; }
.tb-feed-empty { padding: 32px 0; text-align: center; font-size: 12.5px; color: var(--muted); }

.tb-log {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  column-gap: 10px;
  padding: 9px 0;
  align-items: start;
}
.tb-log-ico { display: grid; place-items: center; width: 20px; height: 20px; color: var(--muted); }
.tb-log-ico svg { width: 14px; height: 14px; }
.tb-log-ico.action-completed { color: var(--ok); }
.tb-log-ico.action-created { color: var(--primary); }
.tb-log-ico.action-moved { color: var(--primary); }
.tb-log-ico.action-reopened { color: var(--primary); }
.tb-log-ico.action-attached { color: var(--warn); }
.tb-log-ico.action-assigned { color: var(--purple); }
.tb-log .avatar-xs { width: 22px; height: 22px; font-size: 10px; }
.tb-log-body { min-width: 0; font-size: 13px; line-height: 1.55; color: var(--text-2); }
.tb-log-body b { font-weight: 600; color: var(--text); }
.tb-log-pos { margin-left: 6px; font-size: 11px; color: var(--muted); }
.tb-log-content { margin-top: 3px; color: var(--text-2); white-space: pre-wrap; word-break: break-word; }
.tb-log-time { padding-top: 1px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.tb-log-actions { margin-left: 6px; opacity: 0; transition: opacity .12s; }
.tb-log:hover .tb-log-actions { opacity: 1; }
.tb-log-actions button {
  padding: 0 2px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 11.5px;
  cursor: pointer;
}
.tb-log-actions button:hover { color: var(--primary-ink); }

.tb-composer { flex: none; padding: 12px 20px 16px; border-top: 1px solid var(--line); }
.tb-composer textarea {
  width: 100%;
  min-height: 52px;
  max-height: 160px;
  resize: none;
  border: 0;
  outline: none;
  background: none;
  font: inherit;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text);
}
.tb-composer textarea::placeholder { color: var(--muted); }
.tb-compose-bar { display: flex; align-items: center; justify-content: flex-end; margin-top: 4px; }
.tb-reply {
  height: 30px;
  padding: 0 18px;
  border: 0;
  border-radius: 5px;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .14s;
}
.tb-reply:hover { background: var(--primary-ink); }
.tb-reply:disabled { opacity: .5; cursor: default; }

@media (max-width: 980px) {
  .drawer-body { overflow-y: auto; }
  .tb-split { display: block; }
  .tb-left-scroll { overflow: visible; padding: 14px 18px 24px; }
  .tb-right { border-left: 0; border-top: 1px solid var(--line); }
  .tb-feed { overflow: visible; }
  .tb-field { grid-template-columns: 96px minmax(0, 1fr); }
  .task-title-input { font-size: 18px; }
}

@media (max-width: 620px) {
  .tb-field { grid-template-columns: minmax(0, 1fr); row-gap: 2px; min-height: 0; padding: 6px 0; align-items: start; }
  .tb-field .tb-f-value { width: 100%; }
  .tb-time { row-gap: 2px; }
  .tb-dash { display: none; }
}

/* 备注内联编辑器不撑破字段行 */
.tb-desc-value .desc-editor { max-width: 100%; }
.tb-desc-value .desc-editor-toolbar { overflow-x: auto; overflow-y: hidden; }
