:root { --bg: #eef1f6; --ink: #1d2433; --muted: #5b6475; --line: #d5dbe6; --card: #fff; --accent: #e87d0d; color-scheme: light; }
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--ink); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
#demo { display: flex; flex-direction: column; min-height: 100vh; padding: 12px 16px 16px; gap: 12px; }
.top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; font-weight: 700; font-size: 17px; }
.logo { width: 26px; height: 26px; border-radius: 7px; background: #e87d0d; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; }
.pill { background: #e3f6e8; color: #17692f; border: 1px solid #bfe6c9; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; }
.grow { flex: 1; }
.btn { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 8px; padding: 6px 11px; font: inherit; font-size: 13px; cursor: pointer; text-decoration: none; display: inline-block; }
.btn:hover { border-color: var(--accent); }
.btn.on { background: #fff3e6; border-color: var(--accent); color: #8a4300; font-weight: 600; }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.body { display: grid; grid-template-columns: 260px 1fr; gap: 14px; flex: 1; min-height: 0; }
.guide { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; align-self: start; }
.guide h2 { margin: 0 0 6px; font-size: 15px; }
.guide ol { margin: 0; padding-left: 20px; }
.guide li { margin: 6px 0; }
.note { color: var(--muted); font-size: 12.5px; margin: 10px 0 0; }
.main { background: #232323; color: #e8e8e8; border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs .btn { background: #333; color: #ddd; border-color: #444; }
.tabs .btn.on { background: #e87d0d; color: #fff; border-color: #e87d0d; }
.view { position: relative; background: #111; border-radius: 8px; overflow: hidden; user-select: none; touch-action: none; }
.view canvas, .view img { display: block; width: 100%; height: auto; }
.split { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.4); cursor: ew-resize; }
.split::after { content: "⇆"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: #fff; color: #222; border-radius: 50%; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.tag { position: absolute; top: 8px; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; border-radius: 6px; padding: 2px 8px; }
.tag.l { left: 8px; } .tag.r { right: 8px; }
.controls { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; font-size: 13px; }
.controls label { display: flex; align-items: center; gap: 8px; }
.controls input[type=range] { width: 160px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; }
.grid button { border: 2px solid transparent; border-radius: 8px; background: #2d2d2d; color: #ddd; padding: 0 0 4px; cursor: pointer; font: inherit; font-size: 11.5px; overflow: hidden; text-align: center; }
.grid button img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; margin-bottom: 3px; }
.grid button.on { border-color: #e87d0d; color: #fff; }
.facts { font-size: 12.5px; color: #bbb; }
.facts code { color: #ffd2a3; }
.player { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.player input[type=range] { flex: 1; min-width: 140px; }
.muted { color: #9a9a9a; }
@media (max-width: 900px) { .body { grid-template-columns: 1fr; } .guide { order: 2; } }
@media (max-width: 600px) { #demo { padding: 10px 12px 14px; } .controls input[type=range] { width: 120px; } .grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); } }
