/* ============================================================
   Kango 看购 · 客户服务投诉受理中心  —  按 Figma「官网 / 2投诉中心」还原
   依赖 style.css 的设计令牌（--brand / --ink / --gray / --line / --max）
   本文件只写本页特有的组件：pill 选择器 / 上传框 / 工单列表 / 回复时间线 /
   分页 / 登录弹窗 / toast
   ============================================================ */

/* ---------- 页面骨架 ---------- */
.cp-page {
  padding: 60px 0 40px;
  min-height: 60vh;
}
.cp-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 40px;
}
.cp-head h1 {
  font-size: 34px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}
.cp-head-link {
  font-size: 17px;
  color: var(--gray);
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s;
}
.cp-head-link:hover {
  color: var(--brand);
}
.cp-head-link .arr {
  margin-left: 4px;
}

.cp-lead {
  font-size: 22px;
  color: var(--ink);
  margin-bottom: 28px;
}
.cp-lead .req {
  color: #f5222d;
  margin-left: 2px;
}

.cp-block {
  margin-bottom: 44px;
}
.cp-label {
  font-size: 18px;
  color: var(--ink);
  margin-bottom: 18px;
}
.cp-label .cp-label-sub {
  font-size: 15px;
  color: var(--gray);
  margin-left: 14px;
}

/* ---------- pill 单选（投诉对象类型） ---------- */
.cp-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}
.cp-pill {
  min-width: 116px;
  height: 52px;
  padding: 0 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #e3e3e3;
  border-radius: 10px;
  cursor: pointer;
  transition:
    border-color 0.2s,
    color 0.2s;
}
.cp-pill:hover {
  border-color: var(--brand-light);
}
.cp-pill.is-on {
  border-color: var(--brand);
  color: var(--brand);
}
/* 详情页里的只读 pill */
.cp-pill.is-static {
  cursor: default;
  border-color: #e3e3e3;
  color: var(--ink);
}

/* ---------- 下拉（投诉类别） ---------- */
.cp-select {
  height: 48px;
  min-width: 240px;
  padding: 0 14px;
  font-size: 16px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #e3e3e3;
  border-radius: 10px;
  outline: none;
  cursor: pointer;
}
.cp-select:focus {
  border-color: var(--brand);
}

/* ---------- 文本域 ---------- */
.cp-textarea-wrap {
  position: relative;
}
.cp-textarea {
  width: 100%;
  min-height: 235px;
  padding: 22px 24px;
  font-size: 16px;
  line-height: 1.8;
  color: var(--ink);
  font-family: inherit;
  background: #fff;
  border: 1px solid #e3e3e3;
  border-radius: 12px;
  outline: none;
  resize: vertical;
}
.cp-textarea:focus {
  border-color: var(--brand);
}
.cp-textarea::placeholder {
  color: #bdbdbd;
}
.cp-counter {
  position: absolute;
  right: 16px;
  bottom: 12px;
  font-size: 13px;
  color: var(--gray-light);
}
/* 详情页只读正文 */
.cp-readbox {
  min-height: 180px;
  padding: 22px 24px;
  font-size: 16px;
  line-height: 1.9;
  color: var(--ink);
  background: #fff;
  border: 1px solid #e3e3e3;
  border-radius: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------- 上传截图 ---------- */
.cp-upload {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-start;
}
.cp-upload-btn {
  width: 260px;
  height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #fafafa;
  border: 1px dashed #d9d9d9;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s;
}
.cp-upload-btn:hover {
  border-color: var(--brand);
}
.cp-upload-btn svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: var(--gray);
  stroke-width: 1.6;
}
.cp-upload-btn .t1 {
  font-size: 16px;
  color: var(--ink);
}
.cp-upload-btn .t2 {
  font-size: 13px;
  color: var(--gray-light);
  padding: 0 12px;
  text-align: center;
}
.cp-upload-btn.is-busy {
  opacity: 0.6;
  pointer-events: none;
}
.cp-thumb {
  position: relative;
  width: 150px;
  height: 150px;
  border-radius: 10px;
  overflow: hidden;
  background: #f5f5f5;
}
.cp-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cp-thumb .del {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  line-height: 22px;
  text-align: center;
  font-size: 15px;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 50%;
  cursor: pointer;
}

