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

:root {
  --cc-bg: #FAF7F2;
  --cc-chat: #FFFFFF;
  --cc-panel: #F4F0E9;
  --cc-rule: #E8E2D9;
  --cc-rule-soft: #F0EBE3;

  --cc-ink: #2A2723;
  --cc-ink-2: #6F6A62;
  --cc-ink-3: #8C857A;

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

  --cc-red: #BC5230;
  --cc-amber: #C08A2E;
  --cc-green: #4E7A52;

  --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 var(--cc-rule);
}

.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-terracotta);
  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-terracotta);
  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: #F2ECE3; }

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

.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: #F3EFE8; 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 var(--cc-rule);
  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);
}

/* ══════════════════════════════════════════════════════════════════════
 * v3：品牌 / 登录 / 模型面板 / 附件 / 主动送达 / 手机 tab
 * 设计语言：暖白 #FAF7F2、白会话、1px #E8E2D9、6px 圆角、赤陶只做信号色
 * ════════════════════════════════════════════════════════════════════ */

/* ── 品牌 ─────────────────────────────────────────────────────────── */

.cc-side-head { justify-content: space-between; }

.cc-brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  min-width: 0;
  color: var(--cc-ink);
  text-decoration: none;
}

.cc-brand-word {
  font-family: var(--cc-serif);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.cc-brand-t { color: var(--cc-terracotta); font-style: italic; }

.cc-brand-sub {
  font-family: var(--cc-sans);
  font-size: 12px;
  line-height: 1.2;
  color: var(--cc-ink-2);
}

.cc-brand--gate { align-items: flex-start; }
.cc-brand--gate .cc-brand-word { font-size: 30px; }

/* ── 交付标记 ─────────────────────────────────────────────────────── */

.cc-row-delivered {
  flex: none;
  margin-left: 2px;
  margin-right: auto;
  font-family: var(--cc-sans);
  font-size: 11px;
  line-height: 1.3;
  color: var(--cc-terracotta);
  white-space: nowrap;
}

/* ── 输入栏：左模型 / 右附件 ──────────────────────────────────────── */

.cc-composer { position: relative; }

.cc-model {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  max-width: 210px;
  height: 36px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: var(--cc-r);
  color: var(--cc-ink-2);
  font-family: var(--cc-sans);
  font-size: 12px;
  line-height: 1;
  transition: background 110ms var(--cc-ease), color 110ms var(--cc-ease);
}

.cc-model:hover { background: #FFFFFF; color: var(--cc-ink); }
.cc-model[aria-expanded="true"] { background: #FFFFFF; color: var(--cc-terracotta); }
.cc-model .cc-ico { width: 16px; height: 16px; }

.cc-model-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cc-bar .cc-plus {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: var(--cc-r);
  background: none;
  color: var(--cc-ink-2);
}

.cc-bar .cc-plus:hover { background: #FFFFFF; color: var(--cc-ink); }
.cc-bar .cc-plus[aria-expanded="true"] { color: var(--cc-terracotta); transform: none; }

.cc-bar textarea { font-family: var(--cc-serif); font-size: 15px; }

.cc-send { height: 36px; }

/* ── 模型面板 ─────────────────────────────────────────────────────── */

.cc-model-panel {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(100% - 4px);
  z-index: 25;
  max-width: 460px;
  padding: 10px 12px 8px;
  border: 1px solid var(--cc-rule);
  border-radius: var(--cc-r);
  background: #FFFFFF;
}

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

.cc-mp-label {
  font-family: var(--cc-sans);
  font-size: 11px;
  line-height: 1.4;
  color: var(--cc-ink-3);
  margin-top: 4px;
}

.cc-mp-row {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 6px 0 2px;
  scrollbar-width: none;
}

.cc-mp-row::-webkit-scrollbar { display: none; }

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

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

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

.cc-mp-chip--model { border-radius: var(--cc-r); }

.cc-mp-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--cc-rule-soft);
}

.cc-mp-hint {
  min-width: 0;
  font-family: var(--cc-sans);
  font-size: 11px;
  color: var(--cc-ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cc-mp-default {
  flex: none;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--cc-rule);
  border-radius: var(--cc-r);
  background: #FFFFFF;
  font-family: var(--cc-sans);
  font-size: 12px;
  color: var(--cc-ink);
}

.cc-mp-default:hover { border-color: var(--cc-terracotta); color: var(--cc-terracotta); }
.cc-mp-empty { padding: 6px 0; font-size: 12px; color: var(--cc-ink-3); }

/* ── 附件菜单 / 待发条 ────────────────────────────────────────────── */

.cc-attach {
  position: absolute;
  right: 12px;
  bottom: calc(100% - 4px);
  z-index: 25;
  display: flex;
  flex-direction: column;
  padding: 4px;
  border: 1px solid var(--cc-rule);
  border-radius: var(--cc-r);
  background: #FFFFFF;
}

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

.cc-attach-item {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px 0 10px;
  border-radius: var(--cc-r);
  font-family: var(--cc-sans);
  font-size: 13px;
  color: var(--cc-ink);
  white-space: nowrap;
}

.cc-attach-item:hover { background: #F7F3EC; }
.cc-attach-item .cc-ico { width: 17px; height: 17px; color: var(--cc-ink-2); }

.cc-staged {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 0 2px 8px;
}

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

.cc-stage {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  max-width: 200px;
  height: 42px;
  padding: 3px 4px 3px 3px;
  border: 1px solid var(--cc-rule);
  border-radius: var(--cc-r);
  background: #FFFFFF;
}

.cc-stage-thumb {
  width: 34px;
  height: 34px;
  border-radius: 4px;
  object-fit: cover;
}

.cc-stage .cc-ico { width: 20px; height: 20px; margin: 0 4px; color: var(--cc-ink-2); }

.cc-stage-name {
  min-width: 0;
  font-family: var(--cc-sans);
  font-size: 12px;
  color: var(--cc-ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cc-stage-x {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: var(--cc-r);
  color: var(--cc-ink-3);
}

.cc-stage-x:hover { background: #F2EDE5; color: var(--cc-ink); }
.cc-stage-x .cc-ico { width: 12px; height: 12px; margin: 0; }

/* ── 消息里的附件 ─────────────────────────────────────────────────── */

.cc-atts { margin-top: 6px; }

.cc-atts--img {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cc-att-img {
  display: block;
  width: 132px;
  height: 132px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--cc-rule);
  border-radius: var(--cc-r);
  background: var(--cc-panel);
}

.cc-att-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

.cc-atts--file {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cc-att-file {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  max-width: 260px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--cc-rule);
  border-radius: var(--cc-r);
  background: #FFFFFF;
  font-family: var(--cc-sans);
  font-size: 12px;
  color: var(--cc-ink-2);
}

.cc-att-file .cc-ico { width: 14px; height: 14px; }

.cc-att-file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cc-msg--me .cc-att-file { background: #FFFFFF; border-color: #EADACF; }

.cc-bubble--empty { color: var(--cc-ink-3); }

.cc-thread-err {
  margin: 20px auto;
  font-family: var(--cc-sans);
  font-size: 12px;
  color: var(--cc-terracotta);
  text-align: center;
}

/* ── 登录 / 启动失败 ─────────────────────────────────────────────── */

.cc-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--cc-bg);
}

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

.cc-gate-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(300px, 100%);
}

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

.cc-gate-note {
  margin-top: 10px;
  font-family: var(--cc-sans);
  font-size: 12px;
  color: var(--cc-ink-2);
}

.cc-gate-input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--cc-rule);
  border-radius: var(--cc-r);
  background: #FFFFFF;
  color: var(--cc-ink);
  font-family: var(--cc-sans);
  font-size: 16px;
  outline: none;
}

.cc-gate-input:focus { border-color: var(--cc-terracotta); }

.cc-gate-btn {
  height: 44px;
  border-radius: var(--cc-r);
  background: var(--cc-terracotta);
  color: #FFFFFF;
  font-family: var(--cc-sans);
  font-size: 15px;
}

.cc-gate-btn:hover { background: var(--cc-terracotta-deep); }
.cc-gate-btn:disabled { background: #DED8CE; }

.cc-gate-err {
  min-height: 18px;
  font-family: var(--cc-sans);
  font-size: 12px;
  line-height: 1.5;
  color: var(--cc-terracotta);
}

.cc-gate-retry {
  height: 44px;
  border: 1px solid var(--cc-rule);
  border-radius: var(--cc-r);
  background: #FFFFFF;
  font-family: var(--cc-sans);
  font-size: 14px;
  color: var(--cc-ink);
}

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

/* ── 图片放大 ─────────────────────────────────────────────────────── */

.cc-lightbox {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(30, 26, 22, 0.94);
}

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

.cc-lightbox img {
  max-width: 92vw;
  max-height: 86vh;
  object-fit: contain;
  border-radius: var(--cc-r);
}

.cc-lightbox-close {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top));
  right: 14px;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--cc-r);
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.12);
}

