/* 10 应用：复制自 30-视觉设计/原型/ecr/ecr.css（2026-09-30 09:11:27），去掉了开头的原型工具条（.ecr-proto*、.ecr-page）。30 改了要重新复制 */
/*
 * ECR 方案 1「四格漫画」（D-018 / D-020）· 30 视觉设计 · v0.2
 * 加载在 themes.css、app.css、mag.css 之后，只写 ECR 的差异。
 * 规矩：没有全局 reset；每条选择器都以 .mag.ecr 开头（原型工具条除外）；自己的类名一律 ecr- 前缀，
 *       不改写 mag.css / app.css 已有的类（要不同就加 ecr- 类），状态用 aria-* / data-*。
 */

/* ---------- 共用零件 ---------- */
.mag.ecr img { display: block; max-width: 100%; }
.mag.ecr .ecr-foot { margin-top: 22px; padding-top: 8px; border-top: 1px solid var(--stock-edge); font-size: 12px; color: var(--muted); text-align: center; }

/* 漫画格：黑框 + 纸面；图没到位时用平网占位 */
.mag.ecr .ecr-pnl, .mag.ecr .ecr-scene, .mag.ecr .ecr-art { position: relative; margin: 0; background: var(--paper); border: 2px solid var(--graphite); overflow: hidden; }
.mag.ecr .ecr-pnl img, .mag.ecr .ecr-scene img, .mag.ecr .ecr-art img { width: 100%; height: 100%; object-fit: cover; }
.mag.ecr [data-img="miss"] { background: var(--t-wash); }
.mag.ecr [data-img="miss"] img { visibility: hidden; }

/* 马克笔圈：每次路径略有抖动；pathLength=100 */
.mag.ecr .ecr-loop { position: absolute; left: -8px; top: -8px; width: calc(100% + 16px); height: calc(100% + 16px); pointer-events: none; overflow: visible; }
.mag.ecr .ecr-loop path { fill: none; stroke: var(--t-ink); stroke-width: 3.5; stroke-linecap: round; vector-effect: non-scaling-stroke; stroke-dasharray: 100; stroke-dashoffset: 100; animation: ecr-draw .45s var(--ease-out) forwards; }
.mag.ecr .ecr-loop[data-still] path { animation: none; stroke-dashoffset: 0; }
.mag.ecr .ecr-loop[data-dashed] path { stroke-width: 3.5; stroke-dasharray: 4 2.5; stroke-dashoffset: 0; animation: none; }
.mag.ecr .ecr-loop[data-dashed] .ecr-halo { stroke: var(--paper); stroke-width: 7; stroke-dasharray: none; }
@keyframes ecr-draw { to { stroke-dashoffset: 0; } }

/* ================= 翻到的这一页：四格放进翻到卡 ================= */
.mag.ecr .ecr-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: -4px -4px 14px; }
.mag.ecr .ecr-pnl { aspect-ratio: 3 / 4; }
.mag.ecr .ecr-pnl:nth-child(1) { transform: rotate(-.6deg); }
.mag.ecr .ecr-pnl:nth-child(4) { transform: rotate(.5deg); }

/* 对话气泡（画里不放字，气泡由页面画） */
.mag.ecr .ecr-bub {
  position: absolute; display: grid; place-items: center; min-width: 36px; height: 28px; padding: 0 8px;
  background: var(--paper); border: 2px solid var(--graphite); border-radius: 50% / 46%; color: var(--graphite);
}
.mag.ecr .ecr-bub svg { width: 16px; height: 16px; }
.mag.ecr .ecr-bub .ecr-dots { width: 18px; height: 7px; }
.mag.ecr .ecr-bub::after { content: ""; position: absolute; width: 8px; height: 8px; background: var(--paper); border-right: 2px solid var(--graphite); border-bottom: 2px solid var(--graphite); }
.mag.ecr .ecr-bub-tl { left: 6px; top: 6px; }
.mag.ecr .ecr-bub-tl::after { right: 7px; bottom: -5px; transform: skewX(-20deg) rotate(40deg); }
.mag.ecr .ecr-bub-tr { right: 6px; top: 6px; }
.mag.ecr .ecr-bub-tr::after { left: 7px; bottom: -5px; transform: skewX(20deg) rotate(40deg); }
.mag.ecr .ecr-bub-br { right: 6px; bottom: 30%; }
.mag.ecr .ecr-bub-br::after { left: 5px; bottom: -5px; transform: skewX(20deg) rotate(40deg); }
.mag.ecr .ecr-bub-s { min-width: 28px; height: 24px; padding: 0 5px; color: var(--t-ink); }
.mag.ecr .ecr-bub-empty { width: 48px; }
.mag.ecr .ecr-badge { position: absolute; right: -7px; top: -7px; display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; font-style: normal; font-size: 10px; font-weight: 700; color: var(--on-ink); background: var(--t-ink); }
.mag.ecr .ecr-think { position: absolute; right: 6px; top: 6px; width: 54px; height: 42px; }
.mag.ecr .ecr-think b { position: absolute; right: 0; top: 0; width: 44px; height: 27px; background: var(--paper); border: 2px solid var(--graphite); border-radius: 50%; }
.mag.ecr .ecr-think i { position: absolute; background: var(--paper); border: 2px solid var(--graphite); border-radius: 50%; }
.mag.ecr .ecr-think i:nth-child(1) { left: 2px; bottom: 0; width: 7px; height: 7px; }
.mag.ecr .ecr-think i:nth-child(2) { left: 9px; bottom: 8px; width: 10px; height: 10px; }

