/* Shared lightweight operations workbench styles for returns, reviews, questions and chat. */
.ops-shell,
.ops-toolbar,
.ops-split,
.ops-list-panel,
.ops-detail-panel,
.ops-item,
.ops-thumb,
.ops-product-card,
.ops-product-title,
.ops-meta,
.ops-status,
.ops-section,
.ops-text-block,
.ops-translation,
.ops-reply-box,
.ops-image-preview,
.ops-empty,
.ops-button-row {
  --ops-bg: #f5f7fb;
  --ops-card: #ffffff;
  --ops-border: #e5eaf2;
  --ops-border-strong: #d4dde9;
  --ops-text: #111827;
  --ops-muted: #64748b;
  --ops-muted-soft: #94a3b8;
  --ops-primary: #2563eb;
  --ops-primary-soft: #eff6ff;
  --ops-success: #16a34a;
  --ops-success-soft: #f0fdf4;
  --ops-warning-soft: #fffbeb;
  --ops-danger-soft: #fef2f2;
  --ops-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

/* 外壳宽度只由 .container-fluid（1800px / 16px）决定：这里再写一次 max-width，
   退货 / 评价 / 问题 / chat 四页就会比订单管理、商品上架页左右各多缩进 60px。
   高度也不再让每个页面各自算 calc(100vh - Npx)，改成「视口高 - 顶部导航」的弹性列，
   多出/少掉一行工具栏时由内容区自己吸收，不会再差出一个滚动条。 */
.ops-shell {
  display: flex;
  min-height: calc(100vh - 60px);
  flex-direction: column;
  padding-bottom: 30px;
  color: var(--ops-text);
  background: var(--ops-bg);
}

/* 工具条框体一律交给 common.css 的 .erp-toolbar（同一个元素上两个 class 都在）：
   这里再画一次边框，颜色就比订单管理页浅一档（--ops-border #e5eaf2 vs --border rgba(15,23,42,.10)），
   两块工具条摆在一起会像两个版本。内边距与外边距两边本来就是同一组数值，留着只是写明白。 */
.ops-toolbar {
  margin-bottom: 16px;
  padding: 16px;
}

/* 工具条第二行：与订单管理页 .erp-row-bottom 同一套结构
   左 = 搜索框，中 = 状态 tab 条，右 = 新标记 / 已读 / 同步。
   tab 条原先挤在列表栏顶部（1440 宽下只有 ~349px），现在挪到这一行的中间位，
   和订单管理页「等待备货 / 等待发运 / 运输中 / 已签收」那排 tab 同一个位置。 */
.ops-search-box {
  flex: 0 0 auto;
}

.ops-toolbar-row {
  justify-content: space-between;
}

.ops-search-box .input {
  width: 240px;
}

.ops-marks-box {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

/* 「N 条新退货 / 新评价 / 新问题」：数字和文案一起显隐，为 0 时不留下半句话。
   计数一律来自接口返回的真实值，不由前端自己猜。
   显隐走 visibility 而不是 display：这一组在工具条最右边，宽度一变，
   右侧按钮会平移、中间 tab 条因为居中也会跟着挪（实测一次 74px，切店铺/同步后计数归零就整条工具条跳一下）。
   min-width 按「3 位数 + 3 个字」留够槽位，数字从 9 变 10、从 99 变 100 也不顶动别人。 */
.new-marks {
  display: inline-flex;
  visibility: hidden;
  justify-content: flex-end;
  align-items: center;
  min-width: 88px;
  gap: 6px;
  color: #6b7280;
  font-size: 12px;
  white-space: nowrap;
}

.new-marks.is-visible {
  visibility: visible;
}

.new-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  padding: 2px 8px;
  border-radius: 10px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

/* 「已读 / 同步」两个次按钮：同一套尺寸，三页一致 */
.ops-mark-btn {
  height: 30px;
  padding: 0 10px;
  border-color: #d1d5db;
  color: #6b7280;
  font-size: 12px;
}

.ops-mark-btn.is-primary {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: var(--ops-primary);
}

.ops-split {
  display: flex;
  flex: 1 1 0;
  gap: 12px;
  min-height: 520px;
}

.ops-list-panel,
.ops-detail-panel {
  min-width: 0;
  border: 1px solid var(--ops-border);
  border-radius: 10px;
  background: var(--ops-card);
  box-shadow: var(--ops-shadow);
  overflow: hidden;
}

.ops-list-panel {
  display: flex;
  flex: 0 0 380px;
  flex-direction: column;
}

.ops-detail-panel {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
}

.ops-item {
  border-bottom: 1px solid #eef2f7;
  background: var(--ops-card);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.ops-item:hover {
  background: #f8fafc;
}

.ops-item.active {
  background: var(--ops-primary-soft);
  border-left: 3px solid var(--ops-primary);
}

.ops-item.is-new {
  background: var(--ops-warning-soft);
}

.ops-thumb {
  display: block;
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  border: 1px solid var(--ops-border);
  border-radius: 8px;
  background: #f8fafc;
  object-fit: cover;
}

.ops-thumb.is-sm {
  width: 36px;
  height: 36px;
  border-radius: 6px;
}

.ops-thumb.is-md {
  width: 72px;
  height: 72px;
}

.ops-thumb.is-lg {
  width: 80px;
  height: 80px;
}

.ops-thumb.is-empty {
  border-style: dashed;
  object-fit: contain;
}

.ops-thumb.is-previewable {
  cursor: zoom-in;
}

.ops-product-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.ops-product-title {
  display: -webkit-box;
  overflow: hidden;
  margin: 0 0 6px;
  color: var(--ops-text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.ops-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  color: var(--ops-muted);
  font-size: 11px;
  line-height: 1.4;
}

.ops-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.ops-status.is-new,
.ops-status.status-new,
.ops-status.new {
  background: var(--ops-warning-soft);
  color: #92400e;
}

.ops-status.is-viewed,
.ops-status.status-viewed,
.ops-status.viewed {
  background: #e0f2fe;
  color: #075985;
}

.ops-status.is-processed,
.ops-status.status-processed,
.ops-status.processed,
.ops-status.is-success {
  background: var(--ops-success-soft);
  color: #166534;
}

.ops-status.is-warning,
.ops-status.on_moderation {
  background: #fff7ed;
  color: #9a3412;
}

.ops-status.is-danger,
.ops-status.rejected {
  background: var(--ops-danger-soft);
  color: #991b1b;
}

.ops-section {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--ops-border);
  border-radius: 8px;
  background: var(--ops-card);
}

.ops-section.is-primary {
  border-left: 3px solid var(--ops-primary);
  background: var(--ops-primary-soft);
}

.ops-section.is-muted {
  border-left: 3px solid var(--ops-border-strong);
  background: #f8fafc;
}

.ops-section.is-success {
  border-left: 3px solid var(--ops-success);
  background: var(--ops-success-soft);
}

.ops-section.is-warning {
  border-left: 3px solid #f97316;
  background: #fff7ed;
}

.ops-section.is-danger {
  border-left: 3px solid #ef4444;
  background: var(--ops-danger-soft);
}

.ops-text-block {
  color: #374151;
  font-size: 13px;
  line-height: 1.6;
  word-break: break-word;
}

.ops-translation {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: var(--ops-primary-soft);
  color: var(--ops-text);
  font-size: 12px;
  line-height: 1.55;
}

.ops-translation.error {
  border-color: #fecaca;
  background: var(--ops-danger-soft);
  color: #991b1b;
}

.ops-translation .translation-label {
  margin-bottom: 4px;
  color: var(--ops-primary);
  font-size: 11px;
  font-weight: 700;
}

.ops-translation.error .translation-label {
  color: #991b1b;
}

.ops-translation .translation-text {
  white-space: pre-wrap;
  word-break: break-word;
}

.ops-reply-box {
  padding: 12px 16px;
  border-top: 1px solid var(--ops-border);
  background: #f8fafc;
}

.ops-reply-box textarea {
  width: 100%;
  min-height: 72px;
  padding: 8px 10px;
  border: 1px solid var(--ops-border-strong);
  border-radius: 8px;
  background: var(--ops-card);
  color: var(--ops-text);
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
}

.ops-reply-box textarea:focus {
  border-color: var(--ops-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  outline: none;
}

.ops-image-preview {
  position: fixed;
  z-index: 10000;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.88);
  cursor: zoom-out;
}

.ops-image-preview img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 8px;
  background: #fff;
}

.ops-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 30px;
  color: var(--ops-muted-soft);
  text-align: center;
}

.ops-empty svg {
  width: 40px;
  height: 40px;
  margin-bottom: 10px;
  opacity: 0.42;
}

.ops-empty p {
  margin: 0;
  font-size: 13px;
}

.ops-button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

/* ===== 状态 tab 条：退货 / 评价 / 问题三页共用，页面里不要再各写一份 =====
   位置与订单管理页的 #statusTabs.tabs-box 一致：工具条第二行的中间位（.erp-row-bottom 里）。
   两个硬约束：
   1) 绝不出现横向滚动条。档位放不下时必须折行——订单管理页那排 tab 用 overflow-x:auto
      把多余档位滑出去，退货页 7 档（全部 / 等待批准 / 在途中 / 在合作伙伴处 / 具争议 /
      已解决 / 销毁和核销）曾经因此被裁掉，运营以为没这些档。
   2) 退货页用 data-active="true"，评价/问题页用 .active，两种激活写法都要覆盖，
      否则某一页会出现「点了没反应」的假象。 */
.status-tabs {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  min-width: 0;
  gap: 6px;
}

.status-tabs .tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.2px;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.status-tabs .tab:hover {
  border-color: #cbd5e1;
  background: #f1f5f9;
  color: #111827;
}

.status-tabs .tab.active,
.status-tabs .tab[data-active="true"] {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.28);
}

