:root {
  --bg: #0f1420;
  --panel: #171d2b;
  --panel2: #1e2637;
  --line: #2b3448;
  --text: #e6eaf2;
  --muted: #8b95ab;
  --accent: #4f8cff;
  --accent2: #f551a2;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  display: flex; flex-direction: column;
}
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--panel);
}
.brand { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.logo { width: 14px; height: 14px; border-radius: 3px; background: linear-gradient(135deg, #4f8cff 50%, #f551a2 50%); display: inline-block; }
.brand span { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 8px; }
.head-actions { display: flex; gap: 8px; align-items: center; }

main { flex: 1; display: grid; grid-template-columns: 268px 1fr 220px; min-height: 0; }
aside { background: var(--panel); overflow-y: auto; padding: 12px; }
#panel { border-right: 1px solid var(--line); }
#side { border-left: 1px solid var(--line); }

#stage {
  display: flex; align-items: center; justify-content: center;
  overflow: auto; padding: 16px; background:
    radial-gradient(circle at 25% 15%, #1a2438 0%, transparent 55%),
    radial-gradient(circle at 80% 80%, #1b2030 0%, transparent 50%), var(--bg);
}
#empty { color: var(--muted); }
canvas { image-rendering: pixelated; border-radius: 6px; box-shadow: 0 8px 30px rgba(0,0,0,.45); background: #fff; }
.hidden { display: none !important; }

/* controls */
label { display: block; margin: 10px 0; font-size: 12px; color: var(--muted); }
label > input, label > select { width: 100%; margin-top: 4px; }
input[type=text], input[type=number], input:not([type]), select {
  background: var(--panel2); color: var(--text); border: 1px solid var(--line);
  border-radius: 6px; padding: 6px 8px; font: inherit; outline: none;
}
input:focus, select:focus { border-color: var(--accent); }
input[type=color] { padding: 2px; height: 32px; background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; width: 100%; }
input[type=range] { width: 100%; accent-color: var(--accent); }
.slider b { float: right; color: var(--text); font-weight: 600; }
.check { display: flex; align-items: center; gap: 6px; color: var(--text); }
.check input { width: auto; margin: 0; }
.checkbox input { margin: 0; }

button {
  background: var(--panel2); color: var(--text); border: 1px solid var(--line);
  border-radius: 7px; padding: 6px 10px; font: inherit; cursor: pointer;
}
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.wide { width: 100%; margin-top: 8px; }
button.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.tabs { display: flex; gap: 4px; margin-bottom: 8px; }
.tab { flex: 1; padding: 5px 0; font-size: 12px; }
.pane { padding-bottom: 4px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }

.drop {
  border: 2px dashed var(--line); border-radius: 10px; padding: 18px 10px;
  text-align: center; color: var(--muted); cursor: pointer; transition: .15s;
}
.drop:hover, .drop.over { border-color: var(--accent); color: var(--text); background: rgba(79,140,255,.08); }
.drop-icon { font-size: 13px; color: var(--muted); letter-spacing: 2px; }
.hint { font-size: 11px; color: var(--muted); margin-top: 6px; }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.tools button { padding: 7px 0; font-size: 12px; }
.current { margin-top: 8px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
#current-swatch { width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--line); display: inline-block; }

/* side */
.stats { font-size: 12px; color: var(--muted); line-height: 1.7; }
.stats b { color: var(--text); }
.sub { font-size: 12px; color: var(--muted); margin: 12px 0 6px; }
.palette { display: flex; flex-direction: column; gap: 3px; }
.swatch {
  display: flex; align-items: center; gap: 7px; padding: 3px 5px;
  border-radius: 6px; cursor: pointer; font-size: 11px; color: var(--muted);
  border: 1px solid transparent;
}
.swatch:hover { background: var(--panel2); }
.swatch.active { border-color: var(--accent); background: rgba(79,140,255,.12); color: var(--text); }
.swatch i { width: 14px; height: 14px; border-radius: 3px; border: 1px solid rgba(255,255,255,.15); flex: none; }
.swatch span { flex: 1; }
.swatch em { font-style: normal; color: var(--text); }
/* 套餐徽标 / 激活弹窗 */
.badge { font-size: 12px; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.badge.free { color: #f0b429; border-color: rgba(240,180,41,.45); background: rgba(240,180,41,.1); }
.badge.day, .badge.week { color: #4f8cff; border-color: rgba(79,140,255,.5); background: rgba(79,140,255,.12); }
.badge.forever { color: #f551a2; border-color: rgba(245,81,162,.5); background: rgba(245,81,162,.12); }
.badge.expired { color: #ff6b6b; border-color: rgba(255,107,107,.45); background: rgba(255,107,107,.1); }
button.ghost { background: transparent; }
.modal { position: fixed; inset: 0; background: rgba(8,11,18,.72); display: flex; align-items: center; justify-content: center; z-index: 50; backdrop-filter: blur(2px); }
.modal-card { width: min(420px, calc(100vw - 32px)); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.modal-card h3 { margin: 0 0 6px; font-size: 16px; }
.modal-card input { width: 100%; margin: 10px 0; font: 600 16px/1.4 ui-monospace, monospace; letter-spacing: 2px; text-align: center; text-transform: uppercase; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }
.msg { font-size: 12px; min-height: 18px; color: #ff8f8f; }
.msg.ok { color: #6ee7a8; }
.buy { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }

/* 页脚（署名 + 法律链接） */
#site-footer {
  border-top: 1px solid var(--line);
  background: var(--panel);
  padding: 8px 16px;
  font-size: 12px;
  color: var(--muted);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
#site-footer a { color: var(--muted); text-decoration: none; }
#site-footer a:hover { color: var(--accent); text-decoration: underline; }
#site-footer .foot-links a { margin-right: 12px; }
#site-footer .sep { margin-right: 12px; }
#site-footer .foot-credit { font-size: 11px; }
