/* ============================================================
   聆龙团队工作台 — 样式系统
   设计参考：个人工作台 v4.4
   ============================================================ */

:root {
  --bg: #f4f6fb;
  --panel: #ffffff;
  --panel-2: #f7f9fc;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e7eaf0;
  --border-strong: #d6dbe4;
  --primary: #6366f1;
  --primary-2: #8b5cf6;
  --primary-grad: linear-gradient(135deg, #6366f1, #8b5cf6);
  --work: #10b981;
  --info: #0ea5e9;
  --warning: #f59e0b;
  --danger: #ef4444;
  --success: #16a34a;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.05), 0 1px 3px rgba(15,23,42,.04);
  --shadow-md: 0 6px 16px rgba(15,23,42,.07), 0 2px 6px rgba(15,23,42,.04);
  --shadow-lg: 0 20px 48px rgba(15,23,42,.13), 0 6px 16px rgba(15,23,42,.07);
  --ring: 0 0 0 3px rgba(99,102,241,.20);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --ease: cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
.auto-link { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; cursor: pointer; }
.auto-link:hover { color: #4f46e5; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(58% 48% at 10% -6%, rgba(99,102,241,.10), transparent 60%),
    radial-gradient(50% 44% at 96% 0%, rgba(236,72,153,.08), transparent 55%),
    radial-gradient(46% 46% at 50% 112%, rgba(16,185,129,.06), transparent 60%);
}

/* ---------- Header ---------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 34px;
  background: rgba(255,255,255,.72);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 8px 24px rgba(15,23,42,.05);
}
.brand-wrap { display: flex; flex-direction: column; gap: 2px; line-height: 1.2; }
.app-header h1 {
  font-size: 21px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -.01em;
}
.logo { font-size: 22px; filter: drop-shadow(0 2px 5px rgba(99,102,241,.28)); display: inline-flex; align-items: center; vertical-align: middle; }
.brand {
  background: var(--primary-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.app-header .sub {
  color: var(--muted);
  font-size: 12.5px;
  letter-spacing: .015em;
  padding-left: 32px;
}
.spacer { flex: 1; }
.header-tools { display: flex; align-items: center; gap: 8px; }

/* ===== Global Search Trigger (header button) ===== */
.gs-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  font-size: 13px;
  color: var(--muted);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  transition: .15s var(--ease);
}
.gs-trigger:hover { border-color: var(--primary); color: var(--text); background: var(--panel); }
.gs-trigger-hint {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  opacity: .6;
  letter-spacing: .02em;
}

/* ===== Global Search Overlay (Ctrl+K) ===== */
.search-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  /* 不使用 backdrop-filter：同 .mask，避免软件渲染下命中测试异常导致搜索框点击/输入偶发失效 */
  background: rgba(15,23,42,.55);
  z-index: 200;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 13vh;
}
.search-overlay.show {
  display: flex;
  animation: gs-fade-in .15s ease;
}
@keyframes gs-fade-in { from { opacity: 0; } to { opacity: 1; } }

.search-modal {
  width: 600px;
  max-width: 92vw;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(15,23,42,.35);
  overflow: hidden;
  animation: gs-slide-down .2s var(--ease);
}
@keyframes gs-slide-down {
  from { transform: translateY(-24px) scale(.97); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.search-modal-input-wrap {
  position: relative;
  border-bottom: 1px solid var(--border);
}
.search-modal-input-wrap .gs-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 17px;
  opacity: .45;
  pointer-events: none;
}
.search-modal-input-wrap .gs-module-label { color: var(--muted); font-size: 12px; white-space: nowrap; }
.gs-module-select {
  height: 34px;
  padding: 0 26px 0 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 12px;
}
.gs-input {
  width: 100%;
  padding: 16px 44px 16px 48px;
  border: none;
  background: transparent;
  font-size: 16px;
  font-family: inherit;
  font-weight: 500;
  outline: none;
  color: var(--text);
}
.search-modal-input-wrap .gs-input::placeholder { color: var(--muted); font-weight: 400; }
.search-modal-input-wrap .gs-clear {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  color: var(--muted);
  background: var(--border);
}
.search-modal-input-wrap .gs-clear:hover { color: var(--text); background: var(--border-strong); }

.gs-dropdown {
  background: transparent;
  max-height: 50vh;
  overflow-y: auto;
  padding: 4px;
}
.gs-empty, .gs-error {
  padding: 18px 16px;
  text-align: center;
  color: var(--muted);
}
.gs-error { color: var(--danger); }
.gs-empty {
  text-align: center;
  padding: 24px 12px;
  color: var(--muted);
  font-size: 13px;
}
.gs-section { padding: 4px 0; }
.gs-section + .gs-section { border-top: 1px solid var(--border); margin-top: 2px; padding-top: 6px; }
.gs-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  padding: 4px 10px 2px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.gs-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 2px 10px 6px;
}
.gs-tag {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
  cursor: pointer;
  transition: .12s var(--ease);
  user-select: none;
}
.gs-tag:hover { transform: translateY(-1px); box-shadow: 0 2px 6px rgba(99,102,241,.18); }
.gs-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .1s;
}
.gs-item:hover { background: var(--panel-2); }
.gs-item-bar {
  width: 3px;
  min-height: 32px;
  border-radius: 2px;
  flex-shrink: 0;
  margin-top: 2px;
}
.gs-item-body { flex: 1; min-width: 0; }
.gs-item-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  word-break: break-word;
}
.gs-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
}
.gs-status {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
}
.gs-status-todo { background: var(--panel-2); color: var(--muted); }
.gs-status-in_progress { background: #fef3c7; color: #92400e; }
.gs-status-done { background: #d1fae5; color: #065f46; }
.gs-tag-muted { background: var(--panel-2); color: var(--muted); padding: 1px 6px; border-radius: 4px; }
.gs-item-title mark, .gs-item-meta mark {
  background: rgba(99,102,241,.15);
  color: var(--primary);
  border-radius: 2px;
  padding: 0 1px;
}

@media (max-width: 600px) {
  .gs-trigger-hint { display: none; }
  .search-modal { width: 94vw; }
  .search-overlay { padding-top: 8vh; }
}

/* ===== Content inline edit (double click body & title) ===== */
.cd-inline-title {
  position: relative;
  border-radius: 8px;
  padding: 6px 8px;
  margin: -6px -8px;
  border: 1px dashed transparent;
  transition: .15s var(--ease);
  cursor: text;
  flex: 1;
}
.cd-inline-title:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}
.cd-inline-title::after {
  content: '✏️ 双击编辑标题';
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  font-size: 11px;
  font-weight: normal;
  color: var(--primary);
  opacity: 0;
  transition: .15s;
  pointer-events: none;
}
.cd-inline-title:hover::after { opacity: 1; }
.cd-inline-title.editing { background: transparent; border-color: transparent; }
.cd-inline-title.editing::after { display: none; }
.cd-summary {
  position: relative;
  border: 1px dashed transparent;
  transition: .15s var(--ease);
  cursor: text;
}
.cd-summary:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}
.cd-summary::after {
  content: '✏️ 双击编辑摘要';
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--primary);
  opacity: 0;
  transition: .15s;
  pointer-events: none;
}
.cd-summary:hover::after { opacity: 1; }
.cd-summary.editing { background: transparent; border-color: transparent; }
.cd-summary.editing::after { display: none; }
.cd-summary-empty { font-style: italic; }
.cd-editable-tag {
  cursor: pointer;
  user-select: none;
}
.cd-editable-tag:hover { filter: brightness(0.95); }
.cd-tags-row {
  position: relative;
  border-radius: 10px;
  padding: 6px;
  margin: -6px;
  border: 1px dashed transparent;
  transition: .15s var(--ease);
  cursor: text;
}
.cd-tags-row:hover {
  background: var(--panel-2);
  border-color: var(--border-strong);
}
.cd-tags-row::after {
  content: '双击编辑标签';
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--muted);
  opacity: 0;
  transition: .15s;
  pointer-events: none;
}
.cd-tags-row:hover::after { opacity: 1; }
.tag-select {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  font: inherit;
  font-weight: inherit;
  color: inherit;
  padding: 4px 8px;
  margin: -4px -8px;
  min-width: 72px;
  cursor: pointer;
  outline: none;
  border-radius: 999px;
}
.tag-select:focus {
  box-shadow: 0 0 0 2px var(--primary-light);
}
.cd-body {
  position: relative;
  border-radius: 10px;
  padding: 12px;
  margin: -12px;
  border: 1px dashed transparent;
  transition: .15s var(--ease);
  cursor: text;
  min-height: 40px;
  font-size: 14px;
  line-height: 1.8;
}
.cd-body:hover {
  background: var(--panel-2);
  border-color: var(--border-strong);
}
.cd-body::after {
  content: '双击编辑';
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 11px;
  color: var(--muted);
  opacity: 0;
  transition: .15s;
  pointer-events: none;
}
.cd-body:hover::after { opacity: .7; }

.cd-inline-edit {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 16px 0 24px;
  animation: cd-fade-in .15s ease;
}
@keyframes cd-fade-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

.cd-edit-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  justify-content: flex-end;
}

/* 双击编辑标题 */
.cd-title {
  cursor: text;
  border-radius: 6px;
  padding: 2px 6px;
  margin: -2px -6px;
  border: 1px dashed transparent;
  transition: .15s var(--ease);
}
.cd-title:hover {
  background: var(--panel-2);
  border-color: var(--border-strong);
}
.cd-title-edit input {
  font-size: inherit;
  font-weight: inherit;
  border: 1px solid var(--primary);
  border-radius: 6px;
  padding: 2px 8px;
  min-width: 200px;
  outline: none;
  background: var(--panel);
  color: var(--text);
}

/* ===== Rich Text Editor ===== */

/* 编辑器外层包裹（统一管理工具栏+编辑区的间距和边框） */
.rte-wrapper {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--panel);
  overflow: hidden;
}
.rte-wrapper .rte-toolbar {
  position: static;
  border: none;
  border-radius: 0;
  margin-bottom: 0;
  background: var(--panel-2);
  border-bottom: 1px solid var(--border);
}
.rte-wrapper .rte-editor {
  border: none;
  border-radius: 0;
  min-height: 160px;
}

/* 独立工具栏（用于 vehicle.js 等嵌套在编辑区内部的场景） */
.rte-toolbar {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  padding: 7px 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 8px;
}

/* 段落格式下拉 —— 必须用高优先级覆盖 .field select{ width:100% } */
.rte-wrapper .rte-block,
.rte-toolbar .rte-block,
.rte-block {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  height: 30px;
  min-width: 110px;
  width: auto !important;
  padding: 0 26px 0 9px !important;
  border: 1px solid #d8dbe3 !important;
  border-radius: 7px !important;
  background-color: #fff !important;
  color: #374151;
  font-size: 12.5px;
  line-height: 1.35;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  flex: 0 0 auto;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239ca3af' stroke-width='1.4' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 8px center !important;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.rte-block option {
  line-height: 1.5;
  padding: 3px 8px;
}
.rte-block:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 2.5px rgba(99,102,241,.12);
}

/* 工具按钮（B/I/U/S / 链接 / 清除格式） */
.rte-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #4b5563;
  font-size: 13px;
  font-weight: 700;
  font-family: "SF Mono", "Fira Code", "Cascadia Code", Consolas, monospace;
  letter-spacing: .02em;
  cursor: pointer;
  transition: all .15s ease;
  position: relative;
}
.rte-btn:hover {
  background: rgba(99,102,241,.08);
  color: #4338ca;
  border-color: rgba(99,102,241,.18);
}
.rte-btn:active {
  background: rgba(99,102,241,.15);
  transform: scale(.96);
}

/* 分隔线 */
.rte-sep {
  display: inline-block;
  width: 1px;
  height: 18px;
  background: #dfe1e6;
  margin: 0 5px;
  vertical-align: middle;
}

/* 颜色选择器组 */
.rte-colors {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 2px;
  flex-shrink: 0;
}
.rte-swatch {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all .15s ease;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}
.rte-swatch:hover {
  transform: scale(1.15) translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,.12), 0 0 0 2px rgba(99,102,241,.25);
}
.rte-swatch:active {
  transform: scale(1.05);
}