.status-tabs .tab .count {
  /* 这颗胶囊的宽度直接决定 tab 条会不会抖：整排是居中的，任何一颗变宽，
     左右两边一起挪。实测 1 位数和 2 位数都要 16px 内容宽，加上 12px 内边距
     正好 28px；3 位数内容宽 24px，胶囊要 35.56px。退货页真实的每档计数
     （11 / 110 / 240 / 835）里三位数很常见，所以按 3 位数留位：36px。
     数字用等宽字形，位数相同就一模一样宽；4 位数（>999）仍会宽 7.86px，
     拿它换常用档位的稳定，页面上出现四位数时再重新评。 */
  min-width: 36px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

/* 退货页计数为 0 时后端给空字符串，评价/问题页给 "0"：统一按 0 显示，三页读数一致 */
.status-tabs .tab .count:empty::after {
  content: "0";
  opacity: 0.55;
}

.status-tabs .tab.active .count,
.status-tabs .tab[data-active="true"] .count {
  background: rgba(255, 255, 255, 0.26);
  color: #fff;
}

@media (max-width: 980px) {
  /* 窄屏改上下两栏：容器按内容自然高度排（页面滚动），不再撑满视口，
     否则 .ops-detail-panel 的 520px 会被 flex 压缩后连滚动条都看不到。 */
  .ops-split {
    flex: 0 0 auto;
    flex-direction: column;
  }

  .ops-list-panel {
    flex-basis: auto;
    width: 100%;
    max-height: 520px;
  }

  .ops-detail-panel {
    min-height: 520px;
  }
}

/* ============================================================
   列表卡片与详情面板：退货 / 评价 / 问题三页共用（2026-09-19 统一，2026-09-20 放大缩略图 + 标题可点）
   结构固定为「图片列 + 内容列」，内容列依次是：标题 / (SKU + 状态) / 正文 / 信息行。
   字号只有两级：正文 13px、辅助信息 12px。新增类名，既有页面的老选择器不受影响。
   ============================================================ */
.ops-list-card {
  display: grid;
  /* 缩略图尺寸与商品上架（64px）对齐：之前 36px 太小，运营基本都要点开大图才能看清。 */
  grid-template-columns: 64px minmax(0, 1fr);
  column-gap: 10px;
  align-items: start;
  margin: 0;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid #eef2f7;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
  cursor: pointer;
}

.ops-list-card:hover {
  background: #f8fafc;
}

.ops-list-card.is-new {
  background: #fffbeb;
}

/* 选中态用内阴影画左蓝条：border-left 会让选中行内容整体右移 3px，和别的行错开。 */
.ops-list-card.active {
  border-left: 0;
  background: #eff6ff;
  box-shadow: inset 3px 0 0 #2563eb;
}

.ops-list-card > .ops-thumb {
  width: 64px;
  height: 64px;
  border-radius: 8px;
}

/* 列表缩略图点一下直接看大图（不触发卡片的「打开详情」）。 */
.ops-list-card > .ops-thumb.is-previewable {
  cursor: zoom-in;
}

.ops-list-main {
  min-width: 0;
}

.ops-list-title {
  color: #1f2937;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  word-break: break-word;
}

.ops-list-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 2px 8px;
  margin-top: 1px;
}

