/* 明察 Eagle Eye — Apple-minimal, self-contained (tokens duplicated from
   app-style.css; tools with their own style.css do not get the shared
   sheet). Two images side by side on wide screens; stacked vertically
   on small screens, with a single-image toggle + pinch zoom (change #7). */
:root {
  color-scheme: light;
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
  --canvas: #f5f5f7;
  --surface: #fff;
  --recessed: #f5f5f7;
  --ink: #1d1d1f;
  --muted: #65656b;
  --line: rgb(0 0 0 / .06);
  --control-line: rgb(0 0 0 / .14);
  --selected: rgb(0 0 0 / .075);
  --accent: #0071e3;
  --accent-hover: #0065cc;
  --accent-ink: #fff;
  --good: #1eaa50;
  --bad: #e02028;
  --orange: #d97a06;
  --motion: .2s cubic-bezier(.16, 1, .3, 1);
  color: var(--ink);
  background: var(--canvas);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #161618;
  --surface: #1e1e20;
  --recessed: #242426;
  --ink: #f5f5f7;
  --muted: #ababaf;
  --line: rgb(255 255 255 / .08);
  --control-line: rgb(255 255 255 / .19);
  --selected: rgb(255 255 255 / .10);
  --accent: #5aaaf9;
  --accent-hover: #7bbaff;
  --accent-ink: #101820;
  --good: #4cc38a;
  --bad: #ff6b6b;
  --orange: #ff9f0a;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; transition: background-color var(--motion), color var(--motion); }
main { width: min(960px, calc(100% - 32px)); margin: clamp(32px, 7vw, 80px) auto; }
h1 { font-size: clamp(2.25rem, 5vw, 4rem); font-weight: 600; line-height: 1.12; letter-spacing: -.045em; margin: 16px 0 8px; }
h2 { font-size: 1.25rem; font-weight: 600; letter-spacing: -.02em; margin: 0 0 12px; }
h3 { font-size: 1rem; font-weight: 600; margin: 20px 0 8px; }
p { color: var(--muted); margin: 0; }
a { color: var(--ink); text-underline-offset: .2em; }
#back { display: inline-block; font-size: 14px; color: var(--muted); text-decoration: none; margin-bottom: 8px; }
.subtitle { font-size: 1.05rem; color: var(--muted); }
.lede { margin-top: 12px; font-size: 1.05rem; }
.badges { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 16px; font-size: 14px; color: var(--muted); }
.panel { display: grid; gap: 16px; margin-block-start: 32px; border: 1px solid var(--line); border-radius: 24px; padding: clamp(16px, 4vw, 32px); background: var(--surface); }
.of-url-note { font-size: 13px; color: var(--muted); line-height: 1.6; }
.fineprint { font-size: 13px; line-height: 1.6; }
button { display: inline-flex; justify-content: center; align-items: center; background: var(--accent); color: var(--accent-ink); border: 1px solid transparent; border-radius: 8px; min-height: 44px; font: inherit; font-size: 14px; font-weight: 500; padding: 8px 16px; cursor: pointer; transition: background-color var(--motion), transform var(--motion); }
button:not(:disabled):hover { background: var(--accent-hover); }
button:not(:disabled):active { transform: scale(.98); }
button:disabled { opacity: .5; cursor: not-allowed; }
.secondary { color: var(--ink); background: var(--recessed); }
.secondary:not(:disabled):hover { background: var(--selected); }
.buttons { display: flex; flex-wrap: wrap; gap: 8px; }
#status:empty, #tap-msg:empty, #export-msg:empty, #gen-note:empty { display: none; }
#status { font-size: 14px; color: var(--bad); }
#tap-msg { font-size: 14px; color: var(--muted); min-height: 1.4em; }
#export-msg { font-size: 13px; }
.brand-line { text-align: center; color: var(--muted); font-size: 12.5px; letter-spacing: .14em; padding: 20px 0 28px; margin: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Dropzone + difficulty */
.ee-drop { border: 1.5px dashed var(--control-line); border-radius: 16px; padding: 28px 16px; text-align: center; cursor: pointer; background: var(--recessed); display: grid; gap: 6px; }
.ee-drop p:first-child { color: var(--ink); font-size: 15px; }
.ee-drop:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.ee-drop.ee-over { border-color: var(--accent); background: var(--selected); }
.ee-diff-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: 14px; color: var(--ink); }
.ee-radio { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--muted); }
.ee-radio input { accent-color: var(--accent); }

/* Stats */
.ee-stats, .ee-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; }
.ee-stat { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--surface); }
.ee-stat .num { font-size: 1.4rem; font-weight: 600; color: var(--ink); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ee-stat .lbl { font-size: 12px; color: var(--muted); }

/* View + zoom controls */
.ee-view-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.ee-view-btns, .ee-zoom-btns { display: flex; align-items: center; gap: 8px; }
.ee-view-btns button, .ee-zoom-btns button { min-height: 36px; padding: 6px 12px; font-size: 13px; }
.ee-view-on { background: var(--ink) !important; color: var(--surface) !important; }
#zoom-val { font-size: 13px; color: var(--muted); min-width: 44px; text-align: center; font-variant-numeric: tabular-nums; }

/* Stage: two canvases side by side; the stage is the scroll/clip
   container, the inner grid is the zoom surface (transform-origin
   top-left, drag to pan when zoomed). */
.ee-stage { overflow: hidden; touch-action: none; border-radius: 16px; }
.ee-stage.ee-zoomed { overflow: auto; cursor: grab; }
.ee-stage.ee-zoomed:active { cursor: grabbing; }
.ee-stage-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; transform-origin: 0 0; will-change: transform; }
.ee-fig { margin: 0; display: grid; gap: 6px; }
.ee-fig figcaption { font-size: 13px; color: var(--muted); }
.ee-fig canvas { width: 100%; height: auto; display: block; border-radius: 12px; background: var(--recessed); }
#canvas-changed { cursor: crosshair; }
.ee-stage.ee-single .ee-stage-inner { grid-template-columns: 1fr; }

/* Summary + export */
.ee-summary { border: 1px solid var(--line); border-radius: 16px; padding: 16px 20px; background: var(--recessed); display: grid; gap: 12px; }
.ee-summary h3 { margin: 0; }
.ee-export-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.ee-check { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; color: var(--ink); cursor: pointer; }
.ee-check input { margin-top: 3px; accent-color: var(--accent); }

/* Small screens: never force side-by-side (change #7) — stack the two
   images vertically; the single-image toggle + zoom stay available. */
@media (max-width: 720px) {
  .ee-stage-inner { grid-template-columns: 1fr; }
  .ee-view-row { flex-direction: column; align-items: stretch; }
  .ee-view-btns, .ee-zoom-btns { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  button, body { transition: none; }
}
