/* 统一结果页（/result/{task_id}）样式
 *
 * 口径与主站一致（深色 + 金色 accent），但**不引 index.html 的样式表** ——
 * 那份 CSS 与首页的 7 屏强绑定，拷一份过来只会让两边各自漂移。
 * 这里只写结果页真正用到的东西。
 */

:root {
  --bg: #0a0a0c;
  --bg-card: #1a1a24;
  --border: #2a2a36;
  --text: #e8e8ee;
  --text-dim: #8a8a98;
  --accent: #c9a96e;
  --success: #6ea98a;
  --error: #c96e6e;
}

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

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
}

.rp { max-width: 720px; margin: 0 auto; padding: 18px 16px 48px; }

/* ── Header ── */
.rp-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}
.rp-back {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  white-space: nowrap;
}
.rp-back:hover { color: var(--text); border-color: var(--accent); }
.rp-head-main h1 { font-size: 20px; font-weight: 600; letter-spacing: .3px; }
.rp-head-main p { color: var(--text-dim); font-size: 12px; margin-top: 4px; word-break: break-all; }

/* ── Card ── */
.rp-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
}
.rp-card[hidden] { display: none; }
.rp-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.rp-card-head h2 { font-size: 15px; font-weight: 600; }
.rp-tag {
  font-size: 11px;
  color: var(--accent);
  border: 1px solid var(--accent-dim, #8a7a52);
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}
.rp-hint { color: var(--text-dim); font-size: 12px; margin-top: 10px; }
.rp-status { min-height: 18px; }
.rp-error { color: var(--error); }
.rp-error a { color: var(--accent); }

/* ── 前后对比 ── */
.rp-compare {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 12px;
  background: #000;
  /* 高度由「改前」那张按自身比例撑开；改后是绝对定位，跟着同一框走 */
  line-height: 0;
}
.rp-cmp-img { display: block; width: 100%; height: auto; }
.rp-cmp-after {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* ★ clip-path 而不是改宽度：改宽度会把图压扁，clip 只是「盖住左边一部分」，
     两边像素始终按同一尺寸对齐，滑到 0/100 时也不会错位。 */
  clip-path: inset(0 0 0 50%);
}
.rp-cmp-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: rgba(255, 255, 255, .85);
  box-shadow: 0 0 6px rgba(0, 0, 0, .6);
  transform: translateX(-1px);
  pointer-events: none;
}
.rp-range { width: 100%; margin: 12px 0 2px; accent-color: var(--accent); height: 28px; }
.rp-range-label { display: flex; justify-content: space-between; color: var(--text-dim); font-size: 11px; }

/* ── 文字核对 ── */
.rp-texts { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.rp-texts li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, .02);
  word-break: break-word;
}
.rp-texts li.before { color: var(--text-dim); text-decoration: line-through; }
.rp-texts .rp-dot { color: var(--accent); line-height: 1.5; }
.rp-texts .rp-text-kind { color: var(--text-dim); font-size: 11px; margin-left: auto; white-space: nowrap; }

/* ── 版本 ── */
.rp-versions { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.rp-ver {
  flex: 0 0 auto;
  width: 96px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  padding: 6px;
  cursor: pointer;
  text-align: center;
  font-size: 12px;
}
.rp-ver img { width: 100%; height: 70px; object-fit: cover; border-radius: 6px; display: block; margin-bottom: 5px; background: #000; }
.rp-ver.on { border-color: var(--accent); color: var(--accent); }
.rp-ver[disabled] { opacity: .45; cursor: default; }

/* ── 表单 / 按钮 ── */
.rp-field {
  width: 100%;
  background: #10101a;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  padding: 10px 12px;
  margin-top: 10px;
  resize: vertical;
}
.rp-field:focus { outline: none; border-color: var(--accent); }
.rp-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.rp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
}
.rp-btn:hover { border-color: var(--accent); }
.rp-btn[disabled] { opacity: .5; cursor: default; }
.rp-primary { background: var(--accent); border-color: var(--accent); color: #14140f; font-weight: 600; }

/* ── 常规结果 ── */
.rp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.rp-item { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #10101a; }
.rp-item img { width: 100%; display: block; }
.rp-item .rp-item-meta { padding: 7px 9px; font-size: 12px; color: var(--text-dim); }
.rp-video { width: 100%; border-radius: 12px; display: block; background: #000; }
.rp-caption {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: var(--text-dim);
  font-size: 13px;
  white-space: pre-wrap;
}
/* ── 继续修改的框选层（D5）──────────────────────────────────────
   与 index.html 的 .v2stage 同一条口径：JS 按 contain 显式设宽度，
   stage 内容框 == 图片显示框；选框用 % 定位，与归一化坐标同源。 */
.rp-region {
  position: relative; margin: 10px 0; border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden; background: #000;
  touch-action: pan-y; cursor: crosshair;
}
.rp-region.drawing { touch-action: none; }
.rp-region[hidden] { display: none; }
.rp-region img { width: 100%; display: block; -webkit-user-drag: none; user-select: none; }
.rp-region-rect {
  position: absolute; border: 2px solid var(--accent);
  background: rgba(201,169,110,.16); pointer-events: none;
}

/* ── CLARIFY 一键选择（D7）── */
.dc-clarify {
  margin-top: 12px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--accent); background: rgba(201,169,110,.08);
}
.dc-head { font-size: 12px; color: var(--accent); margin-bottom: 4px; }
.dc-q { font-size: 13px; line-height: 1.65; }
.dc-opts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.dc-opt {
  padding: 8px 12px; border-radius: 999px; font-size: 13px; cursor: pointer;
  border: 1px solid var(--accent); background: none; color: var(--text);
}
.dc-opt:hover { background: rgba(201,169,110,.16); }
.dc-hint { font-size: 11px; color: var(--text-dim); margin-top: 6px; }
