/* ===== Cloud edit panel (A 状态 + B 进度 + G 权限) ===== */

.ce-section { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border, #e8eaef); }
[data-theme="dark"] .ce-section { border-top-color: rgba(255,255,255,0.08); }

.ce-section-h {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; font-weight: 600;
  color: var(--text-mute, #5f6168);
  margin-bottom: 10px;
  letter-spacing: 0.3px;
}
.ce-section-h .ce-sub { font-weight: 400; font-size: 11px; opacity: 0.7; }
.ce-lock { font-weight: 400; font-size: 11px; color: #a0a4ad; }

/* status buttons */
.ce-status-row { display: flex; gap: 6px; flex-wrap: wrap; }
.ce-st {
  padding: 6px 14px;
  border-radius: 16px;
  border: 1.5px solid var(--border, #e0e3e8);
  background: transparent;
  color: var(--text-mute, #5f6168);
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s;
}
[data-theme="dark"] .ce-st { border-color: rgba(255,255,255,0.12); color: #8a92a6; }
.ce-st:hover:not(:disabled) { border-color: #06b6d4; color: #06b6d4; }
.ce-st:disabled { opacity: 0.45; cursor: not-allowed; }
.ce-st.on { background: #06b6d4; border-color: #06b6d4; color: #fff; font-weight: 500; }
.ce-st.st-blocked.on { background: #dc4d4d; border-color: #dc4d4d; }
.ce-st.st-paused.on  { background: #8a8e95; border-color: #8a8e95; }
.ce-st.st-done.on    { background: #2d8a4e; border-color: #2d8a4e; }
/* 非彭韬看到的暂缓/完成按钮:加锁样式 */
.ce-st.boss-locked:not(.on) {
  border-style: dashed;
  background: repeating-linear-gradient(45deg,
    rgba(138,142,149,0.05) 0,
    rgba(138,142,149,0.05) 4px,
    transparent 4px,
    transparent 8px);
  color: #a0a4ad;
}
.ce-st.boss-locked:not(.on):hover { border-color: var(--border, #e0e3e8); color: #a0a4ad; }

/* 老板:负责人下拉(转交任务) */
.ce-owner-sel {
  margin-left: 4px;
  padding: 3px 8px;
  border: 1.5px solid var(--border, #e0e3e8);
  border-radius: 6px;
  background: var(--bg, #fff);
  color: var(--text, #1a1f2e);
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  outline: none;
}
[data-theme="dark"] .ce-owner-sel {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.12);
  color: #e8eaf0;
}
.ce-owner-sel:hover, .ce-owner-sel:focus { border-color: #06b6d4; }
.ce-hint-inline { font-size: 11px; color: #a0a4ad; margin-left: 6px; }

/* 已完成任务的撤回横幅(仅彭韬可见) */
.ce-revoke-bar {
  margin-top: 10px;
  padding: 8px 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: rgba(45,138,78,0.08);
  border: 1px solid rgba(45,138,78,0.25);
  border-radius: 6px;
  font-size: 12.5px;
  color: #2d8a4e;
}
.ce-revoke-btn {
  padding: 5px 12px;
  background: transparent;
  border: 1.5px solid #2d8a4e;
  border-radius: 5px;
  color: #2d8a4e;
  font-size: 12px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.ce-revoke-btn:hover:not(:disabled) { background: #2d8a4e; color: #fff; }
.ce-revoke-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* 日志类型:转交 / 撤回 / 协助 */
.ce-log-transfer { border-left: 3px solid #f59e0b; }
.ce-log-revoke   { border-left: 3px solid #2d8a4e; }
.ce-log-assists  { border-left: 3px solid #7e3aa8; }
.ce-kind-tag.ce-kind-transfer { background: rgba(245,158,11,0.15); color: #f59e0b; }
.ce-kind-tag.ce-kind-revoke   { background: rgba(45,138,78,0.15);  color: #2d8a4e; }
.ce-kind-tag.ce-kind-assists  { background: rgba(126,58,168,0.15); color: #7e3aa8; }
.ce-log-edit     { border-left: 3px solid #1f6feb; }
.ce-kind-tag.ce-kind-edit     { background: rgba(31,111,235,0.15); color: #1f6feb; }
.ce-log-delete   { border-left: 3px solid #dc4d4d; }
.ce-kind-tag.ce-kind-delete   { background: rgba(220,77,77,0.15); color: #dc4d4d; }

/* ===== 危险区:删除任务(仅彭韬可见)===== */
.ce-danger-zone {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px dashed rgba(220,77,77,0.3);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.ce-delete-btn {
  padding: 6px 14px;
  border: 1px solid rgba(220,77,77,0.4);
  border-radius: 6px;
  background: transparent;
  color: #dc4d4d;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}
.ce-delete-btn:hover:not(:disabled) {
  background: #dc4d4d; color: #fff; border-color: #dc4d4d;
}
.ce-delete-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.ce-danger-hint { font-size: 11px; color: var(--text-mute, #9094a0); }
[data-theme="dark"] .ce-danger-hint { color: #6a7180; }

/* ===== @提及 chip ===== */
.ce-mention {
  display: inline-block;
  padding: 0 4px;
  margin: 0 1px;
  border-radius: 3px;
  background: rgba(31,111,235,0.10);
  color: #1f6feb;
  font-weight: 500;
  font-size: 0.95em;
}
[data-theme="dark"] .ce-mention { background: rgba(31,111,235,0.18); color: #5fa1ff; }
.ce-mention-me {
  background: rgba(245,158,11,0.18);
  color: #b8741b;
  font-weight: 600;
}
[data-theme="dark"] .ce-mention-me { background: rgba(245,158,11,0.25); color: #f5b942; }

/* =============================================================
   任务弹窗手机端优化
   ============================================================= */
@media (max-width: 720px) {
  .ce-section { margin-top: 14px; padding-top: 10px; }
  .ce-section-h { font-size: 11.5px; margin-bottom: 8px; }

  /* 状态按钮:更紧的 padding */
  .ce-status-row { gap: 4px; }
  .ce-st { padding: 6px 10px; font-size: 11.5px; }

  /* 撤回完成横幅 */
  .ce-revoke-bar {
    flex-direction: column; align-items: stretch; gap: 8px;
    padding: 10px;
  }
  .ce-revoke-btn { width: 100%; padding: 8px; font-size: 12px; }

  /* 进度日志输入区:垂直堆叠 */
  .ce-input { flex-direction: column; gap: 8px; }
  .ce-input .btn-primary { width: 100%; padding: 10px; font-size: 13px; }
  .ce-input textarea { min-height: 56px; font-size: 13px; }

  /* 日志列表 */
  .ce-log-list { max-height: 50vh; }
  .ce-log { padding: 7px 8px; }

  /* 编辑信息面板 */
  .ce-edit-row { flex-direction: column; gap: 8px; }
  .ce-edit-half { flex: none; width: 100%; }
  .ce-edit-form input, .ce-edit-form select, .ce-edit-form textarea {
    padding: 9px 10px; font-size: 13.5px;
  }
  .ce-edit-actions { flex-direction: row-reverse; }
  .ce-edit-actions .btn-primary,
  .ce-edit-actions .btn-secondary { flex: 1; padding: 9px; }
  .btn-secondary { padding: 9px; }

  /* 负责人下拉 */
  .ce-owner-sel { font-size: 12px; padding: 4px 8px; max-width: 140px; }
  .ce-hint-inline { display: none; }

  /* 协助人 chip */
  .ce-assist-chip { font-size: 11.5px; padding: 3px 4px 3px 3px; }
  .ce-assist-name { font-size: 11.5px; }
  .ce-assist-add { font-size: 11.5px; padding: 4px 8px; }

  /* 危险区(删除任务):全宽按钮 */
  .ce-danger-zone {
    flex-direction: column; align-items: stretch; gap: 6px;
    margin-top: 18px;
  }
  .ce-delete-btn { width: 100%; padding: 9px; font-size: 12px; }
  .ce-danger-hint { text-align: center; font-size: 10.5px; }
}

/* ===== 编辑任务信息面板 ===== */
.ce-edit-trigger { padding: 8px 0; }
.ce-edit-btn {
  width: 100%;
  padding: 9px 14px;
  border: 1px dashed var(--border, #e0e3e8);
  border-radius: 6px;
  background: transparent;
  color: var(--text-mute, #5f6168);
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: all 0.12s;
}
[data-theme="dark"] .ce-edit-btn { border-color: rgba(255,255,255,0.15); color: #8a92a6; }
.ce-edit-btn:hover:not(:disabled) {
  border-style: solid;
  border-color: #1f6feb;
  color: #1f6feb;
  background: rgba(31,111,235,0.04);
}
.ce-edit-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.ce-edit-form { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.ce-edit-row  { display: flex; gap: 10px; }
.ce-edit-half { flex: 1; }
.ce-edit-field { display: flex; flex-direction: column; gap: 4px; }
.ce-edit-lbl { font-size: 11.5px; font-weight: 600; color: var(--text-mute, #5f6168); letter-spacing: 0.3px; }
[data-theme="dark"] .ce-edit-lbl { color: #8a92a6; }
.ce-edit-form input, .ce-edit-form select, .ce-edit-form textarea {
  padding: 7px 10px;
  border: 1.5px solid var(--border, #e0e3e8);
  border-radius: 5px;
  font-size: 13px;
  font-family: inherit;
  background: var(--bg, #fff);
  color: var(--text, #1a1f2e);
  outline: none;
}
[data-theme="dark"] .ce-edit-form input,
[data-theme="dark"] .ce-edit-form select,
[data-theme="dark"] .ce-edit-form textarea {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.12);
  color: #e8eaf0;
}
.ce-edit-form input:focus, .ce-edit-form select:focus, .ce-edit-form textarea:focus {
  border-color: #1f6feb;
}
.ce-edit-actions {
  display: flex; justify-content: flex-end; gap: 8px;
  margin-top: 4px;
}

/* 老板:协助人编辑器 chip + 添加下拉 */
.ce-assist-chip {
  display: inline-flex; align-items: center; gap: 4px;
  margin: 0 4px 4px 0;
  padding: 2px 4px 2px 2px;
  border: 1px solid var(--border, #e0e3e8);
  border-radius: 12px;
  background: rgba(126,58,168,0.06);
}
[data-theme="dark"] .ce-assist-chip { border-color: rgba(255,255,255,0.12); background: rgba(126,58,168,0.12); }
.ce-assist-name { font-size: 12px; color: var(--text, #1a1f2e); }
[data-theme="dark"] .ce-assist-name { color: #e8eaf0; }
.ce-assist-x {
  width: 18px; height: 18px;
  padding: 0; margin-left: 2px;
  border: none; border-radius: 50%;
  background: transparent;
  color: #a0a4ad;
  font-size: 14px; line-height: 1;
  cursor: pointer;
  font-family: inherit;
}
.ce-assist-x:hover:not(:disabled) { background: #dc4d4d; color: #fff; }
.ce-assist-x:disabled { opacity: 0.4; cursor: not-allowed; }
.ce-assist-add {
  margin-left: 4px;
  padding: 3px 6px;
  border: 1px dashed var(--border, #e0e3e8);
  border-radius: 12px;
  background: transparent;
  color: var(--text-mute, #5f6168);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  outline: none;
}
[data-theme="dark"] .ce-assist-add { border-color: rgba(255,255,255,0.18); color: #8a92a6; background: rgba(255,255,255,0.02); }
.ce-assist-add:hover, .ce-assist-add:focus { border-color: #7e3aa8; color: #7e3aa8; border-style: solid; }

/* progress input */
.ce-input { display: flex; gap: 8px; margin-bottom: 12px; }
.ce-input textarea {
  flex: 1;
  padding: 8px 12px;
  border: 1.5px solid var(--border, #e0e3e8);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  background: var(--bg, #fff);
  color: var(--text, #1a1f2e);
  resize: vertical;
  outline: none;
  min-height: 38px;
}
[data-theme="dark"] .ce-input textarea {
  background: rgba(255,255,255,0.03);
  border-color: rgba(255,255,255,0.12);
  color: #e8eaf0;
}
.ce-input textarea:focus { border-color: #06b6d4; }
.ce-input .btn-primary { align-self: stretch; padding: 0 18px; white-space: nowrap; }

.ce-err {
  margin-bottom: 10px;
  padding: 8px 12px;
  background: rgba(220,77,77,0.1);
  border-left: 3px solid #dc4d4d;
  color: #dc4d4d;
  font-size: 12px;
  border-radius: 3px;
}

/* log list */
.ce-log-list { display: flex; flex-direction: column; gap: 10px; max-height: 340px; overflow: auto; padding-right: 4px; }
.ce-log { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 6px; background: var(--bg-soft, #f7f8fa); }
[data-theme="dark"] .ce-log { background: rgba(255,255,255,0.03); }
.ce-log-status { border-left: 3px solid #06b6d4; }
.ce-log-create { border-left: 3px solid #8a8e95; opacity: 0.7; }

.ce-log-head { display: flex; align-items: center; gap: 8px; font-size: 12px; margin-bottom: 3px; }
.ce-log-head b { color: var(--text, #1a1f2e); font-weight: 600; }
[data-theme="dark"] .ce-log-head b { color: #e8eaf0; }
.ce-log-at { color: var(--text-mute, #9094a0); font-size: 11px; }
.ce-kind-tag {
  font-size: 10px; padding: 1px 6px; border-radius: 3px;
  background: rgba(6,182,212,0.15); color: #06b6d4; font-weight: 500;
}
.ce-log-create .ce-kind-tag { background: rgba(138,142,149,0.18); color: #8a8e95; }
.ce-log-text { font-size: 13px; line-height: 1.55; color: var(--text, #1a1f2e); white-space: pre-wrap; word-break: break-word; }
[data-theme="dark"] .ce-log-text { color: #c8d0e0; }
.ce-log-text b { color: #06b6d4; }

/* ===== C. 新建任务 ===== */
.cw-fab {
  position: fixed; right: 24px; bottom: 24px;
  display: flex; align-items: center; gap: 6px;
  padding: 12px 20px;
  background: #06b6d4; color: #0a0e1a;
  border: none; border-radius: 28px;
  font-size: 14px; font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(6,182,212,0.4);
  z-index: 100;
  transition: transform 0.12s, box-shadow 0.12s;
}
.cw-fab:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(6,182,212,0.5); }
.cw-fab > span:first-child { font-size: 20px; line-height: 1; }
.cw-fab-lbl { font-size: 13px; }
.cw-fab-member {
  bottom: 82px;
  background: #f5b942;
  color: #111827;
  box-shadow: 0 6px 24px rgba(245,185,66,0.34);
}
.cw-fab-member:hover { box-shadow: 0 10px 30px rgba(245,185,66,0.45); }

.cw-new-modal { max-width: 480px; }
.cw-member-modal { max-width: 540px; }
.cw-new-form { display: flex; flex-direction: column; gap: 14px; padding-top: 6px; }
.cw-new-form label { display: flex; flex-direction: column; gap: 5px; }
.cw-new-row { display: flex; gap: 12px; }
.cw-half { flex: 1; }
.cw-lbl { font-size: 12px; font-weight: 600; color: var(--text-mute, #5f6168); letter-spacing: 0.3px; }
[data-theme="dark"] .cw-lbl { color: #8a92a6; }
.cw-hint { font-size: 11px; color: #a0a4ad; margin-top: 2px; }

.cw-new-form input, .cw-new-form select, .cw-new-form textarea {
  padding: 8px 12px;
  border: 1.5px solid var(--border, #e0e3e8);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  background: var(--bg, #fff);
  color: var(--text, #1a1f2e);
  outline: none;
}
[data-theme="dark"] .cw-new-form input,
[data-theme="dark"] .cw-new-form select,
[data-theme="dark"] .cw-new-form textarea {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.12);
  color: #e8eaf0;
}
.cw-new-form input:focus, .cw-new-form select:focus, .cw-new-form textarea:focus {
  border-color: #06b6d4;
}
.cw-color-row {
  min-height: 35px;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.cw-color-swatch {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.38);
}
.cw-color-swatch.on {
  border-color: #fff;
  box-shadow: 0 0 0 2px #06b6d4, inset 0 0 0 1px rgba(255,255,255,0.5);
}
.cw-color-row input[type="color"] {
  width: 34px;
  height: 28px;
  padding: 2px;
  border-radius: 6px;
}

.cw-new-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.btn-secondary {
  padding: 8px 18px;
  background: transparent;
  border: 1.5px solid var(--border, #e0e3e8);
  color: var(--text-mute, #5f6168);
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}
[data-theme="dark"] .btn-secondary { border-color: rgba(255,255,255,0.12); color: #8a92a6; }
.btn-secondary:hover { border-color: #06b6d4; color: #06b6d4; }

@media (max-width: 480px) {
  .cw-fab { right: 14px; bottom: 14px; padding: 10px 14px; }
  .cw-fab-member { bottom: 68px; }
  .cw-fab-lbl { display: none; }
  .cw-fab > span:first-child { font-size: 24px; }
  .cw-member-modal { max-width: 100%; }
  .cw-color-row { gap: 6px; }
}
