/* ─────────────────────────────────────────────────────────────────────
 * 联络中心 v2 — UI 对标微信，体验对标 Grok Bot
 *
 * 视觉：灰底 #EDEDED、会话白、1px #E5E5E5 分隔、6px 圆角、44px 方形头像、
 *       微信式气泡与红底数字角标、内联链接卡片。
 * 体验：常驻 Bot、一句话派活、多任务并行、卡片原地更新、状态挂在头像上。
 *
 * 分三段：1) token 与复位  2) 左列（会话列表）  3) 右列（会话/卡片/信息窗/泳道）
 * 断点：<768 单栏（列表 ⇄ 会话）、768–899 窄两栏、≥900 300px 列表。
 * ──────────────────────────────────────────────────────────────────── */

:root {
  --cc-bg: #EDEDED;
  --cc-chat: #FFFFFF;
  --cc-panel: #F7F7F7;
  --cc-rule: #E5E5E5;
  --cc-rule-soft: #EFEFEF;

  --cc-ink: #1A1A1A;
  --cc-ink-2: #8C8C8C;
  --cc-ink-3: #B2B2B2;

  --cc-terracotta: #BC5230;
  --cc-terracotta-deep: #9E4226;
  --cc-tint: #F7EAE4;

  --cc-red: #FA5151;
  --cc-amber: #D9A24A;
  --cc-green: #4E9A5F;

  --cc-r: 6px;
  --cc-r-pill: 999px;

  --cc-side-w: 300px;
  --cc-head-h: 56px;
  --cc-info-w: 320px;

  --cc-serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "Songti TC", Georgia, serif;
  --cc-sans: "PingFang SC", "Noto Sans SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;

  --cc-ease: cubic-bezier(.2, .6, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  background: var(--cc-bg);
  color: var(--cc-ink);
  font-family: var(--cc-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

h1, h2, h3, p, ul { margin: 0; padding: 0; }
ul { list-style: none; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

button:disabled { cursor: default; }

a { color: var(--cc-terracotta); text-decoration: none; }

.cc-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.cc-sr {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

:focus-visible { outline: 2px solid var(--cc-terracotta); outline-offset: 1px; }

.cc-ico {
  width: 18px; height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

/* ── 外壳 ─────────────────────────────────────────────────────────── */

.cc-app {
  display: grid;
  grid-template-columns: var(--cc-side-w) minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.cc-main {
  display: flex;
  min-width: 0;
  min-height: 0;
  background: var(--cc-chat);
}

/* ── 左列 ─────────────────────────────────────────────────────────── */

.cc-side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--cc-bg);
  border-right: 1px solid #DCDCDC;
}

.cc-side-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  height: var(--cc-head-h);
  padding: 0 16px;
}

.cc-side-title {
  font-family: var(--cc-sans);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .01em;
}

.cc-side-total {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--cc-r-pill);
  background: var(--cc-red);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.cc-side-total[hidden] { display: none; }

.cc-search {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
  margin: 0 12px 8px;
  padding: 0 8px;
  height: 32px;
  border-radius: var(--cc-r);
  background: #FFF;
  color: var(--cc-ink-3);
}

.cc-search .cc-ico { width: 14px; height: 14px; stroke-width: 1.8; }

.cc-search input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  border: 0;
  background: none;
  font-family: var(--cc-sans);
  font-size: 13px;
  color: var(--cc-ink);
  outline: none;
  -webkit-appearance: none;
}

.cc-search input::placeholder { color: var(--cc-ink-3); }
.cc-search input::-webkit-search-cancel-button { -webkit-appearance: none; }

.cc-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 8px;
}

/* 分组 */

.cc-group + .cc-group { margin-top: 4px; }

.cc-group-head {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  height: 30px;
  padding: 0 16px 0 10px;
  font-family: var(--cc-sans);
  font-size: 12px;
  color: var(--cc-ink-2);
  text-align: left;
}

.cc-group-head:hover { color: var(--cc-ink); }

.cc-group-chev {
  width: 14px; height: 14px;
  transition: transform 160ms var(--cc-ease);
}

.cc-group-head[aria-expanded="false"] .cc-group-chev { transform: rotate(-90deg); }

.cc-group-count {
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  margin-left: 2px;
  border-radius: var(--cc-r-pill);
  background: var(--cc-red);
  color: #fff;
  font-size: 10px;
  font-weight: 500;
}

.cc-group-empty {
  padding: 6px 16px 12px;
  font-family: var(--cc-sans);
  font-size: 12px;
  color: var(--cc-ink-3);
  line-height: 1.6;
}

.cc-group[data-collapsed="1"] .cc-rows { display: none; }

/* 会话行 */

.cc-row {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 64px;
  padding: 0 16px 0 14px;
  text-align: left;
  transition: background 110ms var(--cc-ease);
}

.cc-row:hover { background: #E4E4E4; }

.cc-row[aria-current="true"] { background: #E2E2E2; }

.cc-row[aria-current="true"]::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--cc-terracotta);
}

.cc-row-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  height: 100%;
}

.cc-row-top,
.cc-row-bot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.cc-row-name {
  font-family: var(--cc-sans);
  font-size: 15px;
  font-weight: 400;
  color: var(--cc-ink);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cc-row-time {
  flex: none;
  font-family: var(--cc-sans);
  font-size: 12px;
  color: var(--cc-ink-3);
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
}

.cc-row-bot { margin-top: 1px; }

.cc-row-snip {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--cc-sans);
  font-size: 13px;
  color: var(--cc-ink-2);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cc-row-snip .cc-snip-who { color: var(--cc-ink-3); }

.cc-row-snip .cc-snip-mine { color: var(--cc-ink-3); }

.cc-row--busy .cc-row-snip { color: var(--cc-terracotta); }

.cc-badge {
  display: inline-grid;
  place-items: center;
  flex: none;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--cc-r-pill);
  background: var(--cc-red);
  color: #fff;
  font-family: var(--cc-sans);
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

/* 头像 */

.cc-ava {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: var(--cc-r);
  background: var(--cc-terracotta);
  color: #fff;
  font-family: var(--cc-sans);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: .02em;
  user-select: none;
}

.cc-ava--chat { width: 36px; height: 36px; font-size: 14px; }
.cc-ava--msg { width: 36px; height: 36px; font-size: 14px; border-radius: var(--cc-r); }
.cc-ava--info { width: 48px; height: 48px; font-size: 18px; }
.cc-ava--me { width: 26px; height: 26px; font-size: 12px; border-radius: 4px; }
.cc-ava--self { background: #4A4A4A; }

/* 状态点：只在头像右下角 */

.cc-dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 10px;
  height: 10px;
  border-radius: var(--cc-r-pill);
  border: 2px solid var(--cc-bg);
  background: #BFBFBF;
  box-sizing: content-box;
}

.cc-ava--msg .cc-dot,
.cc-ava--chat .cc-dot,
.cc-ava--info .cc-dot { border-color: var(--cc-chat); }

.cc-dot[data-status="thinking"],
.cc-dot[data-status="working"] { background: var(--cc-terracotta); }

.cc-dot[data-status="thinking"] { animation: cc-breathe 1.6s var(--cc-ease) infinite; }

.cc-dot[data-status="waiting"] { background: var(--cc-amber); }
.cc-dot[data-status="blocked"] { background: var(--cc-red); }
.cc-dot[data-status="done"] { background: var(--cc-green); }

@keyframes cc-breathe {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .4; transform: scale(.82); }
}

/* 底栏 */

.cc-side-foot {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 52px;
  padding: 0 12px 0 14px;
  border-top: 1px solid #DCDCDC;
}

.cc-foot-task {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px 0 8px;
  border-radius: var(--cc-r);
  font-family: var(--cc-sans);
  font-size: 12px;
  color: var(--cc-ink-2);
}

.cc-foot-task:hover { background: #E2E2E2; color: var(--cc-ink); }

.cc-foot-task .cc-ico { width: 15px; height: 15px; }

.cc-foot-count {
  font-variant-numeric: tabular-nums;
  color: var(--cc-terracotta);
}

.cc-me {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  min-width: 0;
}

.cc-me-name {
  font-family: var(--cc-sans);
  font-size: 13px;
  color: var(--cc-ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cc-me-set { width: 26px; height: 26px; color: var(--cc-ink-3); opacity: .55; }
.cc-me-set .cc-ico { width: 15px; height: 15px; }

/* ── 右列：会话 ───────────────────────────────────────────────────── */

.cc-chat {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  background: var(--cc-chat);
}

/* hidden 属性要压过上面的 display:flex（作者样式优先于 UA 的 [hidden]） */
.cc-chat[hidden] { display: none; }

.cc-chat.is-empty .cc-composer { display: none; }

.cc-chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  height: var(--cc-head-h);
  padding: 0 14px 0 20px;
  border-bottom: 1px solid var(--cc-rule);
}

.cc-chat-id { flex: 1 1 auto; min-width: 0; }

.cc-chat-name {
  font-family: var(--cc-sans);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cc-chat-status {
  font-family: var(--cc-sans);
  font-size: 12px;
  color: var(--cc-ink-2);
  line-height: 1.35;
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cc-icon-btn {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: var(--cc-r);
  color: var(--cc-ink-2);
  transition: background 110ms var(--cc-ease), color 110ms var(--cc-ease);
}

.cc-icon-btn:hover { background: #F2F2F2; color: var(--cc-ink); }

.cc-back { display: none; }

.cc-back-label {
  font-family: var(--cc-sans);
  font-size: 13px;
  margin-left: 1px;
}

/* 消息流 */

.cc-msgs {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 8px 20px 12px;
}

.cc-day {
  display: flex;
  justify-content: center;
  margin: 10px 0 8px;
}

.cc-day span {
  font-family: var(--cc-sans);
  font-size: 12px;
  color: var(--cc-ink-3);
  letter-spacing: .02em;
  line-height: 1.4;
}

.cc-msg {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 4px;
}

.cc-msg--me { flex-direction: row-reverse; }
.cc-msg--group { margin-top: 12px; }

.cc-msg-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 70%;
  min-width: 0;
}

.cc-msg--me .cc-msg-body { align-items: flex-end; }

.cc-msg-sender {
  font-family: var(--cc-sans);
  font-size: 12px;
  color: var(--cc-ink-2);
  margin: 0 2px 4px;
}

.cc-bubble {
  position: relative;
  padding: 8px 12px;
  border-radius: var(--cc-r);
  font-family: var(--cc-serif);
  font-size: 16px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.cc-msg--them .cc-bubble {
  background: #FFFFFF;
  border: 1px solid var(--cc-rule);
  color: var(--cc-ink);
}

/* 小尾巴：白气泡朝左，我的朝右 */
.cc-msg--them .cc-bubble::after {
  content: "";
  position: absolute;
  left: -4px;
  top: 12px;
  width: 8px;
  height: 8px;
  background: #FFFFFF;
  border-left: 1px solid var(--cc-rule);
  border-bottom: 1px solid var(--cc-rule);
  transform: rotate(45deg);
}

.cc-msg--me .cc-bubble {
  background: var(--cc-tint);
  color: var(--cc-ink);
}

.cc-msg--me .cc-bubble::after {
  content: "";
  position: absolute;
  right: -4px;
  top: 12px;
  width: 8px;
  height: 8px;
  background: var(--cc-tint);
  transform: rotate(45deg);
}

.cc-msg-fail {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 2px 0;
  font-family: var(--cc-sans);
  font-size: 12px;
  color: var(--cc-red);
}

.cc-msg-fail button {
  font-size: 12px;
  color: var(--cc-red);
  text-decoration: underline;
}

/* 输入中 */

.cc-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 13px 14px;
}

.cc-typing i {
  width: 6px; height: 6px;
  border-radius: var(--cc-r-pill);
  background: var(--cc-ink-3);
  animation: cc-typing 1.1s var(--cc-ease) infinite;
}

.cc-typing i:nth-child(2) { animation-delay: .16s; }
.cc-typing i:nth-child(3) { animation-delay: .32s; }

@keyframes cc-typing {
  0%, 60%, 100% { opacity: .3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-2px); }
}

.cc-typing-note {
  font-family: var(--cc-sans);
  font-size: 12px;
  color: var(--cc-ink-3);
  margin: 4px 2px 0;
}

/* ── 内联任务卡（微信链接卡片式） ─────────────────────────────────── */

.cc-card-row {
  width: 76%;
  max-width: 76%;
  flex-direction: column;
  align-items: stretch;
}

.cc-card {
  width: 100%;
  max-width: 420px;
  min-width: 220px;
  padding: 10px 12px 0;
  border: 1px solid var(--cc-rule);
  border-left: 3px solid var(--cc-terracotta);
  border-radius: var(--cc-r);
  background: #FFFFFF;
  text-align: left;
  font-family: var(--cc-sans);
  cursor: pointer;
}

.cc-card[data-status="done"] { border-left-color: var(--cc-green); }
.cc-card[data-status="failed"] { border-left-color: var(--cc-red); }
.cc-card[data-status="waiting"] { border-left-color: var(--cc-amber); }
.cc-card[data-status="blocked"] { border-left-color: var(--cc-red); }

.cc-card-kicker {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--cc-ink-2);
  line-height: 1.4;
}

.cc-card-state { color: var(--cc-ink-2); }

.cc-card[data-status="running"] .cc-card-state { color: var(--cc-terracotta); }
.cc-card[data-status="done"] .cc-card-state { color: var(--cc-green); }
.cc-card[data-status="failed"] .cc-card-state { color: var(--cc-red); }
.cc-card[data-status="waiting"] .cc-card-state { color: #A9762A; }

.cc-card-time {
  margin-left: auto;
  font-size: 11px;
  color: var(--cc-ink-3);
  font-variant-numeric: tabular-nums;
}

.cc-card-title {
  margin: 6px 0 0;
  font-family: var(--cc-serif);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--cc-ink);
  overflow-wrap: anywhere;
}

.cc-card-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--cc-ink-3);
}

.cc-card-steps li {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  line-height: 1.6;
}

.cc-card-steps .cc-ico { width: 11px; height: 11px; stroke-width: 2; }

.cc-card-steps li[data-state="done"] { color: var(--cc-ink); }
.cc-card-steps li[data-state="active"] { color: var(--cc-terracotta); }

.cc-card-summary {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--cc-rule-soft);
  font-family: var(--cc-sans);
  font-size: 13px;
  line-height: 1.65;
  color: #4F4F4F;
}

