/* 客诉受理台 - 共享样式 */
:root {
  --brand: #07c160;
  --brand-dark: #06a550;
  --brand-soft: #e8f8ef;
  --danger: #e64340;
  --danger-soft: #fdeceb;
  --warn: #ff9f0a;
  --warn-soft: #fff4e0;
  --ink: #1a1a1a;
  --ink-2: #4d545c;
  --ink-3: #8b929c;
  --line: #e8eaed;
  --bg: #f5f6f7;
  --card: #ffffff;
  --radius: 14px;
  --shadow: 0 2px 12px rgba(0, 0, 0, .06);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

.wrap { max-width: 640px; margin: 0 auto; padding: 0 14px 40px; }
.wrap-wide { max-width: 1100px; margin: 0 auto; padding: 0 16px 40px; }

/* ---------- 顶部品牌头 ---------- */
.hero {
  background: linear-gradient(135deg, #07c160, #12b981);
  color: #fff;
  padding: 30px 18px 26px;
  border-radius: 0 0 22px 22px;
  text-align: center;
}
.hero .shop { display: none; }
.hero .sub { font-size: 20px; font-weight: 700; letter-spacing: .5px; }
.hero .promise {
  display: inline-block;
  margin-top: 8px; font-size: 13px; font-weight: 500; opacity: .95;
}
.hero-query-btn {
  display: inline-flex; align-items: center; gap: 5px;
  margin: 16px auto 0; padding: 6px 14px;
  background: rgba(255,255,255,.16); color: #fff;
  border: 1px solid rgba(255,255,255,.55); border-radius: 999px;
  font-size: 12.5px; font-weight: 600; font-family: inherit; cursor: pointer;
}
.hero-query-btn:active { transform: translateY(1px); }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-top: 14px;
}
.card-title {
  font-size: 15px; font-weight: 700; margin: 0 0 4px;
  display: flex; align-items: center; gap: 8px;
  padding-left: 10px; position: relative;
}
.card-title::before {
  content: ''; position: absolute; left: 0; top: 1px; bottom: 1px;
  width: 3px; border-radius: 2px; background: var(--brand);
}
.card-title .tag {
  font-size: 11px; font-weight: 600; padding: 2px 7px;
  background: var(--brand-soft); color: var(--brand-dark); border-radius: 6px;
}
.card-desc { font-size: 13px; color: var(--ink-3); margin: 0 0 12px; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.label { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; display: block; }
.label .req { color: var(--danger); }
.label .opt { color: var(--ink-3); font-weight: 400; }

input[type=text], input[type=tel], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 11px 12px;
  border: 1px solid var(--line); border-radius: 10px;
  font-size: 15px; font-family: inherit; color: var(--ink);
  background: #fff; outline: none; transition: border-color .15s;
}
textarea { resize: vertical; min-height: 96px; line-height: 1.6; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); }
input::placeholder, textarea::placeholder { color: #b9bec6; }

.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }

/* 类型选择 chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px;
  font-size: 13px; background: #fff; cursor: pointer; user-select: none;
  transition: all .15s;
}
.chip.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-dark); font-weight: 600; }

/* 按钮 */
.btn {
  display: block; width: 100%; padding: 13px;
  background: var(--brand); color: #fff; border: none; border-radius: 12px;
  font-size: 16px; font-weight: 600; font-family: inherit; cursor: pointer;
  transition: background .15s;
}
.btn:active { background: var(--brand-dark); }
.btn.ghost { background: #fff; color: var(--ink-2); border: 1px solid var(--line); }
.btn.sm { width: auto; padding: 7px 14px; font-size: 13px; border-radius: 8px; }
.btn.danger { background: var(--danger); }
.btn:disabled { opacity: .5; }

/* 图片上传 */
.img-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.img-box {
  aspect-ratio: 1; border: 1px dashed var(--line); border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-3); font-size: 24px; cursor: pointer; overflow: hidden;
  background: #fafbfc; position: relative;
}
.img-box img { width: 100%; height: 100%; object-fit: cover; }
.img-box .del {
  position: absolute; top: 2px; right: 2px; width: 20px; height: 20px;
  background: rgba(0,0,0,.55); color: #fff; border-radius: 50%;
  font-size: 13px; line-height: 20px; text-align: center;
}

