* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f4f6fa;
  --panel: #ffffff;
  --panel-2: #fafbfd;
  --line: #e6eaf1;
  --line-2: #eff2f7;
  --text: #1f2937;
  --text-2: #5b6675;
  --text-3: #98a1ae;
  --primary: #1d4ed8;
  --primary-d: #1d4ed8;
  --primary-s: #eef4ff;
  --accent: #f97316;
  --ok: #059669;
  --ok-s: #e9faf3;
  --warn: #d97706;
  --warn-s: #fff8e8;
  --danger: #dc2626;
  --danger-s: #fef2f2;
  --r: 12px;
  --sh: 0 1px 2px rgba(16, 24, 40, .05), 0 6px 16px rgba(16, 24, 40, .06);
  --sh-lg: 0 12px 40px rgba(16, 24, 40, .18);
}

html, body { height: 100%; }

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;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; font-size: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--primary); text-decoration: none; }

/* Lucide 图标（内联 sprite + use） */
.ic-svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; flex: none; display: inline-block; }
.big-ic { width: 38px; height: 38px; }
.n-ic { width: 18px; height: 18px; flex: none; }
.x .ic-svg { width: 18px; height: 18px; }

/* ---------- 加载 ---------- */
#boot {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 14px; background: var(--bg);
}
.spinner {
  width: 30px; height: 30px; border: 3px solid var(--line);
  border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.boot-text { color: var(--text-3); font-size: 13px; }

/* ---------- 认证页 ---------- */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: linear-gradient(160deg, #eef3fb 0%, #f7f9fc 45%, #fdf6f0 100%);
}
.auth-card {
  width: 100%; max-width: 412px; background: var(--panel); border-radius: 18px;
  box-shadow: var(--sh-lg); padding: 32px 30px 28px;
}
.auth-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.auth-logo .mark {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), #4f8bf5); color: #fff;
  font-weight: 700; font-size: 17px; letter-spacing: -.5px;
}
.auth-title { font-size: 20px; font-weight: 700; letter-spacing: -.3px; }
.auth-sub { color: var(--text-3); font-size: 12.5px; margin-bottom: 22px; }

.seg { display: flex; background: var(--line-2); border-radius: 10px; padding: 3px; margin-bottom: 18px; }
.seg button {
  flex: 1; padding: 7px 0; border-radius: 8px; font-size: 13px; color: var(--text-2);
  transition: .15s; font-weight: 500;
}
.seg button.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 3px rgba(16, 24, 40, .1); }

.field { margin-bottom: 13px; }
.field label { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 5px; font-weight: 500; }
.input, .select, .textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--panel); outline: none; transition: .15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }
.textarea { resize: vertical; min-height: 74px; line-height: 1.6; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input-sm { width: auto; padding: 4px 8px; font-size: 12.5px; border-radius: 7px; }
.demo-switch { display: inline-flex; align-items: center; gap: 6px; padding: 0 6px; border-left: 1px solid var(--line); margin-left: 2px; }
.ds-lbl { font-size: 12px; color: var(--text-3); white-space: nowrap; }

/* 可搜索人员选择器 */
.combo { position: relative; }
.combo .input { width: 100%; }
.combo-list { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 4px); max-height: 260px; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 28px rgba(15, 23, 42, .14); display: none; }
.combo.open .combo-list { display: block; }
.combo-item { display: block; width: 100%; text-align: left; padding: 8px 12px; border: 0; background: none; cursor: pointer; font-size: 13.5px; color: var(--text-1); }
.combo-item:hover { background: var(--line-2); }
.combo-item.on { color: var(--primary); font-weight: 600; }
.combo-empty { padding: 10px 12px; color: var(--text-3); font-size: 13px; }

