:root {
  --navy: #0e1a2f;
  --navy-2: #16243f;
  --gold: #e6b45c;
  --gold-deep: #c9933a;
  --bg: #f4f5f7;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --user-bubble: #1f3a5f;
  /* ★ 0.2.41：待办抽屉那 6 处 `color` 原来写的是 `var(--sub)` —— **这个变量从来没定义过**
     （0.2.37 写 .todo-date/.todo-close/.todo-loading/.todo-meta/.todo-empty/.tk-atts 时
     顺手用了一个不存在的名字）。CSS 里 `color: var(--未定义)` 是**整条声明作废**，
     于是日期/元信息/空状态那些小字全部掉回继承色（比设计意图深、且和周围不协调）。
     现统一改成既有的 `--muted`（#6b7280，原本就打算用这个灰）。以后再取变量请先在上面这行找找。 */
}

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

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

html, body { height: 100%; }

body {
  font-family: -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.app { display: flex; height: 100vh; overflow: hidden; }

/* ===== 侧边栏 ===== */
.sidebar {
  width: 264px;
  background: linear-gradient(180deg, var(--navy) 0%, #0a1424 100%);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 18px; border-bottom: 1px solid rgba(255,255,255,.08);
}
.logo {
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
}
.logo-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand-name { font-size: 16px; font-weight: 700; color: #fff; letter-spacing: .5px; }
.brand-sub { font-size: 11px; color: #8fa0b8; margin-top: 2px; }
/* 版本号（v0.2.22）：挂在「中创企业智能体」那行末尾的小字，低调不抢主体 */
.brand-version { margin-left: 8px; font-size: 10px; color: #64748b; letter-spacing: .3px; }

.sidebar-section { padding: 16px 12px 2px; }
.sidebar-title {
  font-size: 11px; color: #6b7f9a; letter-spacing: 1.5px; padding: 0 10px 8px; font-weight: 600;
}
.nav-item {
  display: block; width: 100%; text-align: left; padding: 9px 12px; margin-bottom: 2px;
  background: transparent; border: none; border-radius: 8px; color: #cbd5e1;
  font-size: 14px; cursor: pointer; transition: background .15s;
}
.nav-item:hover { background: rgba(255,255,255,.06); }
.nav-item.active { background: rgba(230,180,92,.14); color: var(--gold); font-weight: 600; }

.sidebar-footer { margin-top: auto; padding: 16px; border-top: 1px solid rgba(255,255,255,.08); }
.user-chip { display: flex; align-items: center; gap: 9px; font-size: 13px; color: #cbd5e1; }
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.1);
  display: flex; align-items: center; justify-content: center;
}
.logout-btn {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15);
  color: #cbd5e1; font-size: 12px; padding: 4px 10px; border-radius: 8px; cursor: pointer;
}
.logout-btn:hover { background: rgba(255,255,255,.16); color: #fff; }

/* ===== 主区域 ===== */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: 56px; background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 22px; flex-shrink: 0;
}
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-title { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-status { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #34c759; box-shadow: 0 0 0 3px rgba(52,199,89,.15); }
/* 手机端顶栏入口（侧边栏在移动端隐藏，所以新对话/我的任务放这里） */
.topbar-new {
  border: none; border-radius: 10px; padding: 7px 12px; font-size: 13.5px; font-weight: 600;
  color: #fff; background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  box-shadow: 0 2px 8px rgba(201,147,58,.32); cursor: pointer; white-space: nowrap;
}
.topbar-icon {
  position: relative; border: 1px solid var(--border); border-radius: 10px; background: #fff;
  padding: 6px 9px; font-size: 14px; line-height: 1; cursor: pointer;
}
.topbar-icon .nav-badge {
  position: absolute; top: -7px; right: -7px; margin-left: 0;
}

/* ===== 聊天区 ===== */
.chat { flex: 1; overflow-y: auto; padding: 28px; }

.welcome { max-width: 640px; margin: 8vh auto 0; text-align: center; }
.welcome-logo {
  width: 72px; height: 72px; margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
}
.welcome-logo-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.welcome h1 { font-size: 26px; font-weight: 700; color: var(--navy); }
.welcome p { color: var(--muted); margin-top: 10px; font-size: 15px; }
.welcome-tip { margin-top: 22px !important; font-size: 15px !important; }
.welcome-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%; max-width: 420px; margin: 10px auto 0; padding: 14px 18px;
  background: #fff; border: 1px solid var(--border, #e5e7eb); border-radius: 12px;
  cursor: pointer; text-align: left; transition: all .15s;
}
.welcome-item:hover { border-color: var(--gold, #c9a24b); box-shadow: 0 4px 14px rgba(0,0,0,.06); }
.welcome-no {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  background: var(--navy, #1f3a5f); color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.welcome-label { font-weight: 600; color: var(--navy, #1f3a5f); font-size: 15px; flex: none; }
.welcome-desc { color: var(--muted, #6b7280); font-size: 13px; }
.welcome-foot { margin-top: 16px !important; font-size: 13px !important; color: var(--muted) !important; }
.suggestions { margin-top: 26px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.suggest {
  padding: 14px 16px; text-align: left; background: #fff; border: 1px solid var(--border);
  border-radius: 12px; font-size: 14px; color: var(--text); cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.suggest:hover { border-color: var(--gold); box-shadow: 0 4px 14px rgba(0,0,0,.06); transform: translateY(-1px); }

/* ===== 消息 ===== */
.msg { display: flex; gap: 12px; margin-bottom: 20px; max-width: 860px; }
.msg.assistant { align-items: flex-start; }
.msg.user { flex-direction: row-reverse; margin-left: auto; }
.avatar {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.bubble {
  padding: 12px 16px; border-radius: 4px 14px 14px 14px;
  background: #fff; border: 1px solid var(--border);
  font-size: 14.5px; line-height: 1.7; max-width: 100%;
}
.msg.user .bubble {
  background: var(--user-bubble); color: #fff; border: none;
  border-radius: 14px 4px 14px 14px; padding: 11px 16px;
}

.bubble .text { margin-bottom: 10px; word-break: break-word; overflow-wrap: anywhere; }
.bubble .text:last-child { margin-bottom: 0; }
.bubble .text strong { color: var(--gold-deep); }
/* 长回答的排版：标题行更醒目、段落之间留白、列表行不挤 */
.bubble .text strong.h { display: inline-block; margin: 10px 0 2px; font-size: 15px; }
.bubble .text strong.h:first-child { margin-top: 0; }
.bubble .text .hr { display: block; height: 1px; margin: 10px 0; background: var(--border); }
.msg.user .bubble .text strong { color: var(--gold); }

/* 打字动画 */
.typing { display: flex; gap: 5px; padding: 16px 18px; }
.typing span {
  width: 7px; height: 7px; border-radius: 50%; background: #cbd5e1;
  animation: bounce 1.2s infinite;
}
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%,60%,100% { transform: translateY(0); opacity:.4; } 30% { transform: translateY(-5px); opacity:1; } }

/* ===== 表格 ===== */
.table-wrap { overflow-x: auto; margin: 4px 0 12px; border: 1px solid var(--border); border-radius: 10px; }
.data-table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.data-table th {
  background: #f8fafc; color: #475569; font-weight: 600; text-align: left;
  padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.data-table td { padding: 9px 14px; border-bottom: 1px solid #f1f5f9; color: var(--text); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: #fbf7ee; }

/* ===== 图表 ===== */
.chart-box { margin: 6px 0 12px; border: 1px solid var(--border); border-radius: 10px; padding: 12px; background: #fbfcfe; }
.chart-title { font-size: 13px; font-weight: 600; color: #475569; margin-bottom: 6px; }
.chart-holder { width: 100%; height: 280px; }

/* ===== 文件下载 ===== */
.files { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.file-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--gold);
  background: #fdf8ee; color: var(--gold-deep); font-size: 13px; cursor: pointer;
  transition: background .15s;
}
.file-btn:hover { background: #f9efd8; }

/* ===== 输入区 ===== */
.composer {
  padding: 14px 22px 18px; background: #fff; border-top: 1px solid var(--border); flex-shrink: 0;
}
.composer-inner { display: flex; }
.composer {
  display: flex; align-items: flex-end; gap: 10px; padding: 14px 22px 18px;
}
.composer textarea {
  flex: 1; resize: none; border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 16px; font-size: 15px; font-family: inherit; line-height: 1.5;
  max-height: 160px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.composer textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(230,180,92,.15); }
.send-btn {
  width: 46px; height: 46px; border-radius: 12px; border: none; flex-shrink: 0;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep)); color: #fff;
  font-size: 18px; cursor: pointer; transition: opacity .15s, transform .1s;
  display: flex; align-items: center; justify-content: center;
}
.send-btn:hover { opacity: .92; }
.send-btn:active { transform: scale(.96); }
/* 生成中：按钮变「停止」 */
.send-btn.stop { background: linear-gradient(135deg, #ef4444, #b91c1c); font-size: 15px; }

/* 滚动条 */
.chat::-webkit-scrollbar { width: 8px; }
.chat::-webkit-scrollbar-thumb { background: #d8dde4; border-radius: 4px; }
.chat::-webkit-scrollbar-thumb:hover { background: #c3cad3; }

/* ===== 模型选择器 ===== */
.topbar-right { display: flex; align-items: center; gap: 12px; }
.model-select {
  border: 1px solid var(--border); border-radius: 8px; background: #fff;
  padding: 6px 10px; font-size: 13px; color: var(--text); outline: none; cursor: pointer;
}
.model-select:focus { border-color: var(--gold); }

/* ===== 移动端适配 ===== */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main { width: 100%; }
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar-right { gap: 8px; }
  /* 手机端侧栏整块隐藏 → 版本号挪到顶栏左侧（小号淡灰，不抢「新对话」按钮） */
  .topbar-version { font-size: 10px; color: #94a3b8; letter-spacing: .3px; flex-shrink: 0; }
  .model-select { font-size: 12px; padding: 5px 8px; }
  .chat { padding: 16px 14px; }
  .welcome { margin-top: 3vh; }
  .welcome h1 { font-size: 22px; }
  .composer { padding: 10px 12px 14px; }
  .msg { max-width: 100%; }
  .chart-holder { height: 220px; }
  .data-table { font-size: 12.5px; }
}

/* ===== 思考/步骤面板 ===== */
.steps { margin-bottom: 10px; border: 1px solid var(--border); border-radius: 8px; background: #f8fafc; }
.steps summary { cursor: pointer; font-size: 13px; font-weight: 600; color: #475569; padding: 6px 10px; list-style: none; }
.steps summary::-webkit-details-marker { display: none; }
.steps summary::before { content: '▸ '; color: var(--gold-deep); }
.steps[open] summary::before { content: '▾ '; }
.steps-list { padding: 2px 12px 8px; }
.steps-list div { font-size: 12.5px; color: #64748b; line-height: 1.6; }
.steps-list div:not(:last-child) { margin-bottom: 2px; }

/* ===== 加载动画（首个 delta 到达前显示） ===== */
.loading-hint { display: flex; align-items: center; gap: 8px; color: #94a3b8; font-size: 13px; padding: 6px 0; }
.spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(100,116,139,.25); border-top-color: var(--gold);
  animation: spin .8s linear infinite; flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 登录门 ===== */
.login-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: #0e1a2f; /* 完全不透明，主界面不会透出 */
}
.login-card { text-align: center; padding: 30px 40px; background: #fff; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-logo { width: 72px; height: 72px; margin: 0 auto 14px; }
.login-logo img { width: 100%; height: 100%; object-fit: contain; }
.login-card h2 { color: var(--navy); margin-bottom: 6px; }
.login-hint { color: var(--muted); margin-bottom: 18px; }
.login-btn {
  display: inline-block; padding: 11px 26px; border-radius: 10px;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep)); color: #fff;
  font-size: 15px; font-weight: 600; text-decoration: none;
}
.login-btn:hover { opacity: .92; }
.login-form { margin-bottom: 4px; }
.login-input {
  display: block; width: 100%; margin-bottom: 10px; padding: 11px 14px;
  border: 1px solid var(--border); border-radius: 10px; font-size: 15px; outline: none;
}
.login-input:focus { border-color: var(--gold); }
.login-form .login-btn { width: 100%; }
.login-divider { color: var(--muted); font-size: 12px; margin: 10px 0; }
.login-sso { display: block; background: #3b7cff; }
.login-sso:hover { opacity: .92; }
.login-error { color: #e0483d; font-size: 13px; margin-top: 10px; min-height: 16px; }
.admin-link { text-decoration: none; font-size: 13px; }

/* ===== ★ 0.2.34（审查报告 H4）：强制改密 / 修改密码面板 =====
   半透明遮罩而不是全不透明：让用户看得见「自己确实已经登录进来了」，
   只是必须先把密码改掉（免得被当成「登录失败又被踢回登录页」）。 */
.pwd-overlay {
  position: fixed; inset: 0; z-index: 1100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(14, 26, 47, .82);
}
.pwd-card {
  width: 380px; max-width: calc(100vw - 40px);
  background: #fff; border-radius: 16px; padding: 26px 30px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .45); text-align: center;
}
.pwd-card h3 { color: var(--navy); margin-bottom: 8px; }
.pwd-hint { color: var(--muted); font-size: 13px; line-height: 1.6; margin-bottom: 16px; }
.pwd-actions { margin-top: 12px; display: flex; justify-content: center; gap: 10px; }

/* ===== 视觉升级层（覆盖关键样式，提升质感） ===== */
body {
  background: linear-gradient(160deg, #f0f4fa 0%, #e9edf5 100%);
}
/* 侧边栏更精致的深色渐变 + 品牌金点缀 */
.sidebar {
  background: linear-gradient(180deg, #0b1626 0%, #0e1a2f 55%, #132440 100%);
  box-shadow: inset -1px 0 0 rgba(255,255,255,.04);
}
.brand { padding: 22px 18px; }
.brand-name { letter-spacing: .8px; font-size: 17px; }
.nav-item { border-radius: 10px; padding: 10px 14px; font-size: 14px; transition: all .18s ease; }
.nav-item.active { background: linear-gradient(135deg, rgba(230,180,92,.22), rgba(230,180,92,.10)); box-shadow: 0 0 0 1px rgba(230,180,92,.25) inset; }
/* 顶栏更轻盈 */
.topbar { background: rgba(255,255,255,.86); backdrop-filter: blur(12px); height: 60px; }
/* 欢迎菜单项卡片化 + 悬浮动效 */
.welcome-item {
  border-radius: 14px; padding: 16px 18px; margin-top: 12px;
  box-shadow: 0 1px 3px rgba(15,23,42,.06); transition: all .2s ease;
}
.welcome-item:hover { border-color: var(--gold); box-shadow: 0 8px 22px rgba(15,23,42,.10); transform: translateY(-2px); }
.welcome-label { font-size: 15px; }
.welcome-desc { font-size: 13px; }
/* 消息气泡更精致：阴影 + 更圆角 */
.bubble {
  border-radius: 6px 16px 16px 16px; padding: 14px 18px;
  box-shadow: 0 1px 4px rgba(15,23,42,.07); border: 1px solid #eef1f6;
}
.msg.user .bubble { border-radius: 16px 6px 16px 16px; box-shadow: 0 2px 8px rgba(15,23,42,.16); background: linear-gradient(135deg, #1f3a5f, #2a4a7a); }
.avatar { box-shadow: 0 2px 6px rgba(15,23,42,.18); border-radius: 12px; }
/* 输入区悬浮感 */
.composer { background: rgba(255,255,255,.92); backdrop-filter: blur(12px); border-top: 1px solid #eef1f6; }
.composer textarea { border-radius: 14px; padding: 13px 16px; }
.send-btn { border-radius: 14px; box-shadow: 0 3px 10px rgba(201,147,58,.35); }
/* 登录卡片更精致 */
.login-card { border-radius: 20px; padding: 36px 44px; box-shadow: 0 24px 70px rgba(0,0,0,.45); }
.login-btn { border-radius: 12px; box-shadow: 0 3px 10px rgba(201,147,58,.3); }
/* 思考面板更柔和 */
.steps { border-radius: 10px; background: #f6f8fc; border-color: #e8edf5; }

/* ============================================================
   我的任务 / 今日待办（侧边抽屉）
   ============================================================ */
.nav-badge {
  display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 6px;
  font-size: 11px; line-height: 18px; text-align: center; border-radius: 9px;
  background: #e64340; color: #fff; font-weight: 600;
}
.todo-mask { position: fixed; inset: 0; background: rgba(15,23,42,.38); z-index: 60; }
.todo-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 94vw);
  background: #fff; z-index: 61; display: flex; flex-direction: column;
  box-shadow: -10px 0 34px rgba(15,23,42,.20);
}
.todo-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid var(--border); font-size: 16px;
}
.todo-date { margin-left: 8px; font-size: 12.5px; color: var(--muted); font-weight: 400; }
.todo-close { border: none; background: transparent; font-size: 17px; color: var(--muted); cursor: pointer; padding: 4px 8px; }
.todo-loading { padding: 30px; text-align: center; color: var(--muted); font-size: 13.5px; }
.todo-sec { padding: 14px 18px 4px; }
.todo-sec-title { font-size: 13px; font-weight: 700; color: #1f3a5f; margin-bottom: 8px; }
.todo-warn {
  background: #fff8e6; border: 1px solid #f0d8a0; color: #7a5b12;
  border-radius: 10px; padding: 12px 14px; font-size: 13px; line-height: 1.7;
}
.todo-item {
  border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px; margin-bottom: 9px;
  background: #fff; transition: box-shadow .15s;
}
.todo-item:hover { box-shadow: 0 3px 12px rgba(15,23,42,.08); }
.todo-item.overdue { border-color: #f4b8b4; background: #fff7f6; }
.todo-item.todo-undone { border-left: 3px solid #e6b45c; }
.todo-item.todo-manual { border-left: 3px solid #93b4e6; }
.todo-hidden { color: #7a5b12; }
.todo-title { font-size: 14px; font-weight: 600; color: #1e293b; line-height: 1.5; }
.todo-meta { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.todo-tag { display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 6px; margin-left: 6px; font-weight: 600; }
.todo-tag.red { background: #fdecea; color: #c0392b; }
.todo-tag.orange { background: #fff4e5; color: #b45309; }
.todo-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 9px; }
.todo-btn {
  border: 1px solid var(--border); background: #fff; color: #334155; border-radius: 8px;
  padding: 4px 10px; font-size: 12.5px; cursor: pointer; text-decoration: none; line-height: 1.7;
}
.todo-btn:hover { border-color: #1f3a5f; color: #1f3a5f; }
.todo-btn.primary { background: linear-gradient(135deg, #e6b45c, #d9a03e); border: none; color: #fff; font-weight: 600; }
.todo-guide { font-size: 12.5px; color: #b45309; }
/* ★ v0.2.37：待办「为什么判不了」的原因行（`unknown` 条目上的 `rule_note`）。
   为什么要单独一条而不是复用 `.todo-guide`（0.2.36 就有 `.todo-guide` 了）：
     · `.todo-guide` 是**操作引导**（金色 #b45309，"点这个去处理"），
       而 `rule_note` 是**诊断原因**（"表还没建/没建档"），两类信息混成一个颜色
       用户会以为那句原因也是个可点的去处 ✗；
     · 它是整段中文长句（如「KPI 表还没建：先执行 03-create-kpi-tables.sql…」），
       必须独立成块、能换行 —— 塞进 flex 的 `.todo-actions` 会被挤成窄条。
   所以：块级 + 浅蓝灰底 + 更小的字，视觉上"这是一段说明，不是一个动作" ✓ */
.todo-rule-note {
  font-size: 12px; line-height: 1.7; color: #4b5563;
  background: #f4f7fb; border-left: 2px solid #93b4e6;
  border-radius: 6px; padding: 6px 9px; margin-top: 7px;
  white-space: pre-wrap; word-break: break-word;
}
.todo-ev { font-size: 12.5px; }
.todo-ev a { color: #1f3a5f; }
.todo-done-list { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12.5px; color: #16a34a; }
.todo-empty { padding: 34px 18px; text-align: center; color: var(--muted); font-size: 13.5px; }

/* ===== 任务单（编号 / 等级 / 提交 / 退回 / 明细） ===== */
.todo-tag.blue { background: #e6f0fd; color: #1d4ed8; }
.todo-item.todo-submitted { border-left: 3px solid #1d4ed8; }
.tk-no {
  display: inline-block; font-size: 11.5px; font-weight: 700; color: #1f3a5f;
  background: #eef2f8; border-radius: 6px; padding: 1px 6px; margin-right: 6px;
  font-family: Consolas, monospace;
}
.tk-lv {
  display: inline-block; font-size: 11px; font-weight: 700; border-radius: 6px;
  padding: 1px 6px; margin-right: 6px; color: #fff;
}
.tk-lv.lv-P0 { background: #dc2626; }
.tk-lv.lv-P1 { background: #ea580c; }
.tk-lv.lv-P2 { background: #0f766e; }
.tk-lv.lv-P3 { background: #64748b; }
.tk-desc, .tk-note { font-size: 12.5px; color: #475569; margin-top: 5px; line-height: 1.6; }
.tk-reject {
  font-size: 12.5px; color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca;
  border-radius: 8px; padding: 6px 9px; margin-top: 6px; line-height: 1.6;
}
.tk-atts { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.tk-atts a { color: #1f3a5f; margin-right: 10px; }
.tk-form { margin-top: 9px; border-top: 1px dashed #e2e8f0; padding-top: 9px; }
.tk-form textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 9px; padding: 9px 11px;
  font-size: 13px; font-family: inherit; resize: vertical; outline: none;
}
.tk-form textarea:focus { border-color: var(--gold); }
.tk-file { margin: 7px 0; font-size: 12.5px; }
.todo-btn.danger { background: #fff1f1; border-color: #f6c8c5; color: #c0392b; }

/* 明细抽屉（叠在「我的任务」上面） */
.tk-logs-mask { position: fixed; inset: 0; background: rgba(15,23,42,.42); z-index: 70; }
.tk-logs {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 96vw);
  background: #fff; z-index: 71; display: flex; flex-direction: column;
  box-shadow: -10px 0 34px rgba(15,23,42,.22);
}
.tk-logs-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 10px; border-bottom: 1px solid var(--border); font-size: 14px;
}
.tk-logs-title { padding: 10px 16px 0; font-size: 14px; font-weight: 600; color: #1e293b; }
.tk-log-list { flex: 1; overflow-y: auto; padding: 12px 16px 20px; }
.tk-log { border-left: 2px solid #e2e8f0; padding: 0 0 14px 12px; position: relative; }
.tk-log::before {
  content: ''; position: absolute; left: -5px; top: 4px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--gold);
}
.tk-log-head { font-size: 13px; color: #334155; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tk-log-no {
  font-family: Consolas, monospace; font-size: 11.5px; color: #1f3a5f;
  background: #eef2f8; border-radius: 5px; padding: 1px 5px;
}
.tk-log-note { font-size: 12.5px; color: #475569; margin-top: 4px; line-height: 1.65; white-space: pre-wrap; }
.tk-log-note.dim { color: #94a3b8; }

/* 新建任务表单 */
.tk-new {
  margin: 10px 14px 4px; padding: 12px; border: 1px solid #f0d8a0;
  background: #fffaf0; border-radius: 12px;
}
.tk-new-title { font-size: 13px; font-weight: 700; color: #7a5b12; margin-bottom: 8px; }
.tk-new input[type=text], .tk-new input:not([type]), .tk-new textarea, .tk-new select {
  width: 100%; border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px;
  font-size: 13px; font-family: inherit; outline: none; margin-bottom: 7px; background: #fff;
}
.tk-new textarea { resize: vertical; }
.tk-new-row { display: flex; gap: 6px; }
.tk-new-row select { flex: 1 1 40%; }
.tk-new-row input[type=date] { flex: 1 1 30%; margin-bottom: 7px; border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px; font-size: 13px; font-family: inherit; background: #fff; }

/* 被指派人「打字即筛」下拉（0.2.26）—— 交互照 CRM「选归属」那个字段（输入框 + 浮层候选 +
   input 事件过滤 + 点选回填），实现是 Vue（v-for 渲染候选），不引任何 UI 库。
   规则写在 .tk-new-row 那几条**之后**（同特异度靠顺序生效），所以不用 !important。 */
.tk-new-row .tk-combo { position: relative; flex: 1 1 46%; min-width: 0; margin-bottom: 7px; }
.tk-new .tk-combo input { margin-bottom: 0; padding-right: 30px; }
.tk-combo-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 3px); z-index: 80;
  max-height: 240px; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 22px rgba(15,23,42,.14); padding: 4px 0;
}
.tk-combo-item { padding: 9px 12px; font-size: 13px; color: var(--text); cursor: pointer; line-height: 1.5; }
.tk-combo-item:hover, .tk-combo-item.active { background: #f1f5f9; }
.tk-combo-item .uid { color: var(--muted); font-size: 12px; margin-left: 6px; }
.tk-combo-hint { padding: 10px 12px; font-size: 12.5px; color: var(--muted); }
.tk-combo-clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: none; background: transparent; color: var(--muted);
  font-size: 13px; line-height: 1; padding: 4px 6px; cursor: pointer;
}
.tk-combo-clear:hover { color: #1f3a5f; }
/* 手机端：被指派人独占一行（浮层候选够宽、字数不被挤没），等级/日期落到下一行；
   候选行加高到 ≥40px 的可点区域，浮层限高别顶出屏幕 */
@media (max-width: 768px) {
  .tk-new-row { flex-wrap: wrap; }
  .tk-new-row .tk-combo { flex: 1 1 100%; }
  .tk-combo-item { padding: 11px 12px; font-size: 14px; }
  .tk-combo-list { max-height: 220px; }
}
.todo-tag.gray { background: #f1f5f9; color: #64748b; }
.msg-link { color: #1f3a5f; text-decoration: underline; word-break: break-all; }
.msg.user .msg-link { color: #ffe9b8; }

/* Excel 导出下载链接（v0.2.20）：渲染成浅底圆角「下载按钮」，一眼看出能点、点了是下载 */
.msg-download {
  display: inline-block; margin: 2px 0; padding: 4px 10px;
  background: #eef4ff; border: 1px solid #c7d8f5; border-radius: 8px;
  color: #1f3a5f; font-weight: 600; text-decoration: none;
  word-break: break-all; max-width: 100%;
}
.msg-download:hover { background: #dfeaff; border-color: #a8c4ee; }
.msg.user .msg-download { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .45); color: #fff; }
.msg.user .msg-download:hover { background: rgba(255, 255, 255, .26); }