/* 详情页证据图 */
.cp-shots {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}
.cp-shots a {
  width: 145px;
  height: 128px;
  border-radius: 8px;
  overflow: hidden;
  background: #f5f5f5;
  display: block;
}
.cp-shots img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------- 联系方式 ---------- */
.cp-field {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.cp-field > label {
  width: 76px;
  font-size: 17px;
  color: var(--ink);
  text-align: left;
}
.cp-input {
  width: 344px;
  height: 48px;
  padding: 0 18px;
  font-size: 16px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #e3e3e3;
  border-radius: 10px;
  outline: none;
}
.cp-input:focus {
  border-color: var(--brand);
}
.cp-input::placeholder {
  color: #bdbdbd;
}
.cp-input[readonly] {
  background: #fafafa;
  color: var(--gray);
}
/* 投诉标题这类整行输入 */
.cp-input-wide {
  width: 100%;
  max-width: 720px;
}

/* 留言里的图片：小一号的上传位 + 缩略图 */
.cp-post-upload {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
}
.cp-post-add {
  width: 96px;
  height: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 13px;
  color: var(--gray);
  background: #fafafa;
  border: 1px dashed #d9d9d9;
  border-radius: 8px;
  cursor: pointer;
}
.cp-post-add:hover {
  border-color: var(--brand);
}
.cp-post-add .plus {
  font-size: 22px;
  line-height: 1;
  color: var(--gray-light);
}
.cp-post-upload .cp-thumb {
  width: 96px;
  height: 96px;
}

/* ---------- 主按钮 ---------- */
.cp-btn {
  min-width: 240px;
  height: 64px;
  padding: 0 32px;
  font-size: 20px;
  color: #fff;
  background: linear-gradient(90deg, var(--brand-light), var(--brand));
  border: none;
  border-radius: 34px;
  cursor: pointer;
  transition: opacity 0.2s;
}
.cp-btn:hover {
  opacity: 0.92;
}
.cp-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.cp-btn-sm {
  min-width: 120px;
  height: 42px;
  font-size: 16px;
  border-radius: 21px;
}
.cp-btn-ghost {
  background: #fff;
  color: var(--gray);
  border: 1px solid #e3e3e3;
}

/* ---------- 我的投诉列表 ---------- */
.cp-list {
  border-top: 1px solid var(--line);
}
.cp-item {
  display: flex;
  gap: 20px;
  padding: 24px 4px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.2s;
}
.cp-item:hover {
  background: #fffaf5;
}
.cp-item-thumb {
  width: 92px;
  height: 92px;
  flex: none;
  border-radius: 8px;
  background: #f5f5f5
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 24 24' fill='%23d5d5d5'%3E%3Cpath d='M21 5H3a1 1 0 00-1 1v12a1 1 0 001 1h18a1 1 0 001-1V6a1 1 0 00-1-1zm-1 11l-4.5-5-3.5 4-2.5-3L5 16h15z'/%3E%3C/svg%3E")
    center/28px no-repeat;
  overflow: hidden;
}
.cp-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cp-item-main {
  flex: 1;
  min-width: 0;
}
.cp-item-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.cp-tag {
  font-size: 13px;
  color: var(--gray);
  background: #f5f5f5;
  border-radius: 4px;
  padding: 3px 10px;
}
.cp-item-time {
  margin-left: auto;
  font-size: 14px;
  color: var(--gray-light);
}
.cp-item-title {
  font-size: 17px;
  color: var(--ink);
  font-weight: 600;
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cp-item-detail {
  font-size: 15px;
  color: var(--gray);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cp-status {
  font-size: 13px;
  padding: 3px 10px;
  border-radius: 4px;
}
.cp-status.s1 {
  color: #fa8c16;
  background: #fff5e8;
} /* 待处理 */
.cp-status.s2 {
  color: #1677ff;
  background: #eaf3ff;
} /* 处理中 */
.cp-status.s3 {
  color: #52a447;
  background: #eef8ec;
} /* 已处理 */
.cp-status.s4 {
  color: #999;
  background: #f2f2f2;
} /* 已驳回 */

.cp-empty {
  padding: 80px 0;
  text-align: center;
  color: var(--gray-light);
  font-size: 16px;
}
.cp-empty a {
  color: var(--brand);
  cursor: pointer;
}

/* ---------- 分页 ---------- */
.cp-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 44px 0 10px;
  font-size: 15px;
  color: var(--gray);
}
.cp-pager .pg {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  color: var(--ink);
}
.cp-pager .pg:hover {
  color: var(--brand);
}
.cp-pager .pg.is-on {
  background: var(--brand);
  color: #fff;
}
.cp-pager .pg.is-off {
  color: var(--gray-light);
  cursor: not-allowed;
}
.cp-pager .jump {
  width: 62px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid #e3e3e3;
  border-radius: 16px;
  outline: none;
  text-align: center;
}

/* ---------- 详情：回复区 ---------- */
.cp-sep {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 56px 0 28px;
  color: var(--ink);
  font-size: 17px;
}
.cp-sep::before,
.cp-sep::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.cp-sep .dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--brand);
  display: inline-block;
  position: relative;
}
.cp-sep .dot::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: #fff;
}
.cp-sep .txt {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.cp-reply-box {
  background: #fafafa;
  border-radius: 12px;
  padding: 26px 28px;
  font-size: 16px;
  line-height: 1.9;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 150px;
}
.cp-reply-empty {
  background: #fafafa;
  border-radius: 12px;
  padding: 56px 20px;
  text-align: center;
  color: var(--gray-light);
  font-size: 15px;
  line-height: 2;
}
.cp-reply-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
  margin-top: 14px;
  font-size: 14px;
  color: var(--gray-light);
}
.cp-reply-foot .act {
  color: var(--brand);
  cursor: pointer;
}