.cc-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 0;
  border-top: 1px solid var(--cc-rule-soft);
  font-size: 12px;
  color: var(--cc-ink-2);
}

.cc-card-owner { color: var(--cc-ink-2); }

.cc-card-more {
  font-size: 12px;
  color: var(--cc-terracotta);
  padding: 2px 0;
  margin-left: auto;
}

.cc-card-more:hover { text-decoration: underline; }

.cc-card-approve {
  display: flex;
  gap: 8px;
  padding: 0 0 10px;
}

.cc-card-approve button {
  flex: 1 1 0;
  height: 30px;
  border-radius: var(--cc-r);
  font-family: var(--cc-sans);
  font-size: 13px;
}

.cc-card-approve [data-approve] {
  background: var(--cc-terracotta);
  color: #fff;
}

.cc-card-approve [data-approve]:hover { background: var(--cc-terracotta-deep); }

.cc-card-approve [data-reject] {
  border: 1px solid var(--cc-rule);
  color: var(--cc-ink-2);
}

.cc-card-approve [data-reject]:hover { border-color: var(--cc-ink-3); color: var(--cc-ink); }

/* ── 输入区 ───────────────────────────────────────────────────────── */

.cc-composer {
  flex: none;
  padding: 8px 12px 10px;
  border-top: 1px solid var(--cc-rule);
  background: var(--cc-panel);
}

