/**
 * 客诉管理页面样式（管理端 → 运营管理中心 → 客诉管理）
 *
 * 本阶段仅为页面 UI + 前端交互原型，无真实业务数据。
 * 视觉沿用 B01 黑白灰体系：白色 / 黑色 / 灰色 / 留白 / 圆角 / 轻边框。
 * 状态色仅在需要表达状态时使用：
 *   - 待处理：轻红色标签（需关注）
 *   - D 级客诉：黑底白字标签（克制强调，A/B/C 为浅灰标签）
 *   - 责任归属（组别 + 责任人）：浅灰底信息块适度突出
 */

/* ---- 页面根容器：占满主内容区（与其余页面模块同布局模式） ---- */
#adminPageComplaints {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.complaints-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

/* ---- 顶部固定区（新建客诉按钮，列表滚动时不跟随） ---- */
.complaints-topbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 0 2px 16px;
}

.complaints-new-btn {
  flex-shrink: 0;
  border: 0;
  background: #355944;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.15s;
}
.complaints-new-btn:hover {
  background: #455c4e;
}

/* ---- 主体：左列表 + 右详情（左窄右宽，详情信息较多） ---- */
.complaints-body {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 16px;
  overflow: hidden;
}

/* ---- 左侧客诉列表：独立纵向滚动 ---- */
.complaints-list {
  flex: 0 0 40%;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 2px 6px 4px 2px;
}

.complaints-empty {
  padding: 40px 0;
  text-align: center;
  color: #aeaeb2;
  font-size: 13px;
}

/* ---- 客诉卡片 ---- */
.complaint-card {
  flex-shrink: 0;
  background: #fff;
  border: 1px solid #e8e8ed;
  border-radius: 14px;
  padding: 13px 16px 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.complaint-card:hover {
  border-color: #d0d0d8;
}
/* 当前选中：深一点边框 + 背景略变，不使用大面积颜色 */
.complaint-card.active {
  border-color: #355944;
  background: #fbfbfc;
}

.complaint-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.complaint-card-no {
  font-size: 12px;
  font-weight: 600;
  color: #455c4e;
  letter-spacing: 0.2px;
}

.complaint-card-title {
  font-size: 14px;
  color: #25372f;
  line-height: 1.5;
  margin-bottom: 6px;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 卡片第三行：创建日期 */
.complaint-card-date {
  font-size: 12px;
  color: #8e8e93;
  margin-bottom: 8px;
}

/* 卡片第四行：责任组 + 责任人 */
.complaint-card-responsibility {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 12px;
  color: #6e6e73;
  padding: 7px 10px;
  background: #f7f7f9;
  border: 1px solid #e5ece4;
  border-radius: 8px;
  margin-bottom: 10px;
}
.complaint-card-resp-label {
  color: #aeaeb2;
  flex-shrink: 0;
}
.complaint-card-resp-value {
  color: #455c4e;
  font-weight: 500;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.complaint-card-bottom {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #8e8e93;
}

/* 客诉等级标签：A(一般) ~ D(重大)，四等级不同颜色，低饱和克制用色，严重程度一眼可辨 */
.complaint-level {
  display: inline-block;
  min-width: 22px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 999px;
  background: #edf2ec;
  color: #6e6e73;
  flex-shrink: 0;
}
.complaint-level.level-a {
  color: #5F7F6B;
  background: #EEF5F0;
  border: 1px solid #CFE0D4;
}
.complaint-level.level-b {
  color: #5B6F8C;
  background: #EEF2F7;
  border: 1px solid #D2DBE7;
}
.complaint-level.level-c {
  color: #A56A2A;
  background: #FBF2E8;
  border: 1px solid #ECD6BD;
}
.complaint-level.level-d {
  color: #A94A4A;
  background: #FBECEC;
  border: 1px solid #EBC4C4;
}

/* 状态标签：待处理轻红（需关注），处理中灰色，已处理浅绿（完成） */
.complaint-status {
  display: inline-block;
  font-size: 12px;
  line-height: 1;
  padding: 4px 10px;
  border-radius: 999px;
  background: #edf2ec;
  color: #8e8e93;
  flex-shrink: 0;
}
.complaint-status.pending {
  background: #fdecec;
  color: #e64545;
}
.complaint-status.done {
  background: #e8f3ea;
  color: #2f8a4c;
}

/* 已处理完成提示（详情底部） */
.complaint-done-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #2f8a4c;
  font-weight: 500;
}
.complaint-done-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #2f8a4c;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

/* 无权限提示（非责任组端口查看客诉详情时） */
.complaint-noop-hint {
  font-size: 12px;
  color: #8e8e93;
}

/* ---- 右侧客诉详情：整体固定，内容区独立滚动 ---- */
.complaints-detail {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e8e8ed;
  border-radius: 16px;
  overflow: hidden;
}

.complaint-detail-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 15px 18px;
  border-bottom: 1px solid #edf2ec;
}
.complaint-detail-title {
  font-size: 15px;
  font-weight: 600;
  color: #25372f;
}
.complaint-detail-id {
  font-size: 12px;
  color: #8e8e93;
}

/* 详情内容区：可独立滚动 */
.complaint-detail-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 6px 18px 16px;
}

