:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  /* 主色：企业级管理后台蓝 */
  --primary: #2f6fed;
  --primary-dark: #1d5bd6;
  --primary-soft: #eaf1fd;
  --text: #1f2329;
  --text-sub: #8a8f99;
  --border: #e9ebef;
  --danger: #fa5151;
  --danger-soft: #fdeaea;
  --warn: #ff9d00;
  --warn-soft: #fff4e0;
  /* 状态专用色（与按钮主色解耦，避免混淆） */
  --success: #07c160;
  --success-soft: #e8f8ef;
  --blue: #3a8bff;
  --blue-soft: #e9f1ff;
  --gray-soft: #f0f1f3;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .04), 0 1px 3px rgba(0, 0, 0, .06);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, .05), 0 8px 24px rgba(0, 0, 0, .04);
  --radius: 12px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

/* ---------------- 布局 ---------------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 248px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  box-shadow: 1px 0 0 rgba(0, 0, 0, .01), 2px 0 12px rgba(15, 23, 42, .04);
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; }
.brand-logo {
  width: 40px; height: 40px; border-radius: 11px;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.3; }
.brand-text strong { font-size: 15px; }
.brand-text small { color: var(--text-sub); font-size: 12px; }

.nav { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  width: 100%; text-align: left;
  background: transparent; border: none; cursor: pointer;
  padding: 11px 14px; border-radius: 10px;
  color: #4a4f57; font-size: 14px; font-weight: 500;
  transition: background .15s, color .15s;
}
.nav-item .ico { font-size: 16px; width: 20px; text-align: center; }
.nav-item:hover { background: var(--gray-soft); }
.nav-item.active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }

.sidebar-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border); }
.logout {
  width: 100%; background: transparent; border: 1px solid var(--border);
  color: #6b7077; padding: 9px; border-radius: 9px; cursor: pointer; font-size: 13px;
  transition: border-color .15s, color .15s;
}
.logout:hover { border-color: var(--danger); color: var(--danger); }
.ver { color: var(--text-sub); font-size: 11px; text-align: center; margin: 12px 0 0; }

/* ---------------- 主内容 ---------------- */
.content { flex: 1; display: flex; flex-direction: column; height: 100vh; padding: 28px 32px 48px; width: 100%; overflow: hidden; }
.page-head { margin-bottom: 22px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.page-head h1 { margin: 0; font-size: 21px; font-weight: 650; letter-spacing: .2px; }
.page-desc { margin: 5px 0 0; color: var(--text-sub); font-size: 13px; }

.panel { display: none; }
.panel.active { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow-y: auto; animation: fade .2s ease; }
#tab-home.panel.active { overflow: hidden; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------------- 卡片 / 表单 ---------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 26px;
}
.form { display: flex; flex-direction: column; gap: 20px; }
.field { display: flex; flex-direction: column; }
.field > label { font-weight: 600; font-size: 13px; margin-bottom: 8px; color: #2b3038; }
.hint { color: var(--text-sub); font-size: 12px; margin: 6px 0 0; }
.hint.block { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--border); line-height: 1.7; }

