@font-face { font-family: 'InterV'; src: url('../vendor/fonts/inter_500.woff2') format('woff2'); font-weight: 400 600; }
@font-face { font-family: 'InterV'; src: url('../vendor/fonts/inter_700.woff2') format('woff2'); font-weight: 700 800; }
:root {
  --ink: #1d232b; --ink2: #5a6370; --line: #e6e2db; --paper: #fffdf9; --bg: #efebe5;
  --amber: #f59e0b; --amber2: #ffb34d; --cyan: #0e7490;
  --font: 'InterV', Inter, 'Helvetica Neue', Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--font); }
button { font: inherit; color: inherit; cursor: pointer; }
#app { display: grid; grid-template-columns: 1fr 400px; grid-template-rows: 56px 1fr; height: 100vh; }
.top { grid-column: 1 / -1; display: flex; align-items: center; gap: 22px; padding: 0 20px; background: var(--paper); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: -0.01em; }
.dot { width: 12px; height: 12px; border-radius: 3px; background: var(--amber); display: inline-block; box-shadow: 0 0 0 3px #fde7c2; }
.product { display: flex; gap: 10px; align-items: baseline; min-width: 0; }
.product b { font-weight: 700; white-space: nowrap; }
.product span { color: var(--ink2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.src { margin-left: auto; font-size: 13px; color: var(--ink2); text-decoration: none; border: 1px solid var(--line); padding: 6px 10px; border-radius: 8px; }
.src:hover { color: var(--ink); border-color: #cfc8bd; }

.viewport { position: relative; overflow: hidden; }
.stage { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.stage:active { cursor: grabbing; }
.chips { position: absolute; left: 16px; top: 14px; display: flex; gap: 8px; }
.chip { background: rgba(255,253,249,.88); backdrop-filter: blur(6px); border: 1px solid var(--line); border-radius: 10px; padding: 6px 11px; font-size: 13px; display: flex; gap: 8px; }
.chip span { color: var(--ink2); }
.chip b { font-variant-numeric: tabular-nums; }
.hint { position: absolute; right: 16px; top: 16px; font-size: 12px; color: var(--ink2); opacity: .8; }
.label { position: absolute; pointer-events: none; transform: translate(-50%, -130%); background: var(--ink); color: #fff; font-size: 13px; padding: 6px 10px; border-radius: 8px; white-space: nowrap; display: none; box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.label b { color: var(--amber2); margin-right: 6px; }
.loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink2); background: var(--bg); transition: opacity .4s; }
.loading.done { opacity: 0; pointer-events: none; }

.transport { position: absolute; left: 16px; right: 16px; bottom: 16px; display: flex; align-items: center; gap: 8px; background: rgba(255,253,249,.92); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px; box-shadow: 0 8px 30px rgba(40,30,20,.08); }
.transport button { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; }
.transport button:hover { border-color: #cfc8bd; }
.transport svg { width: 18px; height: 18px; fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.transport .play { background: var(--ink); border-color: var(--ink); }
.transport .play svg { fill: #fff; stroke: none; }
.transport .play .i-pause, .transport .play.on .i-play { display: none; }
.transport .play.on .i-pause { display: block; }
.timeline { position: relative; flex: 1; height: 38px; margin-left: 8px; cursor: pointer; }
.timeline::before { content: ''; position: absolute; left: 0; right: 0; top: 17px; height: 4px; border-radius: 2px; background: #e9e4dc; }
.fill { position: absolute; left: 0; top: 17px; height: 4px; border-radius: 2px; background: var(--amber); }
.knob { position: absolute; top: 11px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: #fff; border: 3px solid var(--amber); box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.ticks { position: absolute; inset: 0; }
.ticks i { position: absolute; top: 26px; font-style: normal; font-size: 10px; color: var(--ink2); transform: translateX(-50%); font-variant-numeric: tabular-nums; }
.ticks i.cur { color: var(--ink); font-weight: 700; }
.ticks s { position: absolute; top: 15px; width: 2px; height: 8px; background: #d8d1c6; margin-left: -1px; }

.side { background: var(--paper); border-left: 1px solid var(--line); padding: 22px 24px; overflow-y: auto; }
.stepno { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--amber); }
.side h1 { font-size: 24px; line-height: 1.2; margin: 6px 0 10px; letter-spacing: -0.015em; }
.side p { font-size: 15px; line-height: 1.55; color: #333a44; margin: 0 0 18px; }
.side p b { color: var(--ink); }
.side p .warn { display: block; margin-top: 10px; padding: 8px 10px; background: #fff4e0; border-radius: 8px; font-size: 13.5px; }
.needs-h { font-size: 12px; font-weight: 700; color: var(--ink2); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.needs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.need { position: relative; width: 82px; height: 82px; border: 1px solid var(--line); border-radius: 10px; background: #fff; display: grid; place-items: center; overflow: hidden; cursor: pointer; }
.need img { max-width: 92%; max-height: 72%; object-fit: contain; mix-blend-mode: multiply; }
.need .q { position: absolute; right: 4px; top: 4px; font-size: 11px; font-weight: 700; background: var(--ink); color: #fff; border-radius: 6px; padding: 1px 5px; }
.need .n { position: absolute; left: 0; right: 0; bottom: 3px; font-size: 9.5px; text-align: center; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; }
.need.tool { background: #f8f6f2; }
.manual { margin: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.manual img { width: 100%; display: block; }
.manual figcaption { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--ink2); padding: 8px 10px; border-top: 1px solid var(--line); background: #faf8f4; }
.manual button { border: 1px solid var(--line); background: #fff; border-radius: 7px; padding: 4px 8px; font-size: 12px; }

.book { position: fixed; inset: 0; background: rgba(20,22,26,.72); display: grid; place-items: center; z-index: 20; }
.book[hidden] { display: none; }
.book-inner { width: min(96vw, 1500px, calc((92vh - 52px) * 1.4145)); background: #fff; border-radius: 14px; overflow: hidden; }
.book-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.book-bar .sp { flex: 1; }
.book-bar button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 4px 12px; }
.book-page { position: relative; }
.book-page img { width: 100%; display: block; }
#bookHots a { position: absolute; border: 2px solid transparent; border-radius: 6px; cursor: pointer; }
#bookHots a:hover, #bookHots a.cur { border-color: var(--amber); background: rgba(245,158,11,.08); }
#bookHots a span { position: absolute; right: 6px; top: 6px; background: var(--amber); color: #fff; font-size: 12px; font-weight: 700; padding: 2px 7px; border-radius: 6px; opacity: 0; }
#bookHots a:hover span, #bookHots a.cur span { opacity: 1; }

/* ---------- capture mode: 1920x1080 video frames ---------- */
.cap { display: none; }
body.capture #app { grid-template-columns: 1fr; grid-template-rows: 1fr; }
body.capture .top, body.capture .side, body.capture .transport, body.capture .chips, body.capture .hint { display: none; }
body.capture .stage { cursor: default; }
body.capture .cap { display: block; position: absolute; inset: 0; pointer-events: none; }
.cap-title { position: absolute; left: 44px; top: 36px; display: flex; align-items: center; gap: 12px; font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
.cap-title .dot { width: 16px; height: 16px; }
.cap-counts { position: absolute; right: 44px; top: 34px; display: flex; gap: 10px; }
.cap-counts span { background: rgba(255,253,249,.9); border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px; font-size: 19px; font-variant-numeric: tabular-nums; }
.cap-manual { position: absolute; right: 44px; top: 96px; margin: 0; width: 380px; background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: 0 14px 40px rgba(40,30,20,.12); transition: opacity .2s; }
.cap-manual img { width: 100%; display: block; }
.cap-manual figcaption { font-size: 14px; color: var(--ink2); padding: 7px 12px; border-top: 1px solid var(--line); background: #faf8f4; }
.cap-band { position: absolute; left: 44px; right: 44px; bottom: 40px; min-height: 140px; display: flex; gap: 26px; align-items: center; background: rgba(255,253,249,.94); border: 1px solid var(--line); border-radius: 18px; padding: 22px 30px; box-shadow: 0 14px 40px rgba(40,30,20,.10); }
.cap-step { flex: none; width: 112px; height: 96px; border-radius: 14px; background: var(--ink); color: #fff; display: grid; place-items: center; text-align: center; font-size: 46px; font-weight: 800; line-height: 1; }
.cap-step small { display: block; font-size: 14px; font-weight: 700; letter-spacing: .1em; color: var(--amber2); margin-bottom: 4px; }
.cap-h { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 6px; }
.cap-p { font-size: 23px; line-height: 1.38; color: #39404a; }
.cap-p b { color: var(--ink); }
.cap-p .warn { color: #a3530a; font-weight: 600; }

@media (max-width: 900px) {
  #app { grid-template-columns: 1fr; grid-template-rows: 56px 58vh auto; height: auto; }
  .side { border-left: 0; border-top: 1px solid var(--line); }
  .viewport { height: 58vh; }
  .product span, .hint { display: none; }
}