.ops-list-sku {
  min-width: 0;
  overflow: hidden;
  color: #64748b;
  font-size: 12px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-list-facts {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
}

.ops-list-text {
  margin-top: 4px;
  color: #374151;
  font-size: 13px;
  line-height: 1.4;
  word-break: break-word;
}

/* 正文偏长的列表（问题 / 评价）在页面上加这个类，截到 2 行；标题不截。 */
.ops-list-text.is-clamped {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.ops-list-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px 8px;
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.4;
}

.ops-list-meta .ops-status {
  min-height: 20px;
  padding: 1px 7px;
  font-size: 12px;
  font-weight: 600;
}

.ops-list-price {
  color: #dc2626;
  font-size: 13px;
  font-weight: 600;
}

.ops-list-link {
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.ops-list-link:hover {
  text-decoration: underline;
}

/* —— 详情面板：三段式（信息 / 内容 / 操作），段内用分隔线，段间才描边 —— */
.ops-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
}

.ops-detail-heading {
  color: #111827;
  font-size: 16px;
  font-weight: 700;
}

.ops-detail-header-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  color: #64748b;
  font-size: 12px;
}

/* 「联系买家」这类预留入口：与主操作同一段里的次级行。 */
.ops-action-secondary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.ops-action-empty {
  color: #9ca3af;
  font-size: 13px;
}

