:root {
  --bg: #0b0b12; --panel: #13131d; --panel-2: #1a1a27; --line: #26263a;
  --text: #ececf4; --muted: #9a9ab0; --accent: #8b5cf6; --accent-2: #22d3ee; --ok: #22c55e;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 "Inter", system-ui, sans-serif; }
a { color: inherit; }
img { max-width: 100%; display: block; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* header */
header.top { position: sticky; top: 0; z-index: 10; background: #0b0b12cc; backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
header.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.logo { white-space: nowrap; font-weight: 800; font-size: 20px; text-decoration: none; letter-spacing: -.3px; display: flex; align-items: center; gap: 10px; }
.logo i { width: 26px; height: 26px; border-radius: 8px; background: conic-gradient(from 200deg, var(--accent), var(--accent-2), var(--accent)); display: inline-block; }
nav a { color: var(--muted); text-decoration: none; margin-left: 22px; font-weight: 500; }
nav a:hover { color: var(--text); }
nav a.lang { border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px; font-size: 13px; font-weight: 700; color: var(--text); }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 10px; border: 0; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn.primary { background: linear-gradient(135deg, var(--accent), #6d28d9); color: #fff; box-shadow: 0 8px 30px #8b5cf655; }
.btn.ghost { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); }
.btn:hover { filter: brightness(1.1); }
.btn.soon { cursor: default; opacity: .7; justify-content: center; }
.btn.soon:hover { filter: none; }

/* hero */
.hero { text-align: center; padding: 90px 0 60px; position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: -40% -10% auto; height: 520px; background: radial-gradient(closest-side, #8b5cf633, transparent), radial-gradient(closest-side at 70% 60%, #22d3ee22, transparent); z-index: -1; }
.hero h1 { font-size: clamp(34px, 6vw, 64px); line-height: 1.05; margin: 0 0 18px; letter-spacing: -1.5px; }
.hero h1 span { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); font-size: 19px; max-width: 640px; margin: 0 auto 30px; }
.badges { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 26px; color: var(--muted); font-size: 14px; }
.badges span { border: 1px solid var(--line); padding: 6px 12px; border-radius: 999px; }

section { padding: 50px 0; }
h2 { font-size: 32px; letter-spacing: -.6px; margin: 0 0 8px; }
.lead { color: var(--muted); margin: 0 0 28px; }

/* cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 22px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .2s, border-color .2s; }
.card:hover { transform: translateY(-3px); border-color: #3a3a55; }
.card img { aspect-ratio: 16/9; object-fit: cover; background: #000; }
.card .body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card h3 { margin: 0; font-size: 20px; }
.card p { margin: 0; color: var(--muted); flex: 1; }
.tag { font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; align-self: flex-start; }
.tag.free { background: #22c55e22; color: var(--ok); }
.tag.pro { background: linear-gradient(90deg, #8b5cf633, #22d3ee33); color: #c4b5fd; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; counter-reset: s; }
.steps div { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.steps div::before { counter-increment: s; content: counter(s); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); font-weight: 800; margin-bottom: 12px; }
.steps b { display: block; margin-bottom: 4px; }
.steps p { margin: 0; color: var(--muted); font-size: 15px; }

.faq details { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { color: var(--muted); margin: 10px 0 0; }

.ad-slot { border: 1px dashed var(--line); border-radius: 12px; color: #55556a; text-align: center; padding: 30px; font-size: 13px; margin: 20px 0; }

footer { border-top: 1px solid var(--line); color: var(--muted); padding: 30px 0 50px; font-size: 14px; margin-top: 40px; }

/* guides */
.article { max-width: 760px; padding-top: 30px; padding-bottom: 40px; font-size: 17px; line-height: 1.7; }
.article h1 { font-size: clamp(30px, 5vw, 44px); line-height: 1.15; letter-spacing: -1px; margin: 10px 0 20px; }
.article h2 { font-size: 24px; margin: 36px 0 10px; }
.article p, .article li { color: #d4d4e0; }
.article a:not(.btn) { color: var(--accent-2); }
.article code { background: var(--panel-2); padding: 1px 6px; border-radius: 5px; font-size: .9em; }
.article li { margin-bottom: 6px; }
.crumbs { margin: 0; font-size: 14px; }
.crumbs a { color: var(--muted) !important; text-decoration: none; }
.guides { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.guides a { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; text-decoration: none; font-weight: 600; }
.guides a:hover { border-color: var(--accent); }
.guides small { display: block; color: var(--muted); font-weight: 400; margin-top: 4px; }

/* themes */
.swatch { display: inline-flex; gap: 4px; vertical-align: middle; }
.swatch i { width: 16px; height: 16px; border-radius: 50%; border: 1px solid #ffffff33; display: inline-block; }
.thumb { position: relative; aspect-ratio: 16/9; overflow: hidden; background: #000; }
.thumb iframe { position: absolute; left: 50%; top: 50%; border: 0; transform-origin: center; pointer-events: none; }
.thumb.checker { background: repeating-conic-gradient(#15151f 0 25%, #1b1b28 0 50%) 0 0 / 20px 20px; }
.theme-card { text-decoration: none; }
.kit-card .row { display: flex; gap: 8px; flex-wrap: wrap; }
.kit-card .row .btn { flex: 1; justify-content: center; padding: 10px 14px; }
.kit-card .need { color: #fcd34d; font-size: 14px; flex: 0; }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.personal { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-bottom: 28px; }
.page-head h1 { font-size: clamp(30px, 5vw, 46px); letter-spacing: -1px; margin: 10px 0 8px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.page-head .swatch i { width: 22px; height: 22px; }

/* editor */
.editor { display: grid; grid-template-columns: 360px 1fr; gap: 24px; padding: 24px 0 40px; align-items: start; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.panel h1 { font-size: 22px; margin: 0 0 4px; }
.panel .lead { margin-bottom: 18px; font-size: 14px; }
.picker { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.picker a { font-size: 13px; padding: 6px 10px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); text-decoration: none; color: var(--muted); }
.picker a.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #c9c9d9; }
.field input, .field select { width: 100%; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); border-radius: 9px; padding: 10px 12px; font: inherit; font-size: 15px; }
.field input:focus, .field select:focus { outline: 2px solid var(--accent); border-color: transparent; }
.field input[type=color] { padding: 4px; height: 42px; cursor: pointer; }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #9a9ab0 50%), linear-gradient(135deg, #9a9ab0 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.range { display: flex; align-items: center; gap: 12px; }
.range input { flex: 1; padding: 0; accent-color: var(--accent); background: none; border: 0; }
.range output { min-width: 38px; text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 14px; }
.more { margin-top: 6px; border-top: 1px solid var(--line); padding-top: 14px; }
.more summary { cursor: pointer; font-weight: 700; font-size: 14px; color: #c4b5fd; margin-bottom: 14px; list-style: none; }
.more summary::before { content: "＋ "; }
.more[open] summary::before { content: "－ "; }
.field small { display: block; color: var(--muted); font-size: 12px; margin-top: 5px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { flex: 1 0 auto; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 13px; cursor: pointer; }
.seg button.on { background: #8b5cf633; border-color: var(--accent); color: #fff; }

.stage { position: sticky; top: 88px; }
.screen { position: relative; width: 100%; aspect-ratio: 16/9; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line);
  background: repeating-conic-gradient(#15151f 0 25%, #1b1b28 0 50%) 0 0 / 24px 24px; }
.screen iframe { position: absolute; left: 50%; top: 50%; border: 0; transform-origin: center; background: transparent; }
.out { margin-top: 16px; }
.url { display: flex; gap: 8px; }
.url input { flex: 1; min-width: 0; background: #07070c; border: 1px solid var(--line); color: #a5f3fc; border-radius: 9px; padding: 12px; font: 13px/1.3 ui-monospace, monospace; }
.obs { margin-top: 14px; color: var(--muted); font-size: 14px; }
.obs ol { margin: 6px 0 0; padding-left: 20px; }
.obs code { background: var(--panel-2); padding: 1px 6px; border-radius: 5px; color: var(--text); }
.note { background: #22d3ee14; border: 1px solid #22d3ee44; color: #a5f3fc; border-radius: 10px; padding: 10px 12px; font-size: 14px; margin: 0 0 16px; }
.mine { margin-top: 16px; }
.mine h2 { font-size: 18px; margin: 0 0 10px; }
.mine label { display: block; font-size: 13px; font-weight: 600; color: #c9c9d9; margin: 16px 0 6px; }
.muted { color: var(--muted); font-size: 14px; margin: 0; }
.saved { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.saved li { display: flex; align-items: center; gap: 8px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 8px 8px 8px 12px; }
.saved a { flex: 1; text-decoration: none; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved a:hover { color: var(--accent-2); }
.saved button { background: none; border: 0; color: var(--muted); font-size: 18px; cursor: pointer; padding: 0 6px; }
.saved button:hover { color: #f87171; }
.demo-note { margin: 10px 0 0; padding: 10px 14px; border-radius: 10px; background: #f59e0b1a; border: 1px solid #f59e0b55; color: #fcd34d; font-size: 14px; }
.field input.invalid { outline: 2px solid #f87171; border-color: transparent; animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px); background: var(--ok); color: #04210f; font-weight: 700; padding: 12px 20px; border-radius: 10px; transition: transform .25s, opacity .25s; opacity: 0; pointer-events: none; }
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

@media (max-width: 900px) {
  .editor { grid-template-columns: 1fr; }
  .stage { position: static; order: -1; }
  nav a:not(.btn):not(.lang) { display: none; }
  nav .btn { padding: 9px 14px; white-space: nowrap; }
}