.complaint-sec {
  padding: 14px 0;
  border-bottom: 1px solid #edf2ec;
}
.complaint-sec:last-child {
  border-bottom: 0;
}
.complaint-sec-title {
  font-size: 13px;
  font-weight: 600;
  color: #25372f;
  margin: 0;
}

/* 模块标题行：标题 + 低存在感「编辑」（小字、灰色，hover 才明显） */
.complaint-sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.complaint-sec-edit {
  border: none;
  background: transparent;
  font-size: 11px;
  color: #c7c7cc;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  user-select: none;
}
.complaint-sec-head:hover .complaint-sec-edit {
  color: #6e6e73;
  background: #eef3ee;
}

/* ---- 详情模块编辑表单 ---- */
.complaint-edit-form {
  margin-top: 4px;
}
.complaint-edit-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.complaint-edit-row .label {
  flex-shrink: 0;
  width: 76px;
  font-size: 13px;
  color: #6e6e73;
  padding-top: 8px;
}
.complaints-form-textarea {
  flex: 1;
  min-width: 0;
  border: 1px solid #d9d9de;
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 13px;
  line-height: 1.6;
  color: #25372f;
  resize: vertical;
  background: #fff;
  font-family: inherit;
}
.complaints-form-textarea:focus {
  outline: none;
  border-color: #355944;
  box-shadow: 0 0 0 2px rgba(29, 29, 31, 0.08);
}
.complaints-form-input {
  flex: 1;
  min-width: 0;
  border: 1px solid #d9d9de;
  border-radius: 8px;
  padding: 8px 11px;
  font-size: 13px;
  color: #25372f;
  background: #fff;
}
.complaints-form-input:focus {
  outline: none;
  border-color: #355944;
  box-shadow: 0 0 0 2px rgba(29, 29, 31, 0.08);
}
.complaint-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

/* 缺失字段占位：暂无记录（灰色弱化） */
.complaint-empty-val {
  color: #c7c7cc;
  font-style: italic;
}

/* 基本信息：两列网格 */
.complaint-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 24px;
}
.complaint-info-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.55;
}
.complaint-info-row .label {
  flex-shrink: 0;
  width: 62px;
  color: #8e8e93;
}
.complaint-info-row .value {
  flex: 1;
  min-width: 0;
  color: #25372f;
  word-break: break-word;
}
.complaint-info-row .value.strong {
  font-weight: 600;
}

/* 责任归属：浅灰底信息块，适度突出（本客诉系统的核心：责任归属） */
.complaint-responsibility {
  margin-top: 12px;
  padding: 12px 14px;
  background: #f7f7f9;
  border: 1px solid #e5ece4;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 客诉内容 / 顾客诉求正文 */
.complaint-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  color: #455c4e;
  white-space: pre-wrap;
  word-break: break-word;
}

/* 处理结果输入 */
.complaint-result-input {
  box-sizing: border-box;
  width: 100%;
  resize: none;
  border: 1px solid #e3e3e8;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.6;
  color: #25372f;
  font-family: inherit;
  min-height: 96px;
  background: #fff;
}
.complaint-result-input:focus {
  outline: none;
  border-color: #355944;
}
.complaint-char-count {
  margin-top: 6px;
  text-align: right;
  font-size: 12px;
  color: #aeaeb2;
}

