:root{
  --bg:#0a0a1a; --bg2:#10102a;
  --p:#7c5cfc; --pk:#ec4899; --c1:#c084fc; --c2:#ec4899;
  --card:rgba(255,255,255,.05); --bd:rgba(124,92,252,.22);
  --tx:#e9e9f5; --mut:rgba(255,255,255,.55);
  --ok:#4ade80; --err:#fb7185;
}
*{margin:0;padding:0;box-sizing:border-box}
html,body{height:100%}
body{
  background:radial-gradient(1200px 600px at 80% -10%,rgba(124,92,252,.18),transparent 60%),
             radial-gradient(900px 500px at -10% 110%,rgba(236,72,153,.15),transparent 55%),
             var(--bg);
  color:var(--tx); font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,'PingFang SC','Microsoft YaHei',sans-serif;
  min-height:100vh; display:flex; flex-direction:column;
}
.top{
  display:flex; align-items:center; justify-content:space-between;
  padding:16px 22px; border-bottom:1px solid var(--bd);
  backdrop-filter:blur(12px); position:sticky; top:0; z-index:10;
  background:rgba(10,10,26,.6);
}
.brand{font-size:18px; font-weight:700; display:flex; align-items:center; gap:8px}
.logo{font-size:22px}
.home{color:var(--c1); text-decoration:none; font-size:14px; font-weight:600}
.home:hover{color:#fff}
.layout{display:flex; flex:1; min-height:0}
.side{
  width:188px; flex-shrink:0; padding:14px 10px; border-right:1px solid var(--bd);
  overflow-y:auto; display:flex; flex-direction:column; gap:4px;
}
.side button{
  display:flex; align-items:center; gap:9px; width:100%; text-align:left;
  background:transparent; border:0; color:var(--mut); padding:11px 12px;
  border-radius:11px; cursor:pointer; font-size:14px; font-weight:600; transition:.18s;
}
.side button:hover{background:var(--card); color:var(--tx)}
.side button.active{
  background:linear-gradient(90deg,rgba(124,92,252,.25),rgba(236,72,153,.18));
  color:#fff; box-shadow:inset 0 0 0 1px var(--bd);
}
.side .em{font-size:17px; width:20px; text-align:center}
.main{flex:1; padding:22px; overflow-y:auto}
.foot{padding:14px; text-align:center; color:var(--mut); font-size:12px; border-top:1px solid var(--bd)}

.tool{animation:fade .25s ease}
@keyframes fade{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
.tool h2{font-size:20px; margin-bottom:4px}
.tool .sub{color:var(--mut); font-size:13px; margin-bottom:16px}
.row{display:flex; gap:10px; flex-wrap:wrap; margin-bottom:12px; align-items:center}
textarea,input[type=text],input[type=number],select{
  width:100%; background:rgba(0,0,0,.28); border:1px solid var(--bd); color:var(--tx);
  border-radius:12px; padding:12px 14px; font-size:14px; font-family:inherit; outline:none; resize:vertical;
}
textarea{min-height:160px; font-family:'JetBrains Mono',ui-monospace,SFMono-Regular,Menlo,monospace; line-height:1.55}
textarea:focus,input:focus,select:focus{border-color:var(--p); box-shadow:0 0 0 3px rgba(124,92,252,.18)}
.half{display:grid; grid-template-columns:1fr 1fr; gap:12px}
.col{display:flex; flex-direction:column; gap:8px}
label{font-size:13px; color:var(--mut); font-weight:600}
.btn{
  display:inline-flex; align-items:center; gap:6px; padding:10px 18px; border-radius:11px;
  border:0; cursor:pointer; font-size:14px; font-weight:700; font-family:inherit;
  background:linear-gradient(90deg,var(--p),var(--pk)); color:#fff; transition:.18s;
}
.btn:hover{filter:brightness(1.08); transform:translateY(-1px)}
.btn.ghost{background:var(--card); color:var(--tx); box-shadow:inset 0 0 0 1px var(--bd)}
.btn.ghost:hover{background:rgba(255,255,255,.09)}
.btn:disabled{opacity:.5; cursor:not-allowed; transform:none}
.grid2{display:grid; grid-template-columns:1fr 1fr; gap:14px}
@media(max-width:760px){
  .side{width:100%; flex-direction:row; overflow-x:auto; border-right:0; border-bottom:1px solid var(--bd)}
  .side button{width:auto; white-space:nowrap}
  .half,.grid2{grid-template-columns:1fr}
  .layout{flex-direction:column}
}
.msg{font-size:13px; margin-top:8px; min-height:18px}
.msg.ok{color:var(--ok)} .msg.err{color:var(--err)}
.swatch{width:100%; height:64px; border-radius:12px; border:1px solid var(--bd)}
.pick{width:60px; height:40px; padding:0; border:1px solid var(--bd); border-radius:10px; background:none; cursor:pointer}
.out{border:1px dashed var(--bd); border-radius:12px; padding:14px; background:rgba(0,0,0,.2); font-size:14px; word-break:break-all; white-space:pre-wrap; min-height:48px}
canvas{max-width:100%}
.qrbox{display:flex; justify-content:center; padding:18px; background:#fff; border-radius:14px; width:max-content; margin:0 auto}
.stat{display:flex; gap:10px; flex-wrap:wrap}
.stat .b{flex:1; min-width:120px; background:var(--card); border:1px solid var(--bd); border-radius:12px; padding:14px}
.stat .b b{font-size:22px; display:block}
.stat .b span{font-size:12px; color:var(--mut)}
a.dl{color:var(--c1); font-weight:600}
.tip{font-size:12px; color:var(--mut); margin-top:6px}
.chips{display:flex; gap:8px; flex-wrap:wrap}
.chip{background:var(--card); border:1px solid var(--bd); border-radius:20px; padding:6px 14px; font-size:13px; font-family:ui-monospace,monospace}
