:root { --bg:#0f1115; --panel:#171a21; --line:#2a2f3a; --text:#e8eaf0; --muted:#8b93a7; --accent:#ff7a1a; --accent2:#ffa05c; --err:#ff5c5c; --ok:#4cd17c; }
* { box-sizing: border-box; }
body { margin:0; font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif; background:var(--bg); color:var(--text); }
header { padding:18px 24px 6px; }
h1 { margin:0; font-size:26px; letter-spacing:.3px; }
h1::before { content:"◆ "; color:var(--accent); }
.sub { margin:4px 0 0; color:var(--muted); }
main { display:grid; grid-template-columns: minmax(320px, 440px) 1fr; gap:20px; padding:16px 24px 24px; }
@media (max-width: 860px) { main { grid-template-columns: 1fr; } .right { order:-1; } }
label { display:block; font-weight:600; margin-bottom:6px; }
textarea, input { width:100%; background:var(--panel); color:var(--text); border:1px solid var(--line); border-radius:10px; padding:10px 12px; font:inherit; }
textarea:focus, input:focus { outline:none; border-color:var(--accent); }
#code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size:12.5px; line-height:1.45; margin-top:10px; }
button { background:#232836; color:var(--text); border:1px solid var(--line); border-radius:10px; padding:9px 14px; font:inherit; cursor:pointer; white-space:nowrap; }
button:hover:not(:disabled) { border-color:var(--accent); }
button:disabled { opacity:.45; cursor:not-allowed; }
button.primary { background:var(--accent); border-color:var(--accent); color:#1a0d00; font-weight:700; }
button.primary:hover:not(:disabled) { background:var(--accent2); }
.row { display:flex; gap:10px; align-items:center; margin-top:10px; }
.row.between { justify-content:space-between; }
.examples { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.chip { font-size:12.5px; padding:5px 10px; border-radius:999px; background:#1d212b; }
.card { background:var(--panel); border:1px solid var(--line); border-radius:12px; padding:12px; margin-top:14px; }
summary { cursor:pointer; font-weight:600; }
.muted { color:var(--muted); font-weight:400; }
.status { color:var(--muted); font-size:14px; }
.status.err { color:var(--err); } .status.ok { color:var(--ok); }
.hidden { display:none; }
#viewer { position:relative; width:100%; height:min(68vh, 640px); min-height:340px; background:radial-gradient(circle at 50% 35%, #1f2430, #0c0e12); border:1px solid var(--line); border-radius:14px; overflow:hidden; }
#viewer canvas { display:block; }
#placeholder { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; color:var(--muted); gap:6px; }
#log { white-space:pre-wrap; font-size:12px; max-height:260px; overflow:auto; color:var(--muted); }
.tip { font-size:13px; }
.spinner { display:inline-block; width:14px; height:14px; border:2px solid var(--muted); border-top-color:var(--accent); border-radius:50%; animation:spin .8s linear infinite; vertical-align:-2px; margin-right:6px; }
@keyframes spin { to { transform:rotate(360deg); } }
