:root{
  --bg:#0b0c10;
  --panel:#12131a;
  --card:#161824;
  --text:#e8e9ef;
  --muted:#a9abc0;
  --line:#2a2d40;
  --accent:#7aa2ff;
  --good:#7bffa7;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,"PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;
  background:linear-gradient(180deg,#0b0c10 0%, #0a0b0f 100%);
  color:var(--text);
}
.topbar{
  display:flex;align-items:center;justify-content:space-between;
  padding:14px 18px;border-bottom:1px solid var(--line);
  position:sticky;top:0;background:rgba(11,12,16,.85);backdrop-filter: blur(10px);z-index:5;
}
.brand{display:flex;gap:12px;align-items:center}
.dot{width:12px;height:12px;border-radius:10px;background:var(--accent);box-shadow:0 0 22px rgba(122,162,255,.35)}
.title{font-weight:700;letter-spacing:.2px}
.sub{font-size:12px;color:var(--muted);margin-top:2px}
.right{display:flex;align-items:center;gap:14px}
.link{color:var(--muted);text-decoration:none}
.link:hover{color:var(--text)}
.ver{font-size:12px;color:var(--muted)}
.layout{display:grid;grid-template-columns: 460px 1fr;gap:14px;padding:14px;align-items:start}
@media (max-width: 1050px){
  .layout{grid-template-columns:1fr; }
}
.panel{
  background:rgba(18,19,26,.85);
  border:1px solid var(--line);
  border-radius:16px;
  padding:12px;
  box-shadow:0 10px 30px rgba(0,0,0,.25);
}
.group{padding:10px;border-radius:14px;background:rgba(22,24,36,.55);border:1px solid rgba(42,45,64,.75);margin-bottom:12px}
.gtitle{font-weight:700;margin-bottom:8px}
textarea{
  width:100%;
  height:220px;
  resize:vertical;
  padding:12px 12px;
  border-radius:12px;
  border:1px solid rgba(42,45,64,.85);
  background:rgba(10,11,15,.55);
  color:var(--text);
  outline:none;
  line-height:1.5;
}
textarea:focus{border-color:rgba(122,162,255,.6);box-shadow:0 0 0 4px rgba(122,162,255,.12)}
.row{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-top:10px}
.btn{
  border:1px solid rgba(42,45,64,.95);
  background:rgba(255,255,255,.04);
  color:var(--text);
  padding:8px 12px;
  border-radius:12px;
  cursor:pointer;
  user-select:none;
}
.btn:hover{background:rgba(255,255,255,.07)}
.btn.primary{background:rgba(122,162,255,.18);border-color:rgba(122,162,255,.35)}
.btn.primary:hover{background:rgba(122,162,255,.25)}
.btn.ghost{background:transparent}
.file{
  display:inline-flex;align-items:center;gap:10px;
  padding:8px 12px;border-radius:12px;border:1px dashed rgba(42,45,64,.95);
  color:var(--muted);cursor:pointer;
}
.file input{display:none}
.grid2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px;
}
@media (max-width: 520px){
  .grid2{grid-template-columns:1fr}
}
.field{
  display:flex;flex-direction:column;gap:6px;
  font-size:12px;color:var(--muted);
}
.field.small{max-width:220px}
input,select{
  width:100%;
  padding:8px 10px;
  border-radius:12px;
  border:1px solid rgba(42,45,64,.85);
  background:rgba(10,11,15,.55);
  color:var(--text);
  outline:none;
}
input:focus,select:focus{border-color:rgba(122,162,255,.6);box-shadow:0 0 0 4px rgba(122,162,255,.12)}
.toggle{display:flex;gap:8px;align-items:center;color:var(--muted);font-size:12px}
.toggle input{width:auto}
.hint{font-size:12px;color:var(--muted)}
.note{margin-top:10px;color:var(--muted);font-size:12px;line-height:1.4}
.preview{
  background:rgba(18,19,26,.55);
  border:1px solid var(--line);
  border-radius:16px;
  padding:12px;
  min-height:420px;
  box-shadow:0 10px 30px rgba(0,0,0,.25);
}
.phead{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:10px}
.pager{display:flex;gap:10px;align-items:center}
.zoom{color:var(--muted);font-size:12px}
.canvasWrap{
  background:rgba(10,11,15,.55);
  border:1px solid rgba(42,45,64,.85);
  border-radius:14px;
  padding:12px;
  overflow:auto;
  max-height: calc(100vh - 180px);
}
canvas{display:block;margin:auto;border-radius:10px;box-shadow:0 12px 35px rgba(0,0,0,.35)}
.foot{padding:10px 18px;color:var(--muted);border-top:1px solid var(--line);display:flex;gap:10px;flex-wrap:wrap}
.sep{opacity:.5}

/* background upload */
#bgFile{padding:10px;background:var(--card);border:1px dashed var(--line);border-radius:12px;}
