@charset "UTF-8"; /* 托管服务器返回的 CSS 不带字符集，声明一下，免得中文和符号被当成别的编码显示成乱码 */
/* ============================================================
   calibrate.css —— 遮挡区域校准页
   画布上的框画在截图上面，截图颜色不确定，所以框用固定的高对比颜色（不跟随深色模式）
   ============================================================ */

.cal {
  max-width: 1240px; margin: 0 auto; padding: 20px;
  display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start;
}
.cal-error { max-width: 1200px; margin: 16px auto 0; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--fail-bg); color: var(--fail); font-size: 13px; white-space: pre-line; }

/* ---------- 左：画布 ---------- */
.cal-stage-wrap {
  position: sticky; top: 76px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 16px 14px; display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.stage-tools { align-self: stretch; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stage-tools .hint { flex: 1; min-width: 160px; }

.stage {
  --aspect: 0.4615;
  --stage-h: calc(100vh - 190px);
  position: relative; width: min(100%, calc(var(--stage-h) * var(--aspect))); aspect-ratio: var(--aspect);
  background: #1d2026; border-radius: 8px; overflow: hidden;
  touch-action: none; user-select: none; -webkit-user-select: none; cursor: crosshair; outline: none;
}
.stage:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.stage.over { box-shadow: 0 0 0 3px var(--accent); }
.stage img { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.stage-empty { position: absolute; inset: 0; display: grid; place-content: center; gap: 6px; text-align: center; color: #c9ccd2; font-size: 13px; padding: 16px; pointer-events: none; }
.stage-empty .hint { color: #8d939e; }
.layer { position: absolute; inset: 0; }
.stage-foot { align-self: stretch; text-align: center; min-height: 1.6em; }

/* 遮挡区域：和主页面画面上的框同一套样式——白色细框 + 玻璃小胶囊；选中的（正在编辑）是荧光绿 */
.z { position: absolute; border-radius: 6px; cursor: move; background: rgba(255, 255, 255, .12); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .8), 0 0 0 1px rgba(0, 0, 0, .3); }
.z .z-name {
  position: absolute; left: 4px; top: 4px; padding: 0 7px; font-size: 11px; line-height: 17px; border-radius: 999px; max-width: calc(100% - 8px);
  color: #fff; background: rgba(18, 18, 20, .62); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
}
.z.r .z-name { left: auto; right: 4px; }
.z.sel { background: rgba(200, 240, 60, .18); box-shadow: inset 0 0 0 2px var(--brand), 0 0 16px var(--brand-glow); z-index: 2; }
.z.sel .z-name { background: var(--brand); color: var(--on-brand); font-weight: 600; }
.mode-area .z { pointer-events: none; opacity: .45; }

/* 视频播放区域（白色虚线） + 预览比例的视频画面（白色点线）；编辑播放区域时变成荧光绿 */
.va { position: absolute; border: 2px dashed rgba(255, 255, 255, .75); border-radius: 6px; pointer-events: none; }
.mode-area .va { pointer-events: auto; cursor: move; border-color: var(--brand); background: rgba(200, 240, 60, .12); z-index: 3; }
.va .z-name { background: rgba(18, 18, 20, .62); }
.mode-area .va .z-name { background: var(--brand); color: var(--on-brand); }
.vbox { position: absolute; border: 1.5px dotted rgba(255, 255, 255, .85); pointer-events: none; }
.vbox span { position: absolute; right: 2px; bottom: 2px; font-size: 10.5px; color: #fff; background: rgba(0, 0, 0, .55); padding: 0 4px; border-radius: 3px; }

/* 8 个缩放把手 */
.hd { position: absolute; width: 11px; height: 11px; background: #fff; border-radius: 50%; transform: translate(-50%, -50%); z-index: 4; box-shadow: 0 0 0 1.5px var(--brand), 0 1px 4px rgba(0, 0, 0, .45); }
.hd[data-h=nw] { left: 0; top: 0; cursor: nwse-resize; }
.hd[data-h=n]  { left: 50%; top: 0; cursor: ns-resize; }
.hd[data-h=ne] { left: 100%; top: 0; cursor: nesw-resize; }
.hd[data-h=e]  { left: 100%; top: 50%; cursor: ew-resize; }
.hd[data-h=se] { left: 100%; top: 100%; cursor: nwse-resize; }
.hd[data-h=s]  { left: 50%; top: 100%; cursor: ns-resize; }
.hd[data-h=sw] { left: 0; top: 100%; cursor: nesw-resize; }
.hd[data-h=w]  { left: 0; top: 50%; cursor: ew-resize; }

/* ---------- 右：设置 ---------- */
.cal-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.cal-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.cal-card p { margin: 0; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 10px; }
.row .field { flex: 1; min-width: 140px; }
.row select { width: 100%; }
input[type=text], textarea {
  font: inherit; font-size: 13px; color: var(--text); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 5px 8px; width: 100%;
}
textarea { resize: vertical; min-height: 52px; }
input[type=number] { width: 100%; }
.draft-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--info-bg); color: var(--info); font-size: 12.5px; }
.draft-bar span { flex: 1; }

/* 区域列表 */
.zlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.zlist li { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; }
.zlist li:hover { background: var(--fill); }
.zlist li.sel { background: var(--accent-weak); }
.zlist .sw { width: 10px; height: 10px; border-radius: 3px; background: var(--subtle); flex: none; }
.zlist li.sel .sw { background: var(--brand); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
.zlist .zl-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zlist .empty-li { cursor: default; color: var(--muted); }
.zlist .empty-li:hover { background: none; }

/* 选中区域的编辑器 */
.editor { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.editor-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }

/* 导出 */
.problems { margin: 0; padding: 8px 12px 8px 26px; border-radius: var(--radius-sm); background: var(--warn-bg); color: var(--warn); font-size: 12.5px; }
.ok-line { font-size: 12.5px; color: var(--pass); }
.json-preview summary { cursor: pointer; font-size: 12.5px; color: var(--muted); }
.json-preview pre { margin: 8px 0 0; max-height: 280px; overflow: auto; font: 11.5px/1.5 ui-monospace, Menlo, monospace; background: var(--fill); padding: 10px; border-radius: var(--radius-sm); white-space: pre; }

@media (max-width: 900px) {
  .cal { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .cal-stage-wrap { position: static; }
  .stage { --stage-h: 72vh; }
  .topbar { flex-wrap: wrap; padding: 10px 16px; }
  .brand-sub { display: none; }
}

/* ---------- 液态玻璃（和 Eup Preflight 主页面同一套风格） ---------- */
.cal-stage-wrap, .cal-card {
  background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--glass-shadow);
}
.cal { max-width: 1280px; }