/* 底部操作区：固定在详情底部，不随内容滚动 */
.complaint-detail-actions {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 12px 16px 16px;
  border-top: 1px solid #edf2ec;
  background: #fff;
}
.complaint-btn {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
/* 主按钮：黑色「提交处理结果」 */
.complaint-btn.primary {
  border: 0;
  background: #355944;
  color: #fff;
}
.complaint-btn.primary:hover {
  background: #455c4e;
}
/* 次按钮：白底 / 浅边框「标记处理中」 */
.complaint-btn.secondary {
  background: #fff;
  border: 1px solid #e3e3e8;
  color: #455c4e;
  font-weight: 500;
}
.complaint-btn.secondary:hover {
  background: #f4f7f3;
  border-color: #c7c7cc;
}
.complaint-btn.secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---- 轻量 toast ---- */
.complaints-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 2100;
  background: #355944;
  color: #fff;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.complaints-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ---- 新建客诉弹窗（本轮为 UI + 前端演示交互，无真实业务逻辑） ---- */
.complaints-modal-mask {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
}
.complaints-modal-mask.show {
  display: flex;
}
.complaints-modal {
  width: 640px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 48px);
  background: #fff;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}
.complaints-modal-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 4px;
}
.complaints-modal-title {
  font-size: 17px;
  font-weight: 600;
  color: #25372f;
}
.complaints-modal-close {
  border: 0;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: #8e8e93;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}
.complaints-modal-close:hover {
  color: #25372f;
  background: #f4f7f3;
}
.complaints-modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 24px 8px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
/* 新建客诉表单分区 */
.complaints-form-section {
  border: 1px solid #deebdd;
  border-radius: 12px;
  background: #fbfbfd;
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.complaints-form-section-title {
  margin: 0 0 2px;
  font-size: 13px;
  font-weight: 700;
  color: #333;
  padding-bottom: 8px;
  border-bottom: 1px solid #efeff4;
}
.complaints-modal-foot {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 24px 20px;
}

/* 表单字段 */
.complaints-form-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.complaints-form-label {
  font-size: 13px;
  font-weight: 600;
  color: #25372f;
}
.complaints-form-required {
  color: #e64545;
  margin-left: 2px;
}
.complaints-form-input,
.complaints-form-textarea {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid #e3e3e8;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13px;
  line-height: 1.55;
  color: #25372f;
  background: #fff;
  font-family: inherit;
}
.complaints-form-textarea {
  resize: none;
  min-height: 60px;
}
.complaints-form-input:focus,
.complaints-form-textarea:focus {
  outline: none;
  border-color: #355944;
}
/* 组别下拉：复用输入框视觉，隐藏系统箭头改为简洁 SVG 箭头 */
.complaints-form-select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 34px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%236e6e73' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-color: #fff;
}
.complaints-form-select:focus {
  outline: none;
  border-color: #355944;
}

/* 客诉等级：A/B/C/D 单选按钮（字母 + 名称），默认 A */
.complaints-level-options {
  display: flex;
  gap: 10px;
}
.complaints-level-option {
  min-width: 84px;
  border: 1px solid #e3e3e8;
  background: #fff;
  color: #25372f;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.complaints-level-option .lv {
  font-weight: 700;
  margin-right: 5px;
}
.complaints-level-option:hover {
  border-color: #c7c7cc;
  background: #f4f7f3;
}
.complaints-level-option.active {
  background: #355944;
  border-color: #355944;
  color: #fff;
}

/* 等级说明区域：仅显示当前选中等级（判断标准 / 常见 / 处理原则），浅灰块 */
.complaints-level-info {
  margin-top: 10px;
  padding: 10px 12px;
  background: #f4f7f3;
  border: 1px solid #e5ece4;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.7;
  color: #6e6e73;
}
.complaints-level-info-row {
  display: flex;
  gap: 8px;
}
.complaints-level-info-row:not(:last-child) {
  margin-bottom: 4px;
}
.complaints-level-info-row .info-lbl {
  flex-shrink: 0;
  min-width: 3em;
  font-weight: 600;
  color: #25372f;
}

/* 必填校验提示 */
.complaints-form-error {
  display: none;
  font-size: 12px;
  color: #e64545;
}
.complaints-form-row.has-error .complaints-form-error {
  display: block;
}
.complaints-form-row.has-error .complaints-form-input,
.complaints-form-row.has-error .complaints-form-textarea {
  border-color: #e64545;
}

/* 字段小提示（组别可多选 / 图片数量等） */
.complaints-form-tip {
  margin-left: 8px;
  font-size: 12px;
  font-weight: 400;
  color: #8e8e93;
}

/* 责任组别多选：按钮组，至少选 1、可取消、无重复、不可自由输入 */
.complaints-group-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.complaints-group-option {
  min-width: 84px;
  border: 1px solid #e3e3e8;
  background: #fff;
  color: #455c4e;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.complaints-group-option:hover {
  border-color: #c7c7cc;
  background: #f4f7f3;
}
.complaints-group-option.active {
  background: #355944;
  border-color: #355944;
  color: #fff;
  font-weight: 600;
}

/* ---- 新建弹窗：图片上传区（最多 2 张，预览缩略图 + 删除 + 重新选择） ---- */
.complaint-form-image-area {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.complaint-form-images {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.complaint-form-img {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e5ece4;
  background: #f4f7f3;
  cursor: zoom-in;
  flex-shrink: 0;
}
.complaint-form-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.complaint-form-img-del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.complaint-form-img-del:hover {
  background: rgba(0, 0, 0, 0.75);
}
.complaint-form-img-add {
  width: 96px;
  height: 96px;
  border: 1px dashed #c7c7cc;
  border-radius: 10px;
  background: #fafafc;
  color: #6e6e73;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.complaint-form-img-add:hover {
  border-color: #355944;
  color: #25372f;
  background: #f4f7f3;
}
.complaint-form-file-input {
  display: none;
}

/* ---- 详情页：客诉图片缩略图区（客诉内容之后 / 顾客诉求之前；四端可见） ---- */
.complaint-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.complaint-thumb {
  width: 96px;
  height: 96px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e5ece4;
  background: #f4f7f3;
  cursor: zoom-in;
  flex-shrink: 0;
  transition: transform 0.15s, box-shadow 0.15s;
}
.complaint-thumb:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}
.complaint-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---- 图片预览遮罩：背景变暗、大图、保持原始比例不被裁剪 ---- */
.complaint-lightbox-mask {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.72);
  padding: 40px;
  box-sizing: border-box;
}
.complaint-lightbox-mask.show {
  display: flex;
}
.complaint-lightbox-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain; /* 保持原始比例，不被裁剪 */
  border-radius: 8px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
}
.complaint-lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.complaint-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* 详情页：处理结果输入区 */
.complaint-result-input {
  box-sizing: border-box;
  width: 100%;
  min-height: 80px;
  border: 1px solid #e3e3e8;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13px;
  line-height: 1.55;
  color: #25372f;
  background: #fff;
  font-family: inherit;
  resize: none;
}
.complaint-result-input:focus {
  outline: none;
  border-color: #355944;
}
.complaint-char-count {
  margin-top: 6px;
  font-size: 12px;
  color: #8e8e93;
  text-align: right;
}
.complaint-info-row .value.strong {
  font-weight: 600;
  color: #25372f;
}