/* 留言时间线 */
.cp-thread {
  margin-top: 26px;
}
.cp-msg {
  padding: 18px 0;
  border-bottom: 1px dashed var(--line);
}
.cp-msg:last-child {
  border-bottom: none;
}
.cp-msg-head {
  font-size: 14px;
  color: var(--gray-light);
  margin-bottom: 8px;
}
.cp-msg-head .who {
  color: var(--gray);
}
.cp-msg-body {
  font-size: 16px;
  line-height: 1.9;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}
.cp-msg-imgs {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.cp-msg-imgs img {
  width: 110px;
  height: 96px;
  object-fit: cover;
  border-radius: 6px;
}

/* 留言输入 */
.cp-post {
  margin-top: 20px;
  display: none;
}
.cp-post.is-open {
  display: block;
}
.cp-post .cp-textarea {
  min-height: 110px;
}
.cp-post-act {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 12px;
}

/* ---------- 登录弹窗 ---------- */
.cp-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}
.cp-mask.is-open {
  display: flex;
}
.cp-modal {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 16px;
  padding: 32px 28px 28px;
  position: relative;
}
.cp-modal h3 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 6px;
}
.cp-modal .sub {
  font-size: 14px;
  color: var(--gray);
  margin-bottom: 22px;
}
.cp-modal .close {
  position: absolute;
  top: 14px;
  right: 18px;
  font-size: 22px;
  line-height: 1;
  color: var(--gray-light);
  cursor: pointer;
}
.cp-modal .cp-input {
  width: 100%;
}
.cp-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  align-items: center;
}
.cp-row .cp-input {
  flex: 1;
  min-width: 0;
}
.cp-captcha-img {
  width: 110px;
  height: 48px;
  border-radius: 8px;
  border: 1px solid #e3e3e3;
  cursor: pointer;
  background: #f5f5f5;
  flex: none;
}
/* 登录方式切换 */
.cp-tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid #eee;
  margin-bottom: 20px;
}
.cp-tab {
  padding: 0 2px 10px;
  font-size: 15px;
  color: var(--gray);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.cp-tab.is-on {
  color: var(--brand);
  font-weight: 600;
  border-bottom-color: var(--brand);
}
.cp-tabpane {
  display: none;
}
.cp-tabpane.is-on {
  display: block;
}

/* 扫码登录 */
.cp-qr-wrap {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 4px auto 0;
  border: 1px solid #e3e3e3;
  border-radius: 12px;
  overflow: hidden;
  background: #fafafa;
}
.cp-qr-img {
  width: 100%;
  height: 100%;
  display: block;
}
/* 二维码失效 / 已扫描时盖上去，避免用户对着一张废码干等 */
.cp-qr-cover {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.94);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px;
  text-align: center;
}
.cp-qr-cover[hidden] {
  display: none;
}
.cp-qr-cover-txt {
  font-size: 14px;
  color: var(--gray);
  line-height: 1.5;
}
.cp-qr-wrap .cp-btn-sm {
  width: auto;
  min-width: 0;
  height: 34px;
  font-size: 13px;
  padding: 0 14px;
  margin-top: 0;
}
.cp-qr-tip {
  margin: 16px 0 2px;
  font-size: 13px;
  color: var(--gray);
  text-align: center;
  line-height: 1.6;
}

.cp-modal .cp-btn {
  width: 100%;
  min-width: 0;
  height: 52px;
  font-size: 18px;
  margin-top: 8px;
}
.cp-modal-err {
  min-height: 20px;
  font-size: 13px;
  color: #f5222d;
  margin: 6px 0 2px;
}

/* 已登录状态条 */
.cp-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  color: var(--gray);
}
.cp-user .out {
  color: var(--brand);
  cursor: pointer;
}

/* ---------- toast ---------- */
.cp-toast {
  position: fixed;
  left: 50%;
  top: 80px;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 15px;
  padding: 12px 22px;
  border-radius: 8px;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  max-width: 80vw;
  text-align: center;
}
.cp-toast.is-on {
  opacity: 1;
}

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .cp-page {
    padding: 32px 16px;
  }
  .cp-head h1 {
    font-size: 24px;
  }
  .cp-lead {
    font-size: 17px;
  }
  .cp-pills {
    gap: 12px;
  }
  .cp-pill {
    min-width: 92px;
    height: 44px;
    font-size: 15px;
    padding: 0 16px;
  }
  .cp-input,
  .cp-upload-btn {
    width: 100%;
  }
  .cp-field {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .cp-btn {
    width: 100%;
    min-width: 0;
    height: 54px;
    font-size: 18px;
  }
  .cp-shots a {
    width: 46%;
    height: 110px;
  }
}