.ops-detail-section {
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.ops-detail-section + .ops-detail-section {
  margin-top: 6px;
}

/* 两栏区块后面接的单栏段落（.ops-detail-section + .ops-detail-section 匹配不到这种情况）。 */
.ops-detail-columns + .ops-detail-section {
  margin-top: 6px;
}

.ops-detail-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.ops-detail-columns .ops-detail-section + .ops-detail-section {
  margin-top: 0;
}

.ops-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.ops-detail-title {
  margin: 0 0 6px;
  color: #374151;
  font-size: 13px;
  font-weight: 600;
}

.ops-detail-head .ops-detail-title {
  margin: 0;
}

.ops-detail-subtitle {
  color: #374151;
  font-size: 12px;
  font-weight: 600;
}

.ops-detail-subsection {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #eef2f7;
}

.ops-detail-row {
  margin-bottom: 4px;
  color: #1f2937;
  font-size: 12px;
  line-height: 1.5;
}

.ops-detail-row:last-child {
  margin-bottom: 0;
}

.ops-detail-label {
  color: #64748b;
}

.ops-detail-product {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.ops-detail-image {
  /* 详情商品图与订单管理看板（72px）对齐。 */
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
  border-radius: 8px;
  object-fit: cover;
}

/* 可点击的标题：默认保持正文色，悬停才变蓝下划线，避免整列表一片链接色。 */
.ops-title-link {
  color: inherit;
  text-decoration: none;
}

.ops-title-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

.ops-detail-product-body {
  min-width: 0;
  flex: 1;
}

.ops-detail-product-title {
  margin-bottom: 4px;
  color: #1f2937;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  word-break: break-word;
}

.ops-detail-meta {
  margin-bottom: 2px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.4;
  word-break: break-word;
}

.ops-detail-text {
  color: #374151;
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
}

/* 空态不再撑满面板：只占一条，避免详情里出现大片空白和滚动条。 */
.ops-detail-empty {
  padding: 14px;
  border: 1px dashed #e5e7eb;
  border-radius: 6px;
  background: #f9fafb;
  color: #9ca3af;
  font-size: 12px;
  text-align: center;
}

/* 翻译入口：有边框的蓝色按钮，放在小标题右侧，比正文下的灰字按钮显眼。 */
.ops-translate-btn {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.ops-translate-btn:hover {
  border-color: #93c5fd;
  background: #dbeafe;
}

.ops-translate-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}
