/* 图片放大工具 · 样式
   视觉规范（配色 / 圆角 / 间距 / 字阶）取自同类工具的公开样式；
   文案、图标与品牌元素均为自有，不含他方 Logo 或品牌名。
   全部用 CSS 变量声明，嵌入 OneNav 主题时可直接覆盖。 */

.jcu {
  /* —— 取色 —— */
  --bg:      #ffffff;
  --plane:   #f8f9fa;
  --ink:     #111111;
  --ink-2:   #374151;
  --ink-3:   #6b7280;
  --line:    #e5e7eb;
  --dash:    #3b82f6;
  --green:   #4caf50;
  --green-2: #43a047;
  --red:     #e05252;
  --red-2:   #c93f3f;
  --dark:    #1f2937;
  --dark-2:  #111827;

  --shadow-lg: 0 14px 42px rgba(85, 58, 174, .09);
  --shadow-sm: 0 8px 20px rgba(75, 191, 115, .20);
  --shadow-md: 0 10px 40px rgba(17, 24, 39, .16);

  --font: -apple-system, system-ui, "Segoe UI", "Helvetica Neue",
          "Microsoft YaHei", "PingFang SC", "Hiragino Sans",
          "Yu Gothic", "Malgun Gothic", Tahoma, Arial, sans-serif;

  max-width: 904px;
  margin-inline: auto;
  padding: 24px 20px 48px;
  color: var(--ink-2);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 200;
  line-height: 24px;
  letter-spacing: 1px;
}

.jcu, .jcu * { box-sizing: border-box; }
.jcu [hidden] { display: none !important; }
[hidden] { display: none !important; }   /* 全局兜底：flex/grid 的 display 会覆盖 UA 规则 */
html, body { max-width: 100%; overflow-x: hidden; }

/* 深色主题：默认关闭，与参考站保持一致。站点启用夜间模式时在 .jcu 上加 data-jcu-theme="dark" */
.jcu[data-jcu-theme="dark"] {
  --bg: #1a2027; --plane: #212830; --ink: #f3f4f6; --ink-2: #cbd2d9; --ink-3: #9aa3ad;
  --line: #303942; --dark: #e5e7eb; --dark-2: #f3f4f6;
  --shadow-lg: 0 14px 42px rgba(0,0,0,.4); --shadow-md: 0 10px 40px rgba(0,0,0,.5);
}

/* ================= ① 上传区 ================= */
.jcu-hero { margin-bottom: 24px; }

.jcu-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 299px; padding: 48px 28px; text-align: center;
  background: var(--bg);
  border: 2px dashed var(--dash); border-radius: 16px;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  transition: background .16s, border-color .16s;
}
.jcu-drop:hover, .jcu-drop:focus-visible { background: var(--plane); outline: none; }
.jcu-drop:focus-visible { box-shadow: var(--shadow-lg), 0 0 0 3px rgba(59,130,246,.28); }
.jcu-drop.is-over { background: rgba(59,130,246,.05); border-style: solid; }

.jcu-drop h1 {
  margin: 0 0 12px; font-size: 32px; font-weight: 700; line-height: 1.15;
  color: var(--ink); letter-spacing: -.8px; text-wrap: balance;
}
.jcu-feats { margin: 0 0 26px; max-width: 640px; font-size: 16px; font-weight: 200; line-height: 1.6; color: var(--ink-2); }

.jcu-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 14px 42px; min-height: 52px;
  background: var(--green); color: #fff; border-radius: 8px;
  font-size: 21px; font-weight: 600; line-height: 21px;
  box-shadow: var(--shadow-sm);
  transition: background .15s;
}
.jcu-cta svg { width: 22px; height: 22px; flex: none; }
.jcu-drop:hover .jcu-cta { background: var(--green-2); }

.jcu-prompt { margin: 22px 0 0; font-size: 14px; color: var(--ink-3); }
.jcu-prompt a { color: var(--green); font-weight: 600; text-decoration: none; }
.jcu-prompt a:hover { text-decoration: underline; }

.jcu-note {
  margin: 18px auto 0; max-width: 720px; text-align: center;
  font-size: 13.5px; line-height: 1.75; color: var(--ink-3);
}
.jcu-note strong { color: var(--green); font-weight: 700; }

