/* =====================================================================
 * 营销活动（第一版）样式 —— 黑白灰低饱和，沿用 B01 现有视觉
 * ===================================================================== */

/* ---- 左侧菜单：独立一级项支持右侧未读角标（仅营销活动使用 badge） ---- */
.admin-menu-item--standalone {
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-menu-item--standalone .admin-menu-badge {
  margin-left: auto;
}
/* 营销活动未读数字：低饱和深灰，不使用红色警告风格 */
.admin-menu-badge[data-badge-route$="/marketing-activities"] {
  background: #355944;
  color: #fff;
}

/* ---- 页面骨架 ---- */
/* 页面挂载容器与滚动链：
   .admin-content 是 overflow:hidden 的定高容器，#adminPageMarketing 作为其 flex 子项必须
   flex:1 + min-height:0 才能获得确定高度，否则详情内容超出可视区时会被直接裁切、整页无法滚动
   （与订单/学习/工作手册等页面容器的布局模式保持一致，仅针对营销页生效）。 */
#adminPageMarketing {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.mk-page {
  flex: 1;
  min-width: 0;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 28px 48px;
  overflow-y: auto;
  height: 100%;
  box-sizing: border-box;
}

.mk-list-view,
.mk-detail-view {
  display: flex;
  flex-direction: column;
  width: 100%;
}
.mk-detail-view {
  display: none;
}

.mk-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.mk-title {
  font-size: 22px;
  font-weight: 700;
  color: #25372f;
  margin: 0 0 6px;
  letter-spacing: .5px;
}
.mk-subtitle {
  font-size: 13px;
  color: #86868b;
}

/* ---- 按钮 ---- */
.mk-btn {
  border: 1px solid #d8d8dc;
  background: #fff;
  color: #25372f;
  padding: 8px 18px;
  border-radius: 9px;
  font-size: 14px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  white-space: nowrap;
}
.mk-btn:hover {
  background: #f4f4f6;
}
.mk-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}
.mk-btn-primary {
  background: #355944;
  border-color: #355944;
  color: #fff;
}
.mk-btn-primary:hover {
  background: #3a3a3e;
}
.mk-btn-dark {
  background: #355944;
  border-color: #355944;
  color: #fff;
}
.mk-btn-dark:hover {
  background: #46464b;
}
.mk-btn-light {
  background: #eef3ee;
  border-color: #e2e2e6;
  color: #3a3a3e;
}
.mk-btn-light:hover {
  background: #e8e8ec;
}
.mk-btn-danger-ghost {
  background: #fff;
  border-color: #cfcfd4;
  color: #6b6b70;
}
.mk-btn-danger-ghost:hover {
  background: #f6f6f7;
  border-color: #9d9da3;
}

/* ---- 状态切换 ---- */
.mk-filter-bar {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid #e5e5e8;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.mk-filter-tab {
  border: none;
  background: transparent;
  padding: 10px 16px;
  font-size: 14px;
  color: #86868b;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.mk-filter-tab:hover {
  color: #25372f;
}
.mk-filter-tab.active {
  color: #25372f;
  font-weight: 600;
  border-bottom-color: #25372f;
}
.mk-filter-count {
  background: #ececef;
  color: #6b6b70;
  font-size: 12px;
  border-radius: 10px;
  padding: 0 7px;
  line-height: 18px;
}
.mk-filter-tab.active .mk-filter-count {
  background: #355944;
  color: #fff;
}