.cc-bar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.cc-plus {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: var(--cc-r-pill);
  border: 1px solid #DCDCDC;
  background: #FFFFFF;
  color: var(--cc-ink-2);
  transition: color 110ms var(--cc-ease), border-color 110ms var(--cc-ease), transform 160ms var(--cc-ease);
}

.cc-plus:hover { color: var(--cc-terracotta); border-color: var(--cc-terracotta); }

.cc-plus[aria-expanded="true"] {
  color: var(--cc-terracotta);
  border-color: var(--cc-terracotta);
  transform: rotate(45deg);
}

.cc-bar textarea {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 32px;
  max-height: 132px;
  padding: 5px 10px;
  border: 1px solid var(--cc-rule);
  border-radius: var(--cc-r);
  background: #FFFFFF;
  color: var(--cc-ink);
  font-family: var(--cc-serif);
  font-size: 15px;
  line-height: 1.5;
  resize: none;
  overflow-y: auto;
  outline: none;
}

.cc-bar textarea::placeholder { color: var(--cc-ink-3); font-family: var(--cc-sans); font-size: 14px; }
.cc-bar textarea:focus { border-color: var(--cc-terracotta); }

.cc-send {
  flex: none;
  height: 32px;
  padding: 0 14px;
  border-radius: var(--cc-r);
  background: var(--cc-terracotta);
  color: #FFFFFF;
  font-family: var(--cc-sans);
  font-size: 14px;
  transition: background 110ms var(--cc-ease);
}