/* 多选人员选择器（抄送人） */
.combo.multi .input { border-style: dashed; }
.mpc-box { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mpc-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px; background: var(--primary-soft, rgba(37, 99, 235, .12)); color: var(--primary); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.mpc-chip i { font-style: normal; cursor: pointer; font-weight: 700; line-height: 1; opacity: .7; }
.mpc-chip i:hover { opacity: 1; }

/* 周度周报 */
.wk-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.wk-cell { background: var(--panel-2, var(--panel)); border: 1px solid var(--line); border-radius: 12px; padding: 14px 10px; text-align: center; }
.wk-cell b { display: block; font-size: 26px; line-height: 1.2; }
.wk-cell span { font-size: 12.5px; color: var(--text-3); }
.wk-cell.bad b { color: var(--danger, #dc2626); }

.hint { font-size: 12px; color: var(--text-3); line-height: 1.6; margin: 2px 0 0; padding: 8px 10px; background: var(--panel-2); border-radius: 8px; }

.row-inline { display: flex; gap: 8px; align-items: flex-start; }
.row-inline .grow { flex: 1; min-width: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 9px 16px; border-radius: 9px; font-weight: 500; font-size: 13.5px;
  transition: .15s; white-space: nowrap; border: 1px solid transparent;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-d); }
.feishu-btn { background: #3370ff; font-weight: 600; }
.feishu-btn:hover:not(:disabled) { background: #245bdb; }
.btn-ghost { background: var(--panel); border-color: var(--line); color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { border-color: #c9d2e0; color: var(--text); background: var(--panel-2); }
.btn-soft { background: var(--primary-s); color: var(--primary); }
.btn-soft:hover:not(:disabled) { background: #e2ecff; }
.btn-danger { background: var(--danger-s); color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: #fde3e3; }
.btn-warn { background: var(--warn-s); color: var(--warn); }
.btn-warn:hover:not(:disabled) { background: #fdeecb; }
.btn-block { width: 100%; }
.btn-sm { padding: 5px 11px; font-size: 12.5px; border-radius: 8px; }

.auth-msg { font-size: 12.5px; margin-top: 10px; min-height: 18px; }
.auth-msg.err { color: var(--danger); }
.auth-msg.ok { color: var(--ok); }
.auth-foot { margin-top: 16px; text-align: center; font-size: 12.5px; color: var(--text-3); }
.auth-foot button { color: var(--primary); font-weight: 500; }
.auth-tip { background: var(--warn-s); color: #92600a; font-size: 12.5px; padding: 9px 12px; border-radius: 9px; margin-bottom: 14px; }

/* ---------- 应用骨架 ---------- */
.app { display: flex; min-height: 100vh; }

.side {
  width: 216px; flex: 0 0 216px; background: var(--panel); color: var(--text-2);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.side-head { padding: 20px 18px 16px; display: flex; align-items: center; gap: 10px; }
.side-head .mark {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), #4f8bf5); color: #fff; font-weight: 600; font-size: 15px;
}
.side-head b { color: var(--text); font-size: 15px; letter-spacing: -.2px; display: block; line-height: 1.25; }
.side-head span { font-size: 11px; color: var(--text-3); }
.side-nav { flex: 1; padding: 6px 10px; overflow-y: auto; }
.side-nav .group { font-size: 11px; color: var(--text-3); padding: 14px 10px 6px; letter-spacing: .5px; }
.side-nav button {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 11px;
  border-radius: 9px; color: var(--text-2); font-size: 13.5px; text-align: left; transition: .15s; margin-bottom: 2px;
}
.side-nav button:hover { background: var(--panel-2); color: var(--text); }
.side-nav button.on { background: var(--primary-s); color: var(--primary); font-weight: 500; border-left: 2px solid var(--primary); }
.side-nav button .ic { width: 18px; text-align: center; display: inline-flex; align-items: center; justify-content: center; }
.side-nav button .cnt {
  margin-left: auto; background: #ef4444; color: #fff; font-size: 11px;
  min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 5px;
}
.side-foot { padding: 12px 14px; border-top: 1px solid var(--line-2); font-size: 12px; color: var(--text-3); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: var(--panel); border-bottom: 1px solid var(--line); padding: 0 24px;
  height: 62px; display: flex; align-items: center; gap: 16px; position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 16.5px; font-weight: 650; letter-spacing: -.2px; }
.topbar .sub { font-size: 12.5px; color: var(--text-3); }
.topbar .spacer { flex: 1; }
.who { display: flex; align-items: center; gap: 9px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--primary-s); color: var(--primary); font-weight: 600; font-size: 13px;
}
.who .nm { font-size: 13.5px; font-weight: 500; line-height: 1.3; }
.who .dp { font-size: 11.5px; color: var(--text-3); line-height: 1.3; }

.content { padding: 22px 24px 60px; flex: 1; }
.wrap { max-width: 1180px; margin: 0 auto; }

/* ---------- 卡片 / 统计 ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); }
.card-h { padding: 15px 18px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 10px; }
.card-h h3 { font-size: 14.5px; font-weight: 600; }
.card-h .spacer { flex: 1; }
.card-b { padding: 18px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 15px 16px; box-shadow: var(--sh); }
.stat .lb { font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.stat .vl { font-size: 25px; font-weight: 700; letter-spacing: -.5px; margin-top: 4px; line-height: 1.2; }
.stat .vl small { font-size: 12px; font-weight: 500; color: var(--text-3); margin-left: 3px; }

/* 数据看板图表 */
.svg-chart { width: 100%; height: auto; display: block; }
.db-row { display: grid; grid-template-columns: 150px 1fr 130px; align-items: center; gap: 12px; padding: 7px 0; }
.db-name { font-size: 13px; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-bar { height: 12px; background: var(--panel-2); border-radius: 6px; overflow: hidden; }
.db-bar i { display: block; height: 100%; background: linear-gradient(90deg, #1d4ed8, #3b82f6); }
.db-num { font-size: 13px; color: var(--text-2); text-align: right; }
.db-num span { font-size: 11.5px; }
@media (max-width: 640px) { .db-row { grid-template-columns: 96px 1fr 86px; gap: 8px; } }
.stat.warn .vl { color: var(--warn); }
.stat.danger .vl { color: var(--danger); }
.stat.ok .vl { color: var(--ok); }
.stat.blue .vl { color: var(--primary); }

/* ---------- 标签 / 徽章 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px;
  font-size: 11.5px; font-weight: 500; white-space: nowrap; line-height: 1.7;
}
.b-blue { background: var(--primary-s); color: var(--primary); }
.b-green { background: var(--ok-s); color: var(--ok); }
.b-orange { background: var(--warn-s); color: var(--warn); }
.b-red { background: var(--danger-s); color: var(--danger); }
.b-gray { background: #f1f3f7; color: var(--text-2); }

.toolbar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 15px; }
.toolbar .spacer { flex: 1; }
.toolbar .input, .toolbar .select { width: auto; min-width: 130px; padding: 7px 11px; font-size: 13px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button {
  padding: 9px 14px; font-size: 13.5px; color: var(--text-2); border-bottom: 2px solid transparent;
  margin-bottom: -1px; white-space: nowrap; transition: .15s;
}
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }

/* ---------- 任务列表 ---------- */
.task-list { display: flex; flex-direction: column; gap: 10px; }
.task-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 15px 17px; box-shadow: var(--sh); cursor: pointer; transition: .16s;
  border-left: 3px solid transparent;
}
.task-card:hover { border-color: #cfd9e8; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(16, 24, 40, .09); }
.task-card.p-high { border-left-color: #ef4444; }
.task-card.p-normal { border-left-color: #93c5fd; }
.task-card.p-low { border-left-color: #d1d5db; }
.task-card.st-done { opacity: .62; }
.task-card.od { border-left-color: var(--danger); background: #fff6f6; }
.task-card.od:hover { border-color: var(--danger); }
.tc-top { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 7px; }
.tc-title { font-size: 14.5px; font-weight: 600; flex: 1; min-width: 0; line-height: 1.45; }
.tc-title.done { text-decoration: line-through; color: var(--text-3); }
.tc-desc { color: var(--text-2); font-size: 13px; margin-bottom: 9px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tc-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.tc-meta .k { color: var(--text-3); }
.tc-flow { display: flex; align-items: center; gap: 6px; }
.pill { background: #f1f3f7; border-radius: 6px; padding: 1px 7px; font-size: 12px; color: var(--text-2); }
.arrow { color: var(--text-3); font-size: 12px; }

/* ---------- 权限配置页 ---------- */
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pill.on { background: var(--primary); color: #fff; cursor: pointer; }
.perm-cfg { max-width: 920px; margin: 0 auto; }
.perm-cfg .field { margin-bottom: 14px; }
.perm-tree { border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; background: #fafbfc; max-height: 420px; overflow: auto; }
.perm-node { padding: 7px 0; border-bottom: 1px dashed var(--line-2); }
.perm-node:last-child { border-bottom: 0; }
.perm-dept { display: block; font-size: 14px; margin-bottom: 4px; }
.perm-dept input { margin-right: 6px; vertical-align: -1px; }
.perm-members { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 4px 0 2px 18px; }
.perm-mem { font-size: 13px; color: var(--text-2); display: inline-flex; align-items: center; gap: 4px; }
.perm-mem input { margin-right: 2px; }
.perm-stat { font-size: 14px; margin: 4px 0 14px; }
.perm-stat b { color: var(--primary); }
.perm-actions { display: flex; align-items: center; gap: 10px; }
.perm-actions .spacer { flex: 1; }
.muted { color: var(--text-3); font-size: 12px; }
.tc-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }

.progress { height: 5px; background: var(--line-2); border-radius: 3px; overflow: hidden; margin-top: 10px; }
.progress i { display: block; height: 100%; background: var(--primary); border-radius: 3px; transition: width .3s; }
.progress.done i { background: var(--ok); }

/* ---------- 表格 ---------- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; font-size: 12px; color: var(--text-3); font-weight: 500;
  padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--panel-2); white-space: nowrap;
}
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); font-size: 13px; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: var(--panel-2); }

/* ---------- 空状态 ---------- */
.empty { padding: 52px 20px; text-align: center; color: var(--text-3); }
.empty .big { font-size: 34px; margin-bottom: 10px; opacity: .5; }
.empty p { font-size: 13.5px; margin-bottom: 14px; }

/* ---------- 模态 ---------- */
.mask {
  position: fixed; inset: 0; background: rgba(17, 24, 39, .45); z-index: 100;
  display: flex; align-items: flex-start; justify-content: center; padding: 40px 18px; overflow-y: auto;
  animation: fade .16s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  background: var(--panel); border-radius: 15px; width: 100%; max-width: 620px;
  box-shadow: var(--sh-lg); animation: pop .2s cubic-bezier(.16, 1, .3, 1); margin: auto 0;
}
.modal.wide { max-width: 800px; }
.modal.narrow { max-width: 440px; }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.985); } }
.m-head { padding: 18px 22px 14px; border-bottom: 1px solid var(--line-2); display: flex; align-items: flex-start; gap: 12px; }
.m-head h3 { font-size: 16px; font-weight: 650; flex: 1; }
.m-head .x { color: var(--text-3); font-size: 20px; line-height: 1; padding: 2px 4px; border-radius: 6px; }
.m-head .x:hover { background: var(--line-2); color: var(--text); }
.m-body { padding: 20px 22px; }
.m-foot { padding: 14px 22px 18px; display: flex; gap: 9px; justify-content: flex-end; border-top: 1px solid var(--line-2); }

/* 右侧抽屉（任务详情） */
.mask.drawer { align-items: stretch; justify-content: flex-end; padding: 0; animation: fade .16s ease; }
.mask.drawer .modal { max-width: 520px; width: 92%; margin: 0; height: 100%; border-radius: 0; box-shadow: -12px 0 44px rgba(16, 24, 40, .2); display: flex; flex-direction: column; animation: slideIn .22s cubic-bezier(.16, 1, .3, 1); }
.mask.drawer .m-body { flex: 1; overflow-y: auto; }
@keyframes slideIn { from { transform: translateX(48px); opacity: .55; } }

/* ---------- 详情 ---------- */
.detail-sec { margin-bottom: 20px; }
.detail-sec:last-child { margin-bottom: 0; }
.sec-title { font-size: 12.5px; color: var(--text-3); font-weight: 600; letter-spacing: .3px; margin-bottom: 9px; }
.kv { display: grid; grid-template-columns: 88px 1fr; gap: 7px 12px; font-size: 13.5px; }
.kv .k { color: var(--text-3); }
.desc-box { background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 9px; padding: 12px 14px; font-size: 13.5px; white-space: pre-wrap; word-break: break-word; }

/* 附件 */
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.att-card { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); cursor: pointer; transition: .15s; position: relative; }
.att-card:hover { border-color: var(--primary); }
.att-ic { width: 34px; height: 34px; flex: 0 0 34px; display: flex; align-items: center; justify-content: center; background: var(--panel-2); border-radius: 8px; color: var(--text-2); overflow: hidden; }
.att-ic .ic-svg { width: 18px; height: 18px; }
.att-img { width: 100%; height: 100%; object-fit: cover; }
.att-meta { min-width: 0; flex: 1; }
.att-name { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-sub { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.att-del { position: absolute; top: 4px; right: 4px; border: none; background: transparent; color: var(--text-3); cursor: pointer; padding: 2px; border-radius: 6px; display: none; }
.att-card:hover .att-del { display: block; }
.att-del:hover { color: var(--danger); background: var(--panel-2); }
.att-del .ic-svg { width: 14px; height: 14px; }
.att-prev { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.att-prev-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; font-size: 13px; }
.att-prev-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-prev-st { font-size: 11.5px; color: var(--text-3); }
.att-prev-st[data-st="done"] { color: var(--ok); }
.att-prev-st[data-st="fail"] { color: var(--danger); }
.att-prev-x { border: none; background: transparent; color: var(--text-3); cursor: pointer; padding: 2px; }
.att-prev-x:hover { color: var(--danger); }

/* 评论 / 讨论 */
.cmt-list { display: flex; flex-direction: column; gap: 10px; max-height: 280px; overflow-y: auto; margin-bottom: 12px; }
.cmt { display: flex; gap: 9px; align-items: flex-start; }
.cmt-av { width: 28px; height: 28px; border-radius: 50%; background: var(--primary-s); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 590; flex: none; }
.cmt-body { flex: 1; min-width: 0; background: var(--panel-2); border-radius: 9px; padding: 8px 11px; }
.cmt.me .cmt-body { background: var(--primary-s); }
.cmt-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.cmt-head b { font-size: 13px; font-weight: 590; }
.cmt-time { font-size: 11.5px; color: var(--text-3); }
.cmt-text { font-size: 13.5px; white-space: pre-wrap; word-break: break-word; line-height: 1.5; }
.cmt-box { border-top: 1px solid var(--line-2); padding-top: 12px; }

/* 时间轴 */
.tl { position: relative; padding-left: 22px; }
.tl::before { content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding-bottom: 16px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ''; position: absolute; left: -22px; top: 5px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--panel); border: 2px solid #cbd5e1;
}
.tl-item.done::before { border-color: var(--ok); background: var(--ok); }
.tl-item.doing::before { border-color: var(--primary); background: var(--primary); }
.tl-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.tl-head b { font-size: 13.5px; font-weight: 600; }
.tl-body { font-size: 13px; color: var(--text-2); margin-top: 5px; white-space: pre-wrap; word-break: break-word; }
.tl-meta { font-size: 11.5px; color: var(--text-3); margin-top: 4px; }
.node-acts { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

.notice {
  padding: 11px 14px; border-radius: 9px; font-size: 13px; margin-bottom: 14px;
  display: flex; gap: 9px; align-items: flex-start;
}
.notice.blue { background: var(--primary-s); color: #1e40af; }
.notice.orange { background: var(--warn-s); color: #92600a; }
.notice.red { background: var(--danger-s); color: #991b1b; }
.notice.green { background: var(--ok-s); color: #065f46; }

/* ---------- 权限配置 ---------- */
.muted { color: var(--text-3); font-size: 12.5px; }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.perm-cfg .pill { cursor: pointer; border: 1px solid var(--line); background: var(--panel); padding: 7px 13px; border-radius: 8px; color: var(--text-2); font-size: 13px; transition: all .15s; }
.perm-cfg .pill:hover { border-color: #c9d2e0; color: var(--text); }
.perm-cfg .pill.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.perm-tree { margin: 6px 0 12px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--panel); max-height: 360px; overflow: auto; }
.perm-node { padding-left: 0; }
.perm-node .perm-node { padding-left: 18px; border-left: 1px dashed var(--line); margin-left: 6px; }
.perm-dept { display: flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; padding: 4px 0; cursor: pointer; }
.perm-dept input { margin: 0; }
.perm-members { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 4px 0 8px 24px; }
.perm-mem { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text-2); font-weight: 400; cursor: pointer; }
.perm-stat { background: var(--panel-2); border-radius: 9px; padding: 11px 14px; font-size: 13.5px; margin: 6px 0 14px; }
.perm-stat b { color: var(--primary); font-size: 15px; }
.perm-actions { display: flex; align-items: center; gap: 10px; }
.perm-actions .spacer { flex: 1; }

/* ---------- Toast ---------- */
#toasts { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: #1f2937; color: #fff; padding: 9px 17px; border-radius: 9px; font-size: 13.5px;
  box-shadow: var(--sh-lg); animation: drop .22s cubic-bezier(.16, 1, .3, 1); max-width: 90vw;
}
.toast.err { background: var(--danger); }
.toast.ok { background: var(--ok); }
@keyframes drop { from { opacity: 0; transform: translateY(-12px); } }

/* ---------- 移动端 ---------- */
@media (max-width: 860px) {
  .app { flex-direction: column; }
  .side { width: 100%; flex: none; height: auto; position: relative; }
  .side-head { padding: 14px 16px 10px; }
  .side-nav { display: flex; gap: 6px; overflow-x: auto; padding: 0 12px 12px; }
  .side-nav .group { display: none; }
  .side-nav button { flex: none; width: auto; margin-bottom: 0; padding: 7px 13px; }
  .side-nav button .cnt { display: none; }
  .side-foot { display: none; }
  .content { padding: 15px 14px 60px; }
  .topbar { padding: 0 15px; height: 56px; }
  .topbar h1 { font-size: 15px; }
  .who .nm, .who .dp { display: none; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat .vl { font-size: 21px; }
  .mask { padding: 14px 10px; }
  .m-body { padding: 16px; }
  .kv { grid-template-columns: 78px 1fr; }
  .tbl { display: block; overflow-x: auto; white-space: nowrap; }
}

/* 演示模式身份提示条 */
.demo-bar {
  background: var(--warn-s, #fef3c7);
  color: #92600a;
  border: 1px solid rgba(146, 96, 10, .18);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.7;
  margin-bottom: 16px;
}
.demo-bar.hidden { display: none; }
