/* ============ 云端工作平台 - 核心样式 ============ */
:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --sidebar-bg: #1e2a45;
  --sidebar-text: #b8c2d9;
  --sidebar-active: #ffffff;
  --primary: #3d6df5;
  --primary-dark: #2f56d6;
  --primary-soft: #e8edff;
  --text: #24292f;
  --text-2: #6a7280;
  --border: #e4e7ec;
  --success: #16a34a;
  --danger: #dc2626;
  --warn: #d97706;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 8px 24px rgba(16, 24, 40, .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, #3d6df5, #7c5cf0);
  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, #dbe4fb); 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(61,109,245,.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: #dcfce7; 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: #3b82f6; }
.quad.q3 { border-left-color: #f59e0b; }
.quad.q4 { border-left-color: #94a3b8; }
.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: #3b82f6; }
.quad.q3 .quad-dot { background: #f59e0b; }
.quad.q4 .quad-dot { background: #94a3b8; }
.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: #2f56d6; }

/* 接稿管理 · 客户结算方式默认值 */
.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: #f8faff; }
.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: #eef4ff; }
.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: #6a7280; }
.b-blue { background: #e0eaff; color: #2f56d6; }
.b-amber { background: #fef3c7; color: #b45309; }
.b-green { background: #dcfce7; color: #15803d; }
.b-red { background: #fee2e2; color: #b91c1c; }
.cat-badge { display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 20px; }
.cat-tr { background: #e0eaff; color: #2f56d6; }
.cat-page { background: #dcfce7; color: #15803d; }
.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 #d3ddff;
  color: #34406b;
  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: #1e2a45;
  color: #d7e0f5;
  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; } }

/* 轻提示 */
#toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translate(-50%, 16px);
  background: #1e2a45;
  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: #fbfcfe;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: grab;
  margin-top: 6px;
}
.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: 34px;
  box-sizing: border-box;
  border: 1.6px solid var(--primary);
  border-radius: 7px;
  background: #fff;
  display: flex;
  align-items: center;
  padding: 0 12px;
  white-space: nowrap;
  overflow: hidden;
  cursor: default;
  user-select: none;
  transition: box-shadow .15s;
}
.mm-node.root { font-weight: 600; }
.mm-node.sel { box-shadow: 0 0 0 3px rgba(61, 109, 245, .22); }
.mm-node-text { flex: 1; min-width: 0; outline: none; overflow: hidden; text-overflow: ellipsis; cursor: default; }
.mm-node-text[contenteditable="true"] { cursor: text; user-select: text; }
.mm-dot {
  position: absolute; right: -9px; top: 50%;
  transform: translateY(-50%);
  width: 17px; height: 17px; border-radius: 50%;
  color: #fff; font-size: 11px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 2;
}

.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 #4f6df8, 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（图片版） */
.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: #6a7280; letter-spacing: 2px; }
.rp-wrap .rp-title { font-size: 22px; margin: 4px 0; font-weight: 700; }
.rp-wrap .rp-meta { font-size: 12px; color: #6a7280; }
.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 #9bb0e8;
  background: #f6f9ff;
  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: #2f56d6; 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: #9bb0e8; }
.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: #2f56d6; }
.g-b { background: #0d9488; }
.g-c { background: #64748b; }
.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: #eef2ff; color: #4338ca; }
.rt-tag.t-warn { background: #fef2f2; color: #b91c1c; }
.rt-tag.t-obs { background: #f1f5f9; color: #475569; }
.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, #6f8ff5, #2f56d6); }
.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; }