/* 发送成员行 + 成员选择器 */
.senders-row { display: flex; gap: 10px; align-items: stretch; }
.senders-row #senders { flex: 1; }
.senders-row .btn { white-space: nowrap; }
.member-picker { margin-top: 12px; border: 1px solid var(--border); border-radius: 12px; background: #fafbfc; overflow: hidden; }
.mp-head { display: flex; gap: 10px; align-items: center; padding: 12px; border-bottom: 1px solid var(--border); }
.mp-head input[type=text] { flex: 1; width: auto; }
.mp-all { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-sub); white-space: nowrap; cursor: pointer; }
.mp-list { max-height: 230px; overflow-y: auto; padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.mp-item { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 8px; font-size: 14px; cursor: pointer; }
.mp-item:hover { background: #eef1f5; }
.mp-item input { accent-color: var(--primary); width: 16px; height: 16px; }
.mp-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border-top: 1px solid var(--border); }
.mp-foot .msg .mp-warn { color: #c78000; font-size: 12px; }
.mp-foot .btn-row { display: flex; gap: 10px; }

input[type=text], input[type=password], input[type=datetime-local], textarea {
  width: 100%; padding: 11px 13px;
  border: 1px solid var(--border); border-radius: 10px;
  font-size: 14px; font-family: inherit; color: var(--text);
  background: #fcfcfd; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; }
input:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft); background: #fff;
}

/* 拖拽上传 */
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  border: 1.5px dashed #cdd2da; border-radius: 12px;
  padding: 26px 16px; cursor: pointer; text-align: center;
  background: #fafbfc; transition: border-color .15s, background .15s;
}
.dropzone:hover { border-color: var(--primary); background: var(--primary-soft); }
.dropzone.drag { border-color: var(--primary); background: var(--primary-soft); }
.dz-ico { font-size: 28px; }
.dz-title { font-weight: 600; font-size: 14px; }
.dropzone small { color: var(--text-sub); font-size: 12px; }

