/* ============================ 消息操作条（对齐 Trae） ============================
   Trae 在每条消息下面放一行：时间 + 一排小图标（复制/转发/删除/撤回）。
   这里照做，并且：
     · 平时图标淡一点，鼠标移到消息上才明显（不抢视线）
     · 复制成功图标闪一下绿色
     · 长消息先折叠成 8 行，「展示更多」展开
   ========================================================================= */

.msg-meta {
  display: flex; align-items: center; gap: var(--sp-2);
  flex-wrap: wrap;
}

.msg-acts {
  display: inline-flex; align-items: center; gap: 1px;
  margin-left: 2px;
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-out);
}
.msg:hover .msg-acts,
.msg-acts:focus-within { opacity: 1; }

.msg-act {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; padding: 0;
  border: 0; border-radius: 4px; background: transparent;
  color: var(--fg-3); cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.msg-act:hover { background: var(--sunken); color: var(--fg); }
.msg-act.ok { color: var(--accent); background: var(--accent-dim); }
.msg-act .icon { width: 14px; height: 14px; }

/* 长消息折叠 */
.bubble.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 8;
  -webkit-box-orient: vertical;
  overflow: hidden;
  position: relative;
}
.msg-more {
  align-self: flex-start;
  margin-top: 2px; padding: 2px 4px;
  border: 0; background: transparent; cursor: pointer;
  font: inherit; font-size: 0.75rem; color: var(--accent);
}
.msg-more:hover { text-decoration: underline; }

/* ============================ 转发选择器 ============================ */
.fwd-item {
  display: flex; align-items: center; gap: var(--sp-2);
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface); cursor: pointer;
  font: inherit; text-align: left; margin-bottom: 6px;
  transition: border-color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
}
.fwd-item:hover { border-color: var(--accent-line); background: var(--accent-dim); }
.fwd-item .fi-name { flex: 1; font-size: 0.8125rem; color: var(--fg); }
.fwd-item .fi-meta { font-size: 0.75rem; color: var(--fg-3); }

/* ============================ 发送队列 ============================ */
.composer-queue {
  margin-bottom: 8px;
  padding: 8px 10px;
  border: 1px dashed var(--border-hi);
  border-radius: var(--r-md);
  background: var(--sunken);
}
.composer-queue[hidden] { display: none; }

.cq-head {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.75rem; color: var(--fg-2); font-weight: 600;
  padding-bottom: 6px;
}
.cq-head .icon { width: 13px; height: 13px; color: var(--fg-3); }
.cq-head .spacer { flex: 1; }
.cq-tip { font-weight: 400; color: var(--fg-3); font-size: 0.6875rem; }

.cq-item {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 6px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--border);
  margin-top: 4px;
}
.cq-idx {
  flex: 0 0 auto; width: 18px; height: 18px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.6875rem; background: var(--accent-dim); color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.cq-text {
  flex: 1; min-width: 0; font-size: 0.75rem; color: var(--fg-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cq-edit {
  flex: 1; min-width: 0; height: 26px; padding: 0 8px;
  font-size: 0.75rem; border-radius: 4px;
  border: 1px solid var(--accent-line); background: var(--surface);
}
.cq-acts { display: inline-flex; gap: 1px; flex: 0 0 auto; }

/* 回复进行中：按钮不置灰（还要能继续发、进队列），只做个忙态提示 */
.composer-send.busy { opacity: 0.82; }
.composer-send.busy::after {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; margin-left: 2px;
  animation: sendPulse 1.1s ease-in-out infinite;
}
@keyframes sendPulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
/* ---- 任务派发规则（群设置页） ---- */
.disp-step {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 0; border-top: 1px solid var(--border);
}
.disp-step:first-of-type { border-top: 0; }
.disp-idx {
  flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.6875rem; font-weight: 600;
  background: var(--accent-dim); color: var(--accent);
}
.disp-txt { font-size: 0.8125rem; line-height: 1.75; color: var(--fg-2); }
/* ============================ 电商业务线 ============================ */
.ecom-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}
.ecom-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 12px 16px;
}
.ecom-card-label {
  font-size: 0.75rem;
  color: var(--fg-3);
  margin-bottom: 6px;
}
.ecom-card-main {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -0.02em;
}
.ecom-card-sub {
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--fg-3);
  line-height: 1.5;
}
.ecom-card-sub strong { color: var(--fg-2); font-weight: 600; }

.ecom-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: var(--sp-3);
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}
.ecom-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--fg-2);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out);
}
.ecom-tab:hover { background: var(--sunken); }
.ecom-tab.active { background: var(--accent-dim); color: var(--accent); font-weight: 600; }