/* ---- 活动卡片 ---- */
.mk-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mk-card {
  background: #fff;
  border: 1px solid #ebebef;
  border-radius: 14px;
  padding: 16px 18px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.mk-card:hover {
  border-color: #cfcfd4;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .06);
}
.mk-card:focus-visible {
  outline: 2px solid #9a9aa0;
  outline-offset: 2px;
}
.mk-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.mk-card-title {
  font-size: 16px;
  font-weight: 600;
  color: #25372f;
  line-height: 1.45;
}
.mk-card-meta {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.mk-card-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.mk-chip {
  font-size: 12px;
  color: #5d5d62;
  background: #eef3ee;
  border: 1px solid #e7e7eb;
  border-radius: 6px;
  padding: 2px 8px;
  line-height: 18px;
}
.mk-card-summary {
  font-size: 13px;
  color: #5d5d62;
  line-height: 1.7;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mk-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: #aeaeb2;
}

/* ---- 状态徽标（低饱和灰阶区分） ---- */
.mk-status {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  line-height: 18px;
  padding: 1px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.mk-status-ongoing {
  background: #355944;
  color: #fff;
}
.mk-status-upcoming {
  background: #fff;
  color: #25372f;
  border: 1px solid #bdbdc2;
}
.mk-status-ended {
  background: #eef3ee;
  color: #9a9aa0;
}
.mk-status-draft {
  background: #fff;
  color: #9a9aa0;
  border: 1px dashed #cfcfd4;
}

/* ---- 未读标记（轻量，不报警告色） ---- */
.mk-unread-tag {
  display: inline-block;
  font-size: 11px;
  color: #5d5d62;
  background: #e9e9ec;
  border-radius: 4px;
  padding: 1px 6px;
  margin-left: 8px;
  vertical-align: 2px;
  line-height: 16px;
}

.mk-empty {
  text-align: center;
  color: #9a9aa0;
  font-size: 14px;
  padding: 40px 0;
}
.mk-loading {
  text-align: center;
  color: #9a9aa0;
  font-size: 14px;
  padding: 30px 0;
  display: none;
}
.mk-muted {
  color: #aeaeb2;
}

/* ---- 详情页 ---- */
.mk-back-btn {
  border: none;
  background: transparent;
  color: #5d5d62;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  align-self: flex-start;
  margin-bottom: 14px;
}
.mk-back-btn:hover {
  color: #25372f;
}

.mk-version-note {
  background: #eef3ee;
  border: 1px solid #e5e5e8;
  border-radius: 8px;
  color: #5d5d62;
  font-size: 13px;
  padding: 8px 14px;
  margin-bottom: 14px;
}

.mk-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.mk-detail-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.mk-detail-title {
  font-size: 20px;
  font-weight: 700;
  color: #25372f;
  margin: 0;
}
.mk-detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.mk-read-summary {
  background: #f6f6f8;
  border: 1px solid #ebebef;
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 16px;
  cursor: pointer;
  color: #3a3a3e;
  font-size: 13px;
}
.mk-read-summary:hover {
  border-color: #cfcfd4;
}
.mk-read-summary-count b {
  color: #25372f;
}
.mk-read-link {
  margin-left: auto;
  color: #5d5d62;
  font-size: 13px;
}
.mk-read-summary:hover .mk-read-link {
  color: #25372f;
}

.mk-section {
  background: #fff;
  border: 1px solid #ebebef;
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 14px;
}
.mk-section-title {
  font-size: 14px;
  font-weight: 700;
  color: #25372f;
  margin-bottom: 12px;
  letter-spacing: .3px;
}
/* ---- 基本信息 ---- */
/* 布局：第一行 活动类型 / 活动时间 / 适用渠道 三列；适用顾客、适用产品各自独占整行。
   网格子项顺序由 detailHtml 固定为：
   1 活动类型 → 2 活动时间 → 3 适用渠道 → 4 适用顾客 → 5 适用产品 */
.mk-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 24px;
  align-items: start;
}
/* 第 4、5 项（适用顾客 / 适用产品）：长文本独占整行，不被压成窄列 */
.mk-info-grid .mk-info-item:nth-child(n + 4) {
  grid-column: 1 / -1;
}
.mk-info-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 14px;
  color: #25372f;
  min-width: 0;
  overflow-wrap: break-word;
  word-break: normal;
}
.mk-info-label {
  font-size: 12px;
  color: #86868b;
  letter-spacing: .2px;
}
.mk-info-item > span:last-child {
  line-height: 1.75;
}
@media (max-width: 1100px) {
  .mk-info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  /* 三列放不下时：适用渠道单独整行，长文本行仍保持整行 */
  .mk-info-grid .mk-info-item:nth-child(n + 3) {
    grid-column: 1 / -1;
  }
}
@media (max-width: 768px) {
  .mk-info-grid {
    grid-template-columns: 1fr;
  }
}
.mk-para {
  font-size: 14px;
  line-height: 1.85;
  color: #25372f;
  white-space: normal;
  overflow-wrap: break-word;
}
.mk-para-muted {
  color: #3f3f45;
}
.mk-notes {
  background: #f4f4f5;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.85;
  color: #4a4a50;
}
.mk-detail-foot-info {
  font-size: 12px;
  color: #aeaeb2;
  text-align: right;
  padding: 4px 4px 20px;
}

/* ---- 岗位执行要求 ---- */
.mk-role-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mk-own-role-block {
  background: #355944;
  border-radius: 10px;
  color: #fff;
  padding: 14px 16px;
  margin-bottom: 4px;
}
.mk-own-role-label {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
  opacity: .82;
}
.mk-own-role-content {
  font-size: 14px;
  line-height: 1.85;
  white-space: normal;
  overflow-wrap: break-word;
}
.mk-role-req {
  border: 1px solid #ebebef;
  border-radius: 10px;
  padding: 12px 14px;
}
.mk-role-req-name {
  font-size: 12px;
  color: #86868b;
  margin-bottom: 6px;
}
.mk-role-req-body {
  font-size: 14px;
  line-height: 1.8;
  color: #25372f;
  white-space: normal;
  overflow-wrap: break-word;
}

/* ---- 新建 / 编辑 弹窗 ---- */
body.mk-modal-open {
  overflow: hidden;
}
.mk-overlay-wrap {
  position: fixed;
  inset: 0;
  z-index: 120;
}
.mk-overlay {
  position: absolute;
  inset: 0;
  background: rgba(29, 29, 31, .42);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(1px);
}
.mk-modal {
  background: #fff;
  width: 100%;
  max-width: 720px;
  max-height: 92vh;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .24);
}
.mk-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid #ebebef;
}
.mk-modal-title {
  font-size: 16px;
  font-weight: 700;
  color: #25372f;
  margin: 0;
}
.mk-modal-close {
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: #86868b;
  cursor: pointer;
  padding: 4px;
}
.mk-modal-close:hover {
  color: #25372f;
}
.mk-modal-body {
  padding: 20px 22px;
  overflow-y: auto;
}
.mk-modal-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid #ebebef;
  background: #fafafa;
  flex-wrap: wrap;
}
.mk-editor-note {
  font-size: 12px;
  color: #86868b;
}

