/* ============ 云端工作平台 - 核心样式（豆小芽配色 v2：深灰+嫩绿+橘红） ============ */
:root {
  --bg: #f7f6f2;                /* 暖灰底 */
  --surface: #ffffff;
  --sidebar-bg: #3a3a3a;        /* 深灰侧栏（呼应logo深灰） */
  --sidebar-text: #d6d6d6;
  --sidebar-active: #ffffff;
  --primary: #585858;           /* 主色=深灰 */
  --primary-dark: #3a3a3a;
  --primary-soft: #f0f0f0;      /* 灰软背景 */
  --accent: #E85828;            /* 品牌橘红（logo嘴巴/心形） */
  --accent-dark: #c44417;
  --accent-soft: #fde7df;       /* 橘软背景 */
  --brand-green: #68B828;       /* logo嫩绿（嫩芽小叶） */
  --text: #2a2a2a;
  --text-2: #6e6e6e;
  --border: #e8e6e0;            /* 暖边 */
  --success: #5ca620;           /* 嫩绿（logo绿调） */
  --success-soft: #e8f5d5;
  --danger: #d8453a;            /* 略偏橘的暖红 */
  --warn: #d97706;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(60,40,20,.08), 0 1px 2px rgba(60,40,20,.04);
  --shadow-lg: 0 8px 24px rgba(60,40,20,.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

.layout { display: flex; min-height: 100vh; }

/* ---------- 侧边栏 ---------- */
.sidebar {
  width: 232px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px 16px;
}
.brand-logo {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #585858, #E85828);
  color: #fff;
  font-size: 18px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.brand-name { color: #fff; font-size: 15px; font-weight: 600; }
.brand-sub { font-size: 11px; opacity: .6; margin-top: 2px; }

.nav { flex: 1; padding: 8px 10px; overflow-y: auto; }
.nav-label {
  font-size: 11px;
  letter-spacing: 1px;
  opacity: .45;
  padding: 12px 10px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  margin-bottom: 2px;
  transition: background .15s, color .15s;
  user-select: none;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; font-weight: 500; }
.nav-item .icon { width: 18px; text-align: center; font-size: 15px; }

.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: 12px;
  opacity: .55;
}

/* ---------- 主区域 ---------- */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: 60px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 10;
}
#topbar-title { display: none !important; }
.topbar-right { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.date { color: var(--text-2); font-size: 13px; }
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}

.content { padding: 28px; max-width: 1200px; width: 100%; margin: 0 auto; }

/* 接稿管理 / 思维导图 等需横向铺满的页面：模块挂载时会给 .content 加 .wide-page */
.content.wide-page { max-width: none; padding: 22px 28px; }

/* ---------- 通用组件 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
}

.card + .card { margin-top: 12px; }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; }

.btn {
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  transition: background .15s;
  font-family: inherit;
}
.btn:hover { background: var(--primary-dark); }
.btn-ghost { background: transparent; color: var(--text-2); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn.active:hover { background: var(--primary-dark); }

/* 接稿管理 · 快捷汇总栏 */
.quick-bar { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 4px; }
.quick-summary {
  font-size: 14px; color: var(--text); background: var(--primary-soft);
  border: 1px solid var(--primary-bd, #e8e6e0); border-radius: 8px;
  padding: 10px 14px; margin-bottom: 14px; line-height: 1.6;
}
.quick-summary .qs-amt { color: var(--danger); font-size: 15px; }
.quick-summary .qs-clear { margin-left: 12px; }

.input, .textarea, .select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 14px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border .15s, box-shadow .15s;
}
.input:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(88,88,88,.12); }
.textarea { resize: vertical; min-height: 90px; }

.empty {
  text-align: center;
  color: var(--text-2);
  padding: 36px 0;
  font-size: 13px;
}

/* 统计卡 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: var(--shadow);
}
.stat-label { color: var(--text-2); font-size: 13px; }
.stat-value { font-size: 24px; font-weight: 700; margin-top: 4px; }
.stat-hint { font-size: 12px; color: var(--text-2); margin-top: 4px; }

/* 待办 */
.todo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--border);
}
.todo-item:last-child { border-bottom: none; }
.todo-check {
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.todo-check.done { background: var(--success); border-color: var(--success); }
.todo-check.done::after { content: "✓"; color: #fff; font-size: 11px; }
.todo-text { flex: 1; }
.todo-text.done { text-decoration: line-through; color: var(--text-2); }
.todo-priority { font-size: 11px; padding: 2px 8px; border-radius: 20px; }
.p-high { background: #fee2e2; color: var(--danger); }
.p-mid { background: #fef3c7; color: var(--warn); }
.p-low { background: #e8f5d5; color: var(--success); }
.todo-del { color: var(--text-2); cursor: pointer; font-size: 13px; padding: 4px 6px; border-radius: 6px; }
.todo-del:hover { color: var(--danger); background: #fee2e2; }

/* 待办 · 四象限 */
.todo-add { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.chk-inline { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--text); white-space: nowrap; cursor: pointer; }
.chk-inline input { width: 15px; height: 15px; cursor: pointer; }

.quad-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.quad {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  min-width: 0;
}
.quad.q1 { border-left-color: #ef4444; }
.quad.q2 { border-left-color: #585858; }
.quad.q3 { border-left-color: #f59e0b; }
.quad.q4 { border-left-color: #888888; }
.quad-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.quad-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.quad.q1 .quad-dot { background: #ef4444; }
.quad.q2 .quad-dot { background: #585858; }
.quad.q3 .quad-dot { background: #f59e0b; }
.quad.q4 .quad-dot { background: #888888; }
.quad-head b { font-size: 14px; font-weight: 600; }
.quad-sub { font-size: 12px; color: var(--text-2); }
.quad-count { margin-left: auto; font-size: 12px; color: var(--text-2); background: var(--bg); border: 1px solid var(--border); border-radius: 20px; padding: 1px 9px; }
.quad-empty { font-size: 12px; color: var(--text-2); padding: 14px 2px; text-align: center; }

.todo-item.is-done { opacity: 0.62; }
.todo-main { flex: 1; min-width: 0; }
.todo-dl-wrap { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.todo-dl-input { font-size: 12px; padding: 3px 6px; border: 1px solid var(--border); border-radius: 6px; color: var(--text-2); background: var(--bg); }
.todo-dl-input.overdue { border-color: var(--danger); color: var(--danger); font-weight: 600; }
.todo-dl-input.due-today { border-color: var(--warn); color: var(--warn); font-weight: 600; }
.todo-dl-input:disabled { opacity: 0.6; cursor: default; }
.dl-chip { font-size: 11px; padding: 1px 7px; border-radius: 20px; font-weight: 600; }
.dl-chip.overdue { background: #fee2e2; color: var(--danger); }
.dl-chip.due-today { background: #fef3c7; color: var(--warn); }

.todo-flags { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.flag-btn {
  border: 1px solid var(--border); background: var(--bg);
  width: 26px; height: 26px; border-radius: 6px; cursor: pointer;
  font-size: 13px; line-height: 1; color: var(--text-2); transition: all .12s;
}
.flag-btn.star.on { background: #fef3c7; border-color: var(--warn); color: #d97706; }
.flag-btn.bolt.on { background: #fee2e2; border-color: var(--danger); color: #dc2626; }
.flag-btn:hover { filter: brightness(0.97); }

@media (max-width: 760px) {
  .quad-grid { grid-template-columns: 1fr; }
}

/* 接稿管理 · 客户名自动补全下拉 */
.client-ac { position: relative; display: inline-block; width: 100%; }
.client-menu {
  position: absolute; z-index: 50; top: calc(100% + 2px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: 0 6px 20px rgba(15,23,42,.12);
  max-height: 220px; overflow-y: auto; padding: 4px;
}
.client-opt {
  padding: 6px 10px; font-size: 13px; border-radius: 6px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.client-opt:hover { background: var(--bg); color: #3a3a3a; }

/* 接稿管理 · 客户结算方式默认值 */
.cd-grid { display: flex; flex-wrap: wrap; gap: 10px 18px; padding: 4px 2px; }
.cd-row { display: flex; align-items: center; gap: 8px; }
.cd-name { min-width: 84px; font-weight: 600; }

/* 接稿管理 · 客户名单浮层（删除客户） */
.modal-mask {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(15, 23, 42, 0.45);
  display: none; align-items: center; justify-content: center;
  padding: 24px;
}
.modal-panel {
  background: var(--card, #fff); border-radius: 12px;
  width: min(440px, 92vw); max-height: 80vh; display: flex; flex-direction: column;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25); overflow: hidden;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; font-weight: 700; border-bottom: 1px solid var(--border, #eee);
}
.modal-close { cursor: pointer; font-size: 22px; line-height: 1; color: var(--text-2); padding: 0 4px; }
.modal-close:hover { color: var(--danger, #e11d48); }
.modal-body { padding: 12px 16px; overflow-y: auto; }
.modal-foot { padding: 10px 16px; border-top: 1px solid var(--border, #eee); }
/* 接稿记录编辑弹窗：大字、加宽 */
.job-dialog-mask .modal-panel.job-dialog { width: min(760px, 94vw); max-height: 88vh; }
.job-dialog .modal-head { font-size: 17px; padding: 16px 20px; }
.job-dialog .modal-body { padding: 18px 20px; }
.job-dialog .field label { font-size: 13px; }
.job-dialog .input, .job-dialog .select { font-size: 16px; padding: 11px 14px; }
.job-dialog .amount-bar { font-size: 15px; }
.job-dialog .amount-bar b { font-size: 22px; }
.job-dialog .modal-foot { display: flex; align-items: center; gap: 10px; padding: 14px 20px; }
.job-dialog .jd-save, .job-dialog .jd-cancel { font-size: 15px; padding: 10px 24px; }
/* 列表视图隐藏列：仅不在首页渲染，DOM 与数据字段均保留（双击弹窗详情页完整显示） */
.jc-hide { display: none !important; }
.cm-row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 4px; border-bottom: 1px dashed var(--border, #eee);
}
.cm-row:last-child { border-bottom: none; }
.cm-name { flex: 1; font-weight: 600; }
.cm-count { font-size: 12px; color: var(--text-2); }
.cm-actions { display: inline-flex; gap: 6px; align-items: center; }
.cm-toast {
  display: none; margin: 0 16px; padding: 8px 12px; border-radius: 8px;
  background: #ecfdf5; color: #047857; font-size: 13px; border: 1px solid #a7f3d0;
}

/* 笔记 */
.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.note-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: box-shadow .15s, transform .15s;
  box-shadow: var(--shadow);
}
.note-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.note-title { font-weight: 600; margin-bottom: 8px; }
.note-preview { color: var(--text-2); font-size: 13px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.note-time { font-size: 11px; color: var(--text-2); margin-top: 10px; }

/* 模块开发指引 */
.arch-list { line-height: 2; color: var(--text-2); }
.arch-list code { background: var(--primary-soft); color: var(--primary-dark); padding: 2px 8px; border-radius: 6px; font-size: 12px; }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 12px; white-space: nowrap; }
.table th, .table td { padding: 5px 9px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { color: var(--text-2); font-weight: 500; font-size: 11px; background: #fafbfc; }
.table tbody tr:hover { background: #faf8f3; }
.table .ops .link { cursor: pointer; color: var(--primary); margin-right: 10px; }
.table .link-del { color: var(--danger) !important; }
/* 行内编辑：选择列 + 编辑态高亮 */
.table .c-sel { width: 34px; text-align: center; }
.table td.c-sel input { cursor: pointer; }
.table tr.editing td { background: #f5f0e8; }
.table tr.editing .input, .table tr.editing .select { font-size: 13px; box-sizing: border-box; }
/* 行内编辑输入框加宽：min-width 会覆盖内联窄 width，确保输入可见 */
.table tr.editing .x-client, .table tr.editing .x-project, .table tr.editing .x-memo { min-width: 170px; }
.table tr.editing .x-project { min-width: 190px; }
.table tr.editing .x-received, .table tr.editing .x-deadline, .table tr.editing .x-paydate { min-width: 132px; }
.table tr.editing .x-words, .table tr.editing .x-pages, .table tr.editing .x-price { min-width: 96px; }
.table tr.editing .x-category { min-width: 132px; }
.table tr.editing .x-progress, .table tr.editing .x-payment, .table tr.editing .x-settle { min-width: 110px; }
.memo-cell { white-space: normal; max-width: 200px; word-break: break-word; }
.memo-cell.muted, .muted { color: var(--text-2); }
.field-wide { grid-column: 1 / -1; }

/* ---------- 徽章 ---------- */
.badge { display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 20px; }
.b-gray { background: #eef0f4; color: #6e6e6e; }
.b-blue { background: #f0f0f0; color: #3a3a3a; }
.b-amber { background: #fef3c7; color: #b45309; }
.b-green { background: #e8f5d5; color: #4d8a1a; }
.b-red { background: #fee2e2; color: #b91c1c; }
.cat-badge { display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 20px; }
.cat-tr { background: #f0f0f0; color: #3a3a3a; }
.cat-page { background: #e8f5d5; color: #4d8a1a; }
.x-unitlabel { font-size: 12px; color: var(--text-2); margin-left: 2px; }

/* ---------- 接稿管理：顶部布局 + 注意事项面板 ---------- */
.jobs-top { display: flex; gap: 12px; align-items: stretch; flex-wrap: wrap; }
.jobs-top .stat-grid { flex: 1; min-width: 320px; }
.boards-right { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.notice-board, .todo-board {
  flex: 1; min-width: 240px; align-self: flex-start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px 14px;
}
.nb-head { font-weight: 600; margin-bottom: 8px; color: var(--text); }
.nb-list { margin: 0; padding-left: 18px; }
.nb-list li { margin: 3px 0; line-height: 1.5; color: var(--text); }
.nb-empty { list-style: none; margin: 0; color: var(--text-2); font-size: 13px; line-height: 1.6; }
@media (max-width: 760px) {
  .boards-right { flex-direction: column; }
  .notice-board, .todo-board { width: 100%; min-width: 0; }
}

/* ---------- 表单网格 ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-bottom: 16px; }
.field label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.amount-bar {
  background: var(--primary-soft);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 14px;
}
.amount-bar b { font-size: 20px; color: var(--primary-dark); }
.amount-tip { color: var(--text-2); font-size: 12px; margin-left: 8px; }

/* ---------- 数据同步模块 ---------- */
.field-hint { font-size: 12px; color: var(--text-2); margin-top: 6px; line-height: 1.6; }

.hint-box {
  background: var(--primary-soft);
  border: 1px solid #e0d8c8;
  color: #3a3a3a;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.8;
}
.hint-box code { background: #fff; color: var(--primary-dark); padding: 1px 6px; border-radius: 4px; font-size: 12px; }
.alert-box { border-radius: 8px; padding: 11px 14px; font-size: 13px; margin-top: 14px; line-height: 1.7; }
.alert-warn { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; }
.alert-danger { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

.code-box {
  background: #3a3a3a;
  color: #d6d6d6;
  border-radius: 8px;
  padding: 14px 16px;
  font-family: Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12px;
  line-height: 1.7;
  overflow-x: auto;
  white-space: pre;
  margin-top: 10px;
}
.guide-h { font-weight: 600; font-size: 14px; margin-top: 6px; }
.guide-ol { margin: 8px 0 0 18px; color: var(--text-2); font-size: 13px; line-height: 2; }
.guide-ol code { background: var(--primary-soft); color: var(--primary-dark); padding: 1px 6px; border-radius: 4px; font-size: 12px; }

/* 顶栏同步状态灯 */
.sync-pill {
  font-size: 12px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}
.sync-pill[data-state="syncing"] { animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

/* 顶栏下方全宽同步警示条 —— 仅在同步出错时显示，附带 lastError 详情 */
.sync-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 28px;
  background: #fff4f0;
  color: #b54b1c;
  border-bottom: 1px solid #f0c4a3;
  font-size: 13px;
  line-height: 1.5;
  position: sticky;
  top: 60px;
  z-index: 9;
  box-shadow: 0 2px 6px rgba(229, 88, 40, .08);
}
.sync-alert[hidden] { display: none; }
.sync-alert-icon { font-size: 16px; flex: 0 0 auto; }
.sync-alert-text { flex: 1; word-break: break-word; }
.sync-alert-close {
  flex: 0 0 auto;
  border: none;
  background: transparent;
  color: inherit;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: inherit;
}
.sync-alert-close:hover { background: rgba(229, 88, 40, .12); }

/* 轻提示 */
#toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translate(-50%, 16px);
  background: #3a3a3a;
  color: #fff;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s, transform .22s;
  z-index: 999;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 思维导图模块 ---------- */
.mm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.mm-card { border: 1px solid var(--border); border-radius: 10px; padding: 14px; background: var(--surface); }
.mm-card-title { font-weight: 600; margin-bottom: 6px; word-break: break-all; }
.mm-card-meta { font-size: 12px; color: var(--text-2); }
.mm-card-ops { margin-top: 10px; display: flex; gap: 12px; font-size: 12px; }
.mm-card-ops .link { cursor: pointer; color: var(--primary); }
.mm-card-ops .link-del { color: var(--danger); }

.mm-title-input {
  border: none; outline: none; background: transparent;
  font-size: 15px; font-weight: 600; color: var(--text);
  width: 240px; padding: 2px 0;
  border-bottom: 1px dashed transparent;
  font-family: inherit;
}
.mm-title-input:focus { border-bottom-color: var(--primary); }

.mm-canvas {
  position: relative;
  height: 520px;
  overflow: hidden;
  background: var(--mm-bg, #fbfcfe);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: grab;
  margin-top: 6px;
  transition: background .25s;
}
.mm-canvas.grabbing { cursor: grabbing; }
.mm-stage { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
.mm-links { position: absolute; top: 0; left: 0; overflow: visible; pointer-events: none; }
.mm-nodes { position: absolute; top: 0; left: 0; }

.mm-node {
  position: absolute;
  height: 36px;
  box-sizing: border-box;
  border: 1.6px solid var(--mm-node-border, #7F77DD);
  border-radius: var(--mm-radius, 10px);
  background: var(--mm-node-bg, #fff);
  color: var(--mm-node-text, #3C3489);
  display: flex;
  align-items: center;
  padding: 0 12px;
  white-space: nowrap;
  overflow: hidden;
  cursor: default;
  user-select: none;
  transition: box-shadow .15s, background .2s, color .2s, border-color .2s, border-radius .2s;
  font-family: var(--mm-font, inherit);
}
.mm-node.root {
  font-weight: 600;
  background: var(--mm-center-bg, #534AB7);
  color: var(--mm-center-text, #fff);
  border-color: var(--mm-center-bg, #534AB7);
}
.mm-node.sel { box-shadow: 0 0 0 3px rgba(88, 88, 88, .22); }
.mm-node-text { flex: 1; min-width: 0; outline: none; overflow: hidden; text-overflow: ellipsis; cursor: default; font-family: inherit; }
.mm-node-text[contenteditable="true"] { cursor: text; user-select: text; }
.mm-dot {
  position: absolute; right: -10px; top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--mm-line, #7F77DD);
  border: 1.5px solid var(--mm-dot-border, #fff);
  color: #fff; font-size: 11px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 2;
  transition: background .2s, border-color .2s;
}

/* ---------- 思维导图外观设置面板 ---------- */
.mm-settings-panel {
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--surface);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px 18px;
  font-size: 13px;
}
.mm-settings-panel[hidden] { display: none; }
.mm-settings-row { display: flex; flex-direction: column; gap: 4px; }
.mm-settings-row label {
  font-size: 11px; color: var(--text-2); font-weight: 500;
}
.mm-settings-row select {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
}
.mm-settings-hint {
  grid-column: 1 / -1;
  font-size: 11px;
  color: var(--text-2);
  margin-top: 4px;
}
@media (max-width: 720px) {
  .mm-settings-panel { grid-template-columns: 1fr; }
}

/* ---------- 节点入场动画（所有主题通用） ---------- */
@keyframes mm-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.mm-node {
  /* 入场淡入 + 主题切换平滑（其它属性已在上面 transition 里） */
  animation: mm-fade-in .22s ease;
}

/* ---------- 手绘风主题：节点缓慢轻微抖动（草图味） ---------- */
@keyframes mm-sketch-wobble-a {
  0%, 100% { transform: rotate(-0.7deg) translateY(0); }
  50%      { transform: rotate(0.7deg) translateY(-0.5px); }
}
@keyframes mm-sketch-wobble-b {
  0%, 100% { transform: rotate(0.6deg) translateY(0); }
  50%      { transform: rotate(-0.6deg) translateY(0.4px); }
}
.mm-canvas[data-mm-theme="sketch"] .mm-node {
  animation: mm-fade-in .22s ease, mm-sketch-wobble-a 3.2s ease-in-out infinite;
}
.mm-canvas[data-mm-theme="sketch"] .mm-node:nth-child(2n) {
  animation: mm-fade-in .22s ease, mm-sketch-wobble-b 3.6s ease-in-out infinite;
}
.mm-canvas[data-mm-theme="sketch"] .mm-node:nth-child(3n) {
  animation-duration: .22s, 4s;
}
/* 编辑中 / 选中时停摆，避免抖动干扰输入与对齐 */
.mm-canvas[data-mm-theme="sketch"] .mm-node.sel,
.mm-canvas[data-mm-theme="sketch"] .mm-node .mm-node-text[contenteditable="true"] {
  /* 让父级停止抖动；通过 animation 改为单帧空动画即可 */
  animation: none;
}
/* 暗色主题：节点加一道细微的 hover 高亮 */
.mm-canvas[data-mm-theme="dark"] .mm-node:hover { box-shadow: 0 0 0 2px rgba(255,255,255,.18); }
@media (prefers-reduced-motion: reduce) {
  .mm-node,
  .mm-canvas[data-mm-theme="sketch"] .mm-node,
  .mm-canvas[data-mm-theme="sketch"] .mm-node:nth-child(2n),
  .mm-canvas[data-mm-theme="sketch"] .mm-node:nth-child(3n) {
    animation: none !important;
  }
}

.mm-status {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 12px; color: var(--text-2); margin-top: 10px;
}
.mm-preview { background: #fff; border-radius: 8px; padding: 6px; overflow: auto; }

/* 导出 PDF 的打印容器 */
#print-root { display: none; }
.print-title { text-align: center; font-size: 16px; font-weight: 600; margin-bottom: 10px; }
body.printing .layout, body.printing #toast { display: none; }
body.printing #print-root { display: block; padding: 12px; }
@media print {
  .layout, #toast { display: none !important; }
  #print-root { display: block !important; }
  .rp-wrap { display: block !important; }
  body { background: #fff; }
  .rp-wrap .rp-sheet { box-shadow: none; }
  @page { size: A4 landscape; margin: 10mm; }
}

@media (max-width: 768px) {
  .sidebar { width: 64px; }
  .brand-text, .nav-item span.label, .sidebar-footer, .nav-label { display: none; }
  .content { padding: 16px; }
}

/* ---------- 进入页（Splash） ---------- */
.splash {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  background: #ffffff;
  color: #1f2433;
  user-select: none;
  animation: splash-in .5s ease both;
}
.splash[hidden] { display: none !important; }
.splash-inner {
  display: flex; flex-direction: column; align-items: center; gap: 22px;
  text-align: center; padding: 24px;
}
.splash-logo {
  max-width: 420px; max-height: 50vh; width: auto; height: auto;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 20px 50px rgba(0,0,0,.18), 0 4px 12px rgba(0,0,0,.12);
  cursor: pointer;
  animation: splash-breathe 2.8s ease-in-out infinite;
  transition: transform .25s ease;
  outline: none;
}
.splash-logo:hover, .splash-logo:focus-visible { transform: scale(1.04); }
.splash-logo:focus-visible { box-shadow: 0 0 0 3px #E85828, 0 20px 50px rgba(0,0,0,.18); }
.splash-name {
  font-size: clamp(22px, 3.6vw, 32px);
  font-weight: 700; letter-spacing: 4px;
  color: #1f2433;
  text-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.splash-tip {
  position: absolute; bottom: 22px;
  font-size: 12px; opacity: .5; letter-spacing: 1px;
  color: #1f2433;
}
.splash-leaving { animation: splash-out .5s ease both; pointer-events: none; }

@keyframes splash-in {
  from { opacity: 0; transform: scale(1.02); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes splash-out {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(.96); }
}
@keyframes splash-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.025); }
}

/* 密码门禁（logo 下访问入口） */
.splash-gate {
  display: flex; gap: 8px; margin-top: 6px;
  align-items: center; justify-content: center;
}
.splash-pwd {
  padding: 11px 14px; width: 210px;
  border: 1px solid #c8cfdd; border-radius: 10px;
  background: #fff; color: #1f2433; font-size: 14px; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.splash-pwd:focus { border-color: #E85828; box-shadow: 0 0 0 3px rgba(232,88,40,.18); }
.splash-pwd::placeholder { color: #9aa3b5; }
.splash-enter {
  padding: 11px 20px; border: 0; border-radius: 10px;
  background: #E85828; color: #fff; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background .2s, transform .1s;
}
.splash-enter:hover { background: #c44417; }
.splash-enter:active { transform: translateY(1px); }
.splash-err {
  margin-top: 10px; min-height: 18px; font-size: 13px; color: #d64545;
  opacity: 0; transition: opacity .2s; pointer-events: none;
}
.splash-err.show { opacity: 1; }
.splash-gate.shake { animation: spl-shake .32s ease; }
@keyframes spl-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

/* 侧边栏品牌 logo（图片版） */
.brand-logo-img {
  width: 38px; height: 38px;
  border-radius: 10px;
  object-fit: contain;
  background: #fff;
  padding: 3px;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
  flex-shrink: 0;
}

/* 减少动画偏好：禁用 splash 呼吸与切换动画 */
@media (prefers-reduced-motion: reduce) {
  .splash, .splash-leaving { animation: none; }
  .splash-logo { animation: none; }
}

/* ---------- 打印单据（对账单 / 报价单） ---------- */
.rp-wrap { display: none; }
.rp-wrap .rp-sheet {
  background: #fff; color: #1f2433; padding: 18px 22px; max-width: 1000px; margin: 0 auto;
  font-size: 13px; line-height: 1.5; box-shadow: 0 6px 24px rgba(0,0,0,.12); border-radius: 8px;
}
.rp-wrap .rp-head { text-align: center; border-bottom: 2px solid #1f2433; padding-bottom: 10px; margin-bottom: 10px; }
.rp-wrap .rp-brand { font-size: 13px; color: #6e6e6e; letter-spacing: 2px; }
.rp-wrap .rp-title { font-size: 22px; margin: 4px 0; font-weight: 700; }
.rp-wrap .rp-meta { font-size: 12px; color: #6e6e6e; }
.rp-wrap .rp-cond { font-size: 12px; color: #444; margin-bottom: 10px; background: #f5f7fb; border: 1px solid #e6e9f0; border-radius: 6px; padding: 6px 10px; }
.rp-wrap .rp-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.rp-wrap .rp-table th, .rp-wrap .rp-table td { border: 1px solid #cfd6e4; padding: 6px 8px; text-align: left; }
.rp-wrap .rp-table thead th { background: #eef2fa; }
.rp-wrap .rp-table tfoot td { border-top: 2px solid #1f2433; font-weight: 600; }
.rp-wrap .rp-sum { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; }
.rp-wrap .rp-sum b { color: #b45309; }
.rp-wrap .rp-foot { margin-top: 16px; font-size: 11px; color: #888; text-align: center; }

/* ---------- 接稿批量导入预览 ---------- */
#import-preview:empty { display: none; }
.import-preview {
  border: 1px dashed #d6c8b8;
  background: #faf6f0;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.import-preview .ip-head { font-size: 14px; font-weight: 600; color: #1f2433; }
.import-preview .ip-map { font-size: 12px; color: #3a3a3a; margin-top: 4px; word-break: break-all; }
.import-preview .ip-note { font-size: 12px; color: #888; margin-top: 4px; }
.import-preview .table { font-size: 12px; background: #fff; }
.import-preview .table th, .import-preview .table td { padding: 5px 8px; }
.import-error {
  border: 1px solid #f1b0b0; background: #fff3f3; color: #b91c1c;
  border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 12px;
}

/* ---------- 字数稿费（导入稿件版） ---------- */
.wc-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 14px 0 10px; }
.wc-file-name { font-size: 12px; color: var(--text-2); }
.wc-card { margin-top: 16px; }
.wc-table { margin-top: 4px; }
.wc-table .wc-name { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wc-table .wc-num { text-align: right; font-variant-numeric: tabular-nums; }
.wc-table .input { width: 100%; }
.wc-table .wc-type { min-width: 84px; }
.wc-table .wc-dbg { margin-left: 4px; color: #c8881a; cursor: help; font-size: 12px; }
.wc-table .wc-stale { margin-left: 4px; color: #d4380d; font-weight: 700; font-size: 12px; cursor: help; white-space: nowrap; }
.wc-table .wc-stale::before { content: ""; }

/* ---------- 报价单 ---------- */
.q-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 14px 0 10px; }
.q-hint { font-size: 12px; color: var(--text-2); }
.q-card { margin-top: 16px; }
.q-table { margin-top: 4px; }
.q-items input, .q-items select { width: 100%; }
.q-num { text-align: right; font-variant-numeric: tabular-nums; }
.q-del { cursor: pointer; color: #b91c1c; padding: 0 4px; }
.q-ops { white-space: nowrap; }
.q-ops .btn { margin-right: 4px; }
.q-note { min-height: 120px; font-size: 13px; line-height: 1.8; }
.q-tax-grid { margin-top: 16px; }

/* ---------- 每日一夸 · 顶部通栏大字 ---------- */
.morale-bar {
  display: flex; align-items: center; gap: 18px;
  background: linear-gradient(120deg, #fff3e0, #ffe9ec);
  border: 1px solid #ffd6c2;
  border-radius: 14px;
  padding: 20px 24px;
  margin-bottom: 18px;
  box-shadow: 0 2px 10px rgba(255, 150, 110, .12);
}
.morale-bar.wild {
  background: linear-gradient(120deg, #fff1c9, #ffdceb);
  border-color: #f3c775;
}
.morale-bar-text {
  flex: 1; min-width: 0;
  font-size: clamp(24px, 2.8vw, 38px);
  line-height: 1.4;
  font-weight: 700;
  color: #7c2d12;
  letter-spacing: .5px;
}
.morale-bar.wild .morale-bar-text { color: #8a4b00; }
.morale-bar-btn {
  flex: none;
  border: 1px solid #f0a98c;
  background: #fff;
  color: #c2410c;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.morale-bar-btn:hover { background: #fff7ed; transform: translateY(-1px); }

@media (max-width: 768px) {
  .morale-bar { flex-direction: column; align-items: flex-start; gap: 12px; }
  .morale-bar-text { font-size: clamp(20px, 5vw, 26px); }
}

/* ---------- 客户评分 ---------- */
.rt-note {
  font-size: 13px; color: var(--text-2); line-height: 1.7;
  background: #f6f8fb; border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 14px;
}
.rt-warn {
  margin-top: 8px; font-size: 13px; line-height: 1.7;
  color: #92400e; background: #fffbeb; border: 1px solid #fde68a;
  border-radius: 8px; padding: 10px 14px;
}
.rt-list { margin-top: 4px; }
.rt-row {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 10px; background: #fff;
}
.rt-row.observing { background: #fcfcfd; border-style: dashed; }
.rt-row.open { border-color: #d6c8b8; }
.rt-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; cursor: pointer; }
.rt-grade {
  flex: none; width: 26px; height: 26px; line-height: 26px; text-align: center;
  border-radius: 6px; font-weight: 800; color: #fff; font-size: 14px;
}
.g-s { background: #d97706; }
.g-a { background: #3a3a3a; }
.g-b { background: #0d9488; }
.g-c { background: #888888; }
.g-d { background: #b45309; }
.rt-name { font-size: 15px; }
.rt-score { font-size: 18px; font-weight: 800; color: var(--primary-dark); }
.rt-score em { font-size: 12px; font-weight: 500; color: var(--text-2); font-style: normal; margin-left: 2px; }
.rt-tag { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: #f0f0f0; color: #585858; }
.rt-tag.t-warn { background: #fef2f2; color: #b91c1c; }
.rt-tag.t-obs { background: #f1f5f9; color: #6e6e6e; }
.rt-silent { margin-left: auto; font-size: 12px; color: var(--text-2); }
.rt-chev { color: var(--text-2); font-size: 12px; }
.rt-bars { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 6px 18px; margin-top: 10px; }
.rt-bar { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.rt-bar-k { width: 44px; flex: none; font-weight: 600; }
.rt-bar-track { flex: 1; height: 6px; background: #eef1f6; border-radius: 999px; overflow: hidden; }
.rt-bar-track i { display: block; height: 100%; background: linear-gradient(90deg, #a8a8a8, #585858); }
.rt-bar-v { width: 26px; text-align: right; font-variant-numeric: tabular-nums; }
.rt-detail { margin-top: 12px; border-top: 1px dashed var(--border); padding-top: 12px; }
.rt-summary { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 10px; }
.rt-summary div { font-size: 12px; color: var(--text-2); }
.rt-summary b { display: block; font-size: 15px; color: var(--text); }
.rt-formula {
  font-size: 12px; color: var(--text-2); background: #f8fafc;
  border-radius: 6px; padding: 8px 12px; margin-bottom: 10px; line-height: 1.8;
}
.rt-table td, .rt-table th { font-size: 12px; white-space: nowrap; }
.rt-cfg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; margin: 12px 0; }
.rt-cfg-item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.rt-cfg-item span { width: 128px; flex: none; }
.rt-cfg-item em { font-size: 12px; color: var(--text-2); font-style: normal; }
.rt-cfg-ops { display: flex; gap: 10px; margin-bottom: 8px; }
.rt-unk { font-size: 11px; padding: 1px 6px; border-radius: 4px; background: #fef2f2; color: #b91c1c; }
/* 接稿表：结算方式继承默认时的中性标记 */
.sw-def { font-style: normal; font-size: 11px; color: var(--text-2); margin-left: 2px; }
/* 评价系统下钻：每笔订单的结算方式可下拉修改 */
.rt-settle { font-size: 12px; padding: 1px 4px; max-width: 92px; }

/* 接稿表：交稿超 30 天仍未录收款 */
.row-unpaid { background: #fffbf3; }
.row-unpaid:hover { background: #fff7e8; }

/* ---------- 工作助理模块 ---------- */
.wa-shell { display: flex; gap: 16px; align-items: flex-start; margin-top: 14px; }
.wa-funcs { width: 230px; flex-shrink: 0; display: flex; flex-direction: column; gap: 8px; }
.wa-func {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px; cursor: pointer;
  transition: border .15s, box-shadow .15s;
}
.wa-func:hover { border-color: #d6c8b8; }
.wa-func.active { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(88,88,88,.12); }
.wa-func-ic { font-size: 20px; flex-shrink: 0; }
.wa-func-tx { display: flex; flex-direction: column; min-width: 0; }
.wa-func-tx b { font-size: 14px; font-weight: 600; }
.wa-func-tx small { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.wa-panel { flex: 1; min-width: 0; }

.wa-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 14px 0 12px; }
.wa-scale { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.wa-scale input[type=range] { width: 140px; }
.wa-scale b { color: var(--primary-dark); }
.wa-scale select { padding: 3px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); font-size: 13px; }

.wa-list { display: flex; flex-direction: column; gap: 8px; }
.wa-item {
  display: grid; grid-template-columns: 1fr 96px 84px 56px 92px;
  align-items: center; gap: 10px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 14px; font-size: 13px;
}
.wa-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-meta { color: var(--text-2); text-align: center; }
.wa-state { text-align: center; font-weight: 500; }
.wa-state-ok { color: var(--success); }
.wa-state-run { color: var(--primary); }
.wa-state-err { color: var(--danger); }
.wa-state-wait { color: var(--text-2); }
.wa-prog { text-align: center; color: var(--text-2); font-variant-numeric: tabular-nums; }
.wa-act { text-align: right; }
.wa-err { color: var(--danger); font-size: 12px; }
/* 扫描件·双方向：每行多展示两个方向的状态/进度 */
.wa-item-dual { grid-template-columns: 1fr 96px minmax(200px, 1.2fr) 110px; }
.wa-dual { display: flex; flex-direction: column; gap: 3px; font-size: 12px; line-height: 1.5; }
.wa-dir { display: grid; grid-template-columns: 1fr 56px 44px; align-items: center; gap: 6px; }
.wa-dir-t { color: var(--text-2); }
.wa-dir .wa-state { font-size: 12px; }
.wa-count { font-size: 12px; color: var(--text-2); }
.wa-macro { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; background: var(--surface); }
.wa-macro + .wa-macro { margin-top: 10px; }
.wa-macro-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.wa-macro-head b { font-size: 14px; }
.wa-macro-desc { font-size: 12px; color: var(--text-2); margin-bottom: 8px; line-height: 1.5; }
.wa-code { background: #0f172a; color: #e2e8f0; border-radius: 8px; padding: 12px; max-height: 360px; overflow: auto; font-size: 12px; line-height: 1.45; white-space: pre; word-break: break-word; }
.wa-code code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* 常用宏库：弹出对话框 */
.wa-center { display: flex; justify-content: center; padding: 18px 0; }

/* ===== 独立工具站模式（body.standalone）=====
   只开放「工作助理 + 批处理工作台」，隐去平台侧的日期 / 同步灯 / 账号 / 同步警示条，
   变成一个给员工直接用的纯工具页。类名由 App.boot() 在检测到独立站模式时加上。 */
body.standalone .topbar-right .sync-pill,
body.standalone .topbar-right .avatar,
body.standalone #sync-alert,
body.standalone .brand-sub,
body.standalone .sidebar-footer .module-count { display: none !important; }

/* 工作助理：网格大按钮（点击直接进工具，无中间层） */
.wa-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
  margin-top: 10px;
}
.wa-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 26px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
  font: inherit;
  color: var(--text);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.wa-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}
.wa-tile:active { transform: translateY(-1px); }
.wa-tile-ic { font-size: 42px; line-height: 1; }
.wa-tile-name { font-size: 15px; font-weight: 600; }
.wa-tile-desc { font-size: 12px; color: var(--text-2); max-width: 16em; }
.wa-modal-mask {
  position: fixed; inset: 0; background: rgba(15,23,42,.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
}
.wa-modal {
  width: min(720px, 94vw); max-height: 86vh; display: flex; flex-direction: column;
  background: var(--surface); border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.35);
  overflow: hidden;
}
.wa-modal-title {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; font-size: 16px; font-weight: 600;
  border-bottom: 1px solid var(--border); background: var(--bg);
}
.wa-modal-close {
  border: none; background: transparent; font-size: 22px; line-height: 1;
  cursor: pointer; color: var(--text-2); padding: 0 4px;
}
.wa-modal-close:hover { color: var(--danger); }
.wa-modal-body { padding: 16px 18px; overflow: auto; }
.wa-modal-body.wa-drag { outline: 2px dashed var(--primary); outline-offset: -10px; background: rgba(88,88,88,.05); border-radius: 8px; }
.wa-macro-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.wa-mbtn {
  border: 1px solid var(--border); background: var(--bg); color: var(--text-1);
  border-radius: 999px; padding: 7px 14px; font-size: 13px; cursor: pointer;
  transition: border .15s, background .15s;
}
.wa-mbtn:hover { border-color: var(--primary); background: rgba(88,88,88,.08); }
.wa-macro-view { min-height: 80px; }
.wa-macro-name { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.wa-macro-bar { margin: 10px 0 6px; }
.wa-modal-foot {
  padding: 12px 18px; border-top: 1px solid var(--border); background: var(--bg);
  display: flex; justify-content: flex-end;
}
.wa-copyall {
  border: none; background: var(--primary); color: #fff; border-radius: 8px;
  padding: 9px 16px; font-size: 13px; cursor: pointer;
}
.wa-copyall:disabled { opacity: .5; cursor: not-allowed; }
.wa-copyall:hover:not(:disabled) { background: var(--primary-dark); }

@media (max-width: 768px) {
  .wa-shell { flex-direction: column; }
  .wa-funcs { width: 100%; flex-direction: row; flex-wrap: wrap; }
  .wa-func { flex: 1; min-width: 200px; }
}

/* ===== 思维导图节点 emoji 图标 ===== */
.mm-emoji {
  flex-shrink: 0;
  margin-right: 4px;
  font-size: 14px;
  line-height: 1;
}
.mm-emoji-pop {
  position: fixed;
  z-index: 1200;
  background: #fff;
  border: 1px solid var(--border, #e2e2e2);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,.16);
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(7, 32px);
  gap: 4px;
  max-width: 264px;
}
.mm-emoji-btn {
  width: 32px; height: 32px;
  border: none; background: transparent;
  border-radius: 6px; font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.mm-emoji-btn:hover { background: #f0f0f0; }
.mm-emoji-clear { font-size: 14px; }

/* ===== 批处理工作台 ===== */
.bw-shell { margin-top: 14px; }
.bw-drop {
  border: 2px dashed var(--border, #d8d2c8);
  border-radius: 12px;
  padding: 22px;
  text-align: center;
  color: var(--text-2);
  background: #faf9f6;
  transition: border-color .15s, background .15s;
}
.bw-drop.bw-drag { border-color: var(--primary); background: #f3f0ea; }
.bw-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 0; }
.bw-sep { width: 1px; height: 22px; background: var(--border, #e2e2e2); margin: 0 4px; }
.bw-prefix { width: 70px; padding: 5px 8px; border: 1px solid var(--border, #ccc); border-radius: 6px; }
.bw-list { display: flex; flex-direction: column; gap: 4px; }
.bw-row {
  display: grid;
  grid-template-columns: 26px 22px minmax(140px, 2.4fr) 1.2fr 0.8fr 1fr 0.9fr 1fr 1.2fr;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--border, #ececec);
  font-size: 13px;
}
.bw-row:hover { border-color: #d6c8b8; }
.bw-ic { font-size: 16px; text-align: center; }
.bw-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bw-meta { color: var(--text-2); }
.bw-bid { font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--primary); }
.bw-state { color: #16a34a; font-size: 12px; }
.bw-foot { margin-top: 10px; }
.bw-count { color: var(--text-2); font-size: 12px; }

/* ---------- 我的桌面（总览页）—— Windows 文件夹风格的图标网格 ---------- */
.desktop-section { margin-top: 6px; }
.desktop-section:first-child { margin-top: 0; }
.desktop-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.5px;
  padding: 4px 6px 8px;
  border-bottom: 1px dashed var(--border);
  margin-bottom: 12px;
}
.desktop {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 10px;
  padding: 6px 2px 12px;
}
.desktop-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: background .14s ease, transform .12s ease, box-shadow .14s ease;
  user-select: none;
  outline: none;
}
.desktop-item:hover {
  background: var(--primary-soft);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.desktop-item:active { transform: scale(0.97); }
.desktop-item:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.desktop-icon {
  font-size: 42px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(60,40,20,0.10));
  transition: transform .15s ease;
}
.desktop-item:hover .desktop-icon { transform: scale(1.06); }
.desktop-name {
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  line-height: 1.25;
  color: var(--text);
  word-break: break-word;
}
.desktop-sub {
  font-size: 11px;
  color: var(--text-2);
  text-align: center;
  line-height: 1.3;
  word-break: break-word;
  min-height: 14px; /* 统一高度，让图标对齐 */
}