.cc-send:hover:not(:disabled) { background: var(--cc-terracotta-deep); }

.cc-send:disabled { background: #DEDEDE; color: #FFFFFF; }

/* 派发面板 */

.cc-dispatch {
  margin-bottom: 8px;
  padding: 10px 12px 12px;
  border: 1px solid var(--cc-rule);
  border-radius: var(--cc-r);
  background: #FFFFFF;
}

.cc-dispatch[hidden] { display: none; }

.cc-dispatch-label {
  font-family: var(--cc-sans);
  font-size: 12px;
  color: var(--cc-ink-2);
  line-height: 1.4;
}

.cc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 8px;
}

.cc-chip {
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--cc-rule);
  border-radius: var(--cc-r-pill);
  font-family: var(--cc-sans);
  font-size: 12px;
  color: var(--cc-ink-2);
  background: #FFFFFF;
}

.cc-chip:hover { border-color: var(--cc-ink-3); color: var(--cc-ink); }

.cc-chip[aria-pressed="true"] {
  border-color: var(--cc-terracotta);
  background: var(--cc-tint);
  color: var(--cc-terracotta);
}

.cc-dispatch textarea {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--cc-rule);
  border-radius: var(--cc-r);
  background: #FFFFFF;
  font-family: var(--cc-serif);
  font-size: 15px;
  line-height: 1.6;
  color: var(--cc-ink);
  resize: none;
  outline: none;
}

