/* 评价管理：与私信页面完全独立，避免两套会话模型混用 */

.rv-page {
  --rv-card: #fff;
  --rv-line: #eceff4;
  --rv-muted: #7b8392;
  padding-bottom: 36px;
}

.rv-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.rv-stat {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--rv-line);
  border-radius: 16px;
  background: var(--rv-card);
  padding: 14px 15px;
  box-shadow: var(--shadow);
}

.rv-stat::after {
  content: '';
  position: absolute;
  right: -18px;
  top: -22px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--brand-soft);
  opacity: .55;
}

.rv-stat span { display: block; color: var(--rv-muted); font-size: 11px; font-weight: 650; }
.rv-stat b { display: block; margin-top: 5px; font-size: 23px; line-height: 1.1; letter-spacing: -.03em; }
.rv-stat small { display: block; margin-top: 5px; color: var(--ink-3); font-size: 10px; }
.rv-stat.warn b { color: var(--amber); }
.rv-stat.good b { color: var(--green); }
.rv-stat.alert b { color: var(--red); }

.rv-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  margin-bottom: 14px;
  border: 1px solid var(--rv-line);
  border-radius: 16px;
  background: var(--rv-card);
  box-shadow: var(--shadow);
}

.rv-tabs { display: flex; gap: 4px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.rv-tabs::-webkit-scrollbar { display: none; }
.rv-tab {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.rv-tab em { font-style: normal; margin-left: 3px; color: var(--ink-3); font-weight: 600; }
.rv-tab.active { background: var(--ink); color: #fff; }
.rv-tab.active em { color: rgba(255,255,255,.65); }

.rv-batchbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 9px 14px;
  margin: 12px 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--rv-line);
  border-radius: 14px;
  background: var(--rv-card);
  box-shadow: var(--shadow);
}
.rv-batchbar-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; min-width: 0; }
.rv-batchbar-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.rv-batchbar-sep { width: 1px; height: 18px; background: var(--rv-line); margin: 0 2px; }
.rv-batch-count { font-size: 12px; font-weight: 800; color: var(--ink); }
.rv-batch-last { color: var(--ink-3); font-size: 10px; }
.rv-selectall { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 11px; font-weight: 700; cursor: pointer; }
.rv-selectall input, .rv-card-check input { accent-color: var(--brand); width: 14px; height: 14px; margin: 0; cursor: pointer; }
.rv-card-check { flex: 0 0 auto; display: grid; place-items: center; padding-top: 8px; cursor: pointer; }