/* ================= 答题 ================= */
.mag.ecr .ecr-prog { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(36, 1fr); gap: 2px; }
.mag.ecr .ecr-prog li { aspect-ratio: 1; border: 1px solid var(--graphite); background-color: var(--paper); }
.mag.ecr .ecr-prog li[data-s="done"] { background-color: var(--t-field); }
.mag.ecr .ecr-prog li[data-s="cur"] { background-color: var(--t-ink); border-color: var(--t-ink); }
@media (max-width: 340px) { .mag.ecr .ecr-prog { gap: 1px; } }

.mag.ecr .ecr-scene { margin-top: 10px; aspect-ratio: 5 / 2; }
.mag.ecr .ecr-scene img { object-position: 72% 40%; }

/* 她说的话：气泡压在漫画格下沿，尾巴指回她 */
.mag.ecr .ecr-say { position: relative; z-index: 1; margin-top: -22px; padding: 10px 16px 14px; background: var(--paper); border: 2px solid var(--graphite); border-radius: 22px 26px 24px 20px / 20px 24px 22px 26px; }
.mag.ecr .ecr-say::before { content: ""; position: absolute; right: 22%; top: -12px; width: 18px; height: 18px; background: var(--paper); border-top: 2px solid var(--graphite); border-left: 2px solid var(--graphite); transform: skewX(-24deg) rotate(30deg); }
.mag.ecr .ecr-tip { position: relative; font-size: 12px; color: var(--muted); }
.mag.ecr .ecr-q { position: relative; margin: 2px 0 0; font-size: clamp(20px, 6vw, 25px); color: var(--graphite); min-height: 2.3em; }
.mag.ecr .ecr-say[data-flip] { animation: ecr-flip .38s var(--ease-out); }
@keyframes ecr-flip { from { opacity: .2; transform: translateY(6px) rotate(-.6deg); } }

/* 七个选项：漫画旁白框，左右轻微错落 */
.mag.ecr .ecr-opts { display: grid; gap: 6px; margin-top: 14px; }
.mag.ecr .ecr-opt {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 14px;
  text-align: left; font-size: 16px; background: var(--paper); border: 1.5px solid var(--graphite); border-radius: var(--t-radius-sm);
  transition: background-color .15s var(--ease-out);
}
.mag.ecr .ecr-opt:nth-child(odd) { margin-right: 18px; transform: rotate(-.5deg); }
.mag.ecr .ecr-opt:nth-child(even) { margin-left: 18px; transform: rotate(.4deg); }
.mag.ecr .ecr-opt:nth-child(4) { margin: 0 9px; transform: none; }
.mag.ecr .ecr-opt-n { font-family: var(--t-font-display); font-size: 15px; color: var(--t-ink); font-variant-numeric: tabular-nums; width: 1em; }
.mag.ecr .ecr-opt[aria-checked="true"] { background: var(--t-wash); font-weight: 700; }
@media (hover: hover) { .mag.ecr .ecr-opt:hover { background: var(--t-wash); } }
.mag.ecr .ecr-qfoot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.mag.ecr .ecr-qhint { font-size: 12px; color: var(--muted); }
.mag.ecr .ecr-qnote { margin-top: 6px; font-size: 12px; }
.mag.ecr [data-act="prev"][aria-disabled="true"] { color: var(--muted); text-decoration-color: var(--stock-edge); }