.ecom-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}
.ecom-table th {
  text-align: left;
  font-weight: 500;
  font-size: 0.75rem;
  color: var(--fg-3);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.ecom-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--fg-2);
  vertical-align: middle;
}
.ecom-table tr:last-child td { border-bottom: 0; }
.ecom-table td.num, .ecom-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.ecom-table td strong { color: var(--fg); font-weight: 500; }

.ecom-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.ecom-field { display: flex; flex-direction: column; gap: 4px; }
.ecom-field span { font-size: 0.75rem; color: var(--fg-3); }
.ecom-field input {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--raised);
  color: var(--fg);
  font-size: 0.8125rem;
  outline: none;
}
.ecom-field input:focus { border-color: var(--accent-line); }

.pill-bad { background: #fdf4e3; color: #b3261e; border-color: #e7e5de; }
.pill-warn { background: #fdf4e3; color: #8a5a00; border-color: #e7e5de; }
/* ============================ 对话：角色分组选择 ============================ */
.role-tabs {
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: flex-start;
}
.role-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.role-group-name {
  font-size: 0.6875rem;
  color: var(--fg-3);
  white-space: nowrap;
  padding-right: 2px;
}
.role-group-name::after {
  content: '';
  display: inline-block;
  width: 1px;
  height: 11px;
  background: var(--border);
  margin-left: 8px;
  vertical-align: -2px;
}

/* 同事咨询标记：让人一眼看出这句话是问过同事才给的 */
.msg-consult {
  margin-left: 8px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 0.6875rem;
  font-weight: 500;
  cursor: help;
}

/* ============================ 自治计划 ============================ */
.plan-progress { margin-bottom: 12px; }
.plan-bar {
  height: 6px; border-radius: 999px; background: var(--sunken);
  overflow: hidden; margin-bottom: 6px;
}
.plan-bar-in { height: 100%; background: var(--accent); border-radius: 999px; transition: width var(--dur-slow) var(--ease-out); }
.plan-list { display: flex; flex-direction: column; gap: 2px; }
.plan-item {
  display: flex; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm);
  align-items: flex-start;
}
.plan-item.current { background: var(--accent-dim); }
.plan-dot {
  flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%;
  background: var(--border-hi); margin-top: 6px;
}
.plan-item.done .plan-dot { background: var(--accent); }
.plan-item.blocked .plan-dot { background: #b3261e; }
.plan-item.current .plan-dot { background: var(--accent); box-shadow: var(--ring-line); }
.plan-txt { flex: 1; min-width: 0; }
.plan-title { font-size: 0.8125rem; color: var(--fg); font-weight: 500; }
.plan-item.done .plan-title { color: var(--fg-3); text-decoration: line-through; }
.plan-ac { font-size: 0.6875rem; color: var(--fg-3); line-height: 1.6; margin-top: 2px; }
.plan-gate {
  margin-left: 6px; padding: 1px 6px; border-radius: 999px;
  background: #fdf4e3; color: #8a5a00; font-size: 0.6875rem; font-weight: 500;
}

/* ============================ 通知中心 ============================ */
.notify-panel {
  position: fixed;
  top: calc(var(--topbar-h) + 6px);
  right: 16px;
  width: 360px;
  max-height: 60vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  z-index: 90;
}
.notify-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  font-size: 0.8125rem; font-weight: 600; color: var(--fg);
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.notify-list { padding: 4px 0; }
.notify-item { padding: 10px 12px; border-left: 3px solid transparent; }
.notify-item.unread { background: var(--accent-dim); border-left-color: var(--accent); }
.notify-item.s-action { border-left-color: #2f7d5d; }
.notify-item.s-warn { border-left-color: #b45309; }
.notify-title { font-size: 0.8125rem; font-weight: 500; color: var(--fg); }
.notify-body { font-size: 0.75rem; color: var(--fg-2); line-height: 1.6; margin-top: 3px; white-space: pre-wrap; }
.notify-meta { font-size: 0.6875rem; color: var(--fg-3); margin-top: 4px; }
.notify-empty { padding: 24px 12px; text-align: center; color: var(--fg-3); font-size: 0.75rem; }

.notice-flash {
  position: fixed; right: 16px; bottom: 16px; z-index: 120;
  max-width: 340px; padding: 12px 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.8125rem; color: var(--fg);
  transition: opacity var(--dur-slow), transform var(--dur-slow);
}
.notice-flash.s-warn { border-left-color: #b45309; }
.notice-flash.s-action { border-left-color: #b3261e; }
.notice-flash div { font-size: 0.75rem; color: var(--fg-2); margin-top: 3px; line-height: 1.6; }
.notice-flash.out { opacity: 0; transform: translateY(8px); }