.preview { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.thumb { position: relative; width: 88px; height: 88px; flex-shrink: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #f0f1f3; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb button {
  position: absolute; top: 4px; right: 4px;
  background: rgba(0, 0, 0, .55); color: #fff; border: none;
  border-radius: 50%; width: 20px; height: 20px; cursor: pointer; line-height: 18px; padding: 0;
}

/* 朋友圈附件类型分段控件 */
.seg { display: inline-flex; border: 1.5px solid var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 12px; }
.seg label { padding: 8px 16px; cursor: pointer; font-size: 13px; border-right: 1px solid var(--border); user-select: none; }
.seg label:last-child { border-right: none; }
.seg label:has(input:checked) { background: var(--primary); color: #fff; }
.seg input { display: none; }
.attach-box { margin-top: 4px; }
#mLinkBox input { margin-bottom: 8px; }
.m-media { padding: 8px 10px; background: #f3f5f8; border: 1px solid var(--border); border-radius: 8px; color: var(--text-sub); font-size: 13px; margin-bottom: 10px; word-break: break-all; }

/* 模式选择卡片 */
.radio-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rc {
  display: flex; align-items: center; gap: 10px;
  border: 1.5px solid var(--border); border-radius: 11px;
  padding: 13px 15px; cursor: pointer; transition: border-color .15s, background .15s;
}
.rc input { accent-color: var(--primary); width: 16px; height: 16px; }
.rc-body { display: flex; flex-direction: column; line-height: 1.35; }
.rc-body strong { font-size: 14px; }
.rc-body small { color: var(--text-sub); font-size: 12px; }
.rc:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }

/* 按钮 */
.btn {
  background: var(--primary); color: #fff; border: none;
  padding: 10px 20px; border-radius: 10px; cursor: pointer; font-size: 14px; font-weight: 500;
  transition: background .15s, transform .05s;
}
.btn:hover { background: var(--primary-dark); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: #fff; color: #4a4f57; border: 1px solid var(--border); }
.btn.ghost:hover { background: var(--gray-soft); border-color: #d4d8de; }
.btn.block { width: 100%; }
.btn-row { display: flex; gap: 10px; }

.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.form-actions .btn { margin-left: auto; }
.msg { font-size: 13px; }
.msg.ok { color: var(--success); }
.msg.err { color: var(--danger); }

/* ---------------- 任务列表 ---------------- */
.list-head { display: flex; margin-bottom: 14px; }
.filters {
  flex: 1;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 12px; box-shadow: var(--shadow-sm);
}
.filters select, .filters input[type=date] {
  width: auto; padding: 7px 10px; font-size: 13px;
  border: 1px solid var(--border); border-radius: 8px; background: #fcfcfd;
  color: var(--text); font-family: inherit;
}
.filters select:focus, .filters input[type=date]:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); background: #fff;
}
.filters .filter-sep { color: var(--text-sub); font-size: 13px; }
.filters .btn { padding: 7px 13px; font-size: 13px; }
#clearFilter { margin-left: auto; }
.task-list { display: flex; flex-direction: column; gap: 14px; }
.task-list .empty {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text-sub); text-align: center; padding: 48px 20px; box-shadow: var(--shadow-sm);
}
.card.task {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 18px 20px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 12px; }
.card-head .left { display: flex; align-items: center; gap: 10px; }
.card-head .right { display: flex; align-items: center; gap: 10px; }
.badge { padding: 3px 11px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #fff; }
.s-pending { background: var(--warn); }
.s-running { background: var(--blue); }
.s-sent { background: var(--success); }
.s-failed { background: var(--danger); }
.s-cancelled { background: #9aa0a8; }
.badge.type { border: none; padding: 3px 11px; }
.badge.type-broadcast { background: #e0e7ff; color: #4f46e5; }
.badge.type-moment { background: #dcfce7; color: #16a34a; }
.badge.type-group { background: #fef3c7; color: #b45309; }
.card-head .time { color: var(--text-sub); font-size: 12px; }
.card-body { white-space: pre-wrap; font-size: 14px; margin-bottom: 10px; word-break: break-word; }
.card-imgs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.card-imgs img { width: 96px; height: 96px; flex-shrink: 0; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); cursor: pointer; transition: transform .12s, box-shadow .12s; }
.card-imgs img:hover { transform: scale(1.04); box-shadow: 0 2px 10px rgba(0, 0, 0, .12); }
.card-meta { color: #9aa0a8; font-size: 12px; margin-bottom: 12px; }
.card-actions { display: flex; gap: 8px; }
.card-actions button {
  background: var(--gray-soft); border: none; padding: 7px 14px;
  border-radius: 8px; cursor: pointer; font-size: 13px; color: #4a4f57; transition: background .15s;
}
.card-actions button:hover { background: #e3e5e9; }
/* 主按钮：主题蓝 */
.card-actions button.run { background: var(--primary); color: #fff; }
.card-actions button.run:hover:not(:disabled) { background: var(--primary-dark); }
/* 失败态：橙色「重新发送」 */
.card-actions button.retry { background: var(--warn); color: #fff; }
.card-actions button.retry:hover:not(:disabled) { background: #e98c00; }
/* 改时间：橙色 */
.card-actions button.reschedule { background: #f97316; color: #fff; }
.card-actions button.reschedule:hover:not(:disabled) { background: #ea580c; }
/* 置灰（成功/进行中/已取消/失效态） */
.card-actions button:disabled,
.card-actions button.run:disabled,
.card-actions button.retry:disabled,
.card-actions button.reschedule:disabled {
  background: #eef0f2; color: #b6bac0; cursor: not-allowed;
}
/* 发送情况按钮（次要灰描边） */
.card-actions button.btn-detail {
  background: #fff; border: 1px solid var(--border); color: #4a4f57;
}
.card-actions button.btn-detail:hover:not(:disabled) { background: var(--gray-soft); }
/* 改时间内联编辑器 */
.time-edit { display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; }
.time-edit .dt-input {
  font-size: 12px; padding: 3px 6px; border: 1px solid var(--border); border-radius: 6px;
  background: #fff; color: #1f2329; font-family: inherit;
}
.time-edit .dt-input.invalid { border-color: #e54; }
.time-edit .mini {
  font-size: 12px; padding: 3px 8px; border: 1px solid var(--border); border-radius: 6px;
  background: #fff; color: #4a4f57;cursor: pointer;
}
.time-edit .mini.save { background: var(--primary); color: #fff; border-color: var(--primary); }
.time-edit .mini:hover { filter: brightness(.97); }

.send-result { margin-top: 10px; }
.send-result.collapsed { display: none; }
.send-result .sr-line {
  background: #f5f8ff; border: 1px solid #dCE6ff; border-radius: 8px;
  padding: 9px 12px; font-size: 13px; color: #2b3a55; line-height: 1.6;
}
.send-result .sr-line b { color: var(--primary); }
/* 成员发送状态明细 */
.send-result .sr-detail {
  margin-top: 8px; background: #fff; border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px; font-size: 13px;
}
.send-result .sr-detail-title { color: var(--text-sub); font-size: 12px; margin-bottom: 6px; }
.send-result .sr-detail.collapsed { display: none; }
.send-result .sr-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.send-result .sr-list li {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 10px; padding: 6px 8px; background: var(--gray-soft); border-radius: 6px;
}
.send-result .sr-user { font-weight: 600; color: #2b3a55; word-break: break-all; }
.send-result .sr-uid { font-weight: 400; color: #9aa3b2; font-size: 12px; margin-left: 4px; }
.send-result .sr-st { font-size: 12px; padding: 2px 8px; border-radius: 10px; text-align: center; }
.send-result .sr-st.sr-2 { background: #e3f6ea; color: #1a7f3c; }
.send-result .sr-st.sr-0 { background: #fff3e0; color: #b9770a; }
.send-result .sr-st.sr-x { background: #f0f1f3; color: #9aa0a8; }
.send-result .sr-cust { text-align: right; color: var(--text-sub); font-size: 12px; }
.card-actions button:disabled:hover { background: #eef0f2; }
.err-text { color: var(--danger); font-size: 12px; margin-top: 10px; word-break: break-word; background: var(--danger-soft); padding: 8px 12px; border-radius: 8px; }

/* ---------------- 登录 ---------------- */
.login-overlay {
  position: fixed; inset: 0; background: rgba(20, 24, 30, .45);
  display: none; align-items: center; justify-content: center; z-index: 100;
  backdrop-filter: blur(2px);
}
.login-box {
  background: #fff; border-radius: 16px; padding: 34px 36px; width: 340px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .18); text-align: center;
}
.login-ico { font-size: 34px; margin-bottom: 6px; }
.login-box h2 { margin: 0 0 4px; font-size: 19px; }
.login-tip { color: var(--text-sub); font-size: 13px; margin: 0 0 18px; }
.login-box input[type=password] {
  width: 100%; padding: 11px 13px; border: 1px solid var(--border);
  border-radius: 10px; font-size: 14px; margin-bottom: 16px; background: #fcfcfd;
}
.login-box input[type=password]:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

/* ---------------- 预览 Lightbox（图片 / 视频通用） ---------------- */
.lightbox {
  position: fixed; inset: 0; background: rgba(15, 18, 24, .82);
  display: none; align-items: center; justify-content: center; z-index: 200;
  padding: 32px; cursor: zoom-out;
}
.lightbox.show { display: flex; animation: fade .15s ease; }
.lightbox img, .lightbox video {
  max-width: 92vw; max-height: 88vh; border-radius: 10px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, .4); background: #fff; cursor: default;
}
.lightbox video { background: #000; }
.lb-close {
  position: fixed; top: 18px; right: 26px; color: #fff; font-size: 34px;
  line-height: 1; cursor: pointer; opacity: .85; user-select: none; transition: opacity .15s;
}
.lb-close:hover { opacity: 1; }

/* 任务卡片内的视频缩略图（点击预览） */
.card-video {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px;
  background: #f0f1f3; cursor: pointer; transition: background .15s, border-color .15s;
}
.card-video:hover { background: #e6e8ec; border-color: #d4d8de; }
.card-video .cv-play {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%;
  background: var(--primary); color: #fff; font-size: 12px; line-height: 26px;
  text-align: center; padding-left: 2px;
}
.card-video .cv-name { font-size: 13px; color: #4a4f57; word-break: break-all; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 760px) {
  .app { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: static; flex-direction: row;
    align-items: center; padding: 12px 14px; gap: 12px;
  }
  .brand { padding: 0; }
  .brand-text { display: none; }
  .nav { flex-direction: row; margin: 0; flex: 1; gap: 6px; }
  .nav-item { padding: 9px 12px; font-size: 13px; }
  .nav-item .ico { width: auto; }
  .sidebar-foot { margin: 0; padding: 0; border: none; display: flex; align-items: center; gap: 10px; }
  .ver { display: none; }
  .content { padding: 18px 16px 40px; }
  .radio-cards { grid-template-columns: 1fr; }
  .form-actions { flex-direction: column; align-items: stretch; }
  .form-actions .btn { margin: 0; }
  .btn-row { display: flex; }
  .btn-row .btn { flex: 1; }
}

/* ---------------- 首页数据看板 ---------------- */
#tab-home.panel.active { display: flex; flex-direction: column; }
.home-wrap { display: flex; flex-direction: column; gap: 14px; flex: 1; min-height: 0; }
.home-section-title { font-size: 14px; font-weight: 700; color: var(--text); margin: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 12px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.stat-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--primary); }
.stat-card.s-member::before { background: #6b5bd2; }
.stat-card.s-item::before { background: var(--warn); }
.stat-card.s-customer::before { background: var(--success); }
.stat-value { font-size: 24px; font-weight: 700; color: var(--text); line-height: 1.1; }
.stat-label { font-size: 12px; color: var(--text-sub); margin-top: 4px; }
.stat { background: #fafbfc; border: 1px solid var(--border); border-radius: 10px; padding: 14px; text-align: center; }
.stat-num { font-size: 22px; font-weight: 700; color: var(--text); }
/* 流失客户 */
#lossStats { grid-template-columns: repeat(3, 1fr); }
.loss-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.loss-head h3 { margin: 0; font-size: 16px; font-weight: 650; }
.loss-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.loss-table th, .loss-table td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--border); }
.loss-table th { color: var(--text-sub); font-weight: 600; background: #fafbfc; }
.loss-table tr:hover td { background: rgba(0,0,0,.02); }
.loss-table .muted { color: var(--text-sub); }
.home-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: stretch; }
.home-row > .card { min-width: 0; }
.home-chart-card, .home-wrap .card { padding: 18px; }
.home-wrap > .card:last-child { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.home-member-card { display: flex; flex-direction: column; }
.card-title, .home-chart-card .card-title { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.chart-box { width: 100%; position: relative; max-height: 220px; overflow: hidden; }
.member-summary-box { flex: 1; min-height: 0; }
.member-summary-box .empty { color: var(--text-sub); font-size: 13px; padding: 20px 4px; }
.ms-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ms-table thead th {
  background: var(--gray-soft); color: var(--text-sub); font-weight: 600;
  padding: 6px 6px; text-align: center; font-size: 12px;
}
.ms-table thead th.ms-th-user { text-align: left; }
.ms-table tbody td { padding: 7px 6px; border-bottom: 1px solid var(--border); }
.ms-table tbody tr:last-child td { border-bottom: none; }
.ms-td-user { font-weight: 600; color: var(--text); text-align: left; }
.ms-td-num { text-align: center; }
.ms-uid { font-weight: 400; color: var(--text-sub); font-size: 12px; margin-left: 4px; }
.ms-pill { font-size: 11px; padding: 2px 8px; border-radius: 10px; font-weight: 500; white-space: nowrap; }
.ms-pill.ms-pub { background: #e3f6ea; color: #1a7f3c; }
.ms-pill.ms-unpub { background: #fff3e0; color: #b9770a; }
.ms-pill.ms-cust { background: #e9f1ff; color: #2f6fed; }
.ms-pagination {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-sub);
}
.ms-page-info { margin-right: auto; }
.ms-page-cur { padding: 0 4px; }
.ms-page-btn {
  background: #fff; border: 1px solid var(--border); border-radius: 6px;
  padding: 4px 10px; font-size: 12px; color: #4a4f57; cursor: pointer; transition: background .15s;
}
.ms-page-btn:hover:not(:disabled) { background: var(--gray-soft); }
.ms-page-btn:disabled { background: #f4f5f7; color: #b6bac0; cursor: not-allowed; border-color: #e3e5e9; }
.chart-svg { width: 100%; height: auto; display: block; max-height: 220px; }
.chart-svg .grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 2 3; opacity: 0.35; }
.chart-svg .axis { fill: var(--text-sub); font-size: 10px; opacity: 0.65; }
.chart-svg .line-broadcast { stroke: #6b5bd2; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.chart-svg .line-moment { stroke: var(--success); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.chart-svg .area-broadcast, .chart-svg .area-moment { opacity: 0.65; }
.chart-svg .guide-line { stroke: var(--text-sub); stroke-width: 1; stroke-dasharray: 2 2; opacity: 0.25; }
.chart-svg .highlight-dot { stroke: #fff; stroke-width: 1.2; }
.chart-svg .highlight-dot.hb { fill: #6b5bd2; }
.chart-svg .highlight-dot.hm { fill: var(--success); }
.chart-tooltip {
  position: absolute; pointer-events: none; display: none;
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 6px; padding: 6px 8px; font-size: 11px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .14); z-index: 10;
  min-width: 100px; backdrop-filter: blur(2px);
}
.chart-tooltip .tt-date { color: var(--text-sub); font-size: 10px; margin-bottom: 3px; }
.chart-tooltip .tt-row { display: flex; gap: 8px; }
.chart-tooltip .tt-b { color: #6b5bd2; }
.chart-tooltip .tt-m { color: var(--success); }
.chart-legend { display: flex; gap: 14px; margin-top: 4px; font-size: 12px; }
.chart-legend .lg-broadcast { color: #6b5bd2; }
.chart-legend .lg-moment { color: var(--success); }
.activity-list {
  list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column;
  flex: 1; min-height: 0; overflow-y: auto; position: relative;
}
.activity-list:hover { animation-play-state: paused; }
.act-item { display: flex; align-items: flex-start; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.act-item:last-child { border-bottom: none; }
.act-ico { font-size: 14px; line-height: 1.3; width: 18px; text-align: center; flex: none; }
.act-body { flex: 1; min-width: 0; overflow: hidden; }
.act-line { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-sub); }
.act-line b { color: var(--text); }
.act-tag { font-size: 11px; padding: 1px 6px; border-radius: 4px; font-weight: 500; line-height: 1.4; }
.act-tag-moment { background: #e3f6ea; color: #1a7f3c; }
.act-tag-broadcast { background: #efeaff; color: #6b5bd2; }
.act-info { font-size: 13px; color: var(--text); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-time { font-size: 11px; color: var(--text-sub); white-space: nowrap; padding-top: 2px; flex: none; margin-left: 4px; }
.act-empty { color: var(--text-sub); padding: 10px 4px; }

@media (max-width: 720px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .home-row { grid-template-columns: 1fr; }
}

/* ---------------- 接口配置保护密码弹窗 ---------------- */
.lock-overlay {
  position: fixed; left: 248px; top: 0; right: 0; bottom: 0; z-index: 150;
  background: rgba(15, 18, 24, .78);
  display: none; align-items: center; justify-content: center;
  backdrop-filter: blur(2px);
  animation: fade .2s ease;
}
.lock-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  width: 400px; max-width: 92vw; padding: 28px 30px 26px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .22);
  text-align: center;
}
.lock-box h3 { margin: 0 0 8px; font-size: 18px; font-weight: 700; }
.lock-tip { color: var(--text-sub); font-size: 13px; margin: 0 0 18px; line-height: 1.55; }
.lock-box input {
  width: 100%; padding: 10px 12px; font-size: 14px;
  border: 1px solid var(--border); border-radius: 8px; outline: none;
  background: var(--bg); color: var(--text); margin-bottom: 14px;
}
.lock-box input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.lock-box .btn { width: 100%; }
.lock-box .msg { display: block; margin-top: 10px; }
.lock-capybara { width: 130px; height: 100px; margin: 0 auto 10px; }
.capybara-img { width: 100%; height: 100%; object-fit: contain; display: block; animation: capybara-float 2.4s ease-in-out infinite; }
@keyframes capybara-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-4px) rotate(1deg); }
}
@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