.mk-field {
  margin-bottom: 14px;
}
.mk-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.mk-field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #3a3a3e;
  margin-bottom: 6px;
}
.mk-req {
  color: #6b6b70;
  margin-left: 2px;
}
.mk-input,
.mk-textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #dcdce0;
  border-radius: 9px;
  font-size: 14px;
  color: #25372f;
  background: #fff;
  padding: 9px 12px;
  outline: none;
  transition: border-color .15s;
  font-family: inherit;
}
.mk-input:focus,
.mk-textarea:focus {
  border-color: #355944;
}
.mk-textarea {
  resize: vertical;
  min-height: 64px;
  line-height: 1.7;
}
.mk-field-hint {
  font-size: 12px;
  color: #aeaeb2;
  margin-top: 4px;
}
.mk-check-list {
  display: flex;
  gap: 6px 18px;
  flex-wrap: wrap;
  padding: 4px 0;
}
.mk-check-item {
  font-size: 14px;
  color: #3a3a3e;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.mk-check-item input {
  accent-color: #25372f;
}
.mk-sub-head {
  font-size: 13px;
  font-weight: 700;
  color: #25372f;
  border-top: 1px solid #e5ece4;
  padding-top: 14px;
  margin: 2px 0 12px;
}
.mk-role-editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.mk-role-editor-grid .mk-field {
  margin-bottom: 0;
}