/* 弹窗底部按钮 */
.complaints-modal-btn {
  border: 0;
  background: #355944;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 22px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.15s;
}
.complaints-modal-btn:hover {
  background: #455c4e;
}
.complaints-modal-btn.ghost {
  background: #fff;
  border: 1px solid #e3e3e8;
  color: #455c4e;
  font-weight: 500;
}
.complaints-modal-btn.ghost:hover {
  background: #f4f7f3;
  border-color: #c7c7cc;
}

/* ---- 窄屏基础适配（1440px 桌面完整可用；小屏降级为上下布局） ---- */
@media (max-width: 1100px) {
  .complaints-list {
    flex: 0 0 46%;
  }
}
@media (max-width: 768px) {
  .complaints-topbar {
    padding-bottom: 12px;
  }
  .complaints-body {
    flex-direction: column;
  }
  .complaints-list {
    flex: 0 0 46%;
    min-height: 220px;
  }
  .complaints-detail {
    flex: 1;
  }
  .complaint-info-grid {
    grid-template-columns: 1fr;
  }
  .complaints-modal {
    width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);
  }
  .complaints-modal-head {
    padding: 16px 18px 4px;
  }
  .complaints-modal-body {
    padding: 14px 18px 8px;
  }
  .complaints-modal-foot {
    padding: 12px 18px 16px;
  }
}