.cc-dispatch textarea:focus { border-color: var(--cc-terracotta); }

.cc-dispatch-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}

.cc-split {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cc-split-label {
  font-family: var(--cc-sans);
  font-size: 12px;
  color: var(--cc-ink-2);
  margin-right: 2px;
}

.cc-split-btn {
  width: 26px;
  height: 26px;
  border-radius: var(--cc-r);
  border: 1px solid var(--cc-rule);
  font-family: var(--cc-sans);
  font-size: 12px;
  color: var(--cc-ink-2);
  background: #FFFFFF;
}

.cc-split-btn.is-on {
  border-color: var(--cc-terracotta);
  color: var(--cc-terracotta);
  background: var(--cc-tint);
}

.cc-dispatch-go {
  height: 30px;
  padding: 0 16px;
  border-radius: var(--cc-r);
  background: var(--cc-terracotta);
  color: #FFFFFF;
  font-family: var(--cc-sans);
  font-size: 13px;
}

.cc-dispatch-go:hover { background: var(--cc-terracotta-deep); }

.cc-dispatch-go:disabled { background: #DEDEDE; }

.cc-dispatch-note {
  margin-top: 6px;
  font-family: var(--cc-sans);
  font-size: 11px;
  color: var(--cc-ink-3);
  line-height: 1.5;
}

/* 空态 */

.cc-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 100%;
  padding: 24px;
  text-align: center;
}

.cc-empty-title {
  font-family: var(--cc-sans);
  font-size: 14px;
  color: var(--cc-ink-2);
}

.cc-empty-sub {
  font-family: var(--cc-sans);
  font-size: 12px;
  color: var(--cc-ink-3);
  max-width: 30ch;
  line-height: 1.6;
}

/* ── 信息窗 ───────────────────────────────────────────────────────── */

.cc-info {
  flex: none;
  width: var(--cc-info-w);
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-left: 1px solid var(--cc-rule);
  background: #FFFFFF;
}

.cc-info[hidden] { display: none; }

.cc-info-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  height: var(--cc-head-h);
  padding: 0 10px 0 14px;
  border-bottom: 1px solid var(--cc-rule);
}

