/* ==========================================================================
   任务四象限工作台 · 设计基调参照飞书：克制、留白、圆角、单一主色
   ========================================================================== */
:root {
  --brand: #3370ff;
  --brand-hover: #245bdb;
  --brand-light: #eaf1ff;
  --bg: #f5f6f7;
  --surface: #ffffff;
  --line: #eff0f1;
  --line-strong: #dee0e3;
  --text: #1f2329;
  --text-2: #646a73;
  --text-3: #8f959e;
  --danger: #f54a45;
  --danger-bg: #fef1f1;
  --warn: #ff8800;
  --warn-bg: #fff8eb;
  --ok: #00b578;
  --ok-bg: #e8f8f1;
  --purple: #7b61ff;
  --radius: 10px;
  --shadow-sm: 0 1px 2px rgba(31, 35, 41, 0.06);
  --shadow: 0 4px 16px rgba(31, 35, 41, 0.1);
  --shadow-lg: 0 12px 48px rgba(31, 35, 41, 0.18);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; font-size: 14px; }
input, textarea, select {
  font-family: inherit; font-size: 14px; color: var(--text);
  border: 1px solid var(--line-strong); border-radius: 6px; padding: 7px 10px;
  background: #fff; outline: none; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(51, 112, 255, .12); }
textarea { resize: vertical; min-height: 60px; line-height: 1.6; }
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d9dde2; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #c4c9cf; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- 通用组件 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 14px; border-radius: 6px; font-size: 14px;
  background: #fff; border: 1px solid var(--line-strong); color: var(--text);
  transition: all .15s; white-space: nowrap;
}
.btn:hover { background: #f5f6f7; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn.danger { color: var(--danger); border-color: #f8c5c3; }
.btn.danger:hover { background: var(--danger-bg); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: rgba(31, 35, 41, .06); }
.btn.sm { height: 26px; padding: 0 10px; font-size: 12px; border-radius: 5px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.tag {
  display: inline-flex; align-items: center; height: 20px; padding: 0 6px;
  border-radius: 4px; font-size: 11px; background: #f2f3f5; color: var(--text-2);
  white-space: nowrap; margin-right: 4px;
}
.tag.blue { background: var(--brand-light); color: var(--brand); }
.tag.red { background: var(--danger-bg); color: var(--danger); }
.tag.orange { background: var(--warn-bg); color: #c96a00; }
.tag.green { background: var(--ok-bg); color: #00875a; }
.tag.purple { background: #f2efff; color: var(--purple); }

.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%; color: #fff;
  font-size: 11px; font-weight: 600; flex: 0 0 auto; overflow: hidden;
}
.avatar.lg { width: 36px; height: 36px; font-size: 14px; }
.avatar.sm { width: 20px; height: 20px; font-size: 10px; }

.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.muted { color: var(--text-3); }
.mini { font-size: 12px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { padding: 40px 0; text-align: center; color: var(--text-3); font-size: 13px; }

/* ---------------- 登录页 ---------------- */
.auth-wrap { display: flex; height: 100vh; }
.auth-left {
  flex: 1.1; background: linear-gradient(135deg, #2b5bd7 0%, #3370ff 45%, #5b8cff 100%);
  color: #fff; padding: 64px 72px; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.auth-left::after {
  content: ''; position: absolute; width: 520px; height: 520px; border-radius: 50%;
  background: rgba(255, 255, 255, .08); right: -160px; bottom: -180px;
}
.auth-left::before {
  content: ''; position: absolute; width: 300px; height: 300px; border-radius: 50%;
  background: rgba(255, 255, 255, .06); right: 80px; top: -120px;
}
.auth-brand { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 600; z-index: 1; }
.auth-logo {
  width: 34px; height: 34px; border-radius: 9px; background: rgba(255, 255, 255, .18);
  display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.auth-title { font-size: 34px; font-weight: 600; line-height: 1.35; margin: 0 0 18px; z-index: 1; letter-spacing: .5px; }
.auth-sub { font-size: 15px; line-height: 1.9; color: rgba(255, 255, 255, .82); z-index: 1; max-width: 430px; }
.auth-points { display: flex; flex-direction: column; gap: 14px; margin-top: 34px; z-index: 1; }
.auth-point { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: rgba(255, 255, 255, .9); }
.auth-point i {
  width: 22px; height: 22px; border-radius: 50%; background: rgba(255, 255, 255, .2);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-style: normal; flex: 0 0 auto;
}
.auth-right { width: 480px; background: #fff; display: flex; align-items: center; justify-content: center; padding: 40px; }
.auth-card { width: 100%; max-width: 340px; }
.auth-tabs { display: flex; gap: 26px; margin-bottom: 28px; border-bottom: 1px solid var(--line); }
.auth-tab { padding: 0 0 12px; font-size: 17px; font-weight: 600; color: var(--text-3); position: relative; }
.auth-tab.active { color: var(--text); }
.auth-tab.active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--brand); border-radius: 2px;
}
.auth-field { margin-bottom: 16px; }
.auth-field input { height: 42px; padding: 0 12px; }
.auth-hint { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.auth-submit { height: 42px; font-size: 15px; margin-top: 8px; }
.auth-alt { margin-top: 22px; }
.auth-divider { display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: 12px; margin: 20px 0 14px; }
.auth-divider::before, .auth-divider::after { content: ''; height: 1px; background: var(--line); flex: 1; }
.auth-oauth { display: flex; gap: 10px; }
.auth-oauth button { flex: 1; height: 40px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; font-size: 13px; color: var(--text-2); }
.auth-oauth button:hover { background: #f5f6f7; }
.auth-err { color: var(--danger); font-size: 12px; min-height: 18px; margin-top: -6px; margin-bottom: 6px; }
.auth-quota { font-size: 12px; color: var(--text-3); margin-top: 18px; text-align: center; }
.auth-license { font-size: 12px; color: var(--text-3); text-align: center; margin-top: 6px; }
.auth-license.expired { color: var(--danger); font-weight: 600; background: #fff2f0; padding: 8px 10px; border-radius: 6px; margin-top: 12px; }
.auth-demo { margin-top: 16px; padding: 10px 12px; background: #f7f8fa; border-radius: 6px; font-size: 12px; color: var(--text-2); line-height: 1.7; }

@media (max-width: 900px) {
  .auth-left { display: none; }
  .auth-right { width: 100%; }
}

/* ---------------- 应用骨架 ---------------- */
.app { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }
.sidebar {
  width: 218px; flex: 0 0 218px; background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 14px 10px;
  min-height: 0; overflow: hidden;
}
/* 导航区独立滚动：窗口再矮、项目再多，也只滚这一块，不影响上下固定区 */
.side-scroll {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden;
  overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #d9dde2 transparent;
}
.side-scroll::-webkit-scrollbar { width: 6px; }
.side-scroll::-webkit-scrollbar-thumb { background: #d9dde2; border-radius: 8px; }
.side-scroll::-webkit-scrollbar-thumb:hover { background: #c4c9cf; }
.side-scroll::-webkit-scrollbar-track { background: transparent; }
.side-brand { flex: 0 0 auto; display: flex; align-items: center; gap: 9px; padding: 4px 8px 16px; font-weight: 600; font-size: 15px; }
.side-brand .mark {
  width: 26px; height: 26px; border-radius: 7px; background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.side-group { margin-bottom: 14px; }
.side-group-title {
  font-size: 11px; color: var(--text-3); padding: 6px 10px; letter-spacing: .5px;
  display: flex; justify-content: space-between; align-items: center;
}
.side-add {
  width: 18px; height: 18px; line-height: 16px; text-align: center; border: none;
  border-radius: 4px; background: var(--brand); color: #fff; font-size: 14px;
  cursor: pointer; padding: 0; margin-left: 4px;
}
.side-add:hover { background: var(--brand-dark); }
.kv code {
  display: block; min-height: 32px; padding: 7px 10px; border: 1px solid var(--line-strong);
  border-radius: 8px; background: #fafbfc; color: var(--text); font-size: 12.5px;
  word-break: break-all; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.nav-item {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 6px;
  color: var(--text-2); font-size: 13.5px; margin-bottom: 1px; cursor: pointer; position: relative;
}
.nav-item:hover { background: #f5f6f7; color: var(--text); }
.nav-item.active { background: var(--brand-light); color: var(--brand); font-weight: 500; }
.nav-item .ico { width: 16px; text-align: center; font-size: 14px; opacity: .85; }
.nav-item .badge {
  margin-left: auto; background: var(--danger); color: #fff; font-size: 10px;
  min-width: 16px; height: 16px; border-radius: 8px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
}
.nav-item .badge.gray { background: #e8e9eb; color: var(--text-2); }
.proj-dot { width: 8px; height: 8px; border-radius: 3px; flex: 0 0 auto; }
/* 账号 / 退出固定在侧栏底部，永远可见（小窗口不再被挤出视口） */
.side-foot {
  flex: 0 0 auto; margin-top: 0; border-top: 1px solid var(--line);
  padding-top: 10px; background: var(--surface);
  box-shadow: 0 -8px 14px -14px rgba(31, 35, 41, .45);
}
.user-chip { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.user-chip:hover { background: #f5f6f7; }
.user-chip .name { font-size: 13px; font-weight: 500; line-height: 1.3; }
.user-chip .role { font-size: 11px; color: var(--text-3); }

.side-foot-actions { display: flex; gap: 8px; padding: 6px 10px 2px; }
.side-action {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px;
  padding: 7px 8px; font-size: 12.5px; color: var(--text-2);
  background: #f5f6f7; border: 1px solid var(--line); border-radius: 6px; cursor: pointer;
}
.side-action:hover { background: #eceef0; }
.side-action.danger { color: #d4380d; }
.side-action.danger:hover { background: #fff1f0; border-color: #ffccc7; }
.side-action .ic { width: 15px; height: 15px; }
.side-action:hover .ic { stroke: currentColor; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 54px; flex: 0 0 54px; background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px; padding: 0 20px;
}
.topbar h1 { font-size: 16px; font-weight: 600; margin: 0; }
.topbar .sub { font-size: 12px; color: var(--text-3); }
.search {
  margin-left: auto; display: flex; align-items: center; gap: 6px;
  background: #f5f6f7; border-radius: 6px; padding: 0 10px; height: 32px; width: 220px;
}
.search input { border: none; background: transparent; padding: 0; height: 30px; font-size: 13px; }
.search input:focus { box-shadow: none; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 6px; display: flex; align-items: center;
  justify-content: center; position: relative; color: var(--text-2); font-size: 15px;
}
.icon-btn:hover { background: #f5f6f7; }
.icon-btn .red-dot {
  position: absolute; top: 5px; right: 5px; width: 7px; height: 7px;
  background: var(--danger); border-radius: 50%; border: 1.5px solid #fff;
}
.content { flex: 1; overflow: auto; padding: 18px 20px 40px; }

/* ---------------- 四象限 ---------------- */
.matrix {
  display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr;
  gap: 14px; height: calc(100vh - 54px - 18px - 40px); min-height: 520px;
}
.qbox {
  background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line);
  display: flex; flex-direction: column; overflow: hidden; position: relative;
  transition: box-shadow .15s, border-color .15s;
}
.qbox.dragover { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(51, 112, 255, .1); }
.qhead { display: flex; align-items: center; gap: 8px; padding: 12px 14px 10px; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.qbar { flex: 0 0 auto; }
.qhead .qt { font-size: 14px; font-weight: 600; }
.qhead .qh { font-size: 11px; color: var(--text-3); }
.qhead .qc {
  margin-left: auto; font-size: 12px; font-weight: 600; min-width: 22px; height: 22px;
  border-radius: 11px; display: flex; align-items: center; justify-content: center; padding: 0 8px;
}
.qbar { height: 3px; }
/* 象限内独立滚动：任务行锁定 44px 永不被压缩，装不下的用滑条往下看。
 * min-height:0 是 flex 滚动的关键（否则 qbody 会被内容顶开，滚动条不出现）。 */
.qbody {
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto; overflow-x: hidden;
  overscroll-behavior: contain; scrollbar-gutter: stable;
  scrollbar-width: thin; scrollbar-color: #b9c0c9 transparent;
  padding: 8px; display: flex; flex-direction: column; gap: 5px;
}
.qbody::-webkit-scrollbar { width: 9px; }
.qbody::-webkit-scrollbar-track { background: #f4f6f8; border-radius: 9px; }
.qbody::-webkit-scrollbar-thumb { background: #b9c0c9; border-radius: 9px; border: 2px solid #f4f6f8; }
.qbody::-webkit-scrollbar-thumb:hover { background: #8f98a3; }
/* flex 子项禁止收缩：行数再多也保持每行 44px，不叠字 */
.qbody > * { flex: 0 0 auto; }
.qbody > .task-card { flex: 0 0 44px; }
/* 装不下时底部给出明确提示，点击即向下翻一屏 */
.qscroll-tip {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
  display: none; align-items: center; justify-content: center;
  height: 24px; padding: 0 12px; border-radius: 12px;
  background: rgba(38, 48, 62, .82); color: #fff; font-size: 11px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .14); cursor: pointer; z-index: 3;
  white-space: nowrap; user-select: none;
}
.qscroll-tip:hover { background: rgba(38, 48, 62, .94); }
.qbox.has-more .qscroll-tip { display: flex; }
.q1 .qbar, .q1 .qc { background: var(--danger); color: #fff; }
.q2 .qbar, .q2 .qc { background: var(--brand); color: #fff; }
.q3 .qbar, .q3 .qc { background: var(--warn); color: #fff; }
.q4 .qbar, .q4 .qc { background: #a1a7b0; color: #fff; }
.q1 .qh { color: var(--danger); }

.task-card {
  background: #fff; border: 1px solid var(--line); border-radius: 6px;
  height: 44px; box-sizing: border-box; padding: 5px 8px;
  display: flex; align-items: center; gap: 7px; overflow: hidden;
  cursor: pointer; transition: border-color .15s, box-shadow .15s; position: relative;
}
.task-card:hover { border-color: #cfd4da; box-shadow: var(--shadow-sm); }
.task-card.dragging { opacity: .45; }
.task-card .tc-main { flex: 1; min-width: 0; }
.task-card .tt { font-size: 12.5px; line-height: 1.3; margin: 0; display: flex; gap: 6px; }
.task-card .tt .txt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 项目归属胶囊：夹在行首时间徽标与任务标题之间，带项目色圆点，不撑高 44px 卡片 */
.task-card .tt .tc-project {
  flex: 0 1 auto; min-width: 0; max-width: 92px;
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; line-height: 1.2; color: var(--text-2);
  background: #f4f6f8; border-radius: 3px; padding: 1px 5px 1px 4px;
  white-space: nowrap; overflow: hidden;
}
.task-card .tt .tc-project .pc-dot {
  flex: 0 0 auto; width: 6px; height: 6px; border-radius: 50%;
  background: var(--pc, #8f959e);
}
.task-card .tt .tc-project .pc-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-card .meta { display: flex; align-items: center; gap: 5px; font-size: 10px; line-height: 1.35; color: var(--text-3); flex-wrap: nowrap; min-width: 0; overflow: hidden; white-space: nowrap; }
.task-card .meta > span { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-card .meta .tc-tags { display: inline-flex; flex: 0 1 auto; min-width: 0; gap: 3px; overflow: hidden; }
.task-card .meta .tc-read, .task-card .meta .chip-read { flex: 0 0 auto; }
.task-card .meta .tag { font-size: 9px; padding: 0 3px; flex: 0 0 auto; }
/* 责任人放在信息行最后、靠右独立成列，永不与标签/已读状态重叠 */
.task-card .meta .tc-owner {
  flex: 0 0 auto; margin-left: auto; padding-left: 6px; max-width: 76px;
  text-align: right; color: var(--text-2); font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.task-card .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; margin: 0; background: #eef0f2; border-radius: 0; overflow: hidden; }
.task-card .bar i { display: block; height: 100%; background: var(--brand); border-radius: 0; }
.task-card.done { opacity: .6; }
.task-card.done .txt { text-decoration: line-through; }
.chip-read { font-size: 9px; padding: 0 4px; border-radius: 3px; background: #f2f3f5; color: var(--text-3); }
.chip-read.all { background: var(--ok-bg); color: #00875a; }
.chip-read.part { background: var(--warn-bg); color: #c96a00; }

/* 行首时间徽标：逾期红 / 未到期绿 / 已完成与未设截止灰 */
.due-chip { flex: 0 0 auto; min-width: 68px; max-width: 88px; text-align: center; font-size: 10px; line-height: 1.2; padding: 3px 5px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.due-chip.over { color: #d92d20; background: #fff1f0; font-weight: 600; }
.due-chip.future { color: #00875a; background: #e8f7ef; font-weight: 600; }
.due-chip.done { color: #637381; background: #f2f3f5; }
.due-chip.none { color: var(--text-3); background: #f5f6f7; }

/* 行尾「今日重点」小圆圈 */
.focus-dot { flex: 0 0 auto; width: 21px; height: 21px; padding: 0; border-radius: 50%; border: 1.5px solid #cfd4da; background: #fff; color: var(--text-3); font-size: 11px; line-height: 18px; text-align: center; cursor: pointer; transition: all .15s; }
.focus-dot:hover { border-color: var(--brand); color: var(--brand); transform: scale(1.08); }
.focus-dot.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }

/* 今日重点 1-5 选择器 */
.fp-box { font-size: 13px; line-height: 1.7; }
.fp-label { font-size: 12px; color: var(--text-3); margin-bottom: 10px; }
.fp-opts { display: flex; gap: 8px; }
.fopt { width: 44px; height: 40px; border: 1px solid var(--line-strong); background: #fff; border-radius: 8px; font-size: 16px; font-weight: 600; cursor: pointer; color: var(--text-2); }
.fopt:hover { border-color: var(--brand); color: var(--brand); }
.fopt.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* 侧栏项目自定义分组 + 拖拽 */
.pf-group { margin: 0 0 4px; border-radius: 6px; }
.pf-group.pf-drop { outline: 2px dashed var(--brand); outline-offset: -2px; background: var(--brand-light); }
.pf-head { display: flex; align-items: center; gap: 4px; padding: 5px 8px 3px 10px; font-size: 11px; color: var(--text-3); }
.pf-toggle, .pf-edit, .pf-del { border: none; background: transparent; cursor: pointer; color: var(--text-3); font-size: 11px; padding: 0 3px; line-height: 16px; }
.pf-toggle:hover, .pf-edit:hover { color: var(--brand); }
.pf-del:hover { color: var(--danger); }
.pf-name { font-weight: 600; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-cnt { margin-left: auto; background: #e8e9eb; color: var(--text-2); border-radius: 8px; padding: 0 6px; font-size: 10px; line-height: 16px; }
.pf-body { min-height: 4px; }
.proj-row { cursor: grab; }
.proj-row.dragging { opacity: .4; }
.proj-row.drop-before { box-shadow: inset 0 2px 0 var(--brand); }
.proj-row.drop-after { box-shadow: inset 0 -2px 0 var(--brand); }

/* ---------------- 通用页头 / 工具条 ---------------- */
.page-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.page-head .t { font-size: 17px; font-weight: 600; }
.proj-org-bar { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; flex-wrap: wrap; }
.proj-org-bar .row { gap: 2px; }
.proj-org-bar .avatar { width: 24px; height: 24px; font-size: 11px; }
.toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.seg { display: flex; background: #eaebed; border-radius: 6px; padding: 2px; }
.seg button { padding: 4px 12px; border-radius: 5px; font-size: 12.5px; color: var(--text-2); }
.seg button.active { background: #fff; color: var(--text); box-shadow: var(--shadow-sm); font-weight: 500; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }

/* ---------------- 表格（团队视图） ---------------- */
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th {
  text-align: left; font-weight: 500; color: var(--text-3); font-size: 12px;
  padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fafbfc; white-space: nowrap;
}
table.grid td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.grid tr:last-child td { border-bottom: none; }
table.grid tbody tr { cursor: pointer; }
table.grid tbody tr:hover { background: #fafbfc; }
table.grid .t-title { font-weight: 500; }
table.grid .t-sub { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

/* ---------------- 项目视图 ---------------- */
.project-layout { display: flex; gap: 14px; align-items: flex-start; }
.tree-panel { width: 232px; flex: 0 0 232px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; max-height: calc(100vh - 140px); overflow: auto; }
.tree-node {
  display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 5px;
  font-size: 13px; color: var(--text-2); cursor: pointer; position: relative;
}
.tree-node:hover { background: #f5f6f7; }
.tree-node.active { background: var(--brand-light); color: var(--brand); font-weight: 500; }
.tree-node .lv { font-size: 10px; color: var(--text-3); }
.tree-node .acts { margin-left: auto; display: none; gap: 2px; }
.tree-node:hover .acts { display: flex; }
.tree-node .acts button { font-size: 12px; color: var(--text-3); padding: 0 3px; }
.tree-node .acts button:hover { color: var(--brand); }
.lv-badge { font-size: 9px; background: #eef0f2; color: var(--text-3); border-radius: 3px; padding: 0 3px; }
.task-area { flex: 1; min-width: 0; }
.list-row {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; background: #fff;
  border-bottom: 1px solid var(--line); cursor: pointer; font-size: 13px;
}
.list-row:hover { background: #fafbfc; }
.list-row .badge-soft { min-width: 82px; justify-content: center; }
.list-row:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.list-row:last-child { border-bottom: none; border-radius: 0 0 var(--radius) var(--radius); }

/* ---------------- 抽屉 ---------------- */
.drawer-mask {
  position: fixed; inset: 0; background: rgba(31, 35, 41, .35); z-index: 60;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.drawer-mask.show { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 560px; max-width: 94vw; background: #fff;
  z-index: 61; transform: translateX(100%); transition: transform .24s cubic-bezier(.4, 0, .2, 1);
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
}
.drawer.show { transform: translateX(0); }
.drawer-head {
  padding: 16px 20px 12px; border-bottom: 1px solid var(--line);
  display: flex; align-items: flex-start; gap: 10px;
}
.drawer-body { flex: 1; overflow: auto; padding: 16px 20px 24px; }
.drawer-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; }
.sec-title {
  font-size: 12px; color: var(--text-3); font-weight: 500; margin: 20px 0 10px;
  display: flex; align-items: center; gap: 8px;
}
.sec-title:first-child { margin-top: 0; }
.sec-title::after { content: ''; height: 1px; background: var(--line); flex: 1; }
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 8px 12px; font-size: 13px; align-items: start; }
.kv .k { color: var(--text-3); font-size: 12.5px; padding-top: 2px; }
.kv .v { min-width: 0; word-break: break-word; }
.badge-soft { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 4px; font-size: 12px; background: #f2f3f5; color: var(--text-2); }
.badge-soft.q1 { background: var(--danger-bg); color: var(--danger); }
.badge-soft.q2 { background: var(--brand-light); color: var(--brand); }
.badge-soft.q3 { background: var(--warn-bg); color: #c96a00; }
.badge-soft.q4 { background: #f2f3f5; color: var(--text-2); }

/* 修改对比 */
.diff-item {
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; background: #fafbfc;
}
.diff-head { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.diff-line { font-size: 13px; line-height: 1.8; }
.diff-line .f { color: var(--text-3); font-size: 12px; }
.diff-line .b { color: var(--text-3); text-decoration: line-through; }
.diff-line .a { color: var(--brand); font-weight: 500; }
.diff-line .arrow { color: var(--text-3); margin: 0 6px; }

/* 已读回执 */
.receipt { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.receipt .person {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px 3px 3px;
  background: #f5f6f7; border-radius: 14px; font-size: 12px; color: var(--text-2);
}
.receipt .person.unread { background: #fff; border: 1px dashed var(--line-strong); color: var(--text-3); }
.receipt .person.stale { background: var(--warn-bg); color: #c96a00; }
.receipt-sum { font-size: 12px; margin-bottom: 8px; }
.receipt-sum b { font-size: 13px; }

/* ---------------- 弹窗 ---------------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(31, 35, 41, .4); z-index: 70;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  opacity: 0; pointer-events: none; transition: opacity .18s;
}
.modal-mask.show { opacity: 1; pointer-events: auto; }
.modal {
  background: #fff; border-radius: 12px; width: 620px; max-width: 100%; max-height: 88vh;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: var(--shadow-lg); transform: scale(.97); transition: transform .18s;
}
.modal-mask.show .modal { transform: scale(1); }
.modal-head { flex: 0 0 auto; padding: 18px 22px 12px; font-size: 16px; font-weight: 600; display: flex; align-items: center; }
/* 内容区必须可收缩，否则长弹窗（项目组织等）底部会被视口裁掉、看不到下半部分 */
.modal-body { flex: 1 1 auto; min-height: 0; padding: 0 22px 8px; overflow: auto; }
.modal-foot { flex: 0 0 auto; padding: 14px 22px 18px; display: flex; justify-content: flex-end; gap: 8px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }

/* ---------------- 强提醒浮层 ---------------- */
.alert-layer {
  position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 40%, rgba(245, 74, 69, .96), rgba(150, 20, 18, .97));
  padding: 24px;
}
.alert-layer.show { display: flex; animation: alertIn .22s ease-out; }
@keyframes alertIn { from { opacity: 0; } to { opacity: 1; } }
.alert-card {
  background: #fff; border-radius: 16px; width: 460px; max-width: 100%; padding: 26px 26px 20px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .4); text-align: center;
  animation: alertPulse 1.1s ease-in-out infinite alternate;
}
@keyframes alertPulse {
  from { box-shadow: 0 24px 80px rgba(0, 0, 0, .4), 0 0 0 0 rgba(255, 255, 255, .55); }
  to { box-shadow: 0 24px 80px rgba(0, 0, 0, .4), 0 0 0 16px rgba(255, 255, 255, 0); }
}
.alert-bell { font-size: 40px; margin-bottom: 6px; animation: ring .7s ease-in-out infinite; }
@keyframes ring { 0%, 100% { transform: rotate(-12deg); } 50% { transform: rotate(12deg); } }
.alert-kicker { font-size: 12px; color: var(--danger); letter-spacing: 2px; font-weight: 600; }
.alert-title { font-size: 19px; font-weight: 600; margin: 8px 0 6px; line-height: 1.5; }
.alert-desc { font-size: 13px; color: var(--text-2); line-height: 1.7; margin-bottom: 4px; }
.alert-meta { font-size: 12px; color: var(--text-3); margin: 8px 0 16px; }
.alert-actions { display: flex; flex-direction: column; gap: 8px; }
.alert-actions .btn { height: 40px; font-size: 14px; }
.alert-call { background: var(--danger); border-color: var(--danger); color: #fff; }
.alert-call:hover { background: #d93a35; }
.alert-snooze { display: flex; gap: 6px; }
.alert-snooze .btn { flex: 1; height: 34px; font-size: 13px; }
.alert-count { font-size: 11px; color: var(--text-3); margin-top: 10px; }

/* ---------------- 通知中心 ---------------- */
.msg-item { display: flex; gap: 10px; padding: 13px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.msg-item:hover { background: #fafbfc; }
.msg-item.unread { background: #f7faff; }
.msg-item .mt { font-size: 13.5px; font-weight: 500; margin-bottom: 3px; display: flex; align-items: center; gap: 6px; }
.msg-item .mc { font-size: 12.5px; color: var(--text-2); line-height: 1.65; }
.msg-item .mtime { font-size: 11px; color: var(--text-3); margin-top: 4px; }

/* ---------------- 组织架构 ---------------- */
.org-tree { font-size: 13.5px; }
.org-node { border-left: 1px solid var(--line); margin-left: 10px; padding-left: 14px; }
.org-node.root { border-left: none; margin-left: 0; padding-left: 0; }
.org-row {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 6px; margin-bottom: 2px;
}
.org-row:hover { background: #fafbfc; }
.org-row .dept-name { font-weight: 500; }
.org-row .lv-tag { font-size: 10px; background: #eef0f2; color: var(--text-3); border-radius: 3px; padding: 1px 4px; }
.org-members { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 0 10px 4px; }
.member-card {
  display: flex; align-items: center; gap: 7px; padding: 5px 10px 5px 5px;
  border: 1px solid var(--line); border-radius: 16px; font-size: 12.5px; background: #fff;
}
.member-card .role-mini { font-size: 10px; color: var(--text-3); }

/* ---------------- 统计 ---------------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat-card .l { font-size: 12px; color: var(--text-3); margin-bottom: 8px; }
.stat-card .n { font-size: 24px; font-weight: 600; line-height: 1; }
.stat-card .n small { font-size: 12px; font-weight: 400; color: var(--text-3); margin-left: 3px; }
.stat-card .foot { font-size: 11px; color: var(--text-3); margin-top: 6px; }
.bar-mini { height: 5px; background: #eef0f2; border-radius: 3px; overflow: hidden; }
.bar-mini i { display: block; height: 100%; background: var(--brand); }

/* ---------------- Toast ---------------- */
.toast-wrap { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: rgba(31, 35, 41, .92); color: #fff; padding: 9px 16px; border-radius: 8px;
  font-size: 13px; box-shadow: var(--shadow); animation: toastIn .2s ease-out; max-width: 460px;
}
.toast.ok { background: #0f7b52; }
.toast.err { background: #c9382f; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------------- 小工具 ---------------- */
.spin { display: inline-block; width: 13px; height: 13px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: sp .7s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
.skel { background: linear-gradient(90deg, #f2f3f5 25%, #e9ebee 37%, #f2f3f5 63%); background-size: 400% 100%; animation: skel 1.4s ease infinite; border-radius: 6px; }
@keyframes skel { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@media (max-width: 1100px) {
  .matrix { grid-template-columns: 1fr; grid-template-rows: auto; height: auto; }
  .qbox { min-height: 260px; }
  .project-layout { flex-direction: column; }
  .tree-panel { width: 100%; flex: none; max-height: 240px; }
}

/* ---------------- 线性图标 ---------------- */
.ic { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.ic.lg { width: 20px; height: 20px; }
.ic.sm { width: 13px; height: 13px; }

/* 表单小修饰 */
.inline-select { height: 30px; font-size: 13px; padding: 0 8px; }
.progress-pills { display: flex; gap: 4px; margin-top: 6px; }
.progress-pills button { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: #f2f3f5; color: var(--text-2); }
.progress-pills button:hover { background: var(--brand-light); color: var(--brand); }
.subtask-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13px; cursor: pointer; }
.subtask-row:last-child { border-bottom: none; }
.subtask-row:hover { color: var(--brand); }
.timeline-item { position: relative; padding-left: 18px; padding-bottom: 14px; border-left: 1px solid var(--line); margin-left: 6px; }
.timeline-item:last-child { padding-bottom: 0; border-left-color: transparent; }
.timeline-item::before { content: ''; position: absolute; left: -4px; top: 4px; width: 7px; height: 7px; border-radius: 50%; background: #cdd1d6; }
.timeline-item.sub::before { background: var(--warn); }
.timeline-item .th { font-size: 12px; color: var(--text-3); margin-bottom: 4px; }
.timeline-item .tb { font-size: 13px; line-height: 1.7; }
.read-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; padding: 2px 7px; border-radius: 10px; background: #f2f3f5; color: var(--text-2); }
.read-pill.ok { background: var(--ok-bg); color: #00875a; }
.read-pill.warn { background: var(--warn-bg); color: #c96a00; }
.read-pill.none { background: #f2f3f5; color: var(--text-3); }

/* 内容区工具条左侧计数 */
.page-count { font-size: 13px; color: var(--text-2); font-weight: 500; }
.page-count b { color: var(--text); }

/* ==========================================================================
   登录页补充（邀请制版本）
   ========================================================================== */
.auth-foot { font-size: 12px; color: rgba(255, 255, 255, .55); z-index: 1; }
.auth-card-title { font-size: 20px; font-weight: 600; margin-bottom: 18px; }
.auth-invite-tip {
  margin-top: 18px; padding: 12px 14px; border-radius: 10px;
  background: var(--brand-light); font-size: 12.5px; line-height: 1.75; color: var(--text-2);
}
.auth-invite-tip b { display: block; color: var(--brand); font-weight: 500; margin-bottom: 2px; }
.auth-invite-tip span { display: block; }

/* ==========================================================================
   邀请激活页
   ========================================================================== */
.join-wrap {
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px;
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
  background: radial-gradient(circle at 50% 0%, #eef3ff 0%, var(--bg) 46%);
}
.join-card {
  width: 100%; max-width: 440px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 16px; padding: 26px 24px 24px;
  box-shadow: var(--shadow);
}
.join-brand { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; color: var(--text-2); margin-bottom: 22px; }
.join-brand .auth-logo { width: 26px; height: 26px; border-radius: 8px; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.join-title { font-size: 19px; font-weight: 600; margin-bottom: 6px; }
.join-sub { font-size: 13px; color: var(--text-2); line-height: 1.7; margin-bottom: 18px; }
.join-loading { font-size: 13px; color: var(--text-3); text-align: center; padding: 30px 0; }
.join-fail { text-align: center; }
.join-fail-title { font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.join-fail-msg { font-size: 13px; color: var(--text-2); line-height: 1.7; margin-bottom: 18px; }
.join-foot { font-size: 12px; color: var(--text-3); }

/* ==========================================================================
   移动端菜单按钮
   ========================================================================== */
.m-menu {
  display: none; position: fixed; left: 12px; top: calc(10px + env(safe-area-inset-top));
  z-index: 70; width: 36px; height: 36px; border-radius: 9px;
  background: var(--surface); border: 1px solid var(--line-strong);
  align-items: center; justify-content: center; box-shadow: var(--shadow-sm);
}
.nav-mask {
  display: none; position: fixed; inset: 0; z-index: 55;
  background: rgba(31, 35, 41, .38); opacity: 0; transition: opacity .2s;
}
body.nav-open .nav-mask { display: block; opacity: 1; }

/* ==========================================================================
   移动端适配（≤ 820px）
   ========================================================================== */
@media (max-width: 820px) {
  .app { display: block; height: 100vh; height: 100dvh; }
  .m-menu { display: flex; }

  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 258px;
    transform: translateX(-102%); transition: transform .22s ease;
    z-index: 60; box-shadow: var(--shadow-lg);
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
  }
  body.nav-open .sidebar { transform: translateX(0); }

  .main { height: 100vh; height: 100dvh; }
  .topbar { padding: 12px 14px 12px 58px; gap: 8px; }
  .topbar h1 { font-size: 15px; }
  .topbar .sub { display: none; }
  .topbar .search { display: none; }

  .content { padding: 12px 12px calc(72px + env(safe-area-inset-bottom)); }

  /* 四象限改为单列纵向，每块给最小高度，避免被压扁 */
  .matrix { grid-template-columns: 1fr; grid-template-rows: none; gap: 12px; }
  .matrix > * { min-height: 168px; }

  /* 任务列表行改为两行布局 */
  .list-row { flex-wrap: wrap; padding: 12px 12px; gap: 6px 8px; }
  .list-row > .grow { flex: 1 1 100%; order: 1; }
  .list-row .badge-soft { order: 0; }
  .list-row > span[style*="width:112px"] { width: auto !important; text-align: left !important; }
  .list-row > div[style*="width:74px"] { width: 96px !important; }

  .form-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 84px 1fr; font-size: 13px; }

  .drawer { width: 100%; }
  .modal { width: calc(100vw - 24px) !important; max-height: 86vh; }
  .modal-body { max-height: calc(86vh - 130px); }
  .modal-foot { flex-wrap: wrap; }
  .modal-foot .btn { flex: 1 1 auto; min-height: 42px; justify-content: center; }

  .btn { min-height: 38px; }
  .btn.sm { min-height: 32px; }

  .auth-wrap { display: block; }
  .auth-left { display: none; }
  .auth-right { min-height: 100vh; min-height: 100dvh; padding: 28px 20px calc(28px + env(safe-area-inset-bottom)); align-items: flex-start; }
  .auth-card { width: 100%; max-width: 460px; margin: 0 auto; box-shadow: none; border: none; padding: 8px 4px; }
  .auth-submit { min-height: 46px; }

  .alert-layer .alert-card { width: calc(100vw - 28px) !important; }

  /* 宽表格横向滚动，避免挤压变形 */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 620px; }
}

/* ==========================================================================
   邀请面板
   ========================================================================== */
.invite-list { border-top: 1px solid var(--line); padding-top: 4px; }
.invite-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 12.5px; flex-wrap: wrap; }
.invite-row:last-child { border-bottom: none; }
.invite-row.dim { opacity: .55; }
.invite-code { font-family: var(--font-mono, ui-monospace, monospace); font-size: 12.5px; letter-spacing: .06em; background: #f2f3f5; padding: 3px 8px; border-radius: 6px; color: var(--text); }
.invite-state { font-size: 11.5px; padding: 2px 7px; border-radius: 9px; background: #f2f3f5; color: var(--text-2); }
.invite-state.valid { background: var(--brand-light); color: var(--brand); }
.invite-state.used { background: var(--ok-bg); color: #00875a; }
.invite-state.expired, .invite-state.revoked { background: #f2f3f5; color: var(--text-3); }
.invite-created input { width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; font-size: 12.5px; background: #fafbfc; color: var(--text); }

/* 移动端工具条换行（顶部计数 + 分段筛选 + 主按钮） */
@media (max-width: 820px) {
  .page-head { flex-wrap: wrap; row-gap: 8px; }
  .page-head .grow { display: none; }
  .page-head .page-count { flex: 1 1 auto; white-space: nowrap; }
  .seg { flex: 1 1 auto; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .seg button { white-space: nowrap; padding: 0 10px; font-size: 12.5px; }
  .page-head .btn.primary { flex: 0 0 auto; }
  .toolbar { flex-wrap: wrap; row-gap: 6px; }
}

/* ==========================================================================
   每日提醒设置 + 提醒弹窗
   ========================================================================== */
.card.pad { padding: 18px 20px; max-width: 640px; }
.dr-box { font-size: 13.5px; line-height: 1.7; }
.dr-line { margin: 0 0 10px; }
.dr-line b { color: var(--brand); font-size: 15px; padding: 0 2px; }
.dr-list { margin: 6px 0 0; padding-left: 18px; }
.dr-list li { margin: 2px 0; }
/* 超期未完成任务：红色警示，条目可点击直达详情 */
.dr-line b.dr-danger { color: #d92d20; font-weight: 700; }
.dr-sec-title { margin: 10px 0 2px; font-size: 12.5px; font-weight: 600; color: #b42318; }
.dr-list.dr-overdue { margin-top: 2px; }
.dr-list.dr-overdue li { color: #b42318; cursor: pointer; }
.dr-list.dr-overdue li:hover { text-decoration: underline; }
.dr-days { margin-left: 6px; font-size: 11px; color: #d92d20; opacity: .85; white-space: nowrap; }
.dr-slot { display: flex; gap: 8px; align-items: center; margin: 6px 0; }
.dr-time { width: 130px; height: 32px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 8px; font-size: 13px; background: #fafbfc; color: var(--text); }
.dr-label { font-size: 13px; color: var(--text-2); font-weight: 600; }
.switch-row { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.dr-tip { margin-top: 4px; }

/* ==========================================================================
   项目分栏（运行中 / 已完成）· 循环跟进 · 回收站 · 完成判定
   ========================================================================== */
.side-sub-title { display: flex; align-items: center; gap: 6px; padding: 9px 12px 4px; font-size: 11.5px; color: var(--text-3); }
.side-sub-title > span:last-child { background: #e8e9eb; color: var(--text-2); border-radius: 8px; padding: 0 6px; font-size: 11px; line-height: 16px; }
.proj-count { flex: 0 0 auto; font-size: 11px; }
/* 侧栏双栏：两栏结构镜像，用细分隔线和弱化样式区分，避免看成重复内容 */
.side-sub-title.lane-done { margin-top: 6px; padding-top: 11px; border-top: 1px solid var(--line); }
.pf-group.pf-done .pf-head { padding-top: 3px; padding-bottom: 2px; }
.pf-group.pf-done .pf-name { color: var(--text-3); }
.pf-group.pf-done .pf-cnt { background: #f0f1f3; color: var(--text-3); }
.nav-item.lane-empty { opacity: .5; }
.nav-item.lane-empty:hover { opacity: .85; }
.cyc-dot { flex: 0 0 auto; color: var(--purple); font-size: 13px; font-weight: 700; margin-right: 2px; }
.trash-link { padding-left: 24px !important; color: var(--text-3); font-size: 12.5px; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; }
.trash-link:hover { color: var(--text-2); }

.phase-badge { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 5px; font-size: 12px; font-weight: 500; flex: 0 0 auto; }
.phase-badge.running { background: var(--brand-light); color: var(--brand); }
.phase-badge.done { background: var(--ok-bg); color: var(--ok); }

.proj-action-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 8px 10px; margin-bottom: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.proj-action-bar .mini { flex: 0 0 auto; }
.act-sep { width: 1px; height: 18px; background: var(--line-strong); margin: 0 4px; flex: 0 0 auto; }

.cycle-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 12px; margin-bottom: 10px; background: #f7f5ff; border: 1px solid #e9e3ff; border-radius: 8px; }
.cycle-tag { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 4px; background: #ece6ff; color: var(--purple); font-size: 12px; font-weight: 500; }
.cycle-off { font-size: 11.5px; color: #c96a00; background: var(--warn-bg); padding: 2px 8px; border-radius: 4px; }

.cyc-field > span, #pj-cycle-wrap > span, .cyc-cfg > span { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.cyc-cfg .row { align-items: center; }
.cyc-cfg select, .cyc-cfg input { min-height: 32px; }
.cyc-cfg b { color: var(--text); font-weight: 600; }
.cycle-bar b { color: var(--purple); font-weight: 600; }
.chk { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; color: var(--text); }
.chk input { width: 15px; height: 15px; flex: 0 0 auto; accent-color: var(--brand); }

.trash-row { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 7px; margin-bottom: 7px; background: #fff; }
.trash-row .grow { flex: 1 1 auto; }
.trash-row b { font-size: 13px; font-weight: 500; }

.ok-tag { color: var(--ok); font-size: 12px; font-weight: 500; }
.cyc-card { border: 1px solid var(--line-strong); border-radius: 8px; padding: 12px 14px; margin-bottom: 12px; background: #fff; }
.cyc-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.cyc-sec-title { font-size: 12px; color: var(--text-2); font-weight: 500; margin: 10px 0 6px; }
.cyc-note { padding: 7px 10px; background: #fafbfc; border-radius: 6px; margin-bottom: 6px; font-size: 13px; line-height: 1.7; }
.cyc-note .mini { display: block; margin-bottom: 2px; }
.cyc-card .card { max-height: 220px; overflow: auto; }

@media (max-width: 760px) {
  .proj-action-bar { gap: 5px; }
  .proj-action-bar .btn.sm { min-height: 30px; }
  .cycle-bar { gap: 6px; }
}

/* ==========================================================================
   矮窗口适配（桌面端把窗口拉小 / 笔记本分屏）：压缩留白，减少右侧纵向滚动，
   左侧导航仍由 .side-scroll 独立滚动，底部账号与退出按钮始终可见。
   ========================================================================== */
@media (max-height: 720px) {
  .side-brand { padding-bottom: 8px; }
  .side-group { margin-bottom: 8px; }
  .matrix { min-height: 400px; }
  .user-chip { padding-top: 5px; padding-bottom: 5px; }
  .side-foot { padding-top: 7px; }
}

/* ==========================================================================
   任务附件：任务资料 / 过程附件 / 完成交付
   ========================================================================== */
.att-group { margin-bottom: 8px; }
.att-group-title { font-size: 11.5px; color: var(--text-3); padding: 4px 0 5px; }
.att-row {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  padding: 6px 8px; margin-bottom: 5px;
  border: 1px solid var(--line); border-radius: 6px; background: #fff;
}
.att-row .grow { flex: 1 1 auto; min-width: 0; font-size: 13px; }
.att-row .btn, .att-row .mini { flex: 0 0 auto; }
.att-row .ic { color: var(--text-3); }
#nf-files, #cf-files { font-size: 13px; padding: 7px 8px; }

/* ==========================================================================
   项目组织架构弹窗：小窗口下不裁切，下拉框/表格完整显示
   ========================================================================== */
.porg-body .row { flex-wrap: wrap; gap: 8px; }
.porg-body .row > select, .porg-body .row > input { flex: 1 1 160px; min-width: 0; height: 34px; }
.porg-body select { height: 34px; line-height: 1.4; }
.porg-body .card { overflow-x: auto; }
.porg-body .grid { min-width: 520px; }
.porg-tpl {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 9px 10px; margin-bottom: 10px;
  background: #f7f9fc; border: 1px solid var(--line); border-radius: 8px;
}
.porg-tpl .mini { line-height: 1.6; }

/* ==========================================================================
   说明气泡：解释性文字收进模块名 / 字段名后的小圆圈叹号
   ========================================================================== */
.hint-i {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; margin-left: 6px; padding: 0;
  border: 1px solid #bcc3cd; border-radius: 50%; background: #fff;
  color: #8b94a2; font-size: 10px; font-weight: 700; line-height: 1;
  font-family: Arial, sans-serif; cursor: pointer; vertical-align: middle;
  flex: 0 0 auto; transition: all .14s;
}
.hint-i:hover { border-color: var(--brand); background: #eef4ff; color: var(--brand); }
.hint-pop {
  position: fixed; z-index: 120; max-width: 320px; min-width: 140px;
  padding: 10px 13px; border-radius: 8px; background: #2b3038; color: #fff;
  font-size: 12.5px; line-height: 1.7; box-shadow: var(--shadow-lg);
  white-space: pre-wrap; word-break: break-word;
  opacity: 0; transform: translateY(-4px);
  transition: opacity .14s ease, transform .14s ease;
}
.hint-pop.show { opacity: 1; transform: translateY(0); }

/* ---------------- 项目 / 分组备忘录 ----------------
   平时零视觉痕迹；悬停名字满 2 秒后才由 core.js 挂到 body 上显示。
   z-index 高于 modal-mask(70)，所以项目组织弹窗里的分组名也能浮出。 */
.memo-pop {
  position: fixed; z-index: 150; width: 300px; max-width: calc(100vw - 24px);
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 8px 28px rgba(31, 35, 41, .16);
  font-size: 12.5px; color: var(--text);
  opacity: 0; transform: translateY(-4px);
  transition: opacity .14s ease, transform .14s ease;
}
.memo-pop.show { opacity: 1; transform: translateY(0); }
.memo-head {
  display: flex; align-items: center; gap: 8px; flex: 0 0 auto;
  padding: 10px 12px; background: #f8fafc; border-bottom: 1px solid var(--line);
  font-weight: 600;
}
.memo-head > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.memo-edit {
  flex: 0 0 auto; padding: 3px 9px; border: 1px solid #d7dce3; border-radius: 6px;
  background: #fff; color: var(--brand); font-size: 11px; cursor: pointer;
}
.memo-edit:hover { background: var(--brand-light); border-color: var(--brand); }
.memo-text {
  flex: 1 1 auto; min-height: 42px; max-height: 210px; overflow: auto;
  padding: 11px 12px; line-height: 1.7; color: var(--text-2);
  white-space: pre-wrap; word-break: break-word;
}
.memo-meta { flex: 0 0 auto; padding: 0 12px 6px; font-size: 10.5px; color: var(--text-3); }
.memo-tip {
  flex: 0 0 auto; padding: 6px 12px 8px; font-size: 10.5px;
  color: var(--text-3); border-top: 1px dashed var(--line);
}