/* ---- 阅读情况 ---- */
.mk-read-stats {
  display: flex;
  gap: 18px;
  font-size: 14px;
  color: #3a3a3e;
  margin-bottom: 16px;
  background: #f6f6f8;
  border: 1px solid #ebebef;
  border-radius: 10px;
  padding: 10px 14px;
}
.mk-read-stats b {
  color: #25372f;
}
.mk-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.mk-table th,
.mk-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid #edf2ec;
  color: #25372f;
}
.mk-table th {
  color: #86868b;
  font-weight: 600;
  font-size: 12px;
}
.mk-table td:first-child {
  font-weight: 600;
}
.mk-read-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3a3a3e;
  margin-right: 6px;
}
.mk-unread-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid #b7b7bc;
  margin-right: 6px;
  box-sizing: border-box;
}

/* ---- 移动端 ---- */
@media (max-width: 768px) {
  .mk-page {
    padding: 18px 14px 60px;
  }
  .mk-page-header {
    flex-direction: column;
    align-items: stretch;
  }
  .mk-page-header .mk-btn {
    align-self: flex-start;
  }
  .mk-field-row,
  .mk-role-editor-grid {
    grid-template-columns: 1fr;
  }
  .mk-card-top {
    flex-direction: column;
    gap: 6px;
  }
  .mk-detail-head {
    flex-direction: column;
  }
}

/* ===================================================================
   营销活动到期提醒（员工端系统内弹窗）
   视觉与「学习与认证」强提醒一致（黑色按钮/浅灰幽灵按钮/遮罩居中卡片），
   独立命名独立逻辑；多个活动合并到同一弹窗，不连续弹多个 alert。
   =================================================================== */
.mkt-alert-mask {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  padding: 16px;
}
.mkt-alert-card {
  position: relative;
  width: 480px;
  max-width: 100%;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: #fff;
  border-radius: 16px;
  padding: 30px 32px 24px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  box-sizing: border-box;
}
.mkt-alert-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #aeaeb2;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.mkt-alert-close:hover {
  color: #25372f;
  background: #f4f7f3;
}
.mkt-alert-title {
  margin: 0 0 14px;
  font-size: 20px;
  font-weight: 700;
  color: #25372f;
  letter-spacing: 0.5px;
}
.mkt-alert-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mkt-alert-desc {
  margin: 0 0 4px;
  font-size: 13px;
  line-height: 1.7;
  color: #6e6e73;
}
.mkt-alert-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: #f4f7f3;
  border: 1px solid #e5ece4;
  border-radius: 12px;
  padding: 10px 12px 10px 16px;
}
.mkt-alert-msg {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: #25372f;
  min-width: 0;
}
.mkt-alert-go,
.mkt-alert-btn {
  border: 0;
  background: #355944;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.mkt-alert-go:hover,
.mkt-alert-btn:hover {
  background: #455c4e;
}
.mkt-alert-btn.ghost {
  background: #fff;
  border: 1px solid #e3e3e8;
  color: #455c4e;
  font-weight: 500;
}
.mkt-alert-btn.ghost:hover {
  background: #f4f7f3;
  border-color: #c7c7cc;
}
.mkt-alert-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}
@media (max-width: 768px) {
  .mkt-alert-card {
    padding: 26px 20px 20px;
  }
  .mkt-alert-item {
    flex-direction: column;
    align-items: stretch;
    text-align: left;
  }
  .mkt-alert-go {
    align-self: flex-start;
  }
}