/* ── 任务台：派任务 ───────────────────────────────────────────────── */

.cc-lane-tools {
  display: flex;
  justify-content: flex-end;
  flex: none;
  padding: 8px 16px 0;
}

.cc-lane-new {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--cc-rule);
  border-radius: var(--cc-r);
  background: #FFFFFF;
  font-family: var(--cc-sans);
  font-size: 13px;
  color: var(--cc-ink);
}

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

.cc-lane-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 8px 16px 0;
  padding: 10px;
  border: 1px solid var(--cc-rule);
  border-radius: var(--cc-r);
  background: #FFFFFF;
}

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

.cc-lane-form textarea {
  width: 100%;
  padding: 8px 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.6;
  resize: none;
  outline: none;
}

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

.cc-lane-form-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.cc-btn-primary,
.cc-btn-quiet {
  height: 32px;
  padding: 0 14px;
  border-radius: var(--cc-r);
  font-family: var(--cc-sans);
  font-size: 13px;
}

.cc-btn-primary { background: var(--cc-terracotta); color: #FFFFFF; }
.cc-btn-primary:hover { background: var(--cc-terracotta-deep); }

.cc-btn-quiet { border: 1px solid var(--cc-rule); background: #FFFFFF; color: var(--cc-ink-2); }
.cc-btn-quiet:hover { border-color: var(--cc-ink-3); color: var(--cc-ink); }

/* ── 手机 tab（桌面隐藏） ─────────────────────────────────────────── */

.cc-tabs { display: none; }

/* ══════════════════════════════════════════════════════════════════════
 * 手机端：像手机微信，不是把桌面压窄
 * ════════════════════════════════════════════════════════════════════ */

@media (max-width: 767px) {
  .cc-app { height: var(--cc-vh, 100dvh); }

  .cc-side { padding-bottom: calc(52px + env(safe-area-inset-bottom)); }

  .cc-tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: flex;
    height: calc(52px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid var(--cc-rule);
    background: #FFFFFF;
  }

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

  .cc-tab {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 52px;
    font-family: var(--cc-sans);
    font-size: 11px;
    color: var(--cc-ink-3);
  }

  .cc-tab.is-on { color: var(--cc-terracotta); }
  .cc-tab .cc-ico { width: 20px; height: 20px; }

  .cc-chat-head { height: 48px; }
  .cc-chat-name { font-size: 15px; }
  .cc-chat-status { display: none; }

  .cc-back { min-height: 44px; }
  .cc-back-label { font-size: 15px; }

  .cc-back-count {
    display: inline-grid;
    place-items: center;
    min-width: 18px;
    height: 18px;
    margin-left: 4px;
    padding: 0 5px;
    border-radius: var(--cc-r-pill);
    background: var(--cc-terracotta);
    color: #FFFFFF;
    font-family: var(--cc-sans);
    font-size: 11px;
    font-weight: 500;
  }

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

  .cc-row { grid-template-columns: 48px minmax(0, 1fr); height: 64px; gap: 12px; }
  .cc-row .cc-ava { width: 48px; height: 48px; font-size: 18px; }
  .cc-row-name { font-size: 16px; }
  .cc-badge { min-width: 18px; height: 18px; font-size: 11px; }

  .cc-msg-body { max-width: 78%; }
  .cc-ava--msg { width: 36px; height: 36px; font-size: 14px; }
  .cc-bubble { max-width: 100%; }

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

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

  .cc-model {
    max-width: 128px;
    height: 44px;
    padding: 0 6px;
  }

  .cc-model-label { font-size: 11px; }

  .cc-bar textarea {
    min-height: 40px;
    max-height: 108px;
    font-size: 16px; /* 防止 iOS 聚焦缩放 */
  }

  .cc-bar .cc-plus {
    width: 44px;
    height: 44px;
  }

  .cc-send { height: 40px; min-width: 56px; }

  .cc-model-panel,
  .cc-attach {
    left: 8px;
    right: 8px;
    bottom: calc(100% - 2px);
    max-width: none;
  }

  .cc-attach { left: auto; min-width: 148px; }
  .cc-attach-item { height: 44px; }

  .cc-mp-chip { height: 32px; }
  .cc-mp-default { height: 32px; }

  .cc-att-img { width: 148px; height: 148px; }

  .cc-lane-tools { padding: 8px 12px 0; }
  .cc-lane-form { margin: 8px 12px 0; }

  .cc-lane-new,
  .cc-btn-primary,
  .cc-btn-quiet { height: 40px; }

  .cc-lane-body { padding-bottom: calc(52px + env(safe-area-inset-bottom)); }

  .cc-info { padding-bottom: env(safe-area-inset-bottom); }

  .cc-lightbox { padding: 16px; }
  .cc-lightbox img { max-width: 96vw; max-height: 82vh; }
}

/* ── 附件缩略图（微信式 60×60 + 文件名小条） ──────────────────────── */

.cc-status {
  padding: 0 2px 6px;
  font-family: var(--cc-sans);
  font-size: 12px;
  line-height: 1.5;
  color: var(--cc-ink-2);
}

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

.cc-atts {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
  margin-top: 6px;
}

.cc-att {
  display: block;
  width: 76px;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
}

.cc-att-thumb {
  display: block;
  width: 60px;
  height: 60px;
  object-fit: cover;
  border: 1px solid var(--cc-rule);
  border-radius: var(--cc-r);
  background: var(--cc-panel);
}

.cc-att-name {
  display: block;
  margin-top: 3px;
  font-family: var(--cc-sans);
  font-size: 11px;
  line-height: 1.3;
  color: var(--cc-ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cc-msg--me .cc-att-thumb { border-color: #E4D5C9; }

/* ── 手机端触控与长按 ─────────────────────────────────────────────── */

@media (max-width: 767px) {
  .cc-icon-btn { width: 44px; height: 44px; }
  .cc-send { height: 44px; min-width: 58px; }
  .cc-row,
  .cc-tab,
  .cc-icon-btn,
  .cc-model,
  .cc-plus,
  .cc-send { -webkit-touch-callout: none; }

  .cc-bubble,
  .cc-att-name { -webkit-user-select: text; user-select: text; }

  .cc-atts { gap: 6px; }
}

html, body { max-width: 100%; overflow-x: hidden; }

/* 手机单栏：只留一栏占满，避免两行 grid 把高度分掉 */
@media (max-width: 767px) {
  .cc-app[data-pane="roster"] .cc-main { display: none; }
  .cc-app[data-pane="thread"] .cc-side { display: none; }
  .cc-side { height: 100%; }
  .cc-main { height: 100%; }
}