.rv-scope-list { display: grid; gap: 7px; }
.rv-scope-option { display: flex; align-items: flex-start; gap: 8px; padding: 9px 10px; border: 1px solid var(--line-2); border-radius: 10px; background: #fbfcfd; cursor: pointer; }
.rv-scope-option:has(input:checked) { border-color: rgba(255,77,31,.5); background: var(--brand-soft); }
.rv-scope-option input { margin-top: 2px; accent-color: var(--brand); }
.rv-scope-option span { display: grid; gap: 2px; min-width: 0; }
.rv-scope-option b { font-size: 11px; color: var(--ink); }
.rv-scope-option small { color: var(--ink-3); font-size: 10px; line-height: 1.4; }
.rv-scope-note { display: flex; align-items: center; gap: 6px; padding: 9px 10px; border-radius: 10px; background: var(--brand-soft); color: #a34820; font-size: 11px; font-weight: 700; }
.rv-scope-note svg { width: 14px; height: 14px; }
.rv-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.rv-seg label { display: inline-flex; align-items: center; gap: 5px; padding: 7px 10px; border: 1px solid var(--line-2); border-radius: 9px; background: #fbfcfd; font-size: 11px; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.rv-seg label:has(input:checked) { border-color: rgba(255,77,31,.5); background: var(--brand-soft); color: #a34820; }
.rv-seg input { accent-color: var(--brand); }
.rv-batch-preview { display: grid; gap: 7px; max-height: 230px; overflow: auto; padding: 10px 11px; border: 1px dashed var(--line-2); border-radius: 11px; background: #fbfcfd; color: var(--ink-2); font-size: 11px; line-height: 1.55; }
.rv-batch-preview-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 5px 10px; }
.rv-batch-preview-head b { color: var(--ink); font-size: 12px; }
.rv-batch-preview-head span { color: var(--ink-3); font-size: 10px; }
.rv-batch-preview ul { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.rv-batch-preview li { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-batch-preview li b { color: var(--ink); }
.rv-confirm-check { display: flex; align-items: flex-start; gap: 8px; padding: 10px 11px; border: 1px solid #ffd6d6; border-radius: 10px; background: #fff8f8; color: #8f2d2d; font-size: 11px; line-height: 1.5; cursor: pointer; }
.rv-confirm-check input { margin-top: 2px; accent-color: var(--red); flex: 0 0 auto; }
.rv-schedule-sheet .rv-settings-grid .field { margin: 0; }

.rv-search {
  position: relative;
  flex: 0 0 230px;
}
.rv-search svg { position: absolute; left: 11px; top: 50%; width: 15px; height: 15px; transform: translateY(-50%); color: var(--ink-3); }
.rv-search input {
  width: 100%;
  height: 34px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: #f8f9fb;
  padding: 0 12px 0 33px;
  font-size: 12px;
  color: var(--ink);
  outline: none;
}
.rv-search input:focus { border-color: rgba(255,77,31,.55); background: #fff; box-shadow: 0 0 0 3px rgba(255,77,31,.08); }

.rv-list { display: grid; gap: 10px; }
.rv-card {
  border: 1px solid var(--rv-line);
  border-radius: 18px;
  background: var(--rv-card);
  padding: 15px 16px 13px;
  box-shadow: var(--shadow);
  transition: border-color .16s ease, opacity .16s ease;
}
.rv-card:hover { border-color: #dfe3ea; }
.rv-card.hidden-comment { opacity: .72; background: #fcfcfd; }
.rv-card.is-hidden { border-left: 3px solid var(--red); }
.rv-card.is-replied { border-left: 3px solid var(--green); }

.rv-head { display: flex; align-items: flex-start; gap: 11px; }
.rv-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #ff9a4b, #ff4d1f);
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 6px 14px -8px rgba(255,77,31,.75);
}
.rv-who { min-width: 0; flex: 1; }
.rv-name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.rv-name b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-name span { color: var(--ink-3); font-size: 10px; flex: 0 0 auto; }
.rv-meta { margin-top: 3px; display: flex; flex-wrap: wrap; gap: 5px 10px; color: var(--ink-3); font-size: 10px; }
.rv-meta code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; }

.rv-badges { display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-end; }
.rv-badge {
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 9px;
  font-weight: 750;
  line-height: 1.2;
  white-space: nowrap;
  background: #f2f4f7;
  color: var(--ink-2);
}
.rv-badge.ok { background: var(--green-soft); color: var(--green); }
.rv-badge.warn { background: var(--amber-soft); color: var(--amber); }
.rv-badge.danger { background: var(--red-soft); color: var(--red); }
.rv-badge.auto { background: var(--blue-soft); color: var(--blue); }

.rv-content {
  margin: 10px 0 0 45px;
  color: #252a33;
  font-size: 13px;
  line-height: 1.72;
  word-break: break-word;
  white-space: pre-wrap;
}

.rv-reply {
  margin: 9px 0 0 45px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f7f9fb;
  border: 1px solid #edf0f4;
  color: var(--ink-2);
  font-size: 11px;
  line-height: 1.55;
}
.rv-reply b { color: var(--ink); }

.rv-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 10px 0 0 45px;
}
.rv-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line-2);
  background: #fff;
  color: var(--ink-2);
  border-radius: 9px;
  padding: 6px 9px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}
.rv-action svg { width: 12px; height: 12px; }
.rv-action:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.rv-action.primary { border-color: var(--ink); background: var(--ink); color: #fff; }
.rv-action.primary:hover { background: #000; color: #fff; }
.rv-action.danger:hover { border-color: var(--red); color: var(--red); background: var(--red-soft); }
.rv-action:disabled { opacity: .45; cursor: not-allowed; }
.rv-action-spacer { flex: 1; }

.rv-empty {
  border: 1px dashed var(--line-2);
  border-radius: 18px;
  background: #fff;
  padding: 44px 18px;
  text-align: center;
  color: var(--ink-2);
}
.rv-empty .empty-ico { margin: 0 auto 10px; }
.rv-empty .empty-title { font-size: 15px; }
.rv-empty .empty-desc { margin-top: 6px; font-size: 12px; color: var(--ink-3); }

.rv-notice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 13px;
  margin-bottom: 14px;
  border: 1px solid #ffe3bd;
  border-radius: 13px;
  background: #fffaf1;
  color: #8a5800;
  font-size: 12px;
  line-height: 1.55;
}
.rv-notice svg { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 1px; }
.rv-notice.error { border-color: #ffd3d3; background: #fff7f7; color: #a32b2b; }

.rv-pager { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 16px; color: var(--ink-3); font-size: 11px; }
.rv-pager button { border: 1px solid var(--line-2); background: #fff; border-radius: 9px; padding: 6px 12px; font-size: 11px; cursor: pointer; }
.rv-pager button:disabled { opacity: .4; cursor: not-allowed; }

/* 回复 / 规则弹层 */
.rv-sheet .sheet-body { display: grid; gap: 12px; }
.rv-quote {
  border-left: 3px solid var(--brand);
  border-radius: 0 10px 10px 0;
  background: #fffaf8;
  padding: 10px 12px;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.6;
}
.rv-quote b { color: var(--ink); }
.rv-template-list { display: flex; flex-wrap: wrap; gap: 6px; }
.rv-template {
  border: 1px solid #f0d7cb;
  background: #fff8f4;
  color: #a34820;
  border-radius: 9px;
  padding: 7px 9px;
  font-size: 10px;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
  max-width: 100%;
}
.rv-template:hover { border-color: var(--brand); color: var(--brand); }
.rv-ai-row { display: flex; align-items: center; gap: 8px; }
.rv-ai-row .field { flex: 1; }
.rv-count { text-align: right; color: var(--ink-3); font-size: 10px; }
.rv-warning { border-radius: 9px; background: #fff7e8; color: #9a6500; padding: 8px 10px; font-size: 11px; line-height: 1.5; }

.rv-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.rv-settings-grid .field.full { grid-column: 1 / -1; }
.rv-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 13px; border: 1px solid var(--line-2); border-radius: 12px; background: #fbfcfd; }
.rv-toggle-row b { font-size: 12px; }
.rv-toggle-row p { margin: 3px 0 0; color: var(--ink-3); font-size: 10px; line-height: 1.45; }
.rv-switch { position: relative; width: 40px; height: 23px; flex: 0 0 auto; }
.rv-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.rv-switch i { position: absolute; inset: 0; border-radius: 999px; background: #d7dbe3; transition: .18s; cursor: pointer; }
.rv-switch i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.12); transition: .18s; }
.rv-switch input:checked + i { background: var(--brand); }
.rv-switch input:checked + i::after { transform: translateX(17px); }

.rv-rule-head, .rv-rule-row {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) 100px 42px 30px;
  gap: 8px;
  align-items: center;
}
.rv-rule-head { color: var(--ink-3); font-size: 9px; font-weight: 700; padding: 0 2px; }
.rv-rule-row { padding: 9px 0; border-top: 1px solid var(--rv-line); }
.rv-rule-row .input { height: 32px; font-size: 11px; padding: 0 8px; }
.rv-rule-row select.input { padding: 0 5px; }
.rv-mini-btn { border: 0; background: transparent; color: var(--ink-3); cursor: pointer; padding: 5px; border-radius: 7px; }
.rv-mini-btn:hover { color: var(--red); background: var(--red-soft); }
.rv-mini-btn svg { width: 14px; height: 14px; }
.rv-add-row { display: flex; justify-content: flex-start; margin-top: 8px; }
.rv-template-editor { display: grid; gap: 7px; }
.rv-template-editor .rv-template-line { display: flex; align-items: center; gap: 7px; }
.rv-template-editor .input { flex: 1; height: 34px; font-size: 11px; }

@media (max-width: 1100px) {
  .rv-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rv-search { flex-basis: 190px; }
}

@media (max-width: 760px) {
  .rv-page { padding-bottom: calc(86px + var(--safe-b)); }
  .rv-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .rv-stat { padding: 11px 12px; border-radius: 13px; }
  .rv-stat b { font-size: 19px; }
  .rv-stat small { display: none; }
  .rv-toolbar { flex-wrap: wrap; padding: 8px; }
  .rv-tabs { order: 1; width: 100%; flex-basis: 100%; gap: 2px; }
  .rv-tab { padding: 7px 9px; font-size: 11.5px; }
  .rv-search { order: 2; flex: 1; }
  .rv-batchbar { align-items: stretch; flex-direction: column; padding: 9px 10px; }
  .rv-batchbar-head { justify-content: space-between; }
  .rv-batchbar-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .rv-batchbar-actions .rv-action { justify-content: center; padding: 8px 6px; }
  .rv-batchbar-sep { display: none; }
  .rv-card { padding: 13px 13px 11px; border-radius: 15px; }
  .rv-content, .rv-reply, .rv-actions { margin-left: 0; }
  .rv-content { margin-top: 8px; font-size: 13px; }
  .rv-reply { margin-top: 8px; }
  .rv-actions { margin-top: 9px; }
  .rv-badges { display: none; }
  .rv-settings-grid { grid-template-columns: 1fr; }
  .rv-rule-head { display: none; }
  .rv-rule-row { grid-template-columns: 70px minmax(0, 1fr) 30px; gap: 6px; padding: 10px 0; }
  .rv-rule-row .rv-rule-mode { grid-column: 2; }
  .rv-rule-row .rv-rule-enable { grid-column: 3; grid-row: 1; }
  .rv-rule-row .rv-mini-btn { grid-column: 3; grid-row: 2; }
}
