/* 财肚肚客户管理系统 — 手写样式,零外部依赖 */
:root {
  --bg: #f1f5f9;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-2: #64748b;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --danger: #dc2626;
  --sidebar: #1e293b;
  --radius: 8px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; flex: 0 0 220px;
  background: var(--sidebar); color: #cbd5e1;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand { padding: 20px 20px 16px; border-bottom: 1px solid #334155; }
.brand-name { font-size: 22px; font-weight: 700; color: #fff; letter-spacing: 2px; }
.brand-sub { font-size: 12px; color: #94a3b8; margin-top: 2px; }
.nav { flex: 1; padding: 12px 0; }
.nav-item {
  display: block; padding: 10px 20px; color: #cbd5e1;
  font-size: 14px; border-left: 3px solid transparent;
}
.nav-item:hover { background: #334155; color: #fff; text-decoration: none; }
.nav-item.active { background: #0f172a; color: #fff; border-left-color: var(--primary); }
.sidebar-foot { padding: 14px 20px; font-size: 12px; color: #64748b; border-top: 1px solid #334155; }

/* 移动端抽屉导航(桌面隐藏,见响应式节) */
.nav-toggle {
  display: none;
  border: none; background: none; cursor: pointer;
  font-size: 22px; line-height: 1; padding: 4px 8px; color: var(--text);
}
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, .45);
  z-index: 35;
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card); border-bottom: 1px solid var(--border);
  padding: 12px 24px; position: sticky; top: 0; z-index: 10;
}
.topbar-title { font-size: 16px; font-weight: 600; }
.topbar-user { display: flex; align-items: center; gap: 8px; }
.user-name { font-weight: 600; }

.content { padding: 20px 24px 40px; }
.content-public { max-width: 960px; margin: 0 auto; }

/* ---------- 提示 ---------- */
.flash {
  padding: 10px 16px; border-radius: var(--radius); margin-bottom: 14px;
  border: 1px solid transparent; font-size: 14px;
}
.flash-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.flash-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.flash-info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.scope-note {
  background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af;
  border-radius: var(--radius); padding: 8px 14px; margin-bottom: 14px; font-size: 13px;
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px;
}
.card.narrow { max-width: 820px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.card-head h2 { margin: 0; font-size: 16px; font-weight: 600; }
.card-actions { display: flex; align-items: center; gap: 8px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block; padding: 7px 16px; border: 1px solid var(--border);
  background: #fff; color: var(--text); border-radius: 6px; cursor: pointer;
  font-size: 14px; line-height: 1.4; text-decoration: none;
}
.btn:hover { background: #f8fafc; text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger { background: #fff; border-color: #fecaca; color: var(--danger); }
.btn-danger:hover { background: #fef2f2; }
.btn-sm { padding: 4px 10px; font-size: 13px; }
.btn-block { display: block; width: 100%; }
.btn-disabled { color: #cbd5e1; cursor: not-allowed; background: #f8fafc; }
.link-danger { border: none; background: none; padding: 0; color: var(--danger); cursor: pointer; font-size: 14px; }
.link-accent { border: none; background: none; padding: 0; color: var(--primary); cursor: pointer; font-size: 13px; }
.link-danger { border: none; background: none; padding: 0; color: #d93025; cursor: pointer; font-size: 13px; }
a.accent { color: #059669; }
.inline-form { display: inline; }

/* ---------- 筛选栏 ---------- */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 10px; background: #f8fafc; border: 1px solid var(--border);
  border-radius: 6px; margin-bottom: 14px;
}
.filter-bar input[type="text"], .filter-bar select, .filter-bar input[type="month"] {
  padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px;
  background: #fff;
}
.filter-bar input[type="text"] { min-width: 200px; }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; padding: 9px 10px; background: #f8fafc;
  border-bottom: 1px solid var(--border); color: var(--text-2); font-weight: 600;
  white-space: nowrap;
}
.table td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:hover { background: #f8fafc; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .totals td { font-weight: 600; border-top: 2px solid var(--border); background: #f8fafc; }
.table .ops { white-space: nowrap; }
.table .ops a { margin-right: 10px; }
tr.clickable { cursor: pointer; }
.empty { text-align: center; color: var(--text-2); padding: 24px 0 !important; }

/* ---------- 徽章 ---------- */
.badge {
  display: inline-block; padding: 1px 10px; border-radius: 999px;
  font-size: 12px; line-height: 1.8; white-space: nowrap;
}
.badge-good { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.badge-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.badge-serious { background: #fef3c7; color: #854d0e; border: 1px solid #fcd34d; }
.badge-critical { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.badge-neutral { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }

/* 沉默预警:连续3天未填跟进记录的合伙人姓名标红 */
.silent-name { color: var(--danger); font-weight: 600; }

/* ---------- 表单 ---------- */
.form { margin-top: 4px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.field { display: flex; flex-direction: column; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13px; color: var(--text-2); margin-bottom: 4px; }
.field.required label::after { content: " *"; color: var(--danger); }
.field input, .field select, .field textarea {
  padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 14px; background: #fff; font-family: inherit;
}
.field input:focus, .field select:focus {
  outline: 2px solid #bfdbfe; border-color: var(--primary);
}
.field input[disabled] { background: #f1f5f9; color: var(--text-2); }
.hint { font-size: 12px; color: #94a3b8; margin-top: 3px; }
.q-tip-error { color: #b91c1c; margin: 8px 0 0; }   /* 多选题未勾选提示 */
.sub { font-size: 12px; color: #94a3b8; }
.bar-hint { font-size: 12px; color: #94a3b8; padding: 0 0 10px; }
.form-actions { margin-top: 18px; display: flex; gap: 10px; }
.input-inline {
  padding: 3px 8px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; width: 130px;
}

/* ---------- 弹窗(列表页快捷录入) ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15, 23, 42, .45);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 8vh 16px 16px; overflow-y: auto;
}
.modal-box {
  background: #fff; border-radius: 10px; box-shadow: 0 10px 40px rgba(15, 23, 42, .25);
  width: 100%; max-width: 460px; padding: 18px 20px 20px;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-close {
  border: none; background: none; font-size: 22px; line-height: 1;
  color: var(--text-2); cursor: pointer; padding: 2px 6px;
}
.modal-close:hover { color: var(--text); }

/* 总部权限池勾选:自适应两列,窄屏自然单列 */
.checkbox-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 6px 12px;
}
.checkbox-item { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.checkbox-item input { width: auto; margin: 0; padding: 0; accent-color: var(--primary); }

/* ---------- 详情 ---------- */
.detail-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  margin: 0;
}
.detail-grid > div { display: flex; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.detail-grid > div.full { grid-column: 1 / -1; flex-direction: column; }
.detail-grid dt { width: 130px; flex: 0 0 130px; color: var(--text-2); }
.detail-grid dd { margin: 0; word-break: break-all; }

/* ---------- 分页 ---------- */
.pager {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  margin-top: 14px;
}
.pager-info { color: var(--text-2); font-size: 13px; }
.pager .per-page {
  padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg); color: var(--text-1); font-size: 13px;
}

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #1e293b 0%, #334155 60%, #2563eb 160%);
}
.login-card {
  width: 360px; background: #fff; border-radius: 12px; padding: 32px;
  box-shadow: 0 20px 50px rgba(2, 6, 23, .4);
}
.login-brand { font-size: 26px; font-weight: 700; text-align: center; letter-spacing: 3px; }
.login-sub { text-align: center; color: var(--text-2); font-size: 13px; margin-bottom: 22px; }
.login-card .field { margin-bottom: 14px; }
.login-card .btn-block { margin-top: 8px; padding: 10px; font-size: 15px; }

/* ---------- 错误页 ---------- */
.error-page { text-align: center; padding: 80px 20px; }
.error-code { font-size: 72px; font-weight: 700; color: #cbd5e1; line-height: 1; }
.error-msg { font-size: 17px; margin: 14px 0 24px; color: var(--text-2); }

/* ---------- 使用说明 ---------- */
.help-body h3 { margin: 18px 0 8px; font-size: 15px; }
.help-body h3:first-child { margin-top: 0; }
.help-body li { margin: 4px 0; }

/* ---------- 看板 ---------- */
.quick-actions { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.kpi-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.kpi-group { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.kpi-group-title { margin: 0 0 12px; font-size: 15px; font-weight: 600; color: var(--text-2); }
.kpi-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.kpi-card { background: #f8fafc; border: 1px solid var(--border); border-radius: 6px; padding: 12px 14px; }
.kpi-card.clickable { cursor: pointer; }
.kpi-label { font-size: 13px; color: var(--text-2); }
.kpi-value { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi-unit { font-size: 13px; font-weight: 400; color: var(--text-2); margin-left: 4px; }
.reminder-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.reminder-row .card { margin-bottom: 0; }

/* ---------- 合伙人排序看板 ---------- */
.rank-head { display: flex; align-items: center; gap: 10px; }
.rank-period select {
  padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; background: #fff; cursor: pointer;
}

/* ---------- 响应式(基本) ---------- */
@media (max-width: 900px) {
  .kpi-groups, .reminder-row { grid-template-columns: 1fr; }
  .rank-period select { font-size: 16px; }  /* iOS 聚焦放大防护 */
  .form-grid, .detail-grid { grid-template-columns: 1fr; }
  .modal-overlay { padding: 6vh 10px 10px; }
  .modal-box { max-width: 90%; }

  /* ---- 侧边栏 → 抽屉 ---- */
  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0;
    width: 240px; height: auto;
    flex: none;
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 40;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(2, 6, 23, .35);
  }
  .sidebar-overlay.show { display: block; }
  .nav-toggle { display: block; }

  /* ---- 顶栏 ---- */
  .topbar { padding: 10px 12px; gap: 8px; }
  .topbar-title {
    flex: 1; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .topbar-user { flex-wrap: wrap; gap: 6px; justify-content: flex-end; }

  /* ---- 内容与卡片 ---- */
  .content { padding: 12px 12px 32px; }
  .card { padding: 14px 12px; margin-bottom: 12px; }
  .card-head, .card-actions, .form-actions, .pager { flex-wrap: wrap; }
  .card-head { gap: 8px; }

  /* ---- 表格:横向滑动(卡片表除外) ---- */
  .table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-card { display: block; overflow: visible; }

  /* ---- 意向/签约列表:卡片式 ---- */
  .table-card thead { display: none; }
  .table-card tbody, .table-card tfoot { display: block; }
  .table-card tbody tr, .table-card tfoot tr {
    display: block;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 10px;
    padding: 10px 12px 8px;
    background: #fff;
  }
  .table-card tbody tr:hover { background: #fff; }  /* 关掉触屏 sticky hover */
  .table-card tfoot tr:hover { background: #fff; }
  .table-card td {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 12px; padding: 6px 0;
    border-bottom: 1px dashed #eef2f7;
  }
  .table-card td[data-label]::before {
    content: attr(data-label);
    flex: 0 0 auto; color: var(--text-2); font-size: 13px;
  }
  .table-card td.td-code { display: block; padding: 0 0 2px; border-bottom: none; }
  .table-card td.td-code a { font-size: 12px; color: var(--text-2); }
  .table-card td.td-main {
    display: block; font-size: 16px; font-weight: 600;
    padding: 0 0 6px; border-bottom: none;
  }
  .table-card td.td-ops {
    display: block; white-space: normal;
    margin-top: 6px; padding: 8px 0 0;
    border-top: 1px solid var(--border); border-bottom: none;
  }
  .table-card .ops a { margin-right: 14px; line-height: 2; }  /* 加大触控间距 */
  .table-card td.empty { display: block; text-align: center; }

  /* ---- 筛选栏:1 text 满行 + select 两列网格 ---- */
  .filter-bar { display: grid; grid-template-columns: 1fr 1fr; }
  .filter-bar input[type="text"], .filter-bar input[type="month"] {
    grid-column: 1 / -1; width: 100%; min-width: 0;
  }
  .filter-bar select { width: 100%; min-width: 0; }
  .filter-bar input, .filter-bar select { font-size: 16px; } /* 防 iOS 聚焦放大 */

  /* ---- 详情:标签在上、值在下 ---- */
  .detail-grid > div { flex-direction: column; padding: 8px 0; }
  .detail-grid dt { width: auto; flex: none; margin-bottom: 2px; }

  /* ---- 表单输入防 iOS 聚焦放大 ---- */
  .field input, .field select, .field textarea { font-size: 16px; }
  .input-inline { font-size: 16px; }

  /* ---- 登录 ---- */
  .login-wrap { padding: 12px; }
  .login-card { width: auto; max-width: calc(100vw - 24px); }

  /* ---- 看板:kpi 保持 2 列,字号缩小 ---- */
  .kpi-value { font-size: 18px; }

  /* ---- 触控目标 ---- */
  .btn { min-height: 36px; }
  .btn-sm { min-height: 32px; }

  /* ---- 抽屉打开锁定背景滚动 ---- */
  body.nav-open { overflow: hidden; }
}

/* ---- 任务中心 / 回复 / 电话脱敏(2026-09-21) ---- */
.nav-badge {
  display: inline-block; min-width: 18px; margin-left: 6px; padding: 0 5px;
  border-radius: 9px; background: #dc2626; color: #fff;
  font-size: 11px; line-height: 18px; text-align: center;
}

.topbar-bell {
  position: relative; display: inline-flex; align-items: center;
  color: var(--text-2); padding: 4px; text-decoration: none;
}
.topbar-bell:hover { color: var(--primary); }
.bell-dot {
  position: absolute; top: -2px; right: -4px; min-width: 16px;
  padding: 0 4px; border-radius: 8px; background: #dc2626; color: #fff;
  font-size: 10px; line-height: 16px; text-align: center;
}

.pre-wrap { white-space: pre-wrap; word-break: break-word; }
.script-box {
  background: #f8fafc; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px; margin-bottom: 8px;
}
.copy-btn { margin-bottom: 4px; }

.reply-list { margin: 4px 0 8px; }
.reply-item { padding: 6px 0 6px 10px; border-left: 3px solid var(--border); margin-bottom: 6px; }
.reply-author { font-weight: 600; color: var(--text); margin-right: 8px; }
.reply-time { color: var(--text-2); font-size: 12px; }
.reply-content { margin-top: 2px; color: var(--text); }

.reply-row td {
  background: #f8fafc; border-top: none; padding: 4px 12px 8px;
}
.reply-form { display: flex; gap: 8px; align-items: flex-start; }
.reply-form textarea { flex: 1; }
.reply-form .btn { flex: none; margin-top: 4px; }

.radio-row { display: flex; gap: 16px; flex-wrap: wrap; }
.radio-item { display: inline-flex; align-items: center; gap: 4px; font-weight: normal; }
.hint-inline { color: var(--text-2); font-size: 12px; margin-left: 8px; }

/* ---- 互动消息(2026-09-21) ---- */
.notice-list { margin-bottom: 8px; }
.notice-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 8px;
}
.notice-item .badge { flex: none; margin-top: 2px; }
.notice-unread {
  background: #eff6ff; border-left: 3px solid var(--primary);
  padding-left: 9px;
}
.notice-main { flex: 1; min-width: 0; }
.notice-title { font-weight: 600; color: var(--text); text-decoration: none; }
.notice-title:hover { color: var(--primary); }
.notice-body {
  margin: 4px 0; color: var(--text-2); font-size: 13px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
/* 消息链接直达跟进行锚点:跳转时避开吸顶顶栏 */
[id^="f-"] { scroll-margin-top: 80px; }

/* ========== 请求J 新组件(2026-09-21):图片/表情/积分/看板美化 ========== */

/* ---- 图片网格与预览 ---- */
.img-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.img-grid a { display: block; }
.img-thumb {
  width: 72px; height: 72px; object-fit: cover;
  border: 1px solid var(--border); border-radius: 6px; background: #f8fafc;
}
.img-preview .img-thumb { border-style: dashed; }
/* 视频附件缩略(2026-09-28):与图片缩略同尺寸,可内嵌播放 */
.img-grid video.img-thumb { object-fit: contain; cursor: pointer; }

/* ---- 原生表情面板 ---- */
.emoji-wrap { position: relative; }
.emoji-wrap textarea { width: 100%; padding-right: 40px; }
.emoji-btn {
  position: absolute; right: 8px; top: 8px;
  border: 1px solid var(--border); background: #fff; border-radius: 6px;
  font-size: 16px; line-height: 1; padding: 4px 6px; cursor: pointer;
}
.emoji-btn:hover { border-color: var(--primary); }
.emoji-panel {
  display: none; position: absolute; right: 0; top: 100%;
  margin-top: 4px; z-index: 30;
  width: 264px; max-height: 208px; overflow-y: auto;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(2, 6, 23, .14);
  padding: 8px;
}
.emoji-panel.open { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.emoji-item {
  border: none; background: none; font-size: 18px; line-height: 1.2;
  padding: 4px 2px; cursor: pointer; border-radius: 4px;
}
.emoji-item:hover { background: #f1f5f9; }

/* ---- 回复表单(带表情/图片后加宽) ---- */
.reply-form { flex-wrap: wrap; }
.reply-form .emoji-wrap, .reply-form .field { flex: 1 1 220px; min-width: 0; }
.reply-form .img-preview { flex-basis: 100%; }
.reply-form .hint-inline { flex-basis: 100%; margin-left: 0; }
.reply-form input[type="file"] { max-width: 100%; }

/* ---- 任务积分徽章 ---- */
.points-badge { background: #eef2ff; color: #4338ca; border: 1px solid #c7d2fe; }

/* ---- 标黄徽章(沉默双规则·无新增意向) ---- */
.badge-yellow { background: #fefce8; color: #854d0e; border: 1px solid #fde047; }

/* ---- 看板滚动列表(最新签约/最新收款) ---- */
.scroll-list {
  max-height: 420px; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.scroll-item {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 8px; background: #fff;
}
.scroll-item:hover { border-color: var(--primary); }
.scroll-main { font-weight: 600; min-width: 120px; flex: 1; }
.scroll-sub { color: var(--text-2); font-size: 12px; }
.scroll-money { font-weight: 700; color: #047857; font-variant-numeric: tabular-nums; }

/* ---- KPI 卡图标与彩色点缀 ---- */
.kpi-card { position: relative; padding-left: 46px; transition: transform .15s ease, box-shadow .15s ease; }
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(2, 6, 23, .08); }
.kpi-icon { position: absolute; left: 13px; top: 15px; width: 22px; height: 22px; }
.kpi-icon svg { width: 100%; height: 100%; }
.kpi-accent-leads .kpi-icon { color: #2563eb; }
.kpi-accent-customers .kpi-icon { color: #059669; }
.kpi-accent-payments .kpi-icon { color: #d97706; }
.kpi-accent-reminders .kpi-icon { color: #7c3aed; }
.kpi-accent-leads { border-top: 3px solid #bfdbfe; }
.kpi-accent-customers { border-top: 3px solid #a7f3d0; }
.kpi-accent-payments { border-top: 3px solid #fde68a; }
.kpi-accent-reminders { border-top: 3px solid #ddd6fe; }

/* ---- 排名自定义日期 ---- */
.rank-period { flex-wrap: wrap; }
.rank-period input[type="date"] {
  padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; background: #fff;
}

/* ---- 卡片轻阴影统一 ---- */
.card { box-shadow: 0 1px 3px rgba(2, 6, 23, .05); }

/* ---- 日期输入统一样式 ---- */
input[type="date"], input[type="month"] { min-height: 34px; }

/* ========== 请求J 响应式补充 ========== */
@media (max-width: 900px) {
  input[type="date"] { font-size: 16px; }   /* iOS 聚焦防缩放 */
  .topbar .user-name { display: none; }      /* 顶栏移动优化:隐藏用户名 */
  .topbar-user .btn { padding: 4px 8px; font-size: 12px; }
  .topbar-bell svg { width: 16px; height: 16px; }
  .rank-period input[type="date"] { font-size: 16px; }
  .emoji-panel.open { width: 232px; }
  .kpi-card { padding-left: 40px; }
  .scroll-list { max-height: 360px; }
  .img-thumb { width: 64px; height: 64px; }
  .reply-form { flex-direction: column; }
  .reply-form .emoji-wrap, .reply-form .field { width: 100%; flex: none; }
}

/* ========== 请求K(2026-09-21):会计合并 + 全站表格卡片化补充 ========== */

/* ---- 收款合计行:标签格与收尾格(桌面表格内为匿名单元格,排版不受影响) ---- */
.table-card td.totals-label {
  display: block; padding: 0 0 6px; border-bottom: 1px dashed #eef2f7; font-weight: 600;
}
.table-card td.totals-tail { display: none; }

@media (max-width: 900px) {
  /* ---- 跟进回复行:整块堆叠,浅灰底区分 ---- */
  .table-card td.reply-cell { display: block; padding: 8px 0; }
  .table-card td.reply-cell::before { display: none; }
  .table-card tr.reply-row { background: #f8fafc; }

  /* ---- 行内小操作按钮:加大触控目标 ---- */
  .link-danger, .link-accent {
    min-height: 32px; display: inline-flex; align-items: center;
  }

  /* ---- 表情按钮触控 ---- */
  .emoji-btn {
    width: 36px; height: 36px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
  }

  /* ---- 勾选项触控 ---- */
  .checkbox-item { font-size: 16px; gap: 8px; min-height: 32px; }
}

/* ========== 请求M(2026-09-21):排名手机端改回电脑端表格布局 ========== */
/* 说明:请求L 的排名卡片布局(tr 网格 + td 块 + rank/name flex)已整体废除——
   flex 的 td 会把排名/姓名堆进同一匿名单元格、指标列左移一列,造成
   表头与数据错位,故全部移除,只保留徽章小字权重这一条无害规则。 */

@media (max-width: 900px) {
  /* 排名表:保持桌面同款表格形态(表头排序链接可见),压缩列宽尽量一屏放下,
     放不下时横向滑动(与 .table 同款横滑) */
  .table-ranking {
    display: block; overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .table-ranking thead { display: table-header-group; }
  .table-ranking tbody, .table-ranking tfoot { display: table-row-group; }
  .table-ranking tbody tr, .table-ranking tfoot tr {
    display: table-row; border: none; border-radius: 0;
    margin-bottom: 0; padding: 0; background: #fff;
  }
  .table-ranking th, .table-ranking tbody td, .table-ranking tfoot td {
    display: table-cell; background: transparent; border-radius: 0;
    border-bottom: 1px solid var(--border);
    padding: 7px 8px; font-size: 13px;
    white-space: nowrap;
  }
  .table-ranking td[data-label]::before { display: none; }
  .table-ranking td.name-cell { white-space: normal; text-align: left; font-weight: 600; }
  .table-ranking td.rank-cell { font-weight: 700; color: var(--primary); }
  .table-ranking td .sub { font-size: 11px; }
  .table-ranking td .badge { margin-top: 3px; font-weight: 400; }
  .table-ranking tfoot td.rank-cell { display: table-cell; }
  .table-ranking tfoot td.name-cell { font-weight: 600; }
}

/* ========== 系统升级(2026-09-22):11 项需求 ========== */

/* ---- 意向草稿横幅(#4,localStorage 草稿提示条) ---- */
.draft-banner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
  background: #fffbeb; border: 1px solid #f0dd9a; border-radius: var(--radius);
  padding: 10px 14px; margin-bottom: 14px;
  font-size: 14px; color: #7a5d10;
}

/* ---- 图片灯箱(#11):作业配图/回执图/回复图点开滑动观看 ---- */
#gallery-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(2, 6, 23, .9);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  padding: 16px;
  touch-action: none;   /* 横滑翻页交给 JS,避免手势冲突 */
}
#gallery-img {
  max-width: 100%; max-height: calc(100vh - 140px);
  object-fit: contain; border-radius: 6px;
  user-select: none; -webkit-user-select: none;
}
.gallery-close {
  position: absolute; top: 10px; right: 16px;
  background: none; border: none; color: #fff;
  font-size: 32px; line-height: 1; cursor: pointer;
  min-width: 40px; min-height: 40px;   /* 触控目标 */
}
.gallery-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255, 255, 255, .14); border: none;
  color: #fff; font-size: 26px; line-height: 1; cursor: pointer;
  width: 44px; height: 60px; border-radius: 8px;
}
.gallery-arrow.prev { left: 8px; }
.gallery-arrow.next { right: 8px; }
.gallery-counter { color: #e2e8f0; font-size: 14px; margin-top: 12px; }

/* ---------- 考试中心(2026-10-20) ---------- */
.q-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.q-block { border: 1px solid var(--border); border-radius: 8px; padding: 12px; }
.q-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.q-head strong { flex: 0 0 auto; }
.q-head select { width: auto; min-width: 140px; }
.q-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin-bottom: 8px; }
.q-opts .field { flex-direction: row; align-items: center; gap: 6px; }
.q-opts .field label { margin-bottom: 0; flex: 0 0 18px; }
.q-block.q-room { border-left: 3px solid var(--primary, #4f46e5); }
.q-block.q-missing { border-color: var(--danger); box-shadow: 0 0 0 2px rgba(153, 27, 27, .18); }
.q-section { margin: 14px 0; }
.q-view { border-bottom: 1px solid var(--border); padding: 10px 0; }
.q-view:last-of-type { border-bottom: none; }
.q-view-head { margin-bottom: 6px; word-break: break-all; }
.q-view-opts { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }
.opt-item { color: var(--text-1, #1e293b); }
.opt-correct { color: #166534; font-weight: 600; }
.q-view-ans { color: #166534; font-size: 13px; }
.radio-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.radio-list .radio-item { min-height: 32px; display: flex; align-items: center; }   /* 触控目标 */
.room-meta { color: var(--text-2, #64748b); font-size: 14px; margin-bottom: 12px; }
.score-card { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.score-main { text-align: center; min-width: 120px; }
.score-num { font-size: 44px; font-weight: 700; color: var(--primary, #4f46e5); line-height: 1.1; }
.score-label { color: var(--text-2, #64748b); font-size: 13px; }
.score-side { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }

/* ---------- 练习中心(2026-10-21) ---------- */
.mark-dot { display: inline-block; min-width: 18px; height: 18px; line-height: 18px; text-align: center; border-radius: 4px; font-size: 12px; margin: 0 1px; }
.mark-ok { background: #dcfce7; color: #166534; }
.mark-bad { background: #fee2e2; color: #991b1b; }
.mark-done { background: #fef3c7; color: #92400e; }   /* 问答题待自评 */
.opt-wrong { color: #991b1b; }
.score-sub { color: var(--text-2, #64748b); font-size: 13px; }

/* ---------- 题库 Excel 批量导入(2026-10-21) ---------- */
.q-import { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 10px 0; padding: 10px 12px; border: 1px dashed var(--border); border-radius: 8px; background: #f8fafc; }
.q-import-label { font-weight: 600; color: var(--text-1, #1e293b); }
.q-import input[type="file"] { font-size: 13px; }
.q-import .hint-inline { flex-basis: 100%; }

/* ---------- 多选题+解析(2026-11-02) ---------- */
.ans-multi { display: inline-flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.ans-multi .chk-item { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; cursor: pointer; }   /* 触控目标 */
.ans-multi .chk-item input[type="checkbox"] { width: 16px; height: 16px; }
.q-view-exp { margin-top: 6px; padding: 8px 10px; border-left: 3px solid var(--primary, #4f46e5); background: #f5f7ff; color: var(--text-1, #1e293b); font-size: 13px; border-radius: 0 6px 6px 0; white-space: pre-wrap; }