/* ========================================================================
   2026-09 客诉管理全宽列表 + 详情弹窗
   仅重排现有前端数据和操作入口，不改变客诉字段、API 或权限。
   ======================================================================== */
.complaints-page {
  overflow-y: auto;
  padding: 0 2px 24px;
  color: #25372f;
}

.complaints-topbar {
  align-items: flex-start;
  padding: 2px 0 20px;
}
.c-complaint-heading {
  flex: 1;
  min-width: 0;
}
.c-complaint-heading h1 {
  margin: 0;
  color: #20382c;
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.c-complaint-heading p {
  margin: 8px 0 0;
  color: #738078;
  font-size: 13px;
  line-height: 1.6;
}
.complaints-new-btn {
  min-height: 38px;
  padding: 0 18px;
  border: 1px solid #355944;
  box-shadow: 0 4px 10px rgba(53, 89, 68, 0.12);
}

.complaints-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.complaints-stat-card {
  min-height: 86px;
  box-sizing: border-box;
  padding: 16px 18px;
  border: 1px solid #e3e9e4;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(33, 57, 44, 0.025);
}
.complaints-stat-card span {
  display: block;
  color: #77827b;
  font-size: 12px;
}
.complaints-stat-card strong {
  display: block;
  margin-top: 8px;
  color: #244432;
  font-size: 24px;
  line-height: 1;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.complaints-stat-card.alert strong {
  color: #a94949;
}

.c-complaint-filters {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 132px 126px 148px minmax(190px, auto) 66px;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid #e3e9e4;
  border-radius: 12px;
  background: #fff;
}
.c-complaint-filters input,
.c-complaint-filters select,
.complaints-reset-btn {
  min-height: 38px;
  box-sizing: border-box;
  border: 1px solid #dce4de;
  border-radius: 9px;
  background-color: #fff;
  color: #31473a;
  font: inherit;
  font-size: 13px;
}
.c-complaint-filters input:focus,
.c-complaint-filters select:focus {
  outline: none;
  border-color: #71907d;
  box-shadow: 0 0 0 3px rgba(53, 89, 68, 0.08);
}
.complaints-search {
  position: relative;
}
.complaints-search > span {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 13px;
  color: #869189;
  font-size: 19px;
  transform: translateY(-52%);
  pointer-events: none;
}
.complaints-search input {
  width: 100%;
  padding: 0 12px 0 38px;
}
.c-complaint-filters select {
  width: 100%;
  padding: 0 32px 0 12px;
}
.complaints-date {
  display: flex;
  align-items: center;
  min-height: 38px;
  box-sizing: border-box;
  padding-left: 12px;
  border: 1px solid #dce4de;
  border-radius: 9px;
  color: #6f7d74;
  font-size: 12px;
}
.complaints-date span {
  flex-shrink: 0;
  margin-right: 6px;
}
.complaints-date input {
  min-width: 0;
  width: 100%;
  padding: 0 8px;
  border: 0;
}
.complaints-date input:focus {
  box-shadow: none;
}
.complaints-reset-btn {
  padding: 0 12px;
  color: #607168;
  cursor: pointer;
}
.complaints-reset-btn:hover {
  border-color: #b9c7bd;
  background: #f7faf7;
}

.complaints-body {
  display: block;
  flex: none;
  min-height: 0;
  overflow: visible;
}
.complaints-list {
  display: block;
  flex: none;
  min-height: 0;
  overflow: visible;
  padding: 0;
  border: 1px solid #e3e9e4;
  border-radius: 14px;
  background: #fff;
}
.complaints-list-head,
.complaint-card {
  display: grid;
  grid-template-columns: 122px minmax(250px, 2fr) minmax(150px, 1.05fr) 128px 138px 132px 18px;
  gap: 14px;
  align-items: center;
}
.complaints-list-head {
  min-height: 40px;
  padding: 0 18px;
  border-bottom: 1px solid #e9eee9;
  background: #f7f9f7;
  color: #7c8981;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.complaint-card {
  width: 100%;
  min-height: 96px;
  box-sizing: border-box;
  padding: 15px 18px;
  border: 0;
  border-bottom: 1px solid #edf1ee;
  border-radius: 0;
  background: #fff;
  color: inherit;
  font: inherit;
  text-align: left;
}
.complaint-card:first-of-type {
  border-radius: 0;
}
.complaint-card:last-child {
  border-bottom: 0;
  border-radius: 0 0 14px 14px;
}
.complaint-card:hover,
.complaint-card:focus-visible {
  border-color: #edf1ee;
  background: #f8faf8;
  outline: none;
}
.complaint-card-state {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 6px;
}
.complaint-card-main {
  min-width: 0;
}
.complaint-card-title {
  display: block;
  margin: 0 0 5px;
  overflow: hidden;
  color: #233a2d;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.complaint-card-summary {
  display: -webkit-box;
  overflow: hidden;
  color: #69776f;
  font-size: 12px;
  line-height: 1.55;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.complaint-card-owner {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
  color: #405449;
  font-size: 12px;
}
.complaint-card-owner span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.complaint-card-owner em {
  display: inline-block;
  min-width: 46px;
  color: #98a099;
  font-style: normal;
}
.complaint-card-date,
.complaint-card-duration,
.complaint-card-no {
  color: #69776f;
  font-size: 12px;
  font-style: normal;
  font-variant-numeric: tabular-nums;
}
.complaint-card-duration.overdue {
  color: #b34747;
  font-weight: 600;
}
.complaint-card-no {
  color: #9aa39d;
  font-weight: 400;
  letter-spacing: 0;
}
.complaint-card-arrow {
  color: #a7b0aa;
  font-size: 20px;
  text-align: right;
}
.complaints-empty {
  display: flex;
  min-height: 240px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 7px;
}
.complaints-empty strong {
  color: #53645a;
  font-size: 14px;
}
.complaints-empty span {
  color: #9ca49f;
  font-size: 12px;
}

/* 等级与状态采用低饱和小标签，不给整行铺状态色。 */
.complaint-level,
.complaint-status {
  box-sizing: border-box;
  border: 1px solid transparent;
  font-weight: 650;
}
.complaint-level.level-a {
  color: #a33f3f;
  background: #fbecec;
  border-color: #efd0d0;
}
.complaint-level.level-b {
  color: #9a6729;
  background: #fbf2e5;
  border-color: #ecd9bd;
}
.complaint-level.level-c {
  color: #5a6c80;
  background: #edf2f6;
  border-color: #d5dfe7;
}
.complaint-level.level-d {
  color: #743c48;
  background: #f3e9ec;
  border-color: #dfcbd0;
}
.complaint-status.pending {
  color: #8b6232;
  background: #f7f1e8;
  border-color: #eadcc9;
}
.complaint-status.done {
  color: #60786a;
  background: #edf3ee;
  border-color: #d8e4da;
}

/* 详情弹窗 */
.complaint-detail-mask {
  position: fixed;
  inset: 0;
  z-index: 1900;
  display: none;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 24px;
  background: rgba(21, 35, 27, 0.48);
  backdrop-filter: blur(2px);
}
.complaint-detail-mask.show {
  display: flex;
}
.complaint-detail-modal {
  display: flex;
  width: min(1080px, calc(100vw - 48px));
  max-height: 88vh;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(24, 40, 30, 0.25);
}
.complaint-detail-head {
  align-items: flex-start;
  padding: 22px 24px 20px;
  background: #fbfcfb;
}
.complaint-detail-heading {
  min-width: 0;
}
.complaint-detail-badges {
  display: flex;
  gap: 7px;
  margin-bottom: 10px;
}
.complaint-detail-title {
  margin: 0;
  color: #20382c;
  font-size: 21px;
  line-height: 1.35;
  font-weight: 680;
}
.complaint-detail-meta {
  margin: 7px 0 0;
  color: #859088;
  font-size: 12px;
}
.complaint-detail-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 20px;
}
.complaint-header-action {
  min-height: 36px;
  padding: 0 15px;
}
.complaint-detail-close {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  margin-left: 2px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #7d8981;
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
}
.complaint-detail-close:hover {
  background: #edf2ee;
  color: #2f4738;
}
.complaint-detail-scroll {
  padding: 4px 24px 24px;
}
.complaint-sec {
  padding: 20px 0;
  border-bottom-color: #e9eee9;
}
.complaint-sec-title {
  font-size: 14px;
  color: #294332;
}
.complaint-info-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 34px;
}
.complaint-info-row .label {
  width: 70px;
  color: #8b958e;
}
.complaint-info-row .value {
  color: #30473a;
}
.complaint-feedback {
  margin: 14px 0;
  padding: 18px;
  border: 1px solid #e1e9e3;
  border-radius: 12px;
  background: #f8faf8;
}
.complaint-feedback .complaint-sec-head {
  margin-bottom: 12px;
}
.complaint-feedback-images {
  margin-top: 16px;
}
.complaint-images-title {
  margin: 0 0 9px;
  color: #718078;
  font-size: 12px;
  font-weight: 600;
}
.complaint-thumb {
  width: 112px;
  height: 84px;
}
.complaint-timeline {
  position: relative;
  margin-top: 2px;
  padding-left: 18px;
}
.complaint-timeline::before {
  position: absolute;
  top: 7px;
  bottom: 7px;
  left: 4px;
  width: 1px;
  background: #d8e2da;
  content: '';
}
.complaint-timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 145px minmax(0, 1fr);
  gap: 16px;
  padding: 0 0 16px;
  color: #405449;
  font-size: 13px;
}
.complaint-timeline-item:last-child {
  padding-bottom: 0;
}
.complaint-timeline-item::before {
  position: absolute;
  top: 5px;
  left: -18px;
  width: 9px;
  height: 9px;
  box-sizing: border-box;
  border: 2px solid #6f8c79;
  border-radius: 50%;
  background: #fff;
  content: '';
}
.complaint-timeline-item.completed::before {
  background: #6f8c79;
}
.complaint-timeline-item time {
  color: #8b958e;
  font-size: 12px;
}
.complaint-detail-actions {
  min-height: 64px;
  box-sizing: border-box;
  padding: 12px 24px;
  background: #fbfcfb;
}
.complaint-edit-row .label {
  width: 82px;
}
.complaints-level-options,
.complaints-group-options {
  flex-wrap: wrap;
}

