:root {
  /* —— SparkOS 主色板（低饱和高明度）—— */
  --primary: #3D6FD8;        /* 晨空蓝（round71: #5B8DEF→#3D6FD8 白字/链接达 4.7:1 AA） */
  --primary-dark: #2F5FCC;   /* 主色 hover 加深 */
  --secondary: #7ED6A8;      /* 新芽绿 */
  --accent: #FFB86B;         /* 暖杏橙 */
  --ai: #A78BFA;             /* 薰衣草紫（AI 专属） */

  /* —— 语义色 —— */
  --success: #6EE7B7;
  --warning: #FCD34D;
  --danger: #F87171;
  --info: #93C5FD;
  /* 语义色深色变体（用于文字/图标，保证可读性） */
  --success-text: #047857;
  --warning-text: #B45309;
  --danger-text: #B91C1C;
  --info-text: #1D4ED8;

  /* —— 中性色（冷灰基调）—— */
  --bg: #F8FAFC;             /* 极浅灰蓝背景 */
  --panel: #FFFFFF;          /* 卡片层 */
  --border: #E2E8F0;         /* 分隔线 */
  --muted: #64748B;          /* 次要文字（round71: #94A3B8→#64748B 达 WCAG AA 4.5:1） */
  --text: #1E293B;           /* 主要文字（深蓝灰） */

  /* —— 圆角系统 —— */
  --radius-sm: 8px;          /* 按钮、输入框 */
  --radius: 12px;            /* 卡片、弹窗 */
  --radius-lg: 16px;         /* 大模块 */
  --radius-xl: 24px;         /* AI 功能入口 */
  --radius-full: 999px;      /* 头像、pill */

  /* —— 阴影（蓝紫基调环境光，非纯黑）—— */
  --shadow-sm: 0 1px 2px rgba(91, 141, 239, 0.05);
  --shadow-md: 0 4px 12px rgba(91, 141, 239, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 32px rgba(91, 141, 239, 0.12), 0 4px 8px rgba(0, 0, 0, 0.04);
  --shadow-ai: 0 8px 32px rgba(167, 139, 250, 0.15);

  /* —— 动效 —— */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; }

[x-cloak] { display: none !important; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "PingFang SC",
    "Noto Sans SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: color 0.15s var(--ease); }
a:hover { text-decoration: none; color: var(--primary-dark); }

/* —— 顶部导航 —— */
.navbar {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 60px;
  box-shadow: var(--shadow-sm);
}
.navbar .brand {
  display: inline-flex;
  align-items: center;
  height: 100%;
}
.navbar .brand .brand-logo {
  height: 29px;
  width: auto;
  display: block;
}
.navbar .spacer { flex: 1; }
.navbar a.navlink {
  color: var(--muted);
  font-size: 14px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.15s var(--ease);
}
.navbar a.navlink:hover { color: var(--text); background: var(--bg); }
.navbar a.navlink.active { color: var(--primary); font-weight: 700; background: rgba(91, 141, 239, 0.14); box-shadow: inset 0 -2px 0 0 var(--primary); }

/* —— 顶部导航数码时钟（白色背景 + 深灰数字，每秒刷新） —— */
.digital-clock {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  font-family: "SF Mono", "Menlo", "Consolas", "Roboto Mono", monospace;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  background: #FFFFFF;
  color: #334155;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid #CBD5E1;
}

/* —— 列表行编号 —— */
.row-index {
  flex-shrink: 0;
  width: 22px;
  text-align: right;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.container { max-width: 1120px; margin: 28px auto; padding: 0 24px; }

/* —— 卡片 —— */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}
.card:hover { box-shadow: var(--shadow-md); }
.card h2 { margin: 0 0 12px; font-size: 20px; font-weight: 600; }
.card h3 { margin: 11px 0 8px; font-size: 16px; font-weight: 600; }

/* —— 我的贡献 统计块 —— */
.stat-block { text-align: center; padding: 12px 8px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.stat-num { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1.2; }

/* —— 获得荣誉 条目 —— */
.honor-item { display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); }

/* —— 甘特图 —— */
.gantt { display: flex; flex-direction: column; gap: 6px; position: relative; }
.gantt-sep {
  position: absolute;
  left: 230px; /* 220px 标签列 + 10px 列间距 */
  top: 0;
  bottom: 0;
  border-left: 1px solid #EEF2F7; /* 更浅的分隔线，向下延伸到任务列表区底部 */
  pointer-events: none;
}
.gantt-head, .gantt-row {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 48px;
  gap: 10px;
  align-items: center;
}
.gantt-label-col { min-width: 0; overflow: hidden; }
.gantt-label-col .task-assignee { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.gantt-title { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.gantt-axis { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.gantt-date { text-align: center; font-size: 11px; color: var(--muted); white-space: nowrap; padding: 2px 0; border-left: 1px solid var(--border); }
.gantt-track { position: relative; height: 22px; background: var(--bg); border-radius: var(--radius-sm); }
.gantt-bar { position: absolute; top: 4px; height: 14px; background: #5B8DEF; border-radius: 4px; min-width: 4px; }

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* —— 表单 —— */
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; font-weight: 500; }
input, textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  background: var(--panel);
  color: var(--text);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91, 141, 239, 0.12);
}
.field { margin-bottom: 14px; }

/* 同行字段：标题与输入框同一行（编辑弹窗所占权重 / 起止日期） */
.field-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.field-inline > label {
  flex-shrink: 0;
  width: 96px;
  margin-bottom: 0;
  text-align: right;
}
.field-inline input {
  width: auto;
  flex: 1;
  min-width: 0;
}
.field-inline .range-sep {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 13px;
}

/* 同行字段（左对齐）：label 左对齐，供 AI 分解子任务卡片的标题/目标与描述字段左对齐 */
.field-inline-left {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.field-inline-left > label {
  flex-shrink: 0;
  margin-bottom: 0;
  text-align: left;
}
.field-inline-left input {
  width: auto;
  flex: 1;
  min-width: 0;
}

/* 密码输入框 + 显隐切换图标 */
.pwd-wrap { position: relative; }
.pwd-wrap input { padding-right: 40px; width: 100%; }
.pwd-eye {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 6px;
  color: var(--muted);
  transition: color 0.15s var(--ease);
}
.pwd-eye:hover { color: var(--text); }

/* —— 按钮 —— */
.btn {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s var(--ease);
  font-family: inherit;
}
.btn:hover {
  background: var(--bg);
  border-color: #CBD5E1;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 2px 6px rgba(91, 141, 239, 0.25);
}
.btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); box-shadow: 0 4px 12px rgba(91, 141, 239, 0.3); }
.btn.success { background: #34D399; border-color: #34D399; color: #064E3B; }
.btn.success:hover { background: #10B981; border-color: #10B981; }
.btn.danger { background: var(--panel); border-color: #FCA5A5; color: var(--danger-text); }
.btn.danger:hover { background: #FEF2F2; border-color: #F87171; }
.btn.sm { padding: 5px 12px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* —— AI 操作按钮（渐变 + 微光点）—— */
.btn.ai {
  background: linear-gradient(135deg, #A78BFA, #5B8DEF);
  border: none;
  color: #fff;
  box-shadow: 0 4px 14px rgba(167, 139, 250, 0.3);
}
.btn.ai:hover { background: linear-gradient(135deg, #9F83F8, #4A7DE4); box-shadow: 0 6px 18px rgba(167, 139, 250, 0.4); }
.btn.ai::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fff;
  margin-right: 6px;
  vertical-align: middle;
  animation: spark 2s ease-in-out infinite;
}

/* —— 徽章 —— */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.6;
}
.badge.gray { background: #F1F5F9; color: #475569; }
.badge.blue { background: #DBEAFE; color: var(--info-text); }
.badge.green { background: #D1FAE5; color: var(--success-text); }
.badge.amber { background: #FEF3C7; color: var(--warning-text); }
.badge.red { background: #FEE2E2; color: var(--danger-text); }
.badge.purple { background: #EDE9FE; color: #6D28D9; }

/* 缺陷/需求级别徽标（紧跟标题，按级别带色底） */
.severity-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
  vertical-align: middle;
}
.severity-critical { background: #FEE2E2; color: #B91C1C; }
.severity-major { background: #FFEDD5; color: #C2410C; }
.severity-normal { background: #DBEAFE; color: #1D4ED8; }
.severity-minor { background: #E5E7EB; color: #4B5563; }
/* 需求专用等级：紧急 / 尽快（正常 / 次要复用上面的 normal / minor） */
.severity-urgent { background: #FEE2E2; color: #B91C1C; }
.severity-soon { background: #FFEDD5; color: #C2410C; }

/* 缺陷/需求处理信息条目（内容 + 提交人/时间） */
.note-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.note-item:last-child { border-bottom: none; }

/* 列表页操作区行（排序 / 筛选 / 操作按钮）：单行，下拉不撑满 */
.toolbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  overflow-x: auto;
}
.toolbar select {
  width: auto;
  flex: 0 0 auto;
  min-width: 120px;
  padding: 7px 10px;
  font-size: 13px;
}
.toolbar .btn { margin-left: auto; flex: 0 0 auto; }
/* 操作按钮组（新建/评估等）：整组靠右，组内按钮紧凑排列。
   避免多个 .btn 各自 margin-left:auto 平分剩余空间导致按钮间出现大间距。 */
.toolbar-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}
/* AI 徽章（紫白渐变 + 闪烁星） */
.badge.ai {
  background: linear-gradient(135deg, #EDE9FE, #DBEAFE);
  color: #6D28D9;
}

/* —— 进度条 —— */
.progress {
  height: 8px;
  background: #E2E8F0;
  border-radius: var(--radius-full);
  overflow: hidden;
  min-width: 80px;
}
.progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #A78BFA, #5B8DEF);
  border-radius: var(--radius-full);
  transition: width 0.3s var(--ease);
}

/* —— 表格 —— */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
tr { transition: background 0.15s var(--ease); }
tr:hover td { background: rgba(91, 141, 239, 0.03); }

/* —— 通知/消息 —— */
.notice {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  font-size: 14px;
}
.notice.error { background: #FEF2F2; color: var(--danger-text); border: 1px solid #FECACA; }
.notice.success { background: #ECFDF5; color: var(--success-text); border: 1px solid #A7F3D0; }

/* —— 讨论区 —— */
.post { border-bottom: 1px solid var(--border); padding: 14px 0; }
.post .meta { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.reply {
  border-left: 3px solid var(--ai);
  margin-left: 16px;
  padding: 10px 14px;
  margin-top: 8px;
  background: #F8FAFC;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* —— 看板任务树 —— */
.board-node {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 8px;
  background: var(--panel);
  transition: box-shadow 0.15s var(--ease), border-color 0.15s var(--ease);
}
.board-node:hover { border-color: #CBD5E1; box-shadow: var(--shadow-sm); }
.board-node .row { display: flex; align-items: center; gap: 10px; }
.board-node .row.board-meta { margin-top: 8px; flex-wrap: wrap; }
.board-node .children { margin-left: 24px; margin-top: 8px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.board-node .task-assignee { display: flex; align-items: center; gap: 8px; }

/* 看板任务编号（1.2.2 格式）：状态色圆角底 + 白色加粗数字，水平垂直居中 */
.board-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  font-size: 12px;
  line-height: 1;
  color: #fff;
  font-weight: 700;
  border-radius: 8px;
  flex-shrink: 0;
}

/* 任务难度图标（极难/高难，标题后追加） */
.difficulty-icon {
  font-size: 13px;
  margin-left: 4px;
  vertical-align: middle;
  flex-shrink: 0;
}

/* 关注（图钉）按钮：未关注灰色，关注后彩色 */
.watch-btn {
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  cursor: pointer;
  font-size: 14px;
  opacity: 0.35;
  filter: grayscale(1);
  transition: all 0.15s var(--ease);
  flex-shrink: 0;
}
.watch-btn:hover { opacity: 0.7; }
.watch-btn.watched { opacity: 1; filter: none; }

/* —— 项目首页任务完成度树 —— */
.subtask-indent { padding-left: 2em; }
.tree-parent { cursor: pointer; transition: background 0.15s var(--ease); }
.tree-parent:hover { background: rgba(91, 141, 239, 0.04); }
.tree-toggle { display: inline-block; width: 18px; color: var(--muted); }
.task-actions { width: 1%; white-space: nowrap; text-align: right; }
.drag-handle {
  display: inline-block;
  padding: 2px 6px;
  color: var(--muted);
  cursor: grab;
  user-select: none;
  font-size: 14px;
  letter-spacing: -1px;
  vertical-align: middle;
}
.drag-handle:active { cursor: grabbing; }
.tree-parent.drag-over {
  background: rgba(91, 141, 239, 0.12);
  outline: 1px dashed var(--primary);
}

/* —— 登录页 —— */
.login-wrap { max-width: 380px; margin: 90px auto; }
.login-wrap .card { padding: 32px; box-shadow: var(--shadow-lg); }
.login-wrap .login-logo {
  display: block;
  height: 40px;
  width: auto;
  margin: 0 0 6px;
}
.login-wrap .sub { color: var(--muted); font-size: 14px; margin-bottom: 24px; }

/* —— 评级色块（round71 对比度修复：浅底深字达 WCAG AA） —— */
.grade {
  font-weight: 700;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}
.grade.S { background: #EDE9FE; color: #6D28D9; }
.grade.A { background: #DBEAFE; color: #1D4ED8; }
.grade.B { background: #D1FAE5; color: #047857; }
.grade.C { background: #FEF3C7; color: #B45309; }
.grade.D { background: #FEE2E2; color: #B91C1C; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
/* 今日工作条目：标题与今日目标突出显示 */
.today-title { font-weight: 700; font-size: 14px; color: var(--text); }
.today-goal { font-weight: 600; font-size: 13px; color: var(--primary); margin-top: 2px; }
.flex { display: flex; align-items: center; gap: 10px; }
.mt { margin-top: 12px; }
.mb { margin-bottom: 12px; }

/* —— 头像 —— */
.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #A78BFA, #5B8DEF);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
  overflow: hidden;
  flex-shrink: 0;
}
.avatar.lg { width: 64px; height: 64px; font-size: 26px; }
.avatar.sm { width: 28px; height: 28px; font-size: 14px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* —— 右上角用户下拉菜单 —— */
.user-menu { position: relative; }
.user-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  transition: all 0.15s var(--ease);
  font-family: inherit;
}
.user-trigger:hover { background: var(--bg); border-color: var(--border); }
.user-name { font-weight: 600; }
.caret { font-size: 11px; color: var(--muted); }
.dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 220px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 100;
}
.dropdown-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.dropdown-ident { min-width: 0; }
.dropdown-name { font-weight: 600; font-size: 14px; }
.dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: background 0.15s var(--ease);
}
.dropdown-item:hover { background: var(--bg); text-decoration: none; }

/* —— 弹窗 —— */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px;
  z-index: 200;
  overflow-y: auto;
}
.modal {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.25s var(--ease);
}
.modal h3 { margin: 0 0 16px; }

/* —— Tab 切换 —— */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 16px;
}
.tab {
  padding: 10px 18px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.tab:hover { color: var(--text); }
.tab.active {
  color: var(--primary);
  font-weight: 600;
  border-bottom-color: var(--primary);
}

/* —— 人员/成员行 —— */
.member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.member-row:last-child { border-bottom: none; }

/* —— 图标按钮 —— */
.icon-btn {
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  transition: all 0.15s var(--ease);
}
.icon-btn:hover { color: var(--text); background: var(--bg); }
.icon-btn.danger { color: var(--danger-text); border-color: #FECACA; }
.icon-btn.danger:hover { background: #FEF2F2; }
.icon-btn.borderless { border: none; }

/* —— 人员卡片 —— */
.person-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  text-align: left;
  transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}
.person-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.person-info { flex: 1; min-width: 0; }
.person-name { font-weight: 600; }

/* —— 消息 Banner —— */
.message-banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
  transition: box-shadow 0.15s var(--ease);
}
.message-banner:hover { box-shadow: var(--shadow-sm); }
.message-banner.unread {
  background: #EFF6FF;
  border-color: #BFDBFE;
}
.message-banner.muted { color: var(--muted); }
.message-body { flex: 1; min-width: 0; }
.message-content { margin-top: 4px; white-space: pre-wrap; word-break: break-word; }

/* —— 表情选择器 —— */
.emoji-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-height: 108px;
  overflow-y: auto;
}
.emoji-btn {
  font-size: 20px;
  line-height: 1;
  padding: 4px 6px;
  border: none;
  background: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s var(--ease), transform 0.15s var(--ease);
}
.emoji-btn:hover { background: var(--bg); transform: scale(1.15); }

/* —— 我的任务分组（可折叠）—— */
.task-group { border-bottom: 1px solid var(--border); padding: 10px 0; }
.task-group:last-child { border-bottom: none; }
.task-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 4px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  transition: background 0.15s var(--ease);
}
.task-group-head:hover { background: var(--bg); border-radius: 6px; }

/* —— 头像裁剪 —— */
.crop-area {
  position: relative;
  display: inline-block;
  overflow: hidden;
  background: #111;
  line-height: 0;
  max-width: 100%;
  border-radius: var(--radius-sm);
}
#cropImage { display: block; max-width: none; }
.crop-box {
  position: absolute;
  border: 2px dashed #fff;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45);
  cursor: move;
  box-sizing: border-box;
  touch-action: none;
}

/* —— OKR 展示 —— */
.okr-block { border-bottom: 1px solid var(--border); padding: 12px 0; }
.okr-block:last-child { border-bottom: none; }
.kr-list { margin: 6px 0 0; padding-left: 18px; }
.section-head { font-size: 16px; font-weight: 600; margin: 24px 0 8px; }

/* —— 私信历史记录（聊天气泡）—— */
.history-list {
  max-height: 380px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 0;
}
.chat-row { display: flex; flex-direction: column; }
.chat-row.out { align-items: flex-end; }
.chat-row.in { align-items: flex-start; }
.bubble {
  max-width: 75%;
  padding: 8px 12px;
  border-radius: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14px;
}
.chat-row.in .bubble {
  background: #F1F5F9;
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.chat-row.out .bubble {
  background: linear-gradient(135deg, #3D6FD8, #2F5FCC);
  color: #fff;
  border-bottom-right-radius: 4px;
}

/* —— 导航未读气泡 —— */
.unread-bubble {
  display: inline-block;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-full);
  background: #DC2626;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 20px;
  text-align: center;
  margin-left: 5px;
  vertical-align: top;
}

/* —— 私信历史弹窗回复输入框 —— */
.history-reply {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.history-reply textarea {
  flex: 1;
  resize: vertical;
}

/* ============ AI 专属样式 ============ */

/* AI 生成内容：左侧 3px 紫色渐变竖线 */
.ai-content {
  border-left: 3px solid;
  border-image: linear-gradient(180deg, #A78BFA, #5B8DEF) 1;
  padding-left: 12px;
}

/* AI 头像光晕 */
.ai-avatar-glow {
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.15) 0%, rgba(91, 141, 239, 0.1) 100%);
  box-shadow: 0 0 20px rgba(167, 139, 250, 0.15);
}

/* AI 建议卡片 */
.ai-card {
  border-left: 3px solid transparent;
  border-image: linear-gradient(180deg, #A78BFA, #5B8DEF) 1;
  background: rgba(167, 139, 250, 0.03);
}

/* 呼吸动画（AI 思考中） */
@keyframes breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(167, 139, 250, 0.25); }
  50% { box-shadow: 0 0 0 6px rgba(167, 139, 250, 0.08); }
}
@keyframes spark {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.4); }
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* —— 团队工作页（三列卡片） —— */
.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: start;
}
.team-card { margin-bottom: 0; }
.team-item { padding: 8px 0; border-bottom: 1px solid var(--border); }
.team-item:last-child { border-bottom: none; }

/* —— 看板人员视图（两列卡片） —— */
.people-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  align-items: start;
}
.person-card { margin-bottom: 0; }
.person-head { display: flex; align-items: center; gap: 12px; }
.person-meta { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.person-name-row { display: flex; align-items: center; gap: 8px; }
.person-body { display: flex; flex-direction: column; gap: 12px; }
.person-group { display: flex; flex-direction: column; gap: 6px; }
.person-group-title { font-size: 12px; font-weight: 600; color: var(--muted); }
.person-items { display: flex; flex-direction: column; gap: 6px; }
.person-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.person-item a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 人员视图条目序号：压缩保留宽度，使序号数字前方留空缩小到约 1/3（22px → 8px） */
.person-item .row-index { width: 8px; }
/* 完成率百分数与进度条重叠、右对齐；重叠部分反色显示（mix-blend-mode） */
.person-progress { position: relative; flex-shrink: 0; width: 64px; }
.person-progress .progress { width: 100%; min-width: 0; }
.person-percent {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  line-height: 1;
  color: #fff;
  mix-blend-mode: difference;
  font-variant-numeric: tabular-nums;
}

/* —— 窄屏回落：卡片网格折叠为单列 —— */
@media (max-width: 900px) {
  .team-grid { grid-template-columns: 1fr; }
  .people-grid { grid-template-columns: 1fr; }
}

/* —— 小O AI 助手（工作台）：悬浮气泡 + 右侧竖版对话框 —— */
/* 第六十六批：气泡距页面顶部间距调整为原值(36%)的 1/2 → 18% */
.o-float-bubble {
  position: fixed; right: 18px; top: 18%; z-index: 280;
  width: 58px; height: 58px; padding: 0; border: none; cursor: pointer;
  border-radius: 50%; overflow: hidden; background: #fff;
  box-shadow: 0 6px 20px rgba(30, 41, 59, .22);
  transition: transform .15s ease;
}
.o-float-bubble:hover { transform: scale(1.08); }
.o-float-bubble img { width: 100%; height: 100%; object-fit: cover; display: block; }
.o-float-bubble::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.9), inset 0 0 0 4px rgba(255,255,255,.25);
}
.o-chat-panel {
  position: fixed; right: 18px; bottom: 16px; z-index: 300;
  width: 372px; max-width: calc(100vw - 24px);
  height: min(620px, calc(100vh - 100px));
  display: flex; flex-direction: column;
  background: #fff; border-radius: 14px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, .28);
  overflow: hidden;
}
.o-chat-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-bottom: 1px solid var(--border, #E2E8F0);
  background: linear-gradient(135deg, #F5F3FF, #EFF6FF);
}
.o-chat-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.o-chat-body { flex: 1; overflow-y: auto; padding: 12px 14px; background: #FAFAFC; }
.o-msg { display: flex; flex-direction: column; margin-bottom: 10px; }
.o-msg.me { align-items: flex-end; }
.o-msg.ai { align-items: flex-start; }
.o-msg-bubble {
  max-width: 86%; padding: 8px 12px; border-radius: 12px;
  font-size: 13px; line-height: 1.55; word-break: break-word;
}
.o-msg.me .o-msg-bubble { background: #4F46E5; color: #fff; border-bottom-right-radius: 3px; }
.o-msg.ai .o-msg-bubble { background: #fff; color: #1E293B; border: 1px solid #E2E8F0; border-bottom-left-radius: 3px; }
.o-msg-bubble strong { font-weight: 600; }
.o-chat-recommend {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 10px 14px; border-top: 1px solid #EEF2F7; background: #fff;
}
.o-chat-recommend .chip {
  border: 1px solid #C7D2FE; background: #EEF2FF; color: #4338CA;
  border-radius: 999px; padding: 5px 12px; font-size: 12px; cursor: pointer;
}
.o-chat-recommend .chip:hover { background: #E0E7FF; }
.o-chat-input {
  display: flex; gap: 8px; align-items: center;
  padding: 10px 14px; border-top: 1px solid #EEF2F7; background: #fff;
}
.o-chat-input input {
  flex: 1; min-width: 0; padding: 8px 10px; font-size: 13px;
  border: 1px solid #CBD5E1; border-radius: 8px; outline: none;
}
.o-chat-input input:focus { border-color: #6366F1; }

/* —— round68 移动端可用性：项目页按钮组/导航/触摸目标/小O窄屏 —— */
.proj-nav { flex-wrap: wrap; }

@media (max-width: 900px) {
  .navbar {
    flex-wrap: wrap;
    height: auto;
    min-height: 60px;
    padding: 8px 16px;
    row-gap: 6px;
  }
  .navbar a.navlink {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 10px;
  }
  /* 时钟非核心功能，窄屏隐藏避免挤压导航 */
  .navbar .digital-clock { display: none; }
  .navbar .user-name { display: none; }
  .container { padding: 0 14px; margin: 16px auto; }
  .o-chat-panel { right: 10px; bottom: 10px; height: min(560px, calc(100vh - 80px)); }
  .o-float-bubble { right: 10px; }
}

@media (max-width: 600px) {
  .container { padding: 0 10px; }
  .navbar { gap: 4px 10px; padding: 6px 10px; }
  .navbar a.navlink { font-size: 13px; padding: 8px 8px; min-height: 44px; }
  /* 小O 对话框窄屏全宽，避免遮挡内容 */
  .o-chat-panel { left: 8px; right: 8px; width: auto; }
}