.cc-info-title {
  flex: 1 1 auto;
  font-family: var(--cc-sans);
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cc-info-back { display: none; }

.cc-info-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
}

.cc-info-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--cc-rule-soft);
}

.cc-info-name {
  font-family: var(--cc-sans);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}

.cc-info-role {
  font-family: var(--cc-sans);
  font-size: 12px;
  color: var(--cc-ink-2);
  line-height: 1.5;
  margin-top: 2px;
}

.cc-info-section {
  padding: 14px 0;
  border-bottom: 1px solid var(--cc-rule-soft);
}

.cc-info-section:last-child { border-bottom: 0; }

.cc-info-label {
  font-family: var(--cc-sans);
  font-size: 12px;
  color: var(--cc-ink-2);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cc-info-value {
  font-family: var(--cc-sans);
  font-size: 13px;
  color: var(--cc-ink);
  line-height: 1.7;
}

.cc-info-muted {
  font-family: var(--cc-sans);
  font-size: 12px;
  color: var(--cc-ink-3);
  line-height: 1.7;
}

.cc-info-task {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  padding: 6px 0;
  text-align: left;
  font-family: var(--cc-sans);
  font-size: 13px;
  color: var(--cc-ink);
  line-height: 1.6;
}

.cc-info-task:hover .cc-info-task-title { color: var(--cc-terracotta); }

.cc-info-task-dot {
  flex: none;
  width: 6px;
  height: 6px;
  margin-top: 8px;
  border-radius: var(--cc-r-pill);
  background: var(--cc-terracotta);
}

.cc-info-task[data-status="done"] .cc-info-task-dot { background: var(--cc-green); }
.cc-info-task[data-status="failed"] .cc-info-task-dot { background: var(--cc-red); }
.cc-info-task[data-status="waiting"] .cc-info-task-dot { background: var(--cc-amber); }

.cc-info-task-title { min-width: 0; }

/* 任务详情（信息窗里） */

.cc-detail-title {
  font-family: var(--cc-serif);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.6;
  margin-bottom: 6px;
}

.cc-detail-meta {
  font-family: var(--cc-sans);
  font-size: 12px;
  color: var(--cc-ink-2);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}

.cc-detail-p {
  font-family: var(--cc-serif);
  font-size: 14px;
  line-height: 1.75;
  color: #3A3A3A;
}

.cc-detail-steps {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--cc-sans);
  font-size: 13px;
  color: var(--cc-ink-2);
}

.cc-detail-steps li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cc-detail-steps .cc-ico { width: 13px; height: 13px; }
.cc-detail-steps li[data-state="done"] { color: var(--cc-ink); }
.cc-detail-steps li[data-state="active"] { color: var(--cc-terracotta); }

/* ── 泳道（辅助视图） ─────────────────────────────────────────────── */

.cc-lane {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  background: var(--cc-bg);
}

.cc-lane[hidden] { display: none; }

.cc-lane-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
}

.cc-lane-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.cc-lane-col-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--cc-sans);
  font-size: 12px;
  color: var(--cc-ink-2);
  padding: 0 2px 8px;
}

.cc-lane-col-title span:last-child { color: var(--cc-ink-3); font-variant-numeric: tabular-nums; }

.cc-lane-col { min-width: 0; }

.cc-lane-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cc-lane-card {
  padding: 10px 12px;
  border: 1px solid var(--cc-rule);
  border-left: 3px solid var(--cc-terracotta);
  border-radius: var(--cc-r);
  background: #FFFFFF;
  text-align: left;
  width: 100%;
}