@media (max-width: 1180px) {
  .c-complaint-filters {
    grid-template-columns: minmax(240px, 1fr) repeat(3, 122px) 190px 62px;
  }
  .complaints-list {
    flex: none;
  }
  .complaints-list-head,
  .complaint-card {
    grid-template-columns: 112px minmax(210px, 2fr) minmax(135px, 1fr) 112px 122px 112px 14px;
    gap: 10px;
  }
}

@media (max-width: 900px) {
  .complaints-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .c-complaint-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .complaints-search {
    grid-column: 1 / -1;
  }
  .complaints-list-head {
    display: none;
  }
  .complaint-card {
    grid-template-columns: 105px minmax(220px, 1fr) minmax(140px, 0.65fr) 110px;
  }
  .complaint-card-date,
  .complaint-card-duration,
  .complaint-card-no,
  .complaint-card-arrow {
    display: none;
  }
}

@media (max-width: 600px) {
  .complaints-page {
    padding-bottom: 16px;
  }
  .complaints-topbar {
    align-items: flex-start;
    gap: 14px;
  }
  .c-complaint-heading h1 {
    font-size: 22px;
  }
  .c-complaint-heading p {
    max-width: 245px;
    font-size: 12px;
  }
  .complaints-new-btn {
    padding: 0 13px;
  }
  .complaints-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .complaints-stat-card {
    min-height: 72px;
    padding: 13px 14px;
  }
  .complaints-stat-card strong {
    margin-top: 6px;
    font-size: 21px;
  }
  .c-complaint-filters {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px;
  }
  .complaints-search,
  .complaints-date {
    grid-column: 1 / -1;
  }
  .complaints-reset-btn {
    width: 100%;
  }
  .complaints-list {
    flex: none;
    min-height: 0;
  }
  .complaint-card {
    display: grid;
    min-height: 0;
    grid-template-columns: 1fr auto;
    gap: 10px 12px;
    padding: 15px;
  }
  .complaint-card-state {
    grid-column: 1 / -1;
    grid-row: 1;
  }
  .complaint-card-main {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .complaint-card-owner {
    grid-column: 1;
    grid-row: 3;
  }
  .complaint-card-date,
  .complaint-card-duration,
  .complaint-card-no {
    display: block;
  }
  .complaint-card-date {
    grid-column: 2;
    grid-row: 3;
    align-self: start;
  }
  .complaint-card-duration {
    grid-column: 1;
    grid-row: 4;
  }
  .complaint-card-no {
    grid-column: 2;
    grid-row: 4;
    text-align: right;
  }
  .complaint-detail-mask {
    align-items: flex-end;
    padding: 0;
  }
  .complaint-detail-modal {
    width: 100%;
    max-height: 92vh;
    border-radius: 18px 18px 0 0;
  }
  .complaint-detail-head {
    padding: 18px 16px 15px;
  }
  .complaint-detail-title {
    font-size: 18px;
  }
  .complaint-detail-head-actions {
    align-items: flex-end;
    flex-direction: column-reverse;
    gap: 6px;
    margin-left: 10px;
  }
  .complaint-header-action {
    display: none;
  }
  .complaint-detail-scroll {
    padding: 0 16px 18px;
  }
  .complaint-info-grid {
    grid-template-columns: 1fr;
  }
  .complaint-timeline-item {
    grid-template-columns: 1fr;
    gap: 3px;
  }
  .complaint-detail-actions {
    padding: 10px 16px;
  }
  .complaint-detail-actions .complaint-btn {
    width: 100%;
  }
  .complaints-modal {
    width: calc(100vw - 20px);
    max-width: none;
    max-height: calc(100vh - 20px);
  }
  .complaints-level-option,
  .complaints-group-option {
    min-width: calc(50% - 5px);
  }
}

/* c01-vnext.css 在本文件之后载入；用页面作用域锁定本页新版布局。 */
#adminPageComplaints .complaints-topbar {
  align-items: flex-start;
  padding-bottom: 20px;
}
#adminPageComplaints .complaints-body {
  display: block;
  gap: 0;
}
#adminPageComplaints .c-complaint-filters {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 132px 126px 148px minmax(190px, auto) 66px;
  flex-wrap: initial;
  gap: 10px;
  margin-bottom: 14px;
}
#adminPageComplaints .c-complaint-filters input,
#adminPageComplaints .c-complaint-filters select {
  min-width: 0;
  padding-top: 0;
  padding-bottom: 0;
  flex: none;
}
#adminPageComplaints .complaints-search input {
  padding-left: 38px;
}
#adminPageComplaints .complaints-list {
  flex: none;
  flex-basis: auto;
  padding: 0;
}
#adminPageComplaints .complaint-card {
  margin: 0;
  padding: 15px 18px;
  border: 0;
  border-bottom: 1px solid #edf1ee;
  border-radius: 0;
  background: #fff;
}
#adminPageComplaints .complaint-card:hover,
#adminPageComplaints .complaint-card:focus-visible {
  border-color: #edf1ee;
  background: #f8faf8;
}
#adminPageComplaints .complaint-card:last-child {
  border-bottom: 0;
  border-radius: 0 0 14px 14px;
}

@media (max-width: 1180px) {
  #adminPageComplaints .c-complaint-filters {
    grid-template-columns: minmax(240px, 1fr) repeat(3, 122px) 190px 62px;
  }
}
@media (max-width: 900px) {
  #adminPageComplaints .c-complaint-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  #adminPageComplaints .c-complaint-filters {
    grid-template-columns: 1fr 1fr;
  }
  #adminPageComplaints .complaint-card {
    padding: 15px;
  }
}
