/*
 * MatterDetailPanel — 严格对齐原型 v19
 */

/* ─── Main container ─────────────────────────────────── */
.wk-mp-main {
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  background: var(--wk-bg-surface, #fff);
  /* container query: 子元素根据自身宽度响应式布局 */
  container-type: inline-size;
  container-name: wk-mp-main;
}

.wk-mp-main__inner {
  padding: 16px 24px 24px;
}

.wk-mp-main__empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--wk-text-tertiary, #71717a);
  font-size: 13px;
}

/* ─── Header ─────────────────────────────────────────── */
.wk-mp-header {
  padding-bottom: 4px;
}

.wk-mp-header__row1 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.wk-mp-header__id {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  color: var(--wk-text-tertiary, #71717a);
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--wk-bg-elevated, #f4f4f5);
}

.wk-mp-header__ddl {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--wk-text-secondary, #52525b);
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--wk-bg-elevated, #fafafa);
  border: 1px solid var(--wk-border-default, #e4e4e7);
}

.wk-mp-header__ddl svg {
  color: var(--wk-text-tertiary, #71717a);
}

.wk-mp-header__ddl-label {
  color: var(--wk-text-tertiary, #71717a);
}

.wk-mp-header__ddl-value {
  font-weight: 500;
  color: var(--wk-text-primary, #18181b);
}

.wk-mp-header__ddl--editable {
  cursor: pointer;
  position: relative;
  transition: background 0.15s;
}

.wk-mp-header__ddl--editable:hover {
  background: var(--wk-fill-hover, rgba(0, 0, 0, 0.06));
}

.wk-mp-header__ddl-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.wk-mp-header__date-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.wk-mp-header__action {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--wk-text-tertiary, #71717a);
  padding: 4px 8px;
  border-radius: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all 0.12s;
}

.wk-mp-header__action:hover {
  color: var(--wk-text-primary, #18181b);
  background: var(--wk-bg-hover, #f4f4f5);
}

.wk-mp-header__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--wk-text-tertiary, #a1a1aa);
  cursor: pointer;
  transition: all 0.12s;
}

.wk-mp-header__close:hover {
  color: var(--wk-text-primary, #18181b);
  background: var(--wk-bg-hover, #f4f4f5);
}

.wk-mp-header__title {
  font-size: 24px;
  font-weight: 600;
  color: var(--wk-text-primary, #18181b);
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0;
}

.wk-mp-header__title--clickable {
  cursor: text;
  border-radius: 4px;
  padding: 2px 4px;
  margin: -2px -4px;
  transition: background 0.15s;
}

.wk-mp-header__title--clickable:hover {
  background: var(--wk-fill-hover, rgba(0, 0, 0, 0.04));
}

input.wk-mp-header__title--editing {
  display: block;
  width: 100%;
  font-size: 24px;
  font-weight: 600;
  color: var(--wk-text-primary, #18181b);
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0;
  padding: 2px 4px;
  border: 1px solid var(--wk-primary, #6366f1);
  border-radius: 4px;
  outline: none;
  background: var(--wk-bg-primary, #fff);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

/* ─── Status Pill ────────────────────────────────────── */
.wk-mp-status-wrap {
  position: relative;
  display: inline-block;
}

.wk-mp-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  background: none;
  transition: opacity 0.12s;
}

.wk-mp-pill:hover {
  opacity: 0.85;
}

.wk-mp-pill__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.wk-mp-pill--active {
  background: var(--wk-color-info-bg, #eff6ff);
  color: var(--wk-color-info, #1d4ed8);
  border-color: rgba(37, 99, 235, 0.15);
}

.wk-mp-pill--done {
  background: var(--wk-color-success-bg, #f0fdf4);
  color: var(--wk-color-success, #15803d);
  border-color: rgba(22, 163, 74, 0.15);
}

.wk-mp-pill--archived {
  background: #f4f4f5;
  color: var(--wk-text-secondary, #52525b);
  border-color: var(--wk-border-default, #e4e4e7);
}

.wk-mp-status-dropdown {
  position: absolute;
  z-index: 50;
  top: calc(100% + 4px);
  left: 0;
  min-width: 140px;
  background: var(--wk-bg-surface, #fff);
  border: 1px solid var(--wk-border-default, #e4e4e7);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 4px;
}

.wk-mp-status-dropdown__item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 5px;
  font-size: 12px;
  border: none;
  background: transparent;
  color: var(--wk-text-primary, #18181b);
  cursor: pointer;
  transition: background 0.1s;
}

.wk-mp-status-dropdown__item:hover {
  background: var(--wk-bg-hover, #f4f4f5);
}

.wk-mp-status-dropdown__item.is-active {
  font-weight: 600;
}

/* ─── 主要目标 (紫色左条) ─────────────────────────────── */
.wk-mp-goal {
  margin-top: 16px;
  padding: 12px 16px;
  border-left: 3px solid var(--wk-color-accent);
  background: var(--wk-purple-alpha-04);
  border-radius: 0 6px 6px 0;
}

.wk-mp-goal__label {
  font-size: 11px;
  font-weight: 600;
  color: var(--wk-color-accent-hover);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}

.wk-mp-goal__text {
  font-size: 16px;
  font-weight: 500;
  color: var(--wk-text-primary, #18181b);
  line-height: 1.5;
}

.wk-mp-goal__text--clickable {
  cursor: text;
  border-radius: 4px;
  padding: 4px 6px;
  margin: -4px -6px;
  transition: background 0.15s;
  white-space: pre-wrap;
}

.wk-mp-goal__text--clickable:hover {
  background: var(--wk-fill-hover, rgba(0, 0, 0, 0.04));
}

.wk-mp-goal__placeholder {
  color: var(--wk-text-tertiary, #a1a1aa);
  font-weight: 400;
}

textarea.wk-mp-goal__text--editing {
  display: block;
  width: 100%;
  font-size: 16px;
  font-weight: 500;
  color: var(--wk-text-primary, #18181b);
  line-height: 1.5;
  padding: 4px 6px;
  border: 1px solid var(--wk-primary, #6366f1);
  border-radius: 4px;
  outline: none;
  background: var(--wk-bg-primary, #fff);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
  resize: none;
  overflow: hidden;
  font-family: inherit;
}

.wk-mp-goal__source {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--wk-text-tertiary, #71717a);
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.12s;
}

.wk-mp-goal__source--clickable {
  cursor: pointer;
}

.wk-mp-goal__source--clickable:hover {
  color: var(--wk-text-primary, #18181b);
  background: var(--wk-bg-hover, #f4f4f5);
}

.wk-mp-goal__source-anchor {
  font-size: 10px;
  color: var(--wk-color-accent);
  font-weight: 500;
}

.wk-mp-goal__source-sep {
  color: var(--wk-border-default, #e4e4e7);
}

/* ─── 创建人 / 负责人 ────────────────────────────────── */
.wk-mp-people {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--wk-text-tertiary, #71717a);
}

.wk-mp-people__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.wk-mp-people__item .wk-avatar {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: block;
  flex-shrink: 0;
}

.wk-mp-people__avatars {
  display: inline-flex;
  align-items: center;
}

.wk-mp-people__avatar-wrap {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--wk-bg-surface, #fff);
  border-radius: 50%;
  flex-shrink: 0;
}

.wk-mp-people__avatar-wrap .wk-avatar {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: block;
}

.wk-mp-people__name {
  color: var(--wk-text-secondary, #3f3f46);
  font-weight: 500;
  line-height: 1;
}

.wk-mp-people__role {
  color: var(--wk-text-tertiary, #a1a1aa);
}

/* ─── Tabs ───────────────────────────────────────────── */
.wk-mp-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--wk-border-default, #e4e4e7);
  margin-top: 24px;
  margin-bottom: 16px;
}

.wk-mp-tabs__btn {
  position: relative;
  padding: 8px 12px;
  font-size: 13px;
  border: none;
  background: transparent;
  color: var(--wk-text-tertiary, #71717a);
  cursor: pointer;
  transition: color 0.12s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.wk-mp-tabs__btn:hover {
  color: var(--wk-text-primary, #18181b);
}

.wk-mp-tabs__btn.is-active {
  color: var(--wk-text-primary, #18181b);
  font-weight: 500;
}

.wk-mp-tabs__btn.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--wk-text-primary, #18181b);
  border-radius: 1px;
}

.wk-mp-tabs__count {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  padding: 0 6px;
  border-radius: 4px;
  background: var(--wk-bg-elevated, #f4f4f5);
  color: var(--wk-text-tertiary, #71717a);
}

.wk-mp-tabs__count.is-active {
  background: var(--wk-text-primary, #18181b);
  color: white;
}

/* ─── Tab: 关联群聊 ──────────────────────────────────── */
.wk-mp-channels__toolbar {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.wk-mp-channels__add {
  font-size: 11px;
  color: var(--wk-text-tertiary, #71717a);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: color 0.12s;
}

.wk-mp-channels__add:hover {
  color: var(--wk-text-primary, #18181b);
}

.wk-mp-channels__empty {
  padding: 32px 0;
  text-align: center;
  color: var(--wk-text-quaternary, #a1a1aa);
  font-size: 12px;
  border: 1px dashed var(--wk-border-default, #e4e4e7);
  border-radius: 6px;
}

.wk-mp-channels__card {
  padding: 16px 0;
  border-bottom: 1px solid var(--wk-border-subtle, #f4f4f5);
}

.wk-mp-channels__card:last-child {
  border-bottom: none;
}

.wk-mp-channels__card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.wk-mp-channels__card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--wk-text-primary, #18181b);
}

/* 未加入群时的群名占位: 模糊 + 半透明, 让用户明确 "我没权限"
   又不会对 "是哪个群" 产生误判 */
.wk-mp-channels__card-name--blur {
  display: inline-block;
  filter: blur(2.5px);
  opacity: 0.35;
  user-select: none;
  cursor: help;
  letter-spacing: 0.05em;
  transition: filter 0.3s ease, opacity 0.3s ease;
}

/* 正常态 (已加入群): 无模糊, 渐入清晰 */
.wk-mp-channels__card-name--clear {
  display: inline-block;
  filter: blur(0);
  opacity: 1;
  transition: filter 0.3s ease, opacity 0.3s ease;
}

/* 成员关系加载中: shimmer 骨架占位, 不暴露群名, 不闪烁
   慢网络下仍能看到"正在加载"的反馈而非先模糊再清晰 */
.wk-mp-channels__card-name--skeleton,
.wk-mp-goal__source-skeleton {
  display: inline-block;
  min-width: 64px;
  height: 0.85em;
  border-radius: var(--wk-r-xs);
  background: linear-gradient(
    90deg,
    var(--wk-bg-elevated) 0%,
    var(--wk-bg-hover) 50%,
    var(--wk-bg-elevated) 100%
  );
  background-size: 200% 100%;
  animation: wk-mp-skeleton-shimmer 1.2s ease-in-out infinite;
  vertical-align: baseline;
}

@keyframes wk-mp-skeleton-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

/* 未加入群的 "不在群" 小徽章 (对齐原型 v19 ChannelDigestItem 右侧标签): 
   灰底 + 边框 + 小锁图标 + "不在群" 文字。跟 card-name 在同一行,
   让用户一眼看出 "是这个群, 但我没权限" */
.wk-mp-channels__not-member-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 10px;
  color: var(--wk-text-tertiary, #71717a);
  background: var(--wk-bg-muted, #f4f4f5);
  border: 1px solid var(--wk-border-default, #e4e4e7);
  border-radius: 4px;
  font-weight: 500;
  white-space: nowrap;
}

.wk-mp-channels__card-time {
  font-size: 11px;
  color: var(--wk-text-tertiary, #a1a1aa);
  margin-left: 12px;
}

/* 最新进展紫色块 */
.wk-mp-channels__card-progress {
  margin-top: 4px;
  padding: 8px 12px;
  border-left: 2px solid var(--wk-color-accent);
  background: var(--wk-purple-alpha-06);
  border-radius: 0 6px 6px 0;
}

.wk-mp-channels__card-progress-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--wk-color-accent-hover);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.wk-mp-channels__card-progress-text {
  font-size: 13px;
  color: var(--wk-text-primary, #18181b);
  line-height: 1.625;
}

.wk-mp-channels__card-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.wk-mp-channels__timeline-btn {
  font-size: 11px;
  color: var(--wk-text-tertiary, #71717a);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: color 0.12s;
}

.wk-mp-channels__timeline-btn:hover {
  color: var(--wk-text-primary, #18181b);
}

/* ─── Empty tab ──────────────────────────────────────── */
.wk-mp-empty-tab {
  padding: 40px 0;
  text-align: center;
  color: var(--wk-text-tertiary, #71717a);
  font-size: 12px;
}

/* ─── Footer ─────────────────────────────────────────── */
.wk-mp-footer {
  text-align: center;
  font-size: 11px;
  color: var(--wk-text-tertiary, #a1a1aa);
  padding-top: 12px;
  padding-bottom: 8px;
  border-top: 1px solid var(--wk-border-default, #e4e4e7);
  margin-top: 12px;
}

/* ─── More Menu (删除事项) ───────────────────────────────── */
.wk-mp-more-wrap {
  position: relative;
  display: inline-block;
}

.wk-mp-more-dropdown {
  position: absolute;
  z-index: 50;
  right: 0;
  top: calc(100% + 4px);
  min-width: 140px;
  background: var(--wk-bg-surface, #fff);
  border: 1px solid var(--wk-border-default, #e4e4e7);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 4px;
}

.wk-mp-more-dropdown__item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 5px;
  font-size: 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--wk-text-primary, #18181b);
  transition: background 0.1s;
}

.wk-mp-more-dropdown__item:hover {
  background: var(--wk-bg-hover, #f4f4f5);
}
.wk-mp-more-dropdown__item--danger {
  color: var(--wk-color-danger, #ef4444);
}
.wk-mp-more-dropdown__item--danger:hover {
  background: rgba(239, 68, 68, 0.06);
}

/* ─── Channel More Menu ──────────────────────────────────── */
.wk-mp-ch-more {
  position: relative;
  display: inline-flex;
}

.wk-mp-ch-more__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--wk-text-tertiary, #a1a1aa);
  cursor: pointer;
  transition: all 0.12s;
}

.wk-mp-ch-more__btn:hover {
  background: var(--wk-bg-hover, #f4f4f5);
  color: var(--wk-text-primary, #18181b);
}

.wk-mp-ch-more__dropdown {
  position: absolute;
  z-index: 20;
  right: 0;
  top: 100%;
  margin-top: 4px;
  width: 144px;
  border-radius: 6px;
  border: 1px solid var(--wk-border-default, #e4e4e7);
  background: var(--wk-bg-surface, #fff);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 4px;
}

.wk-mp-ch-more__item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 6px 12px;
  font-size: 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--wk-text-secondary, #52525b);
  transition: background 0.1s;
  border-radius: 4px;
}

.wk-mp-ch-more__item:hover {
  background: var(--wk-bg-hover, #f4f4f5);
}
.wk-mp-ch-more__item--danger {
  color: var(--wk-color-danger, #ef4444);
}
.wk-mp-ch-more__item--danger:hover {
  background: rgba(239, 68, 68, 0.06);
}

/* ─── Timeline Panel (对齐原型 v19 群内事件时间线) ────────── */
.wk-mp-tl {
  margin-top: 12px;
  padding: 16px;
  background: var(--wk-bg-elevated, #fafafa);
  border: 1px solid var(--wk-border-default, #e4e4e7);
  border-radius: 6px;
}

/* Header row */
.wk-mp-tl__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.wk-mp-tl__title {
  font-size: 11px;
  font-weight: 600;
  color: var(--wk-text-secondary, #3f3f46);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Sort toggle button group */
.wk-mp-tl__sort-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: 6px;
  background: var(--wk-bg-surface, #fff);
  border: 1px solid var(--wk-border-default, #e4e4e7);
}

.wk-mp-tl__sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  border: none;
  background: transparent;
  color: var(--wk-text-tertiary, #71717a);
  cursor: pointer;
  transition:
    color 0.12s,
    background 0.12s;
}

.wk-mp-tl__sort-btn:hover {
  color: var(--wk-text-primary, #18181b);
}

.wk-mp-tl__sort-btn.is-active {
  background: var(--wk-text-primary, #18181b);
  color: white;
  font-weight: 500;
}

/* Date group */
.wk-mp-tl__group {
  margin-bottom: 16px;
}

.wk-mp-tl__group:last-child {
  margin-bottom: 0;
}

/* Date separator line */
.wk-mp-tl__date-sep {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.wk-mp-tl__date-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--wk-text-primary, #18181b);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  flex-shrink: 0;
}

.wk-mp-tl__date-raw {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 10px;
  color: var(--wk-text-tertiary, #a1a1aa);
  flex-shrink: 0;
}

.wk-mp-tl__date-line {
  flex: 1;
  height: 1px;
  background: var(--wk-border-default, #e4e4e7);
}

/* Entry rows container */
.wk-mp-tl__entries {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-left: 4px;
}

/* Single entry — single horizontal row */
.wk-mp-tl__entry {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Time column */
.wk-mp-tl__time {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  color: var(--wk-text-tertiary, #a1a1aa);
  flex-shrink: 0;
  width: 40px;
}

/* User: avatar + name */
.wk-mp-tl__user {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.wk-mp-tl__user-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--wk-text-secondary, #3f3f46);
}

/* Content text — fills remaining space */
.wk-mp-tl__content {
  font-size: 13px;
  line-height: 1.625;
  flex: 1;
  min-width: 0;
  color: var(--wk-text-secondary, #27272a);
}

/* Attachment count badge */
.wk-mp-tl__att-count {
  font-size: 10px;
  color: var(--wk-text-tertiary, #71717a);
  background: var(--wk-bg-surface, #fff);
  border: 1px solid var(--wk-border-default, #e4e4e7);
  padding: 1px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  font-weight: 500;
}

/* "↗ 原消息" anchor button */
.wk-mp-tl__anchor-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  color: var(--wk-text-tertiary, #71717a);
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  transition:
    color 0.12s,
    background 0.12s,
    border-color 0.12s;
}

.wk-mp-tl__anchor-btn:hover {
  color: var(--wk-text-primary, #18181b);
  background: var(--wk-bg-hover, #f4f4f5);
  border-color: var(--wk-border-default, #e4e4e7);
}

/* Empty state */
.wk-mp-tl__empty {
  padding: 24px 0;
  text-align: center;
  color: var(--wk-text-tertiary, #71717a);
  font-size: 12px;
}

/* ─── Timeline Input ─────────────────────────────────────── */
.wk-mp-tl-input {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.wk-mp-tl-input__field {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--wk-border-default, #e4e4e7);
  border-radius: 6px;
  font-size: 13px;
  outline: none;
  background: var(--wk-bg-surface, #fff);
  color: var(--wk-text-primary, #18181b);
  transition: border-color 0.12s;
}

.wk-mp-tl-input__field:focus {
  border-color: var(--wk-brand-primary, #18181b);
}

.wk-mp-tl-input__field::placeholder {
  color: var(--wk-text-tertiary, #a1a1aa);
}

.wk-mp-tl-input__btn {
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  background: var(--wk-text-primary, #18181b);
  color: white;
  transition: opacity 0.12s;
}

.wk-mp-tl-input__btn:hover:not(:disabled) {
  opacity: 0.85;
}
.wk-mp-tl-input__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ─── Timeline Tab ───────────────────────────────────────── */
.wk-mp-timeline-tab {
  padding: 0;
}

/* ─── Activity (变更记录) ─────────────────────────────── */
.wk-mp-activity__toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.wk-mp-activity__row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 6px 10px;
  font-size: 12px;
  border-bottom: 1px solid var(--wk-border-soft, #f4f4f5);
}

.wk-mp-activity__row:last-child {
  border-bottom: none;
}

/* 目标变更行: 紫色左边框 + 淡紫背景 (对齐原型 goal_change 高亮) */
.wk-mp-activity__row--goal {
  padding-left: 8px;
  border-left: 2px solid var(--wk-brand-primary, #7c3aed);
  background: rgba(124, 58, 237, 0.04);
}

.wk-mp-activity__time {
  font-size: 11px;
  color: var(--wk-text-tertiary, #a1a1aa);
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  flex-shrink: 0;
  width: 68px;
}

.wk-mp-activity__label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--wk-text-tertiary, #71717a);
  flex-shrink: 0;
  width: 72px;
}

.wk-mp-activity__label--goal {
  color: var(--wk-brand-primary, #7c3aed);
}

.wk-mp-activity__content {
  flex: 1;
  min-width: 0;
  color: var(--wk-text-primary, #18181b);
  line-height: 1.5;
}

.wk-mp-activity__old {
  text-decoration: line-through;
  text-decoration-color: var(--wk-border-default, #d4d4d8);
  color: var(--wk-text-tertiary, #a1a1aa);
}

.wk-mp-activity__new {
  font-weight: 500;
  color: var(--wk-text-primary, #18181b);
}

.wk-mp-activity__actor {
  flex-shrink: 0;
  min-width: 0;
  max-width: 140px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--wk-text-tertiary, #a1a1aa);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wk-mp-activity__actor .wk-avatar {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ─── Activity filter dropdown ─────────────────────────── */
.wk-mp-activity__filter-wrap {
  position: relative;
  display: inline-flex;
}

.wk-mp-activity__filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  min-width: 100px;
  border: 1px solid var(--wk-border-default, #e4e4e7);
  border-radius: 6px;
  background: var(--wk-bg-surface, #fff);
  font-size: 12px;
  color: var(--wk-text-primary, #18181b);
  cursor: pointer;
  transition: all 0.12s;
}

.wk-mp-activity__filter-btn:hover {
  background: var(--wk-bg-hover, #f4f4f5);
}

.wk-mp-activity__filter-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 20;
  min-width: 140px;
  background: var(--wk-bg-surface, #fff);
  border: 1px solid var(--wk-border-default, #e4e4e7);
  border-radius: 6px;
  box-shadow: var(--wk-shadow-lg, 0 8px 24px -6px rgb(0 0 0 / 0.12));
  padding: 4px;
}

.wk-mp-activity__filter-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 6px 10px;
  border: none;
  background: transparent;
  border-radius: 4px;
  font-size: 12px;
  color: var(--wk-text-primary, #18181b);
  cursor: pointer;
  text-align: left;
  transition: background 0.1s;
}

.wk-mp-activity__filter-item:hover {
  background: var(--wk-bg-hover, #f4f4f5);
}

.wk-mp-activity__filter-item.is-active {
  font-weight: 500;
}

/* ─── 响应式: 窄宽度适配 (container query) ─────────────────
 * 事项详情面板作为可拖拽宽度的侧栏, 拖到 < 420px 时:
 *   - inner padding 缩减
 *   - activity actor 列 max-width 压到 80px 并强制省略号
 *   - 关联群卡头部 meta 允许换行
 *   - tabs 在需要时支持横滚
 */
@container wk-mp-main (max-width: 420px) {
  .wk-mp-main__inner {
    padding: 12px 14px 20px;
  }

  .wk-mp-activity__actor {
    max-width: 90px;
  }

  .wk-mp-activity__row {
    gap: 8px;
    padding: 6px 6px;
  }

  .wk-mp-channels__card-head {
    flex-wrap: wrap;
    row-gap: 4px;
  }

  .wk-mp-tabs {
    overflow-x: auto;
    scrollbar-width: none;
  }
  .wk-mp-tabs::-webkit-scrollbar {
    display: none;
  }
  .wk-mp-tabs__btn {
    flex-shrink: 0;
  }

  .wk-mp-goal__source {
    flex-wrap: wrap;
    row-gap: 4px;
  }

  .wk-mp-header__row1 {
    row-gap: 6px;
  }
}

@container wk-mp-main (max-width: 340px) {
  .wk-mp-activity__actor {
    max-width: 64px;
  }
  .wk-mp-main__inner {
    padding: 10px 10px 16px;
  }
}