/* ---------- 自助解决区 ---------- */
.faq-item { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; overflow: hidden; }
.faq-head {
  padding: 13px 14px; display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; font-size: 14px; font-weight: 600; background: #fff;
}
.faq-head .arrow { color: var(--ink-3); font-size: 12px; transition: transform .2s; }
.faq-item.open .arrow { transform: rotate(90deg); }
.faq-body { padding: 0 14px 14px; font-size: 13.5px; color: var(--ink-2); display: none; border-top: 1px solid var(--line); padding-top: 12px; }
.faq-item.open .faq-body { display: block; }
.faq-body .solve { background: var(--brand-soft); border-radius: 8px; padding: 10px 12px; margin-top: 8px; color: #14683f; }
.faq-body .btn { margin-top: 10px; padding: 9px; font-size: 14px; }

/* ---------- 结果页 ---------- */
.success-icon {
  width: 58px; height: 58px; border-radius: 50%; background: var(--brand);
  color: #fff; font-size: 30px; line-height: 58px; text-align: center; margin: 6px auto 12px;
}
.code-box {
  background: var(--brand-soft); border-radius: 10px; padding: 12px;
  text-align: center; font-size: 19px; font-weight: 700; color: var(--brand-dark);
  letter-spacing: 1px; margin: 10px 0;
}

/* ---------- 状态标签 ---------- */
.status {
  display: inline-block; padding: 2px 9px; border-radius: 6px;
  font-size: 12px; font-weight: 600;
}
.status.pending { background: var(--danger-soft); color: var(--danger); }
.status.processing { background: var(--warn-soft); color: #b06d00; }
.status.resolved { background: var(--brand-soft); color: var(--brand-dark); }
.status.closed { background: #eef0f2; color: var(--ink-3); }

/* ---------- 后台 ---------- */
.topbar {
  background: #fff; border-bottom: 1px solid var(--line);
  padding: 12px 16px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 17px; margin: 0; }
.topbar .who { font-size: 13px; color: var(--ink-3); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 16px 0; }
.stat { background: #fff; border-radius: 12px; padding: 14px; box-shadow: var(--shadow); }
.stat .num { font-size: 26px; font-weight: 700; line-height: 1.2; }
.stat .lbl { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.stat.alert .num { color: var(--danger); }
.stat.ok .num { color: var(--brand-dark); }

.tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar input, .toolbar select { width: auto; flex: 1; min-width: 130px; }

.list { display: flex; flex-direction: column; gap: 10px; }
.item {
  background: #fff; border-radius: 12px; padding: 14px; box-shadow: var(--shadow);
  border-left: 4px solid var(--line); cursor: pointer;
}
.item.s-pending { border-left-color: var(--danger); }
.item.s-processing { border-left-color: var(--warn); }
.item.s-resolved { border-left-color: var(--brand); }
.item.overdue { background: #fffafa; }
.item-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.item-code { font-size: 13px; font-weight: 700; color: var(--ink); }
.item-type { font-size: 12px; color: var(--ink-3); }
.item-content {
  font-size: 14px; margin: 8px 0; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.item-foot { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-3); flex-wrap: wrap; gap: 6px; }
.sla { font-weight: 600; }
.sla.late { color: var(--danger); }
.sla.left { color: var(--brand-dark); }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: 16px;
}
.modal-mask.show { display: flex; }
.modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 560px;
  max-height: 88vh; overflow-y: auto; padding: 20px;
}
.modal h3 { margin: 0 0 14px; font-size: 17px; }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.modal-actions .btn { flex: 1; }

.detail-row { margin-bottom: 12px; }
.detail-row .k { font-size: 12.5px; color: var(--ink-3); margin-bottom: 3px; }
.detail-row .v { font-size: 14.5px; color: var(--ink); word-break: break-all; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.thumbs img { width: 78px; height: 78px; object-fit: cover; border-radius: 8px; cursor: pointer; }
.timeline { border-left: 2px solid var(--line); padding-left: 14px; margin-top: 6px; }
.tl-item { position: relative; margin-bottom: 12px; font-size: 13.5px; }
.tl-item::before {
  content: ''; position: absolute; left: -20px; top: 7px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--brand);
}
.tl-item .t { font-size: 12px; color: var(--ink-3); }

/* 登录 */
.login-box { max-width: 340px; margin: 80px auto; background: #fff; border-radius: 16px; padding: 26px; box-shadow: var(--shadow); }
.login-box h2 { margin: 0 0 18px; font-size: 19px; text-align: center; }

.empty { text-align: center; padding: 50px 20px; color: var(--ink-3); font-size: 14px; }
.hint { font-size: 12.5px; color: var(--ink-3); margin-top: 8px; line-height: 1.6; }
.footer { text-align: center; font-size: 12px; color: var(--ink-3); padding: 20px 0 0; line-height: 1.8; }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 40px;
  background: rgba(0,0,0,.82); color: #fff; padding: 10px 18px; border-radius: 8px;
  font-size: 14px; z-index: 200; display: none; max-width: 80%; text-align: center;
}
.toast.show { display: block; }
.warn-banner {
  background: var(--warn-soft); border: 1px solid #ffd79a; color: #8a5a00;
  border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-top: 14px;
}

/* ---------- 一键诉求 ---------- */
.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.quick-btn {
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 10px;
  text-align: center; cursor: pointer; background: #fff; transition: all .15s;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.quick-btn:active { background: var(--brand-soft); border-color: var(--brand); }
.quick-btn .qb-icon { font-size: 24px; line-height: 1; }
.quick-btn .qb-name { font-size: 14px; font-weight: 600; color: var(--ink); }

/* ---------- 自助补偿 ---------- */
.comp-card { border: 2px solid var(--brand); background: linear-gradient(180deg, #f2fdf7, #fff); }
.comp-offer {
  background: var(--brand); color: #fff; font-weight: 700; font-size: 15px;
  border-radius: 10px; padding: 12px; text-align: center; margin-bottom: 12px;
}

/* ---------- 联系方式 ---------- */
.ct-line { padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 15px; }
.ct-line:last-child { border-bottom: none; }
.sub-card { margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fafbfc; }
.solve { background: var(--brand-soft); border-radius: 8px; padding: 10px 12px; color: #14683f; font-size: 14px; }

/* 首屏查询入口跳转后的卡片高亮提示 */
.card.flash { animation: cardFlash 1.6s ease; }
@keyframes cardFlash {
  0%, 100% { box-shadow: var(--shadow); }
  25%, 65% { box-shadow: 0 0 0 3px var(--brand), var(--shadow); background: #f2fdf7; }
}

/* ---------- 新单提醒 ---------- */
.new-bar {
  background: var(--danger); color: #fff; border-radius: 10px; padding: 12px 14px;
  font-size: 14.5px; cursor: pointer; margin-top: 14px; animation: pulse 1.6s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1 } 50% { opacity: .72 } }

/* ---------- 列表徽标 ---------- */
.badge-block {
  font-size: 11px; background: var(--brand-soft); color: var(--brand-dark);
  padding: 1px 6px; border-radius: 5px; font-weight: 600;
}
.badge-re { font-size: 11px; background: var(--danger-soft); color: var(--danger); padding: 1px 6px; border-radius: 5px; }

/* ---------- 主动排查 ---------- */
.risk-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.risk-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 1px solid var(--line); border-left: 4px solid var(--line);
  border-radius: 10px; padding: 11px 12px; background: #fff;
}
.risk-row.lv1 { border-left-color: var(--warn); }
.risk-row.lv2 { border-left-color: #ff7a00; background: #fffaf3; }
.risk-row.lv3 { border-left-color: var(--danger); background: #fff6f5; }
.rk-no { font-size: 14px; font-weight: 700; }
.rk-lv { font-size: 11px; background: var(--danger-soft); color: var(--danger); padding: 1px 6px; border-radius: 5px; margin-left: 4px; }
.risk-row.lv1 .rk-lv { background: var(--warn-soft); color: #b06d00; }
.rk-meta { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.rk-note { font-size: 12.5px; color: var(--ink-2); margin-top: 3px; }
.rk-item { padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.ok-txt { color: var(--brand-dark); font-size: 12px; font-weight: 600; }

/* ---------- 布防清单 ---------- */
.ck-bar { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 12px 0 14px; }
.ck-fill { display: block; height: 100%; background: var(--brand); transition: width .3s; }
.ck-item {
  display: flex; gap: 10px; align-items: flex-start; padding: 11px 10px;
  border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; cursor: pointer; background: #fff;
}
.ck-item.on { background: var(--brand-soft); border-color: #b7ebcf; }
.ck-box {
  width: 20px; height: 20px; flex: none; border: 1.5px solid var(--line); border-radius: 6px;
  background: #fff; text-align: center; line-height: 18px; font-size: 13px; color: var(--brand-dark);
}
.ck-item.on .ck-box { background: var(--brand); border-color: var(--brand); color: #fff; }
.ck-name { font-size: 14px; font-weight: 600; }
.ck-why { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; line-height: 1.5; }

/* ---------- 分布条 ---------- */
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.bar-name { font-size: 13px; width: 96px; flex: none; color: var(--ink-2); }
.bar-track { flex: 1; height: 10px; background: #f0f2f4; border-radius: 999px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.bar-n { font-size: 13px; width: 28px; text-align: right; color: var(--ink-3); }

/* ---------- 回复模板 ---------- */
.tpls { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- 官方入口位指引 ---------- */
.guide { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; background: #fafbfc; }
.g-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.g-where { font-size: 13px; color: var(--brand-dark); font-weight: 600; margin-bottom: 10px; }
.g-steps { display: flex; flex-direction: column; gap: 6px; }
.g-step { display: flex; gap: 8px; font-size: 13.5px; color: var(--ink-2); line-height: 1.6; }
.g-n {
  flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--brand);
  color: #fff; font-size: 11px; text-align: center; line-height: 18px; margin-top: 3px;
}
.g-warn {
  margin-top: 10px; padding: 9px 11px; background: var(--warn-soft);
  border-radius: 8px; font-size: 12.5px; color: #8a5a00; line-height: 1.6;
}