/* ================= 结果 ================= */
.mag.ecr .ecr-dims { margin-top: 18px; padding: 14px 16px 4px; background: var(--paper); border: 2px solid var(--graphite); }
.mag.ecr .ecr-dims-lede { font-size: 13px; color: var(--muted); }
.mag.ecr .ecr-dim { padding: 10px 0 12px; }
.mag.ecr .ecr-dim + .ecr-dim { border-top: 1.5px dashed var(--stock-edge); }
.mag.ecr .ecr-dim-h { display: flex; align-items: baseline; gap: 10px; }
.mag.ecr .ecr-dim-name { font-size: 16px; font-weight: 700; }
.mag.ecr .ecr-dim-num { font-size: 44px; line-height: 1; color: var(--t-ink); text-shadow: var(--misreg); font-variant-numeric: tabular-nums; }
.mag.ecr .ecr-dim-word { margin-left: auto; font-size: 14px; font-weight: 700; color: var(--t-ink); }
/* 刻度尺：7 个漫画小格 = 1–7 分，网点填到你的分数 */
.mag.ecr .ecr-ruler { position: relative; display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 8px; }
.mag.ecr .ecr-ruler i { position: relative; height: 22px; border: 1.5px solid var(--graphite); background: var(--paper); overflow: hidden; }
.mag.ecr .ecr-ruler i::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: var(--f, 0%); background-color: var(--t-wash);
  background-image: radial-gradient(circle, var(--t-print) 0 26%, transparent 29%), radial-gradient(circle, var(--t-print) 0 26%, transparent 29%);
  background-size: var(--dot) var(--dot); background-position: 0 0, calc(var(--dot) / 2) calc(var(--dot) / 2);
}
.mag.ecr .ecr-ruler i[data-mid] { border-style: dashed; }
.mag.ecr .ecr-mark { position: absolute; top: -7px; width: 3px; height: 36px; margin-left: -1.5px; background: var(--t-ink); border-radius: 2px; }
.mag.ecr .ecr-ends { display: flex; justify-content: space-between; margin-top: 4px; font-size: 12px; color: var(--muted); }
.mag.ecr .ecr-dim-desc { margin-top: 4px; font-size: 13px; color: var(--muted); }

.mag.ecr .ecr-eye { margin-top: 22px; font-size: 14px; color: var(--muted); text-align: center; }
.mag.ecr .ecr-type { margin: 0; font-size: 56px; color: var(--t-ink); text-align: center; text-shadow: var(--misreg); }
.mag.ecr .ecr-type[data-mid] { font-size: 38px; }
.mag.ecr .ecr-term { font-size: 12px; color: var(--muted); text-align: center; }
.mag.ecr .ecr-tag { margin-top: 6px; font-size: 16px; text-align: center; text-wrap: balance; }

/* 四格：你那格上色、只圈图片区，标题在圈外；其余三格退成灰 */
.mag.ecr .ecr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 10px; margin-top: 18px; }
.mag.ecr .ecr-cell { position: relative; margin: 0; }
.mag.ecr .ecr-art { aspect-ratio: 1 / 1; overflow: visible; }
.mag.ecr .ecr-art img { filter: grayscale(1) contrast(.9); opacity: .55; }
.mag.ecr .ecr-cell figcaption { display: grid; gap: 1px; padding: 6px 2px 0; }
.mag.ecr .ecr-cell figcaption b { font-family: var(--t-font-display); font-weight: 400; font-size: 19px; color: var(--muted); }
.mag.ecr .ecr-cell figcaption span { font-size: 12px; color: var(--muted); line-height: 1.4; }
.mag.ecr .ecr-cell[data-me] .ecr-art img, .mag.ecr .ecr-cell[data-near] .ecr-art img { filter: none; opacity: 1; }
.mag.ecr .ecr-cell[data-me] figcaption b { color: var(--t-ink); }
.mag.ecr .ecr-cell[data-me] figcaption span, .mag.ecr .ecr-cell[data-near] figcaption span { color: var(--graphite); }
.mag.ecr .ecr-cell[data-near] figcaption b { color: var(--graphite); }
.mag.ecr .ecr-you { position: absolute; right: -8px; top: -12px; z-index: 1; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; font-family: var(--t-font-display); font-size: 19px; color: var(--on-ink); background: var(--t-ink); transform: rotate(8deg); }
.mag.ecr .ecr-also { width: auto; height: 26px; padding: 0 8px; border-radius: 13px; font-size: 14px; color: var(--t-ink); background: var(--paper); border: 2px solid var(--t-ink); top: -10px; transform: rotate(-4deg); }
.mag.ecr .ecr-near { margin-top: 12px; font-size: 14px; text-align: center; text-wrap: balance; }

.mag.ecr .ecr-keys { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.mag.ecr .ecr-keys li { display: inline-flex; align-items: center; gap: 4px; padding: 3px 12px; font-size: 15px; font-weight: 700; background: var(--t-wash); border: 1.5px solid var(--graphite); }
.mag.ecr .ecr-keys svg { width: 14px; height: 14px; color: var(--t-ink); }
.mag.ecr .ecr-caveat { margin-top: 16px; padding: 10px 12px; font-size: 13px; color: var(--muted); border: 1.5px dashed var(--graphite); }

@media (prefers-reduced-motion: reduce) {
  .mag.ecr .ecr-loop path { animation: none; stroke-dashoffset: 0; }
  .mag.ecr .ecr-say[data-flip] { animation: none; }
}