.cc-lane-card[data-status="done"] { border-left-color: var(--cc-green); }
.cc-lane-card[data-status="failed"] { border-left-color: var(--cc-red); }
.cc-lane-card[data-status="waiting"] { border-left-color: var(--cc-amber); }

.cc-lane-card-title {
  font-family: var(--cc-serif);
  font-size: 14px;
  line-height: 1.55;
  margin: 4px 0 6px;
}

.cc-lane-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--cc-sans);
  font-size: 11px;
  color: var(--cc-ink-3);
}

.cc-lane-empty {
  padding: 12px;
  border: 1px dashed var(--cc-rule);
  border-radius: var(--cc-r);
  font-family: var(--cc-sans);
  font-size: 12px;
  color: var(--cc-ink-3);
  text-align: center;
}

/* ── 断点 ─────────────────────────────────────────────────────────── */

@media (max-width: 899px) {
  :root { --cc-side-w: 264px; }
  .cc-msgs { padding: 8px 14px 10px; }
  .cc-chat-head { padding: 0 10px 0 14px; }
}

@media (max-width: 767px) {
  .cc-app { grid-template-columns: minmax(0, 1fr); }

  .cc-side {
    width: 100%;
    border-right: 0;
  }

  .cc-app[data-pane="thread"] .cc-side { display: none; }
  .cc-app[data-pane="roster"] .cc-chat,
  .cc-app[data-pane="roster"] .cc-lane { display: none; }

  .cc-back { display: inline-flex; align-items: center; gap: 2px; width: auto; padding: 0 6px 0 2px; }

  .cc-chat-head { gap: 6px; padding: 0 10px 0 6px; }

  .cc-msgs { padding: 8px 12px 10px; }

  .cc-msg-body { max-width: 74%; }

  .cc-card-row { width: 82%; max-width: 82%; }

  .cc-composer { padding: 8px 10px calc(10px + env(safe-area-inset-bottom)); }

  .cc-plus { width: 30px; height: 30px; }
  .cc-bar textarea { min-height: 32px; }

  /* 信息窗在手机上整屏覆盖 */
  .cc-info {
    position: fixed;
    inset: 0;
    z-index: 60;
    width: 100%;
    border-left: 0;
    background: #FFFFFF;
  }

  .cc-info-back {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    width: auto;
    padding: 0 6px 0 0;
  }

  .cc-info-head { padding: 0 10px; }

  .cc-lane-grid { grid-template-columns: minmax(0, 1fr); }
}

/* 信息窗在中等宽度也覆盖，不挤正文 */
@media (min-width: 768px) and (max-width: 1099px) {
  .cc-info {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 60;
    box-shadow: none;
  }
  .cc-info-back { display: inline-flex; align-items: center; width: auto; padding: 0 6px 0 0; }
}

/* ── 滚动条与动效偏好 ─────────────────────────────────────────────── */

.cc-scroll::-webkit-scrollbar,
.cc-msgs::-webkit-scrollbar,
.cc-info-body::-webkit-scrollbar,
.cc-lane-body::-webkit-scrollbar,
.cc-bar textarea::-webkit-scrollbar,
.cc-dispatch textarea::-webkit-scrollbar { width: 8px; }

.cc-scroll::-webkit-scrollbar-thumb,
.cc-msgs::-webkit-scrollbar-thumb,
.cc-info-body::-webkit-scrollbar-thumb,
.cc-lane-body::-webkit-scrollbar-thumb,
.cc-bar textarea::-webkit-scrollbar-thumb,
.cc-dispatch textarea::-webkit-scrollbar-thumb {
  background: #D2D2D2;
  border-radius: var(--cc-r-pill);
}

.cc-scroll::-webkit-scrollbar-track,
.cc-msgs::-webkit-scrollbar-track,
.cc-info-body::-webkit-scrollbar-track,
.cc-lane-body::-webkit-scrollbar-track { background: transparent; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .cc-dot { opacity: .9; }
}

.cc-noscript {
  padding: 24px;
  font-family: var(--cc-sans);
  font-size: 14px;
  color: var(--cc-ink-2);
}