/* 链接 & 清除格式 图标按钮 — 用 SVG 替代 emoji */
.rte-btn.btn-icon {
  font-family: inherit;
  font-weight: 400;
  letter-spacing: 0;
  font-size: 15px;
}
.rte-btn.btn-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.85;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.rte-editor {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  min-height: 220px;
  padding: 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.8;
  outline: none;
  overflow: auto;
}
.rte-editor:focus {
  border-color: var(--primary);
  box-shadow: var(--ring);
}
.rte-editor p { margin: 0 0 16px; }
.rte-editor img, .rte-editor video, .rte-editor table { max-width: 100%; height: auto; }
.rte-editor pre, .rte-editor code { max-width: 100%; white-space: pre-wrap; overflow-wrap: anywhere; }
.rte-editor, .cd-body { overflow-wrap: anywhere; word-break: break-word; }
.rte-editor p:last-child { margin-bottom: 0; }
.cd-body p { margin: 0 0 16px; }
.cd-body p:last-child { margin-bottom: 0; }
.rte-editor ul, .rte-editor ol { margin: 0 0 10px 20px; padding: 0; }
.rte-editor li { margin-bottom: 4px; }
.rte-editor h1 { font-size: 22px; font-weight: 800; margin: 0 0 12px; line-height: 1.3; }
.rte-editor h2 { font-size: 18px; font-weight: 700; margin: 0 0 10px; line-height: 1.35; }
.rte-editor h3 { font-size: 15px; font-weight: 700; margin: 0 0 8px; line-height: 1.4; }
.rte-editor blockquote {
  margin: 0 0 10px;
  padding: 8px 14px;
  border-left: 3px solid var(--primary);
  background: var(--panel-2);
  border-radius: 0 8px 8px 0;
  color: var(--muted);
}

/* User chip in header */
.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 10px 6px 6px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--panel-2);
  cursor: pointer;
  transition: .15s var(--ease);
}
.user-chip:hover { border-color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.user-chip .user-info { display: flex; flex-direction: column; line-height: 1.15; }
.user-chip .user-name { font-size: 13px; font-weight: 700; }
.user-chip .user-role { font-size: 11px; color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 9px 15px;
  border-radius: 11px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: transform .15s var(--ease), box-shadow .15s var(--ease), border-color .15s, background .15s, color .15s;
  white-space: nowrap;
  font-family: inherit;
}
.btn:hover { border-color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn.primary {
  background: var(--primary-grad);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(99,102,241,.30);
}
.btn.primary:hover { filter: brightness(1.06); box-shadow: 0 10px 24px rgba(99,102,241,.42); color: #fff; }
.btn.danger { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.btn.danger:hover { background: #fecaca; border-color: var(--danger); }
.btn.small { padding: 6px 10px; font-size: 12px; }
.btn.sm { padding: 6px 9px; font-size: 12px; }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* Search */
.search {
  flex: 1;
  min-width: 150px;
  max-width: 280px;
  padding: 9px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 13px;
  transition: .15s;
  font-family: inherit;
}
.search:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); background: var(--panel); }

/* ---------- Nav (segmented tabs) ---------- */
.app-nav {
  position: sticky;
  top: 62px;
  z-index: 20;
  background: linear-gradient(to bottom, rgba(244,246,251,.96), rgba(244,246,251,.82));
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  padding: 6px 34px 0;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(255,255,255,.5) inset;
}
.app-nav .nav-row { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.app-nav .nav-group { display: flex; align-items: center; gap: 4px; }
.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid transparent;
  background: transparent;
  transition: background .15s var(--ease), color .15s, border-color .15s;
  user-select: none;
  white-space: nowrap;
  line-height: 1.2;
  height: 30px;
  font-family: inherit;
  position: relative;
}
.nav-tab .ico { font-size: 15px; line-height: 1; }
.nav-tab .badge {
  margin-left: 2px;
  font-size: 10.5px;
  background: var(--panel-2);
  color: var(--muted);
  padding: 2px 5px;
  border-radius: 8px;
  border: 1px solid var(--border);
  min-width: 18px;
  text-align: center;
  line-height: 1.1;
}
.nav-tab:hover { background: var(--panel-2); color: var(--text); border-color: var(--border); }
.nav-tab.active {
  background: var(--panel);
  color: var(--text);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.nav-tab.active::after {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: -7px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
}
.app-nav .nav-sep { display: inline-block; width: 1px; height: 18px; background: var(--border-strong); margin: 0 3px; flex-shrink: 0; }

/* Mobile nav */
.nav-toggle { display: none; }
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .app-nav {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 220px;
    flex-direction: column;
    background: var(--panel);
    border-right: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    transform: translateX(-100%);
    transition: transform .25s var(--ease);
    z-index: 40;
    padding: 18px 12px;
    overflow-y: auto;
  }
  .app-nav.open { transform: translateX(0); }
  .nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.32);
    z-index: 39;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
  }
  .nav-backdrop.show { opacity: 1; pointer-events: auto; }
  .app-nav .nav-row { flex-direction: column; align-items: stretch; gap: 5px; }
  .app-nav .nav-group { flex-direction: column; align-items: stretch; gap: 5px !important; }
  .nav-tab { width: 100%; height: 42px; justify-content: flex-start; padding: 9px 12px; }
  .nav-tab .badge { margin-left: auto; }
  .app-header .sub { display: none; }
}

/* ---------- Main content ---------- */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 34px 56px;
}

/* 思路图页面：明确从主内容顶部开始布局，避免通用容器影响筛选条和卡片网格 */
.mindmaps-page {
  display: block;
  width: 100%;
  min-height: 0;
}
.mindmaps-toolbar {
  width: 100%;
  margin-top: 0;
  align-items: center;
}
.mindmaps-toolbar .chips {
  flex: 1 1 auto;
  min-width: 0;
}
.mindmaps-grid {
  width: 100%;
  align-items: start;
  justify-items: stretch;
}
.mindmaps-grid > .card {
  width: 100%;
  min-width: 0;
  justify-self: stretch;
}

