﻿:root {
  color-scheme: light;
  --paper: #f4f2ea;
  --page: #f6f7f3;
  --ink: #17191c;
  --muted: #535955;
  --line: #d9dbd3;
  --border: #8b9389;
  --accent: #ff6b3d;
  --focus: #5162d6;
  --sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); font: 16px/1.55 var(--sans); }
main {
  width: min(100%, 1504px, max(900px, calc(160svh - 320px)));
  margin-inline: auto; padding: clamp(16px, 2.4vh, 30px) clamp(14px, 2.6vw, 36px) 22px;
}
header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
h1 { margin: 0; font: 700 clamp(24px, 3vw, 40px)/1.18 "Songti SC", SimSun, serif; }
a { color: var(--ink); text-underline-offset: .22em; }
header a {
  flex: none; display: inline-flex; align-items: center; min-height: 40px;
  padding: 6px 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff;
  font-size: 14px; font-weight: 600; text-decoration: none;
}
header a:hover { background: var(--paper); border-color: var(--ink); }
figure { margin: 0; border: 1px solid var(--line); border-bottom: 0; border-radius: 12px 12px 0 0; overflow: hidden; background: var(--paper); }
.frame {
  --split: 50%;
  position: relative; isolation: isolate; overflow: hidden; width: 100%; aspect-ratio: 16 / 10;
  background: #37403d; cursor: ew-resize; touch-action: pan-y;
}
.frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; user-select: none; }
#target { clip-path: inset(0 calc(100% - var(--split)) 0 0); }
.frame::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: var(--split); width: 2px;
  transform: translateX(-50%); background: #fff; box-shadow: 0 0 3px #252519a8; pointer-events: none;
}
.frame::before {
  content: ""; position: absolute; z-index: 1; left: clamp(15px, var(--split), calc(100% - 15px)); top: 50%;
  width: 30px; height: 30px; transform: translate(-50%, -50%); border: 1px solid #fff9; border-radius: 50%;
  background: linear-gradient(90deg, white 0 2px, transparent 2px 5px, white 5px 7px) center / 7px 10px no-repeat, #272723d6;
  pointer-events: none;
}
figcaption { display: flex; justify-content: space-between; gap: 12px; padding: 8px 14px; font-size: 14px; }
figcaption span:last-child { text-align: end; }
.controls {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px 16px;
  padding: 10px 14px; border: 1px solid var(--line); border-radius: 0 0 12px 12px; background: #fff;
}
.buttons { display: inline-grid; grid-template-columns: repeat(3, minmax(68px, 1fr)); gap: 2px; padding: 3px; border: 1px solid var(--border); border-radius: 9px; background: var(--page); }
button { min-height: 38px; padding: 6px 12px; border: 0; border-radius: 6px; background: transparent; color: var(--ink); cursor: pointer; font: 550 14px/1.4 var(--sans); }
button:hover { background: var(--paper); }
button[aria-pressed="true"] { background: var(--accent); font-weight: 700; }
button[aria-pressed="true"]::before { content: ""; display: inline-block; width: 5px; height: 9px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; margin: 0 6px 1px 0; transform: rotate(45deg); }
label { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
input { width: clamp(100px, 15vw, 190px); min-height: 36px; margin: 0; accent-color: #ae471f; cursor: ew-resize; }
footer { margin-top: 12px; padding-top: 6px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
footer a { display: inline-flex; align-items: center; min-height: 36px; white-space: nowrap; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
@media (max-width: 570px) {
  header { align-items: start; flex-wrap: wrap; margin-bottom: 12px; }
  header a { min-height: 36px; }
  figcaption { gap: 8px; padding: 7px 10px; font-size: 13px; }
  .controls { align-items: stretch; flex-direction: column; gap: 4px; padding: 9px 10px; }
  button { min-height: 42px; }
  label { justify-content: space-between; }
  input { flex: 1; min-height: 40px; min-width: 0; }
}