/* ================= ② 演示 / 结果 卡片（共用布局） ================= */
.jcu-card, .jcu-result-box {
  display: grid; grid-template-columns: 1fr 1fr; gap: 32px;
  padding: 24px; border-radius: 12px;
  background: var(--plane);
}
.jcu-demo { margin-bottom: 24px; }
.jcu-cmp { order: 1; min-width: 0; }
.jcu-card-side, .jcu-result-side { order: 2; min-width: 0; }

.jcu-card-side h2, .jcu-result-side h2 {
  margin: 0 0 10px; font-size: 26px; font-weight: 700; line-height: 1.25;
  color: var(--ink); letter-spacing: -.6px;
}
.jcu-card-desc { margin: 0 0 20px; font-size: 14px; line-height: 1.7; color: var(--ink-2); }

.jcu-points {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin: 0; padding: 0; list-style: none;
  font-size: 12.8px; font-weight: 550; line-height: 1.4;
}
.jcu-points li {
  display: flex; align-items: center; gap: 9px;
  padding: 12px; min-height: 54px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  color: var(--ink-2);
}
.jcu-points li::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.jcu-points:last-child { margin-bottom: 0; }

.jcu-stats { display: flex; flex-direction: column; gap: 8px; margin: 0 0 20px; font-size: 13.5px; color: var(--ink-2); }
.jcu-stats div { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.jcu-stats dt { color: var(--ink-3); }
.jcu-stats dd { margin: 0; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ================= ③ 任务卡片 ================= */
.jcu-work { display: block; }
.jcu-task {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 16px; border-radius: 12px;
  background: var(--bg); border: 1px solid var(--line);
}
.jcu-task-thumb {
  width: 76px; height: 76px; flex: none; object-fit: cover;
  border-radius: 10px; background: var(--plane);
}
.jcu-task-body { flex: 1 1 auto; min-width: 0; position: relative; }
.jcu-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.jcu-pill {
  display: inline-block; padding: 4px 11px; border-radius: 999px;
  background: var(--plane); border: 1px solid var(--line);
  font-size: 12.5px; line-height: 1.5; color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.jcu-task-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ================= 按钮 ================= */
.jcu-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 20px; font-family: var(--font);
  font-size: 14.5px; font-weight: 600; line-height: 1.4;
  border-radius: 8px; border: 1px solid transparent; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.jcu-btn svg { width: 17px; height: 17px; flex: none; }
.jcu-btn:focus-visible { outline: 2px solid var(--dark); outline-offset: 2px; }
.jcu-btn:disabled { opacity: .55; cursor: not-allowed; }

.jcu-btn-go { background: var(--green); color: #fff; }
.jcu-btn-go:hover:not(:disabled) { background: var(--green-2); }

.jcu-btn-del { background: var(--red); color: #fff; }
.jcu-btn-del:hover:not(:disabled) { background: var(--red-2); }

.jcu-btn-dark { background: var(--dark); color: #fff; }
.jcu-btn-dark:hover:not(:disabled) { background: var(--dark-2); }

.jcu-btn-download {
  width: 100%; justify-content: center;
  padding: 13px 24px; font-size: 17px;
  background: var(--green); color: #fff; box-shadow: var(--shadow-sm);
}
.jcu-btn-download:hover { background: var(--green-2); }

/* ================= 进度 ================= */
.jcu-prog { margin: 16px 0; }
.jcu-prog-track { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.jcu-prog-fill { height: 100%; width: 0; background: var(--green); transition: width .2s; }
.jcu-prog-text { display: flex; justify-content: space-between; margin-top: 7px; font-size: 12.8px; color: var(--ink-3); }

/* ================= 对比滑块 ================= */
.jcu-cmp-stage {
  position: relative; overflow: hidden; border-radius: 12px;
  background: var(--bg); border: 1px solid var(--line);
  touch-action: none; user-select: none; line-height: 0;
}
.jcu-layer { display: block; width: 100%; height: auto; }
.jcu-top { position: absolute; inset: 0; overflow: hidden; }
.jcu-top img { display: block; width: 100%; height: 100%; object-fit: fill; }

.jcu-handle {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 40px; margin-left: -20px;
  cursor: ew-resize; display: flex; align-items: center; justify-content: center;
}
.jcu-handle-line { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.22); }
.jcu-handle-grip {
  position: relative; width: 38px; height: 38px; border-radius: 50%;
  background: #fff; color: #333; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 5px rgba(0,0,0,.32);
}
.jcu-handle-grip svg { width: 18px; height: 18px; }
.jcu-handle:focus-visible { outline: 2px solid var(--dark); outline-offset: 3px; border-radius: 4px; }

.jcu-tag {
  position: absolute; bottom: 12px; padding: 4px 11px; border-radius: 6px;
  font-size: 12px; font-weight: 700; line-height: 1.5;
  background: rgba(0,0,0,.62); color: #fff; backdrop-filter: blur(3px);
}
.jcu-tag-l { left: 12px; }
.jcu-tag-r { right: 12px; }

/* ================= ④ 放大配置对话框 ================= */
.jcu-modal { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 20px; }
.jcu-modal-mask { position: absolute; inset: 0; background: rgba(17, 24, 39, .45); backdrop-filter: blur(1px); }

.jcu-modal-box {
  position: relative; width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto;
  background: var(--bg); border-radius: 14px; box-shadow: var(--shadow-md);
  font-family: var(--font); color: var(--ink-2);
  letter-spacing: 1px;
  animation: jcu-pop .16s ease-out;
}
@keyframes jcu-pop { from { opacity: 0; transform: translateY(8px) scale(.99); } }

.jcu-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 24px 16px;
}
.jcu-modal-head h2 { margin: 0; font-size: 22px; font-weight: 700; color: var(--ink); letter-spacing: -.4px; }
.jcu-modal-x {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px;
  background: transparent; color: var(--ink-3); cursor: pointer;
}
.jcu-modal-x svg { width: 20px; height: 20px; }
.jcu-modal-x:hover { background: var(--plane); color: var(--ink); }
.jcu-modal-x:focus-visible { outline: 2px solid var(--dark); outline-offset: 2px; }

.jcu-modal-row {
  display: grid; grid-template-columns: 88px 1fr; gap: 12px 18px;
  padding: 18px 24px;
  border-top: 1px solid var(--line);
}
.jcu-modal-label { font-size: 14px; font-weight: 500; color: var(--ink-2); padding-top: 3px; }
.jcu-radios { display: flex; flex-wrap: wrap; gap: 10px 22px; }

.jcu-radio {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14.5px; color: var(--ink-2); cursor: pointer; white-space: nowrap;
}
.jcu-radio input { position: absolute; opacity: 0; width: 0; height: 0; }
.jcu-dot {
  position: relative; flex: none; width: 18px; height: 18px;
  border: 1.5px solid var(--ink-3); border-radius: 50%;
  transition: border-color .12s, background .12s;
}
.jcu-radio input:checked + .jcu-dot { border-color: var(--ink); border-width: 5.5px; }
.jcu-radio input:focus-visible + .jcu-dot { outline: 2px solid var(--dash); outline-offset: 2px; }
.jcu-radio:hover .jcu-dot { border-color: var(--ink-2); }

.jcu-radio.is-off { cursor: not-allowed; color: var(--ink-3); opacity: .5; }
.jcu-radio.is-off .jcu-dot { border-color: var(--line); }
.jcu-radio.is-off:hover .jcu-dot { border-color: var(--line); }


.jcu-hint { grid-column: 2; margin: 0; font-size: 12.5px; color: var(--ink-3); }

.jcu-modal-foot {
  display: flex; justify-content: flex-end;
  padding: 16px 24px 22px;
  border-top: 1px solid var(--line);
}
.jcu-modal-foot .jcu-btn { padding: 11px 28px; font-size: 15px; }

/* ================= 其它 ================= */
.jcu-err {
  margin: 16px 0 0; padding: 12px 15px; border-radius: 8px;
  font-size: 13.5px; line-height: 1.7;
  background: rgba(192,57,43,.08); color: #c0392b; border: 1px solid rgba(192,57,43,.3);
}
.jcu-log-wrap { margin-top: 20px; font-size: 12.8px; color: var(--ink-3); }
.jcu-log-wrap summary { cursor: pointer; }
.jcu-log {
  margin: 8px 0 0; padding: 12px; max-height: 190px; overflow: auto;
  background: var(--plane); border: 1px solid var(--line); border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px; line-height: 1.7; letter-spacing: 0;
  color: var(--ink-2); white-space: pre-wrap;
}

@media (prefers-reduced-motion: reduce) { .jcu * { transition: none !important; animation: none !important; } }

@media (max-width: 820px) {
  .jcu-card, .jcu-result-box { grid-template-columns: 1fr; gap: 22px; padding: 18px; }
  .jcu-cmp { order: 2; }
  .jcu-card-side, .jcu-result-side { order: 1; }
  .jcu-drop h1 { font-size: 27px; }
  .jcu-drop { min-height: 280px; padding: 36px 20px; }
}
@media (max-width: 560px) {
  .jcu { letter-spacing: .5px; }
  .jcu-points { grid-template-columns: 1fr; }
  .jcu-cta { font-size: 18px; padding: 13px 22px; }
  .jcu-modal-box { max-width: none; }
  .jcu-modal-row { grid-template-columns: 1fr; gap: 10px; }
  .jcu-hint { grid-column: 1; }
  .jcu-task { flex-direction: column; align-items: stretch; }
  .jcu-task-thumb { width: 100%; height: 130px; }
  .jcu-btn { flex: 1; justify-content: center; }
}

/* ================= 处理中：进度内嵌于任务卡片 ================= */
.jcu-thumb-wrap { position: relative; flex: none; line-height: 0; }
.jcu-task-status {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: rgba(17, 24, 39, .62);
  color: #fff;
  /* 缩略图只有 76px 宽：「处理中 100%」必须压到一行，否则会折成两行很难看。
     10px + nowrap 是实测能放下的最大字号。 */
  font-size: 10px; font-weight: 600; letter-spacing: 0;
  line-height: 1.2; text-align: center; padding: 2px;
  white-space: nowrap;
}
.jcu-task .jcu-prog { margin: 0 0 12px; }
.jcu-task .jcu-prog-track { height: 5px; border-radius: 3px; }
.jcu-task .jcu-prog-fill { border-radius: 3px; background: var(--dash); }

/* 仅供屏幕阅读器 */
.jcu-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* 预览按钮 */
.jcu-btn-preview { background: var(--dash); color: #fff; }
.jcu-btn-preview:hover:not(:disabled) { background: #2f6fc4; }

/* 任务卡片内的下载按钮（完成后出现，带文件体积） */
.jcu-btn-dl { background: var(--green); color: #fff; }
.jcu-btn-dl:hover:not(:disabled) { background: var(--green-2); }

/* ================= 多图任务列表 ================= */
.jcu-tasklist { display: flex; flex-direction: column; gap: 12px; }

.jcu-task-item {
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg);
  overflow: hidden;
}
.jcu-task-item .jcu-task { border: 0; border-radius: 0; }

/* 每张卡自己的对比面板 */
.jcu-cmp-panel {
  padding: 16px; border-top: 1px solid var(--line);
  background: var(--plane);
}
.jcu-cmp-panel .jcu-cmp-stage { max-width: 620px; margin-inline: auto; }

.jcu-task-item.is-done .jcu-task-status { background: rgba(17,24,39,.55); }

/* 对比区宽度：默认不超过容器，同时不超过「输出宽度 × 8」——
   避免小图（如 32px 输出）被拉到满宽后两边都糊成一片，看不出差异。 */
.jcu-cmp-panel .jcu-cmp-stage {
  max-width: min(620px, var(--cmp-max, 620px));
  margin-inline: auto;
}

/* 处理中的「终止」按钮：橙色，与「删除」区分 */
.jcu-btn-warn { background: #e8892f; color: #fff; }
.jcu-btn-warn:hover:not(:disabled) { background: #cf7620; }

/* 轻提示：用于「请登陆！」等暂无落点的入口，避免点了没反应 */
.jcu-toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%) translateY(8px);
  max-width: 80vw; padding: 11px 20px; border-radius: 8px;
  background: rgba(17, 24, 39, .92); color: #fff;
  font-size: 14px; line-height: 1.5; letter-spacing: .5px;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 10000;
}
.jcu-toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 品牌字标：低调地放在 H1 上方，不抢 H1 的 SEO 权重 */
.jcu-brand {
  margin: 0 0 8px;
  font-family: var(--font);
  font-size: 13px; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--green);
}