/* ---------- Grid & cards ---------- */
.grid { display: grid; gap: 16px; }
.cards { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.card {
  position: relative;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s;
}
.card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent, #cbd5e1);
}
.card.work { --accent: var(--work); }
.card.primary { --accent: var(--primary); }
.card.info { --accent: var(--info); }
.card.warning { --accent: var(--warning); }
.card.danger { --accent: var(--danger); }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.card .t {
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  letter-spacing: .01em;
}
.card .n {
  font-size: 30px;
  font-weight: 800;
  margin-top: 8px;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.card .d { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* 今天页面概览卡片：紧凑样式 */
.today-summary .card { padding: 12px 14px 11px; min-height: unset; }
.today-summary .card::before { width: 2.5px; }
.today-summary .card .t { font-size: 11.5px; gap: 5px; }
.today-summary .card .n { font-size: 22px; margin-top: 5px; font-weight: 700; }
.today-summary .card .d { font-size: 11px; margin-top: 2px; }

/* 可点击概览卡片 */
.card.clickable, .dashboard-link-card { cursor: pointer; transition: transform .15s, box-shadow .15s; }
.card.clickable:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(99,102,241,.18); }
.card.clickable:active { transform: translateY(-1px); }

/* 跳转目标高亮闪烁 */
@keyframes jumpPulse {
  0%,100% { outline: 2px solid transparent; outline-offset: 2px; }
  35% { outline: 2px solid var(--primary); outline-offset: 3px; }
}
.jump-highlight { animation: jumpPulse 1.6s ease; border-radius: var(--radius); }

/* ---------- Panel ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s;
}
.panel:hover { box-shadow: var(--shadow-md); }
.panel h2, .panel h3 {
  font-size: 15.5px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  letter-spacing: -.01em;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.panel-head h3 { margin: 0; }

/* ---------- List & item ---------- */
.list { display: flex; flex-direction: column; gap: 11px; }
.item {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--panel-2);
  transition: transform .15s var(--ease), box-shadow .15s, border-color .15s, background .15s;
  cursor: pointer;
}
.item:hover { border-color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow-sm); background: var(--panel); }
.item .body { flex: 1; min-width: 0; }
.item .title { font-weight: 650; font-size: 15px; word-break: break-word; letter-spacing: -.005em; }
.item.done .title { text-decoration: line-through; color: var(--muted); }
.item .meta { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 7px; font-size: 12px; color: var(--muted); align-items: center; }
.item .acts { display: flex; gap: 4px; flex-shrink: 0; align-items: center; }
/* 项目详情任务状态：未完成为空框，已完成显示勾选框。 */
.project-task-check {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  margin-top: 1px;
  padding: 0;
  border: 1.5px solid var(--border-strong);
  border-radius: 5px;
  background: var(--panel);
  color: transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  cursor: pointer;
  transition: .15s var(--ease);
}
.project-task-check:hover { border-color: var(--primary); background: rgba(99,102,241,.06); }
.project-task-check.checked { border-color: var(--success); background: var(--success); color: #fff; }
.project-task-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ---------- Tags ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .01em;
  white-space: nowrap;
}
.tag.high, .tag.danger { background: #fee2e2; color: #b91c1c; }
.tag.medium, .tag.warning { background: #fef3c7; color: #b45309; }
.tag.low, .tag.default { background: #e0f2fe; color: #0369a1; }
.tag.primary { background: #e0e7ff; color: #4338ca; }
.tag.success { background: #dcfce7; color: #15803d; }
.tag.info { background: #e0f2fe; color: #0369a1; }
.tag.muted { background: var(--panel-2); color: var(--muted); border: 1px solid var(--border); }
.tag.clickable { cursor: pointer; user-select: none; transition: transform .12s, box-shadow .12s; }
.tag.clickable:hover { transform: translateY(-1px); box-shadow: 0 2px 6px rgba(99,102,241,.18); }
.tag.lg {
  padding: 7px 14px;
  font-size: 13.5px;
  gap: 6px;
  line-height: 1.4;
}
.extension-options { display: flex; gap: 10px; flex-wrap: wrap; }
.task-extension-btn { margin-left: 4px; color: #b45309; border-color: #fcd34d; background: #fef3c7; }
.task-extension-btn:hover { background: #fde68a; }
.project-owner-tag {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fcd34d;
}
.project-owner-tag:hover { background: #fde68a; color: #92400e; }
.task-progress-tag {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fcd34d;
}
.task-progress-tag:hover { background: #fde68a; color: #92400e; }
/* 项目详情状态下拉与大号状态标签保持相同字号和高度。 */
.project-status-select {
  padding: 7px 32px 7px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.4;
  cursor: pointer;
  outline: none;
}
.project-status-select:focus { border-color: var(--primary); box-shadow: var(--ring); }
/* 项目详情负责人下拉与状态下拉保持一致的尺寸和交互。 */
.project-owner-select {
  padding: 7px 32px 7px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.4;
  cursor: pointer;
  outline: none;
}
.project-owner-select:focus { border-color: var(--primary); box-shadow: var(--ring); }
.task-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.inline-edit { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inline-select, .inline-date {
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 6px 10px;
  border: 1px solid var(--primary);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  outline: none;
  min-width: 90px;
}
.inline-date { border-radius: 8px; padding: 5px 10px; }
.inline-input-num, .inline-input-text {
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 6px 10px;
  border: 1px solid var(--primary);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  outline: none;
}
.inline-edit .btn.small { padding: 5px 11px; font-size: 12px; border-radius: 7px; }

/* ---------- Chips (filter tabs) ---------- */
.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--panel-2);
  font-weight: 600;
  transition: .15s;
  white-space: nowrap;
  font-family: inherit;
}
.chip:hover { color: var(--text); border-color: var(--primary); }
.chip.active {
  background: var(--primary-grad);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(99,102,241,.30);
}
.chip.select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  height: 30px;
  line-height: 1;
}
.pool-assignee-select {
  min-width: 116px;
  max-width: 160px;
  padding-right: 24px;
}

/* 模板库模块内搜索：与筛选 chip 保持一致的胶囊样式 */
.content-local-search {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  width: 150px;
  height: 34px;
  padding: 0 8px 0 10px;
  pointer-events: auto;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  transition: .15s;
}
.content-local-search:focus-within { border-color: var(--primary); box-shadow: var(--ring); background: var(--panel); }
.task-local-search, .ticket-local-search, .project-local-search, .notes-local-search { flex: 0 0 150px; }
.local-search-icon { flex: 0 0 auto; font-size: 13px; line-height: 1; opacity: .65; pointer-events: none; user-select: none; }
.content-local-search .input { pointer-events: auto; cursor: text; }
.content-local-search .input {
  min-width: 0;
  width: 100%;
  flex: 1;
  height: 32px;
  padding: 0 4px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
}
.content-local-search .input::placeholder { color: var(--muted); font-weight: 500; }
.content-local-search .icon-btn { width: 22px; height: 22px; padding: 0; flex: 0 0 22px; border: 0; background: transparent; color: var(--muted); }
.content-local-search .icon-btn:hover { color: var(--text); background: var(--border); }
.mindmap-viewer { width: 100%; max-width: 100%; }
.mindmap-viewer .modal-body { background: #eef2f7; }

.due-quick { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.due-quick .chip { padding: 4px 10px; font-size: 11px; }
.chip.select.status-sel { font-weight: 700; font-size: 12.5px; }
.chip.select.status-sel-open { background-color: #fee2e2; color: #b91c1c; border-color: #fca5a5; }
.chip.select.status-sel-pending { background-color: #fef3c7; color: #b45309; border-color: #fcd34d; }
.chip.select.status-sel-resolved { background-color: #dcfce7; color: #15803d; border-color: #86efac; }
.chip.select.status-sel-closed { background-color: #f1f5f9; color: #64748b; border-color: #cbd5e1; }
.chip.select.status-sel option { background-color: #fff; color: #1e293b; }

/* ---------- Icon button ---------- */
.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 15px;
  color: var(--muted);
  padding: 6px;
  border-radius: 8px;
  transition: .15s;
  line-height: 1;
}
.icon-btn:hover { color: var(--text); background: var(--panel); }

/* ---------- Empty state ---------- */
.empty {
  text-align: center;
  color: var(--muted);
  padding: 38px 0;
  font-size: 13.5px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--panel-2);
}
.empty .icon { font-size: 32px; display: block; margin-bottom: 8px; }

/* ---------- Bar (progress) ---------- */
.bar {
  height: 8px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
  margin-top: 10px;
  position: relative;
}
.bar > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
  transition: width .6s var(--ease);
}

/* ---------- Kanban ---------- */
.kanban {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 760px) { .kanban { grid-template-columns: 1fr; } }
.kcol {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  min-height: 120px;
}
.khead {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 10px;
  padding: 2px 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.khead .count {
  font-size: 11px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1px 7px;
}
.kbody {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 50px;
  transition: background .15s;
}
.kbody.drag-over { background: rgba(99,102,241,.06); border-radius: 10px; }
.kcard {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 11px;
  padding: 11px 12px;
  cursor: grab;
  transition: transform .15s var(--ease), box-shadow .15s, border-color .15s;
}
.kcard:active { cursor: grabbing; }
.kcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.kcard .kt { font-size: 13.5px; font-weight: 650; line-height: 1.35; word-break: break-word; }
.kcard .ktags { display: flex; flex-wrap: wrap; gap: 4px; margin: 5px 0 2px; }
.ktag { cursor: pointer; transition: transform .12s, box-shadow .12s; }
.ktag:hover { transform: translateY(-1px); box-shadow: 0 2px 5px rgba(99,102,241,.2); }
.kcard .ktag { font-size: 11px; padding: 1px 7px; }
.kcard .km { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; font-size: 11px; color: var(--muted); align-items: center; }
.kcard .km .ava {
  margin-left: auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  flex-shrink: 0;
}
.kcard .kfoot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}
.kcard .kprogress {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.progress-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.progress-pills .chip {
  cursor: pointer;
  font-size: 12px;
  padding: 3px 10px;
}
.progress-pills .chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.icon-btn.danger {
  color: var(--danger);
}
.icon-btn.danger:hover {
  background: rgba(239,68,68,.08);
}
.icon-btn.pin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  transition: color .15s var(--ease), background .15s var(--ease);
}
.icon-btn.pin-btn:hover { color: var(--text); background: var(--panel-2); }
.icon-btn.pin-btn:active { transform: scale(.94); }
.icon-btn.pin-btn.pinned { color: var(--warning); background: transparent; }
.icon-btn.pin-btn.pinned:hover { color: #d97706; background: #fff7ed; }
.icon-btn.pin-btn:focus-visible { outline: none; box-shadow: 0 0 0 2px rgba(99,102,241,.24); }
.pin-mark {
  position: relative;
  display: block;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 14px solid currentColor;
}
/* 未置顶：空心向上三角形 */
.pin-mark::after {
  content: '';
  position: absolute;
  left: -5px;
  top: 3px;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 9px solid var(--panel);
}
/* 已置顶：同一向上三角形填充 */
.pin-btn.pinned .pin-mark::after { display: none; }

/* 看板拖拽动画与置顶样式 */
.kcard {
  transition: transform .18s var(--ease), box-shadow .15s, border-color .15s, opacity .15s;
}
.kcard.dragging {
  opacity: .4;
  transform: scale(.96) rotate(1.5deg);
  cursor: grabbing;
}
.kbody.drag-over {
  background: rgba(99,102,241,.08);
  border-radius: 10px;
  outline: 2px dashed var(--primary);
  outline-offset: -2px;
}
.kcard.pinned {
  border-left-width: 4px;
  box-shadow: 0 2px 8px rgba(245,158,11,.15);
  background: linear-gradient(135deg, rgba(245,158,11,.04), var(--panel) 40%);
}
.kcard.pinned::before {
  content: '📌';
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 11px;
  opacity: .5;
}
.kcard { position: relative; }
.kfoot-acts {
  display: flex;
  align-items: center;
  gap: 2px;
}
.item.pinned {
  background: rgba(245,158,11,.04);
  border-left: 3px solid var(--warning);
}

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  table-layout: auto;
}
.data-table th {
  text-align: left;
  font-weight: 700;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 8px 8px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 8px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.data-table tbody tr { transition: background .12s; }
.data-table tbody tr:hover { background: var(--panel-2); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* 成员管理表格：紧凑列宽、无横向滚动 */
.member-table {
  min-width: auto; /* 取消全局 980px 最小宽度 */
  width: 100%;
  font-size: 12.5px;
}
.member-table th,
.member-table td {
  padding: 9px 8px; /* 比全局 11px 12px 更紧凑 */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.member-table th { font-size: 11px; }

/* ---------- Modal ---------- */
.mask {
  position: fixed;
  inset: 0;
  /* 不使用 backdrop-filter：软件渲染（无 GPU）环境下会导致弹窗内表单点击/输入偶发失效（命中测试异常） */
  background: rgba(15,23,42,.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 18px;
}
.mask.show { display: flex; animation: fadeIn .2s var(--ease); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 26px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  max-height: 92vh;
  overflow: auto;
  animation: modalIn .28s var(--ease);
}
.modal.lg { max-width: 640px; }
.modal.xl { max-width: 860px; padding: 0; border-radius: 14px; }
.modal.xl .modal-head { padding: 7px 10px; margin-bottom: 0; }
.modal.xl .modal-body { padding: 0 10px 6px; }
.modal.xl .modal-foot { padding: 0 10px 6px; margin-top: 0; }
.modal.xl .task-meta-row { margin-bottom: 8px; }
.modal.xl .sec-title { margin: 8px 0 4px; }
.modal.xl .mt-16 { margin-top: 8px; }
.modal.xl .comment-item { padding: 7px 0; }

/* 思路图查看浮窗：外层 #modal 承载唯一一层圆角容器，iframe 尽量铺满内容区 */
/* 所有业务弹窗统一单层：内部 modal-panel 只负责结构，视觉由外层 #modal 绘制 */
#modal:has(.modal-panel) {
  padding: 0;
  overflow: hidden;
  border-radius: 20px;
}
#modal:has(.modal-panel-lg) { max-width: 640px; }
#modal:has(.modal-panel-xl) { max-width: 860px; }
#modal:has(.modal-panel) .modal-panel {
  width: 100%;
  max-width: none;
  padding: 26px;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: auto;
  max-height: 92vh;
}
#modal:has(.modal-panel-lg) .modal-panel { padding: 26px; }
/* xl 详情弹窗保留原尺寸，但补回统一的安全页边距，避免内容贴边 */
#modal:has(.modal-panel-xl) .modal-panel {
  padding: 22px 24px 20px;
}
#modal:has(.modal-panel-xl) .modal-panel .modal-head {
  margin-bottom: 18px;
}
#modal:has(.modal-panel-xl) .modal-panel .modal-foot {
  margin-top: 20px;
}
#modal:has(.modal-panel) .modal-panel .modal-head,
#modal:has(.modal-panel) .modal-panel .modal-body,
#modal:has(.modal-panel) .modal-panel .modal-foot { position: relative; }

#modal:has(.mindmap-viewer) {
  width: min(1600px, calc(100vw - 32px));
  max-width: 1600px;
  height: 92vh;
  max-height: 92vh;
  padding: 0;
  overflow: hidden;
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  position: relative;
}
#modal:has(.mindmap-viewer) .mindmap-viewer {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}
#modal:has(.mindmap-viewer) .modal-head {
  flex: 0 0 auto;
  padding: 14px 28px 12px;
  margin: 0;
  border-bottom: 1px solid var(--border);
}
#modal:has(.mindmap-viewer) .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 10px;
  overflow: hidden;
  background: #f7f8fb;
  isolation: isolate;
  position: relative;
  z-index: 1;
  contain: strict;
}
#modal:has(.mindmap-viewer) .modal-body iframe {
  width: 100%;
  height: 100%;
  max-height: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  display: block;
  pointer-events: auto;
}
#modal:has(.mindmap-viewer) .modal-foot {
  flex: 0 0 auto;
  margin: 0;
  padding: 12px 28px 14px;
  border-top: 1px solid var(--border);
  background: var(--panel);
  position: relative;
  z-index: 9999;
  pointer-events: auto;
  box-shadow: 0 -4px 12px rgba(0,0,0,.06);
}

/* 手动推送表单：角色/成员 chip 选中态 */
.pj-chip.active { background: var(--primary-bg, #eef2ff); border-color: var(--primary, #6366f1); color: var(--primary, #6366f1); font-weight: 600; }
.pj-user-item { min-width: 0; }
.pj-user-item.active { background: var(--primary-bg, #eef2ff); border-color: var(--primary, #6366f1); }
.pj-user-item input[type="checkbox"] { flex: 0 0 auto; }
.pj-user-item .pj-user-text { min-width: 0; flex: 1; overflow: hidden; }
.pj-user-item .pj-user-text > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.pj-user-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; scrollbar-width: thin; }

/* ---------- 统一详情弹窗（项目 / 工单 / 小记 / 方案） ---------- */
.detail-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.detail-modal .panel {
  margin-bottom: 8px !important;
  padding: 10px !important;
}
.detail-modal .mb-16 { margin-bottom: 8px; }
.detail-modal .sec-title { margin: 8px 0 4px !important; }
.detail-modal .divider { margin: 8px 0; }
.detail-modal .cd-summary {
  padding: 10px !important;
  font-size: 13px !important;
}
.detail-modal .cd-body {
  padding: 12px;
  margin: 0 0 12px;
  min-height: 40px;
  font-size: 13px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.task-meta-row + .task-meta-row {
  margin-top: 12px;
  margin-bottom: 16px;
}
.ticket-customer-value { font-size: 13px; line-height: 1.35; }
.ticket-source-tag.source-taobao { background: #fff1e6; color: #c2410c; }
.ticket-source-tag.source-xhs { background: #fce7f3; color: #be185d; }
.ticket-source-tag.source-douyin { background: #e0f2fe; color: #0369a1; }
.ticket-source-tag.source-other { background: #ede9fe; color: #6d28d9; }
.ticket-detail-actions { margin-top: 20px !important; padding-top: 12px !important; }
.detail-modal .ticket-detail-actions { gap: 10px; flex-wrap: wrap; }
.task-new-btn { margin-left: 12px; }
.dashboard-subnav { display: flex; gap: 6px; margin-bottom: 16px; padding: 4px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; }
.dashboard-subnav-tab { border: 0; background: transparent; color: var(--muted); padding: 8px 14px; border-radius: 8px; font: inherit; cursor: pointer; }
.dashboard-subnav-tab.active, .dashboard-subnav-tab:hover { background: var(--panel); color: var(--primary); box-shadow: var(--shadow-sm); }
.dashboard-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dashboard-date-range { display: inline-flex; align-items: center; gap: 6px; }
.dashboard-date-range input[type="date"] { min-width: 142px; }
.dashboard-workload-table th, .dashboard-workload-table td { white-space: nowrap; }
.dashboard-member-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.dashboard-member-card { padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel-2); }
.dashboard-member-head { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; }
.dashboard-member-head .tag { margin-left: auto; }
.dashboard-member-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.dashboard-member-metrics span { padding: 8px 4px; border-radius: 8px; background: var(--panel); }
.dashboard-member-metrics b { display: block; font-size: 20px; color: var(--primary); }
.dashboard-member-metrics small { display: block; color: var(--muted); font-size: 11px; white-space: nowrap; }
.dashboard-member-metrics .overdue b { color: var(--danger); }
.dashboard-project-progress { margin-top: 16px; }
.project-progress-row { margin-bottom: 16px; cursor: pointer; }
.project-progress-row:hover .project-progress-link { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.project-progress-row:last-child { margin-bottom: 0; }
.project-progress-label { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; font-size: 13px; }
.project-progress-label > span:last-child { color: var(--primary); font-weight: 700; }
.project-progress-label small { color: var(--muted); font-weight: 400; }
.project-progress-track { height: 12px; overflow: hidden; border-radius: 999px; background: var(--border); }
.project-progress-bar { height: 100%; min-width: 0; border-radius: inherit; transition: width .3s var(--ease); }

.detail-modal .cd-tags-row {
  margin: 0 0 14px;
  padding: 0;
  border: 0;
  gap: 8px;
}
.task-tags-block {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 6px 0 8px !important;
  padding: 0 !important;
}
.task-description-block {
  position: relative;
  z-index: 0;
  clear: both;
  display: block;
  width: 100%;
  margin: 0 0 20px !important;
  padding: 14px 16px !important;
  min-height: 68px;
}
/* 子任务列表 */
.task-subtasks { margin-bottom: 12px; }
.subtask-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.subtask-item:last-child { border-bottom: 0; }
.subtask-check {
  flex-shrink: 0;
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; cursor: pointer; color: transparent;
  transition: background .15s, border-color .15s, color .15s;
}
.subtask-check.checked { background: var(--primary); border-color: var(--primary); color: #fff; }
.subtask-check:hover { border-color: var(--primary); }
.subtask-title { flex: 1; min-width: 0; font-size: 13px; line-height: 1.5; word-break: break-word; }
.subtask-title.done { text-decoration: line-through; color: var(--muted); }
.subtask-del { flex-shrink: 0; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--muted); border-radius: 6px; font-size: 16px; font-weight: 700; opacity: 0; transition: opacity .15s, color .15s; }
.subtask-item:hover .subtask-del { opacity: 1; }
.subtask-del:hover { color: var(--danger); background: rgba(239,68,68,.08); }
.subtask-add { display: flex; gap: 6px; align-items: center; margin-bottom: 16px; }
.subtask-input { flex: 1; min-width: 0; height: 32px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; background: var(--input-bg); color: var(--text); }
.subtask-input::placeholder { color: var(--muted); font-size: 12px; }
.subtask-edit-input { flex: 1; min-width: 0; height: 28px; padding: 2px 8px; border: 1px solid var(--primary); border-radius: 6px; font-size: 13px; background: var(--input-bg); color: var(--text); }
.detail-modal .cd-inline-edit {
  margin: 14px 0 24px;
  padding: 0;
}
.detail-modal .rte-wrapper,
.detail-modal .rte-wrapper .rte-toolbar,
.detail-modal .rte-wrapper .rte-editor {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.detail-modal .rte-toolbar,
.detail-modal .rte-editor {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.detail-modal .proj-rate { margin-top: 2px; }
.detail-modal .comment-item { padding: 7px 0; }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
.modal h3 { font-size: 18px; margin-bottom: 0; font-weight: 800; letter-spacing: -.01em; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 12px; }
.modal-head h3 { margin: 0; }
.modal-close {
  background: none;
  border: 1px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
  font-size: 16px;
  color: var(--muted);
  padding: 4px 10px;
  transition: .15s;
  line-height: 1;
}
.modal-close:hover { color: var(--text); border-color: var(--border-strong); }
.modal-body { }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }

/* ---------- Form ---------- */
.field { margin-bottom: 14px; }
.field label, .form-group label {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 600;
  letter-spacing: .01em;
}
.field input, .field textarea, .field select,
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: .15s;
}
.field input:focus, .field textarea:focus, .field select:focus,
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--ring);
  background: var(--panel);
}
.field textarea, .form-group textarea { resize: vertical; min-height: 70px; }
.form-row { display: flex; gap: 12px; }
.form-row .field, .form-row .form-group { flex: 1; margin-bottom: 14px; }

/* 备份范围选择：标签与下拉条同行，下拉条宽度自适应 */
.bk-scope-field { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bk-scope-field label { margin-bottom: 0; }
.bk-scope-select { width: auto; min-width: 220px; max-width: 320px; }

/* ---------- Storage settings ---------- */
.radio-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.radio-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 15px 16px;
  border: 1.5px solid var(--border-strong);
  border-radius: 12px;
  background: var(--panel-2);
  cursor: pointer;
  transition: .15s var(--ease);
}
.radio-card:hover {
  border-color: var(--primary);
  background: var(--panel);
  transform: translateY(-1px);
}
.radio-card input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.radio-card .rc-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}
.radio-card .rc-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}
.radio-card .rc-check {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-strong);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: .15s;
}
.radio-card .rc-check::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  transform: scale(0);
  transition: .15s;
}
.radio-card.selected {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(99,102,241,.08), rgba(139,92,246,.04));
  box-shadow: var(--ring);
}
.radio-card.selected .rc-check {
  border-color: var(--primary);
  background: var(--primary);
}
.radio-card.selected .rc-check::after {
  transform: scale(1);
}

.storage-config-card {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-2);
}
.storage-config-card .field { margin-bottom: 12px; }
.storage-config-card .field:last-child { margin-bottom: 0; }

.storage-presets {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 10px 12px;
  background: rgba(99,102,241,.05);
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
}
.storage-presets .btn { font-size: 12px; padding: 5px 10px; }

.storage-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.storage-migrate {
  margin-top: 18px;
  padding: 16px;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  background: rgba(99,102,241,.03);
}
.storage-migrate-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.storage-migrate-desc {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
  line-height: 1.45;
}
.storage-migrate-btns {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------- Comment ---------- */
.comment-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.comment-item:last-child { border-bottom: none; }
.comment-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.comment-author { font-weight: 700; font-size: 13px; }
.comment-time { font-size: 11px; color: var(--muted); margin-left: auto; }
.comment-actions { display: inline-flex; gap: 2px; margin-left: 4px; }
.cmt-act { cursor: pointer; opacity: 0.4; font-size: 12px; padding: 2px 5px; border-radius: 6px; transition: all 0.15s; user-select: none; }
.cmt-act:hover { opacity: 1; background: rgba(99,102,241,0.12); }
.comment-body { font-size: 13px; line-height: 1.6; padding-left: 36px; word-break: break-word; }
.comment-body.editing .cmt-edit-input { width: 100%; }

/* ---------- Section title ---------- */
.sec-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin: 16px 0 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
/* sec-title 内的 emoji 图标
   Segoe UI Emoji 等字体给 emoji 字符 1–2px 的左 bearing（leading side bearing），
   直接 inline 渲染时其"视觉左缘"会偏右 1–2px，
   导致 emoji + 标题看起来与下方 comment-item / attach-item 等内容的左缘错位。
   用 inline-block span + 负 margin-left 把视觉左缘向左补偿对齐到模态容器左缘。 */
.sec-icon {
  display: inline-block;
  margin-left: -2px;
  font-style: normal;
  font-weight: normal;
}

/* ---------- Divider ---------- */
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* ---------- Login page ---------- */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}
.login-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 32px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo .logo-icon { font-size: 40px; display: block; margin-bottom: 10px; }
.login-logo h1 {
  font-size: 22px;
  font-weight: 800;
  background: var(--primary-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}
.login-logo p { font-size: 13px; color: var(--muted); }
.login-error {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: 11px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 14px;
  font-weight: 600;
}
/* 登录页服务器切换徽标 */
.login-foot {
  margin-top: 14px;
  display: flex;
  justify-content: center;
}
.server-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
  user-select: none;
}
.server-badge:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: #eef2ff;
}
.server-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34,197,94,.18);
}
.login-hint {
  margin-top: 20px;
  padding: 14px;
  background: var(--panel-2);
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}
.login-hint code {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 11px;
}
.demo-accounts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.demo-account {
  cursor: pointer;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: var(--panel);
  transition: .15s;
}
.demo-account:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }

/* ---------- Toast ---------- */
/* 位置：界面右下角。用 bottom 对齐（而非 top），消息从下往上堆叠：
   最新一条在最下方，靠近视线落点，符合桌面端浮动提示（toastWindow）的习惯。
   注意：column 布局下最后插入的 DOM 排在最下方，因此新消息天然出现在底部。 */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  pointer-events: none;   /* 容器不拦截点击，避免遮挡右下角内容 */
}
.toast {
  padding: 10px 16px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastIn .25s var(--ease);
  max-width: 380px;
  pointer-events: auto;   /* 单条提示本身可交互（如未来加关闭按钮） */
}
.toast.success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.toast.error { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.toast.warning { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.toast.info { background: #e0e7ff; color: #4338ca; border: 1px solid #c7d2fe; }
/* 右下角位置：改为由下往上淡入（原为从右侧滑入，在底部位置会显得横向突兀） */
@keyframes toastIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* 小屏适配：窄屏时提示铺满可用宽度，避免长文案挤压 */
@media (max-width: 560px) {
  .toast-container { bottom: 16px; right: 12px; left: 12px; align-items: stretch; }
  .toast { max-width: none; }
}

/* ---------- Misc helpers ---------- */
.flex { display: flex; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.text-sm { font-size: 12px; }
.text-lg { font-size: 16px; }
.text-muted { color: var(--muted); }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.cursor-pointer { cursor: pointer; }
.text-center { text-align: center; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
::-webkit-scrollbar-track { background: transparent; }
::selection { background: rgba(99,102,241,.22); }

/* ---------- Calendar ---------- */
.cal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.cal-head .cal-title { font-size: 17px; font-weight: 800; letter-spacing: -.01em; min-width: 120px; }
.cal-head .chips { margin-left: auto; }
.cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.cal .dow {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  padding: 8px 0 6px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.cal .cell {
  min-height: 88px;
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 6px 7px;
  cursor: pointer;
  background: var(--panel);
  transition: transform .15s var(--ease), box-shadow .15s, border-color .15s;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
}
.cal .cell:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.cal .cell.today {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(99,102,241,.22);
}
.cal .cell.muted { opacity: .4; background: var(--panel-2); cursor: default; }
.cal .cell.muted:hover { border-color: var(--border); box-shadow: none; transform: none; }
.cal .cell .dn {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
}
.cal .cell.today .dn { color: var(--primary); }
.cal .cell .dn .cnt {
  font-size: 10px;
  color: var(--primary);
  background: #e0e7ff;
  border-radius: 6px;
  padding: 1px 5px;
  font-weight: 700;
}
.cal .cell .ecal {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.cal .cell .ecal.task { background: #e0e7ff; color: #4338ca; }
.cal .cell .ecal.task.done { background: #dcfce7; color: #15803d; text-decoration: line-through; }
.cal .cell .ecal.ticket { background: #fef3c7; color: #b45309; }
.cal .cell .ecal.ticket.resolved { background: #dcfce7; color: #15803d; }
.cal .cell .more { font-size: 10px; color: var(--muted); padding: 0 5px; }
@media (max-width: 640px) {
  .cal .cell { min-height: 60px; padding: 4px 5px; }
  .cal .cell .ecal { font-size: 9px; }
  .cal .cell .dn { font-size: 11px; }
}

/* ---------- Calendar: 周视图 ---------- */
.cal-view-tabs { margin-left: auto; }
.cal-subfilters { display: flex; flex-direction: column; gap: 14px; width: 100%; margin-bottom: 14px; }
.cal-owner-row { display: flex; align-items: center; gap: 10px; width: 100%; flex-basis: 100%; margin-top: 0; margin-bottom: 0; }
.cal-owner-filter { display: inline-flex; align-items: center; gap: 6px; }
.cal-owner-filter label { color: var(--muted); font-size: 12px; white-space: nowrap; cursor: default; }
.cal-owner-filter .cal-owner-label { display: inline-flex; align-items: center; cursor: default; }
.cal-owner-tip { white-space: nowrap; }
.cal-head .cal-filters { margin-left: 0; flex-wrap: wrap; margin-bottom: 0; }
.cal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}
.cal-week .wcol {
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--panel);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 220px;
}
.cal-week .wcol.today { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(99,102,241,.18); }
.cal-week .whead {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-2);
  cursor: pointer;
  font-weight: 600;
}
.cal-week .whead:hover { color: var(--primary); }
.cal-week .wcol.today .whead { color: var(--primary); background: #eef2ff; }
.cal-week .whead b { font-size: 13px; color: var(--text); }
.cal-week .wcol.today .whead b { color: var(--primary); }
.cal-week .wcnt {
  margin-left: auto;
  font-size: 10px;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  padding: 1px 6px;
  font-weight: 700;
}
.cal-week .wbody { padding: 6px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.cal-week .witem {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-left: 3px solid var(--primary);
  background: var(--panel-2);
  border-radius: 6px;
  padding: 5px 7px;
  cursor: pointer;
  transition: transform .12s var(--ease), box-shadow .12s;
}
.cal-week .witem:hover { transform: translateX(2px); box-shadow: var(--shadow-sm); }
.cal-week .witem.task { background: #eef2ff; }
.cal-week .witem.task.done .wtitle { text-decoration: line-through; color: var(--muted); }
.cal-week .witem.ticket { border-left-color: #f59e0b; background: #fffbeb; }
.cal-week .witem.ticket.resolved .wtitle { text-decoration: line-through; color: var(--muted); }
.cal-week .witem .wtype { font-size: 11px; }
.cal-week .witem .wtitle {
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.cal-week .witem .wmeta { font-size: 10px; color: var(--muted); }
.cal-week .wempty { text-align: center; color: var(--muted); font-size: 11px; margin-top: 10px; }
@media (max-width: 900px) {
  .cal-week { grid-template-columns: 1fr; gap: 10px; }
  .cal-week .wcol { min-height: auto; }
  .cal-week .wbody { flex-direction: row; flex-wrap: wrap; }
  .cal-week .witem { flex: 1; min-width: 200px; }
  .cal-week .wempty { display: none; }
}

/* ---------- Review week bars ---------- */
.week-bars { display: flex; flex-direction: column; gap: 10px; }
.week-bars > .wbar {
  display: grid;
  grid-template-columns: 56px 1fr 48px;
  align-items: center;
  gap: 10px;
}
.week-bars > .wbar > span { font-size: 12px; color: var(--muted); font-weight: 600; }
.week-bars > .wbar > .track {
  height: 8px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}
.week-bars > .wbar > .track > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--primary-grad);
  transition: width .6s var(--ease);
}
.week-bars > .wbar > b { font-size: 13px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Projects ---------- */
.proj-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.proj-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-top: 3px solid var(--pc, var(--primary));
  border-radius: var(--radius);
  padding: 16px 16px 14px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .2s, border-color .2s;
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
}
.proj-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.proj-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; }
.proj-name {
  font-size: 15px;
  font-weight: 750;
  letter-spacing: -.01em;
  display: flex;
  align-items: center;
  gap: 8px;
  word-break: break-word;
}
.proj-dot { display: inline-block; width: 11px; height: 11px; border-radius: 4px; flex-shrink: 0; }
.proj-desc {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 38px;
}
.proj-rate { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--muted); font-weight: 600; min-height: 20px; }
.proj-rate b { font-size: 15px; color: var(--text); font-variant-numeric: tabular-nums; }
.pbar-seg { height: 9px; border-radius: 999px; background: var(--border); overflow: hidden; display: flex; }
.pbar-seg .seg { height: 100%; transition: width .5s var(--ease); }
.pbar-seg .seg.todo { background: #cbd5e1; }
.pbar-seg .seg.prog { background: var(--warning); }
.pbar-seg .seg.done { background: var(--success); }
.pbar-seg .seg.empty { background: transparent; }
.proj-stats { display: flex; gap: 5px; flex-wrap: nowrap; align-items: center; min-width: 0; min-height: 30px; }
.proj-stats > * { flex-shrink: 0; }
.proj-stats .ps {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px 6px;
  white-space: nowrap;
}
.proj-stats .proj-due {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px 6px;
  margin-left: 2px;
  white-space: nowrap;
}
.proj-stats .proj-due.overdue { color: var(--danger); background: #fee2e2; border-color: #fecaca; }
.proj-stats .ps i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.proj-stats .ps.todo i { background: #cbd5e1; }
.proj-stats .ps.prog i { background: var(--warning); }
.proj-stats .ps.done i { background: var(--success); }
.proj-stats .ps.overdue { color: #b91c1c; border-color: #fecaca; background: #fee2e2; }
.proj-stats .ps.overdue i { background: var(--danger); }
.proj-stats .ps b { color: var(--text); font-variant-numeric: tabular-nums; }
.task-follow-btn { border: 0; background: transparent; color: var(--muted); font-size: 18px; line-height: 1; padding: 2px 5px; cursor: pointer; border-radius: 6px; }
.task-follow-btn:hover, .task-follow-btn.followed { color: #f59e0b; background: #fef3c7; }
.task-origin { color: var(--muted); }
.content-fav-btn { color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; padding: 2px 5px; border-radius: 6px; }
.content-fav-btn:hover, .content-fav-btn.favorited { color: #f59e0b; background: #fef3c7; }
.ticket-follow-star { display: inline-block; font-size: 15px; line-height: 1; cursor: pointer; margin-right: 4px; color: var(--muted); transition: color .15s; }
.ticket-follow-star.favorited, .ticket-follow-star:hover { color: #f59e0b; }
.proj-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 6px; min-height: 40px; }
.proj-acts { display: flex; gap: 2px; }
.proj-top-side { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.proj-fav-btn {
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  opacity: .4;
  transition: opacity .15s, transform .15s, color .15s;
  user-select: none;
  color: var(--muted);
}
.proj-fav-btn:hover { opacity: 1; transform: scale(1.2); color: #f59e0b; }
.proj-fav-btn.followed { opacity: 1; color: #f59e0b; }
.proj-card.followed {
  border-color: rgba(245, 158, 11, .35);
  box-shadow: 0 0 0 1px rgba(245, 158, 11, .12), var(--shadow-sm);
}

/* ---------- Today: 今日聚焦 / 逾期 ---------- */
.item.overdue { background: #fef2f2; }
.item.overdue:hover { background: #fee2e2; }
.overdue-title { color: var(--danger, #ef4444); }
.card.warning { background: #fffbeb; border-color: #fde68a; }
.card.warning .t, .card.warning .n { color: #b45309; }
.card.warning .d { color: #d97706; }

/* ---------- Switch 开关 ---------- */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--border-strong); border-radius: 24px; transition: .25s;
}
.switch .slider:before {
  content: ''; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%; transition: .25s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider:before { transform: translateX(20px); }
.switch input:focus-visible + .slider { box-shadow: 0 0 0 3px rgba(99,102,241,.25); }

/* ---------- 导航栏显示设置 ---------- */
.nav-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.nav-config-item {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  transition: .15s var(--ease);
}
.nav-config-item:hover { background: var(--panel); border-color: var(--border-strong); }
.nav-config-item.on { border-color: rgba(99,102,241,.35); background: rgba(99,102,241,.06); }
.nav-config-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  width: 100%;
}
.nav-config-ico { font-size: 20px; line-height: 1; flex-shrink: 0; }
.nav-config-name { font-size: 13.5px; font-weight: 600; color: var(--text); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-config-label .switch { flex-shrink: 0; }

/* ---------- 模块权限配置矩阵 ---------- */
.rm-grid-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.rm-grid {
  display: grid;
  grid-template-columns: 96px repeat(var(--rm-cols, 5), minmax(72px, 1fr)) 44px;
  min-width: max-content;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.rm-cell { min-width: 0; }
.rm-cell {
  background: var(--panel);
  padding: 10px 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  font-size: 12.5px;
  white-space: nowrap;
}
.rm-cell.rm-head {
  background: var(--panel-2);
  font-weight: 600;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  padding: 10px 6px;
}
.rm-cell.rm-role {
  justify-content: flex-start;
  font-weight: 600;
  padding-left: 12px;
  font-size: 13px;
}
.rm-cell.rm-locked {
  color: var(--primary);
  font-weight: 700;
  font-size: 16px;
}
.rm-cell .icon-btn { padding: 4px 6px; }
.rm-grid .switch { transform: scale(.85); }
.rm-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 10px;
  border-radius: 4px;
  background: rgba(99,102,241,.12);
  color: var(--primary);
  font-weight: 500;
  vertical-align: middle;
}
@media (max-width: 720px) {
  .rm-grid { grid-template-columns: 88px repeat(var(--rm-cols, 5), minmax(80px, 1fr)) 40px; }
  .rm-cell { padding: 8px 2px; font-size: 11.5px; }
}

/* ---------- 方案类型管理 ---------- */
.ct-grid {
  display: grid;
  grid-template-columns: 64px minmax(150px, 1.5fr) minmax(120px, 1.2fr) 70px 70px 90px;
  gap: 1px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--border);
}
.ct-cell {
  background: var(--panel);
  padding: 12px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
.ct-cell.ct-head {
  background: var(--panel-2);
  font-weight: 600;
  font-size: 12.5px;
}
.ct-cell .icon-btn { margin: 0 3px; }
.ct-color-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid var(--border-strong);
}
@media (max-width: 720px) {
  .ct-grid { grid-template-columns: 44px 1.5fr 1fr 50px 50px 80px; }
  .ct-cell { padding: 10px 4px; font-size: 12px; }
}

/* ---------- 附件 / Dropzone ---------- */
.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: 12px;
  padding: 18px 14px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  background: var(--panel-2);
}
.dropzone:hover { border-color: var(--primary); }
.dropzone.dragover {
  border-color: var(--primary);
  background: rgba(99,102,241,.08);
}
.dropzone .dz-icon { font-size: 28px; }
.dropzone .dz-text { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.dropzone .dz-hint { font-size: 11px; color: var(--muted); margin-top: 2px; opacity: .7; }

/* 紧凑附件工具条（替代大 dropzone） */
.attach-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  background: var(--panel-2);
  cursor: pointer;
  position: relative;
  transition: border-color .2s, background .2s, box-shadow .2s;
  flex-wrap: wrap;
  min-height: 48px;
  width: fit-content;
  max-width: 100%;
}
.attach-bar + * { margin-top: 12px; }
/* 详情阅读模式：附件列表后紧接上传按钮时加间距 */
.attach-list + .attach-bar { margin-top: 12px; }
.attach-bar:hover, .attach-bar.dragover {
  border-color: var(--primary);
  background: rgba(99,102,241,.06);
  box-shadow: 0 0 0 3px rgba(99,102,241,.08);
}
.attach-bar:hover::after {
  content: '⌨️ Ctrl+V 也能粘贴';
  position: absolute;
  top: -34px;
  left: 12px;
  padding: 4px 12px;
  background: var(--text);
  color: var(--panel);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  z-index: 5;
  opacity: .92;
}
.attach-bar .ab-btn { font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.attach-bar:hover .ab-btn { color: var(--primary); }
.attach-bar .ab-hint { font-size: 11.5px; color: var(--muted); margin-left: auto; opacity: .65; min-width: 0; }
/* 小记表单：更轻量的附件入口，不影响任务、工单等通用附件工具条。 */
.note-attach-bar { gap: 7px; padding: 5px 9px; border-radius: 7px; }
.note-attach-bar .ab-btn { font-size: 12px; }
.note-attach-bar .ab-hint { font-size: 10.5px; }
.note-attach-bar + input + .attach-list { margin-top: 5px; }

/* ---------- 评论区：按钮工具条 ---------- */
.comment-area {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  background: var(--panel-2);
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.comment-area.dragover {
  border-color: var(--primary);
  background: rgba(99,102,241,.06);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.comment-textarea {
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 13px;
  font-family: inherit;
  min-height: 52px;
  resize: vertical;
  outline: none;
}
.comment-textarea:focus { outline: none; }
.comment-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
}
.btn.ghost {
  background: transparent;
  border: 1px dashed var(--border-strong);
  color: var(--muted);
  box-shadow: none;
}
.btn.ghost:hover { border-color: var(--primary); color: var(--primary); background: rgba(99,102,241,.06); transform: none; box-shadow: none; }

.attach-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 10px; margin-top: 8px; }
.attach-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 10px;
  background: var(--panel-2); border: 1px solid var(--border);
  font-size: 12.5px; transition: border-color .15s;
  min-width: 0;
}
.attach-item:hover { border-color: var(--primary); }
.attach-item .att-icon { font-size: 18px; flex-shrink: 0; width: 40px; height: 40px; border-radius: 8px; background: #fff; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.file-icon { width: 100%; height: 100%; display: block; }
.attach-item .att-thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex-shrink: 0; cursor: zoom-in; border: 1px solid var(--border); }
.attach-item .att-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-item .att-size { color: var(--muted); font-size: 11px; flex-shrink: 0; }
.attach-item .att-del { cursor: pointer; color: var(--danger); font-size: 14px; flex-shrink: 0; opacity: .6; }
.attach-item .att-del:hover { opacity: 1; }
.attach-item .att-rename { cursor: pointer; color: var(--muted); font-size: 14px; flex-shrink: 0; opacity: .55; }
.attach-item .att-rename:hover { opacity: 1; color: var(--primary); }
.attach-item .att-download { cursor: pointer; color: var(--muted); font-size: 14px; flex-shrink: 0; opacity: .55; }
.attach-item .att-download:hover { opacity: 1; color: var(--primary); }
.attach-item .att-link { color: var(--primary); text-decoration: none; }
.attach-item .att-link.clickable { cursor: pointer; }
.attach-item .att-link:hover { text-decoration: underline; }

.attach-thumb { width: 100%; max-height: 200px; border-radius: 8px; margin-top: 4px; object-fit: contain; background: var(--panel-2); }

.attach-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.attach-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 8px; font-size: 11.5px;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  cursor: default; transition: border-color .15s;
}
.attach-chip:hover { border-color: var(--primary); }
.attach-chip .ac-del { cursor: pointer; color: var(--danger); margin-left: 2px; opacity: .5; }
.attach-chip .ac-del:hover { opacity: 1; }
.attach-chip img { width: 16px; height: 16px; border-radius: 3px; object-fit: cover; }

/* 评论项的附件条：缩进 36px 与上方 comment-body 文字起点对齐；上方间距与 comment-head margin-bottom 对齐拉大 */
.comment-attachments { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; padding-left: 36px; }
.comment-att {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 7px; font-size: 11px;
  background: var(--panel-2); border: 1px solid var(--border);
  color: var(--primary); text-decoration: none;
}
.comment-att:hover { border-color: var(--primary); text-decoration: underline; }
.comment-att .file-icon { width: 18px; height: 18px; flex-shrink: 0; } /* 评论附件里 FileUtil.iconFor 默认 80×80 太大，缩到 18px 与 chip 文字对齐 */

/* ---------- 媒体预览 lightbox ---------- */
.preview-overlay {
  position: fixed; inset: 0; z-index: 10001;
  background: rgba(0,0,0,.88);
  display: none; align-items: center; justify-content: center;
  padding: 24px; animation: fadeIn .2s ease;
  /* 桌面端无边框窗口：浮层必须显式 no-drag，否则覆盖到窗口拖拽区的部分
     点击会被"拖动窗口"吃掉（详见 body.embedded 浮层规则处的说明） */
  -webkit-app-region: no-drag;
}
.preview-overlay.show { display: flex; }
.preview-content {
  position: relative; max-width: 92vw; max-height: 92vh;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
/* 关闭按钮：固定到 viewport 右上角，不依赖 .preview-content 尺寸。
   旧版用 position: absolute; top: -44px; right: -4px 在桌面端 detailWindow (720×560)
   小 viewport 下 .preview-content 高度 ≈ 500px 居中后顶距仅 ~30px，
   -44px 让按钮溢出 viewport 顶部 ~14px，按钮上半部分在视口外导致点击无反应。
   fixed 到 viewport 视口永远完整可见可点。 */
.preview-close {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 10002; /* 高于 .preview-overlay 的 10001 */
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.12);
  color: #fff; font-size: 16px; cursor: pointer; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.preview-close:hover { background: rgba(255,255,255,.25); }
.preview-media { max-width: 90vw; max-height: 78vh; display: flex; align-items: center; justify-content: center; }
.preview-img { max-width: 90vw; max-height: 78vh; border-radius: 10px; object-fit: contain; box-shadow: 0 8px 40px rgba(0,0,0,.5); }
.preview-video { max-width: 90vw; max-height: 78vh; border-radius: 10px; background: #000; box-shadow: 0 8px 40px rgba(0,0,0,.5); }
.preview-info { display: flex; align-items: center; gap: 16px; color: rgba(255,255,255,.85); font-size: 13px; }
.preview-name { max-width: 60vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-download { color: #8ab4ff; text-decoration: none; padding: 4px 12px; border-radius: 7px; border: 1px solid rgba(138,180,255,.4); }
.preview-download:hover { background: rgba(138,180,255,.15); }

/* 可点击预览的缩略图 */
.attach-thumb { cursor: pointer; transition: opacity .2s; }
.attach-thumb:hover { opacity: .85; }
.att-preview-btn { cursor: pointer; color: var(--primary); font-size: 12px; flex-shrink: 0; opacity: .7; }
.att-preview-btn:hover { opacity: 1; }
.comment-att.previewable { cursor: pointer; }
.comment-att.previewable:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.comment-att-wrap { display: inline-flex; align-items: center; gap: 2px; }
.catt-del { cursor: pointer; color: var(--danger); font-size: 11px; padding: 2px 4px; opacity: .5; border-radius: 5px; transition: opacity .2s; }
.catt-del:hover { opacity: 1; background: rgba(239,68,68,.1); }

/* ---------- 2026-09-09 评论楼中楼（回复/引用）---------- */
.cmt-replies { margin: 6px 0 2px 36px; padding-left: 12px; border-left: 2px solid var(--border-strong); display: flex; flex-direction: column; gap: 2px; }
.cmt-reply-item { padding: 5px 0 6px; }
.cmt-reply-item + .cmt-reply-item { border-top: 1px dashed var(--border); margin-top: 2px; }
.cmt-reply-head { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; font-size: 12px; color: var(--muted); }
.cmt-reply-head .comment-actions { margin-left: auto; }
.cmt-reply-author { font-weight: 700; font-size: 12px; color: var(--text); }
.cmt-reply-time { font-size: 11px; color: var(--muted); }
.cmt-replies .comment-body { padding-left: 0; } /* 回复正文不再缩进 36px，避免叠层过深 */
.cmt-quote { display: flex; gap: 6px; align-items: baseline; margin: 2px 0 4px; padding: 5px 10px; font-size: 12px; color: var(--muted);
  background: var(--panel-2); border-left: 3px solid var(--primary); border-radius: 0 6px 6px 0; line-height: 1.55; }
.cmt-quote .cq-at { color: var(--primary); font-weight: 700; flex-shrink: 0; }
.cmt-quote .cq-text { word-break: break-all; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cmt-reply-box { margin: 6px 0 4px 36px; padding: 8px 10px 10px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; }
.cmt-reply-target { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.cmt-reply-target .cmt-reply-arrow { color: var(--primary); }
.cmt-reply-target .cmt-reply-name { color: var(--primary); font-weight: 700; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmt-reply-x { cursor: pointer; opacity: .55; font-size: 11px; padding: 1px 4px; border-radius: 5px; transition: opacity .2s; }
.cmt-reply-x:hover { opacity: 1; background: rgba(99,102,241,.12); }
.cmt-reply-input { width: 100%; box-sizing: border-box; padding: 7px 10px; font-size: 13px; font-family: inherit; line-height: 1.5;
  color: var(--text); background: var(--panel); border: 1px solid var(--border-strong); border-radius: 8px; resize: vertical; min-height: 44px; }
.cmt-reply-input:focus { outline: none; border-color: var(--primary); }
.cmt-reply-bar { margin-top: 6px; text-align: right; }
.cmt-reply-bar .btn { background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%); }
.cmt-reply-bar .btn:hover { filter: brightness(1.08); }

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
  .main-content { padding: 12px 14px 44px; }
  .app-header { padding: 12px 14px; }
  .cards { grid-template-columns: 1fr 1fr; }
  .modal { padding: 20px; }
  #modal:has(.modal-panel) { width: calc(100vw - 28px); border-radius: 18px; }
  #modal:has(.modal-panel) .modal-panel { max-height: 94vh; padding: 18px 16px 16px; }
  #modal:has(.modal-panel-xl) .modal-panel { padding: 16px 14px 14px; }
  #modal:has(.mindmap-viewer) { width: calc(100vw - 20px); height: 92vh; max-height: 92vh; border-radius: 18px; }
  #modal:has(.mindmap-viewer) .mindmap-viewer { flex: 1 1 auto; min-height: 0; }
  #modal:has(.mindmap-viewer) .modal-head { padding: 16px 18px 14px; }
  #modal:has(.mindmap-viewer) .modal-body { padding: 10px; }
  #modal:has(.mindmap-viewer) .modal-foot { padding: 12px 18px 14px; }
  #modal:has(.mindmap-viewer) .modal-body iframe { min-height: 0; height: 100%; border-radius: 10px; }
  .kanban { grid-template-columns: 1fr; }
}

/* ---------- Embedded mode（桌面端点任务 → 主窗口切换为任务详情全屏视图） ---------- */
/* 由 TaskPage.openDetailEmbedded 触发：隐藏框架(.app-header/.app-nav/.nav-backdrop)，
   拆掉 .modal-panel 包装层，让 modal-head/body/foot 直接挂到 .embedded-detail-page 下撑满剩余空间 */
body.embedded #main-app > .app-header { display: none; }
body.embedded #main-app > .app-nav,
body.embedded #main-app > .nav-backdrop { display: none; }
body.embedded .main-content { max-width: none; padding: 0; margin: 0; height: 100vh; overflow: hidden; }
body.embedded #page-container { padding: 0; height: 100vh; overflow: hidden; }
body.embedded .embedded-detail-page {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  height: 100vh;
  width: 100vw;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}
/* 嵌入式头部：紧凑、贴边、顶到窗口顶部（无 modal-panel 包裹后无需再 sticky）。
   桌面端独立无边框详情窗把整条头部作为窗口拖拽区（-webkit-app-region: drag），
   仅保留 ✕/🔗/可点按钮为 no-drag，避免无法拖动窗口；浏览器环境无副作用。 */
body.embedded .embedded-detail-page > .modal-head {
  flex: 0 0 auto;
  border-radius: 0;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  -webkit-app-region: drag;
  user-select: none;
  cursor: default;
}
body.embedded .embedded-detail-page > .modal-head h3 { font-size: 16px; }
/* no-drag 子元素禁用文本选择并恢复默认光标：
   拖拽区内若保留 user-select:text,Chromium 在 Windows 会把文本节点渲染成 I-beam(工字钢)；
   交互按钮(✕/🔗)再显式恢复手型 pointer */
body.embedded .embedded-detail-page > .modal-head h3,
body.embedded .embedded-detail-page > .modal-head button,
body.embedded .embedded-detail-page > .modal-head .modal-close,
body.embedded .embedded-detail-page > .modal-head a {
  -webkit-app-region: no-drag;
  user-select: none;
  cursor: default;
}
body.embedded .embedded-detail-page > .modal-head button,
body.embedded .embedded-detail-page > .modal-head .modal-close,
body.embedded .embedded-detail-page > .modal-head a {
  cursor: pointer;
}
/* 嵌入式正文：左右留够呼吸空间，避免内容贴边 */
body.embedded .embedded-detail-page > .modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px 24px 20px;
  max-height: none;
}
/* 嵌入式底部：紧凑、贴边 */
body.embedded .embedded-detail-page > .modal-foot {
  flex: 0 0 auto;
  padding: 8px 18px;
  border-top: 1px solid var(--border);
  background: var(--panel);
}
/* ===== 关键：嵌入式详情窗内所有浮层必须显式声明 no-drag =====
   嵌入式头部整条是窗口拖拽区（-webkit-app-region: drag）。拖拽区是浏览器底层按矩形
   拦截鼠标事件的机制——浮层即使 z-index 更高盖在上面，只要没声明 no-drag，覆盖到
   拖拽区的那部分点击仍会被"拖动窗口"吃掉，不会派发给浮层内元素。
   现象：预览浮层的 ✕ 与头部自身 ✕ 重叠处（头部 ✕ 有 no-drag）能点，其余部分点不动，
   即"只有精确移到 ✕ 上才能关闭"。浏览器环境无 app-region 语义，故网页端正常。
   这里统一给嵌入式下所有浮层/浮层内可交互元素恢复 no-drag。 */
body.embedded .preview-overlay,
body.embedded .preview-close,
body.embedded .preview-content,
body.embedded .notif-lightbox,
body.embedded .notif-detail-modal,
body.embedded .search-overlay,
body.embedded .mask,
body.embedded .pl-detail-modal {
  -webkit-app-region: no-drag;
}
/* 嵌入式下详情内容不再有 modal-panel 包裹层（openDetail 搬移时已拆掉，改挂 .embedded-detail-page）。
   此规则限定在 page-container 内兜底，避免波及嵌入式态下正常打开的编辑/新建弹窗（#modal 内）。 */
body.embedded #page-container .modal-panel {
  width: 100%;
  max-width: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  background: var(--panel);
  max-height: 100vh;
  height: 100vh;
  display: flex;
  flex-direction: column;
}
body.embedded .modal-panel-xl { width: 100%; max-width: none; }
/* ===== 附件中心 ===== */
.page-attachments { max-width: 1200px; margin: 0 auto; }

.att-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.att-stat {
  flex: 1;
  min-width: 100px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.att-stat-num { font-size: 22px; font-weight: 800; color: var(--primary); }
.att-stat-label { font-size: 12px; color: var(--muted); }

.att-toolbar {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.att-search { position: relative; display: flex; align-items: center; }
.att-search-ico { position: absolute; left: 12px; font-size: 14px; opacity: .6; pointer-events: none; }
.att-search input {
  width: 100%;
  padding: 9px 12px 9px 34px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: .15s var(--ease);
}
.att-search input:focus { border-color: var(--primary); box-shadow: var(--ring); }
.att-filters { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.att-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.att-chip {
  padding: 5px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  background: var(--panel);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  transition: .15s var(--ease);
  white-space: nowrap;
}
.att-chip:hover { border-color: var(--primary); color: var(--primary); }
.att-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.att-date { display: flex; align-items: center; gap: 6px; }
.att-date input[type="date"] {
  padding: 5px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 12px;
  outline: none;
}
.att-date input[type="date"]:focus { border-color: var(--primary); }
.att-date-sep { color: var(--muted); font-size: 12px; }

.att-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}
.att-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: .15s var(--ease);
}
.att-card:hover { border-color: var(--primary); box-shadow: 0 4px 16px rgba(0,0,0,.08); transform: translateY(-2px); }
.att-thumb {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel-2);
  position: relative;
  cursor: pointer;
  overflow: hidden;
}
.att-thumb-img img { width: 100%; height: 100%; object-fit: cover; }
.att-thumb-icon { font-size: 42px; opacity: .7; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.att-thumb-icon .file-icon { width: 80px; height: 80px; opacity: 1; }
.att-play { position: absolute; font-size: 28px; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.4); }
.att-info { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.att-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.att-meta { display: flex; gap: 8px; align-items: center; font-size: 11px; color: var(--muted); }
.att-meta-2 { font-size: 11px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.att-owner { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-cat { padding: 1px 7px; border-radius: 4px; font-size: 10px; font-weight: 600; text-transform: uppercase; }
.att-cat-image { background: rgba(59,130,246,.15); color: #3b82f6; }
.att-cat-video { background: rgba(139,92,246,.15); color: #8b5cf6; }
.att-cat-document { background: rgba(16,185,129,.15); color: #10b981; }
.att-cat-archive { background: rgba(245,158,11,.15); color: #f59e0b; }
.att-cat-audio { background: rgba(236,72,153,.15); color: #ec4899; }
.att-cat-other { background: rgba(100,116,139,.15); color: #64748b; }
.att-actions { display: flex; gap: 6px; margin-top: auto; padding-top: 6px; }
.att-del:hover { color: var(--danger); }
.att-pager { display: flex; align-items: center; gap: 12px; justify-content: center; margin-top: 20px; padding: 12px; }
.att-pager-info { font-size: 13px; color: var(--muted); }

@media (max-width: 560px) {
  .att-grid { grid-template-columns: 1fr 1fr; }
  .att-filters { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- 小记 ---------- */
.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.note-card {
  border-radius: 12px;
  padding: 14px 16px 12px;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform .15s var(--ease), box-shadow .15s var(--ease);
  border: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  position: relative;
  overflow: hidden;
}
.note-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,.1);
}
.note-card:active { transform: translateY(-1px); }
.note-card-pinned {
  border-left: 4px solid var(--warning);
  box-shadow: 0 2px 8px rgba(245,158,11,.15);
}
.note-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  min-height: 22px;
}
.note-card-side { display: flex; align-items: center; gap: 6px; margin-left: auto; }
/* 顶部左侧置顶文字标识 */
.note-pin-label {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 11px;
  color: #f59e0b;
  font-weight: 600;
  background: rgba(245,158,11,.1);
  padding: 2px 8px;
  border-radius: 4px;
}
/* 置顶三角形按钮（放在关注五角星旁边） */
.note-pin-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  opacity: .45;
  transition: opacity .15s, transform .15s;
  color: #9ca3af;
}
.note-pin-action:hover { opacity: 1; transform: scale(1.15); color: #6b7280; }
.note-pin-action.pinned { opacity: 1; color: #f59e0b; }
.note-pin-action.pinned:hover { color: #d97706; }
.note-pin-action .pin-mark {
  border-left-width: 6px;
  border-right-width: 6px;
  border-bottom-width: 10px;
}
.note-pin-action .pin-mark::after {
  left: -4px;
  top: 2px;
  border-left-width: 4px;
  border-right-width: 4px;
  border-bottom-width: 7px;
}
.note-card-icons { font-size: 12px; opacity: .6; }
.note-fav-btn {
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  opacity: .45;
  transition: opacity .15s, transform .15s;
  user-select: none;
}
.note-fav-btn:hover { opacity: 1; transform: scale(1.2); }
.note-fav-btn.favorited { opacity: 1; color: #f59e0b; }
.note-card-title {
  font-weight: 700;
  font-size: 15px;
  color: #1e293b;
  margin-bottom: 6px;
  word-break: break-word;
  line-height: 1.4;
}
.note-card-preview {
  font-size: 13px;
  color: #475569;
  line-height: 1.5;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.note-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(0,0,0,.06);
  font-size: 11px;
  color: #64748b;
}
.note-card-date { font-size: 11px; color: #64748b; }
.note-owner {
  font-weight: 600;
  color: #6366f1;
}
.note-tag { cursor: pointer; transition: all .15s; }
.note-tag:hover { background: rgba(255,255,255,.95) !important; color: #111827 !important; }
.note-detail-tag {
  cursor: pointer;
  background: var(--panel-2) !important;
  color: var(--text-muted) !important;
  transition: all .15s;
}
.note-detail-tag:hover { background: var(--primary) !important; color: #fff !important; }

/* 颜色选择器 */
.note-color-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.ncp-swatch {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color .15s, transform .15s;
}
.ncp-swatch:hover { transform: scale(1.1); }
.ncp-swatch.active {
  border-color: var(--primary);
  transform: scale(1.1);
}

/* 小记弹窗 - 紧凑分享 chips */
.qn-share-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.qn-share-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 12.5px;
  cursor: pointer;
  background: var(--panel-2, #f1f5f9);
  color: var(--text-secondary, #64748b);
  border: 1px solid var(--border, #e2e8f0);
  transition: all .15s;
  user-select: none;
}
.qn-share-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.qn-share-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* 分享对话框 */
.note-share-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  max-height: 360px;
  overflow-y: auto;
}
.note-share-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s;
  border: 1px solid var(--border);
}
.note-share-item:hover { background: var(--panel-2); }
.note-share-item.checked { background: rgba(99,102,241,.06); border-color: rgba(99,102,241,.2); }
.note-share-item input[type=checkbox] { width: 18px; height: 18px; cursor: pointer; flex-shrink: 0; }
.note-share-info { flex: 1; min-width: 0; }
.note-share-name { font-weight: 600; font-size: 14px; }
.note-share-status { font-size: 12px; color: var(--primary); font-weight: 600; white-space: nowrap; }

/* 详情页分享对象标签 */
.note-share-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px 3px 4px;
  border-radius: 20px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 500;
}
.note-share-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 11px;
  padding: 0 2px;
  line-height: 1;
  display: flex;
  align-items: center;
}
.note-share-remove:hover { color: var(--danger); }

@media (max-width: 560px) {
  .notes-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
}

/* ===== Notification System ===== */
/* 顶栏铃铛 */
.notify-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.notify-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  transition: .15s var(--ease);
}
.notify-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(99,102,241,.08);
}
.notify-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg);
  box-sizing: content-box;
}
/* 下拉面板 */
.notify-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-width: calc(100vw - 32px);
  max-height: 480px;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,.16);
  z-index: 100;
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.notify-panel.show { display: flex; }
.np-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.np-title { font-weight: 700; font-size: 14px; }
.np-all {
  color: var(--primary);
  font-size: 13px;
  cursor: pointer;
}
.np-all:hover { text-decoration: underline; }
.np-loading, .np-empty {
  padding: 32px 14px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.np-list { flex: 1; overflow-y: auto; }
.np-item {
  display: flex;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: .15s var(--ease);
}
.np-item:hover { background: var(--panel-2); }
.np-icon {
  font-size: 16px;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  line-height: 1;
}
.np-body { flex: 1; min-width: 0; }
.np-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.np-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.np-meta { font-size: 11px; color: var(--muted); margin-top: 4px; }
.np-foot {
  padding: 10px;
  text-align: center;
  color: var(--primary);
  font-size: 13px;
  cursor: pointer;
  border-top: 1px solid var(--border);
}
.np-foot:hover { background: var(--panel-2); }

/* 消息中心页面 */
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}
.page-head h2 { margin: 0; }
.page-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.page-actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.module-tabs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.notif-list { display: flex; flex-direction: column; gap: 8px; }
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: .15s var(--ease);
  position: relative;
}
.notif-item:hover {
  border-color: var(--border-strong);
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.notif-item.unread {
  border-color: var(--primary);
  background: rgba(99,102,241,.04);
}
.notif-icon {
  font-size: 22px;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel-2);
  border-radius: 10px;
}
.notif-body { flex: 1; min-width: 0; }
.notif-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.notif-title .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  flex-shrink: 0;
}
.notif-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.5;
  max-height: 4.5em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.notif-image-thumb img {
  display: block;
}
.notif-image-preview img {
  display: block;
}
.notif-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.notif-meta-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.notif-meta-time {
  flex-shrink: 0;
  margin-left: 8px;
}
.notif-type-tag {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
}
.notif-module-tag {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: var(--primary);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
}
.notif-del {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  opacity: 0;
  transition: .15s var(--ease);
}
.notif-item:hover .notif-del { opacity: 1; }
.notif-del:hover { background: var(--danger); color: #fff; }

/* 标签页切换 */
.tab-bar {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.tab-bar .tab {
  padding: 10px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: .15s var(--ease);
}
.tab-bar .tab:hover { color: var(--text); }
.tab-bar .tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.tab-bar .tab .badge-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--danger);
  color: #fff;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

/* 回收站样式 */
.notif-item.trash-item {
  opacity: 0.75;
  background: var(--panel-2);
  border-style: dashed;
}
.notif-item.trash-item:hover {
  opacity: 0.9;
}
.trash-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-left: 52px;
}

/* 消息来源标签 */
.notif-source-tag {
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
  margin-left: 2px;
}
.notif-source-tag.ai {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.12));
  color: #6366f1;
  border: 1px solid rgba(99, 102, 241, 0.25);
  font-weight: 500;
}
.notif-source-tag.manual {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.25);
  font-weight: 500;
}

/* 消息详情弹窗 */
.notif-detail-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.notif-detail-mask {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
}
.notif-detail-dialog {
  position: relative;
  width: 90%;
  max-width: 560px;
  max-height: 80vh;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.notif-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #f0f0f0;
  background: #fafafa;
}
.notif-detail-title {
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
  flex: 1;
  word-break: break-all;
}
.notif-detail-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #6b7280;
  font-size: 18px;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.notif-detail-close:hover {
  background: #f3f4f6;
  color: #1f2937;
}
.notif-detail-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}
.notif-detail-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f3f4f6;
}
.notif-detail-icon {
  font-size: 24px;
  line-height: 1;
}
.notif-detail-meta-item {
  font-size: 13px;
  color: #6b7280;
}
.notif-detail-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}
.notif-detail-tag.ai {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.12));
  color: #6366f1;
  border: 1px solid rgba(99, 102, 241, 0.25);
}
.notif-detail-tag.type {
  background: #f3f4f6;
  color: #6b7280;
}
.notif-detail-content {
  font-size: 14px;
  color: #374151;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}
.notif-detail-attachments {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #f3f4f6;
}
.notif-att-title {
  font-size: 13px;
  color: #6b7280;
  font-weight: 500;
  margin-bottom: 8px;
}
.notif-att-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f9fafb;
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 13px;
}
.notif-att-icon {
  font-size: 16px;
  flex-shrink: 0;
}
.notif-att-name {
  flex: 1;
  color: #3b82f6;
  text-decoration: none;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.notif-att-name:hover {
  text-decoration: underline;
}
.notif-att-size {
  color: #9ca3af;
  font-size: 12px;
  flex-shrink: 0;
}
.notif-att-preview {
  cursor: pointer;
  transition: opacity 0.2s;
}
.notif-att-preview:hover {
  opacity: 0.8;
}
/* Image Lightbox */
.notif-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.notif-lightbox img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
.notif-lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.notif-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
}
.notif-detail-actions {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid #f0f0f0;
  background: #fafafa;
}
.notif-detail-actions .btn {
  flex: 1;
  padding: 10px 16px;
  font-size: 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.notif-detail-actions .btn-secondary {
  background: #fff;
  color: #374151;
  border: 1px solid #d1d5db;
}
.notif-detail-actions .btn-secondary:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

/* 类型筛选 chips */
.type-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip.sm {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 6px;
}
.badge-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  margin-left: 4px;
  border-radius: 8px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

/* 分页 */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}
.page-info { font-size: 13px; color: var(--muted); }

/* 设置页二级导航 */
.mine-settings {
  display: grid;
  grid-template-columns: minmax(148px, 180px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.mine-settings-content { min-width: 0; }
.mine-settings-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky;
  top: 16px;
}
.mine-settings-tab {
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: .15s ease;
}
.mine-settings-tab:hover { background: var(--panel-2); color: var(--text); }
.mine-settings-tab.active {
  background: var(--primary-light);
  border-color: rgba(99, 102, 241, .25);
  color: var(--primary);
}
.mine-settings-content { min-width: 0; }
.mine-settings-group { display: none; }
.mine-settings-group.active { display: block; }
@media (max-width: 720px) {
  .mine-settings { grid-template-columns: 1fr; gap: 12px; }
  .mine-settings-nav { position: static; flex-direction: row; overflow-x: auto; padding-bottom: 2px; }
  .mine-settings-tab { width: auto; flex: 0 0 auto; white-space: nowrap; }
}

/* 消息推送设置 */
.notify-config-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.notify-config-group {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px 8px;
}
.notify-group-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.notify-config-items-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
}
.notify-config-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  font-size: 13px;
  border-right: 1px solid rgba(0,0,0,.04);
}
.notify-config-item:nth-child(6n) {
  border-right: none;
}

/* 数据备份与还原 */
.bk-config-area {
  padding: 14px 16px;
  background: var(--panel-2);
  border-radius: 10px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}
.bk-config-area select {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--panel);
  font-size: 13px;
  cursor: pointer;
}
.bk-s3-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px 16px;
  margin-top: 4px;
}
.bk-restore-warn {
  padding: 16px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  font-size: 13.5px;
  line-height: 1.7;
}
.bk-restore-warn p { margin: 0 0 6px; }

/* ===== 任务动态时间线 ===== */
.task-activity-block { margin: 14px 0; }
/* 任务详情"📜 动态 (n)" 标题：标题内容流式布局贴左，"收起/展开 ▾" 绝对定位贴右
   不依赖 flex space-between：避免在某些 DPI / 缩放 / 容器宽度下表现成"居中"
   字号/字重继承自 .sec-title（13px / 700），与"💬 评论 / 👥 关注人"完全一致 */
.task-activity-head {
  display: block; /* 覆盖 .sec-title 的 display: flex，让标题内容流式靠左 */
  position: relative;
  cursor: pointer;
  user-select: none;
  padding-right: 60px; /* 给右边 toggle 预留位置，避免长标题覆盖 */
}
.task-activity-head:hover { color: var(--primary); }
.task-activity-toggle {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11.5px;
  font-weight: 400;
  color: #9ca3af;
}
.activity-timeline {
  position: relative;
  padding: 6px 0 6px 22px;
  margin: 8px 0 0 6px;
  border-left: 2px solid #eef0f4;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
.activity-item {
  position: relative;
  padding: 9px 0;
  display: flex;
  gap: 10px;
  line-height: 1.55;
}
.activity-item + .activity-item { border-top: 1px dashed #f3f4f6; }
.activity-dot {
  position: absolute;
  left: -28px;
  top: 10px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}
.activity-content { flex: 1; min-width: 0; }
.activity-head {
  display: flex;
  gap: 6px;
  align-items: baseline;
  flex-wrap: wrap;
  font-size: 13px;
}
.activity-actor {
  font-weight: 600;
  color: #1f2937;
  font-size: 13px;
  letter-spacing: 0.1px;
}
.activity-verb {
  color: #6b7280;
  font-size: 12.5px;
  font-weight: 400;
}
.activity-time {
  color: #9ca3af;
  font-size: 11.5px;
  font-weight: 400;
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}
.activity-detail {
  color: #4b5563;
  font-size: 12.5px;
  margin-top: 4px;
  line-height: 1.55;
}
.activity-changes {
  margin-top: 6px;
  padding: 8px 10px;
  background: #f9fafb;
  border-radius: 8px;
  font-size: 12px;
  color: #374151;
  line-height: 1.65;
}
.activity-change { display: block; padding: 1px 0; }
.activity-label {
  color: #6366f1;
  font-weight: 600;
  margin-right: 2px;
  font-size: 12px;
}
.activity-change .old {
  color: #9ca3af;
  text-decoration: line-through;
  font-size: 12px;
}
.activity-change .new {
  color: #111827;
  font-weight: 500;
  font-size: 12px;
}

/* 进度模块：成员未读监控三色胶囊（与通知 accent 主题一致） */
.pill { display:inline-block; min-width:28px; padding:2px 10px; border-radius:999px; font-size:12px; font-weight:600; text-align:center; line-height:1.4; }
.pill-danger { background:#fff1f2; color:#b91c1c; }
.pill-warn   { background:#fff8e1; color:#a16207; }
.pill-info   { background:#eef2ff; color:#274bbf; }

/* ===== 车型库 ===== */
.vehicle-tree { display: flex; flex-direction: column; gap: 14px; }
.vb-brand {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
/* vb-row 在 ct-grid 内需透明化，让子 ct-cell 直接参与 grid 布局 */
.ct-grid > .vb-row {
  display: contents;
}
.vb-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(99,102,241,.06), transparent);
  border-bottom: 1px solid var(--border);
}
.vb-brand-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vb-name { font-size: 16px; font-weight: 700; }
.vb-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.vb-series { padding: 6px 12px 10px; }
.vs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 8px;
  border-bottom: 1px dashed #f3f4f6;
}
.vs-row:last-child { border-bottom: none; }
.vs-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vs-models { padding: 2px 0 4px 22px; }
.vm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 7px 8px;
  background: #fafafa;
  border-radius: 8px;
  margin-bottom: 4px;
}
.vm-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vm-empty, .vs-empty { color: #9ca3af; font-size: 12.5px; padding: 8px; }
.vb-fav { cursor: pointer; color: #d1d5db; font-size: 15px; user-select: none; }
.vb-fav.favorited { color: #f59e0b; }
.vb-fav:hover { color: #f59e0b; }
/* 资源网格：固定 4 列 */
.vehicle-assets-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}
.vehicle-asset-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  min-width: 0;
  background: #fff;
}
.va-media { width: 100%; aspect-ratio: 4/3; background: #f3f4f6; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.va-img { cursor: zoom-in; }
.va-img img { width: 100%; height: 100%; object-fit: cover; }
.va-video video { width: 100%; height: 100%; object-fit: contain; }
.va-link-video { text-align: center; padding: 12px; cursor: pointer; color: #6366f1; font-weight: 600; font-size: 13px; }
.va-doc { cursor: pointer; flex-direction: column; gap: 4px; background: linear-gradient(135deg,#f8fafc,#eef2ff); }
.va-doc .file-icon { width: 80px; height: 80px; }   /* WPS 风格 SVG：与 att-thumb-icon 保持一致 80×80，避免被卡片 4:3 比例拉伸 */
.va-doc-ext { font-size: 11px; font-weight: 700; color: #6366f1; background: rgba(99,102,241,.1); padding: 2px 8px; border-radius: 6px; }
.va-desc { font-size: 12px; color: #4b5563; padding: 0 10px 10px; line-height: 1.55; word-break: break-word; }
.va-desc a { color: var(--primary); word-break: break-all; }
.va-desc a:hover { text-decoration: underline; }
.va-meta { display: flex; align-items: center; gap: 6px; padding: 8px 10px; }
.va-name { flex: 1; font-size: 12px; color: #374151; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


/* 静默刷新（前台回切/悬浮球打开）：内容原地替换时的轻微淡入，避免"抖一下"的感知 */
.page-fade-in { animation: pageFadeIn 0.18s ease-out; }
@keyframes pageFadeIn {
  from { opacity: 0.55; }
  to { opacity: 1; }
}

/* 成员在线状态指示 */
.online-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #d1d5db;
  margin-right: 5px;
  vertical-align: middle;
}
.online-dot.online {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34,197,94,.18);
}

/* ===== 推送日志 ===== */
.pl-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.pl-stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.pl-stat-num {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
}
.pl-stat-label {
  font-size: 13px;
  color: var(--muted);
}
.pl-filter-bar {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 16px;
}
.pl-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.pl-select {
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--panel);
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  min-width: 120px;
}
.pl-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--ring);
}
.pl-input {
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--panel);
  font-size: 13px;
  color: var(--text);
  min-width: 160px;
}
.pl-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--ring);
}
.pl-input.pl-date {
  min-width: 140px;
}
.pl-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pl-log-item {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.2s;
}
.pl-log-item:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.pl-log-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.pl-log-title {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pl-log-time {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.pl-log-preview {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.5;
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pl-log-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}
.pl-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.pl-tag.ai {
  background: #eef2ff;
  color: #6366f1;
}
.pl-tag.manual {
  background: #fffbeb;
  color: #d97706;
}
.pl-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pl-detail-mask {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
}
.pl-detail-dialog {
  position: relative;
  background: var(--panel);
  border-radius: var(--radius);
  width: 90%;
  max-width: 640px;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  z-index: 1001;
}
.pl-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-2);
}
.pl-detail-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  word-break: break-all;
}
.pl-detail-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.pl-detail-close:hover {
  background: var(--border);
  color: var(--text);
}
.pl-detail-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}
.pl-detail-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.pl-info-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}
.pl-info-item {
  color: var(--text);
}
.pl-detail-content-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  margin-top: 16px;
}
.pl-detail-content {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
  background: var(--panel-2);
  padding: 12px;
  border-radius: 8px;
  word-break: break-word;
}
.pl-recipient-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pl-recipient-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
}
.pl-recipient-name {
  color: var(--text);
  font-weight: 500;
}
.pl-recipient-role {
  color: var(--muted);
  font-size: 11px;
}
.pl-recipient-read {
  color: var(--success);
  font-size: 11px;
  font-weight: 500;
}
.pl-recipient-unread {
  color: var(--warning);
  font-size: 11px;
  font-weight: 500;
}
