/* 印章生成器 - 界面样式（对齐 395 的视觉语言：银灰控制条 + 密集控件） */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 12px/1.5 "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", Arial, sans-serif;
  color: #333; background: #f2f2f2;
  -webkit-font-smoothing: antialiased;
}
a { color: #036; text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font-family: inherit; font-size: 12px; }

@font-face {
  font-family: "SealSong";
  src: url("fonts/sy-song-bold.woff2") format("woff2");
  font-weight: bold; font-style: normal; font-display: swap;
}

/* ---------- 顶栏 ---------- */
#header { background: #fff; border-bottom: 1px solid #e2e2e2; position: relative; z-index: 30; }
#header .hd-in { max-width: 1320px; margin: 0 auto; padding: 0 14px; height: 52px; display: flex; align-items: center; gap: 18px; }
#header .logo { font-size: 19px; font-weight: 700; color: #036; letter-spacing: .5px; white-space: nowrap; }
#header .logo em { color: #A259FF; font-style: normal; }
#header .logo span { font-size: 11px; color: #999; font-weight: 400; margin-left: 6px; letter-spacing: 0; }
#nav { display: flex; align-items: center; gap: 2px; overflow-x: auto; scrollbar-width: none; }
#nav::-webkit-scrollbar { display: none; }
#nav a {
  padding: 6px 10px; border-radius: 4px; color: #444; white-space: nowrap;
  font-size: 12.5px; border: 1px solid transparent;
}
#nav a:hover { background: #f4f0ff; color: #7c3aed; text-decoration: none; }
#nav a.on { background: #A259FF; color: #fff; }
.hd-right { margin-left: auto; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.hd-right .tip { color: #999; font-size: 11px; }

/* ---------- 控制条 ---------- */
#sfbar {
  background-image: linear-gradient(to top, #F9F9F9, #EEEEEE);
  border-bottom: 1px solid #dcdcdc; position: relative; z-index: 20;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
#sfbar .bar-in { max-width: 1320px; margin: 0 auto; padding: 7px 10px; }
#sfbar .row { display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; }
#sfbar .row + .row { margin-top: 6px; padding-top: 6px; border-top: 1px dashed #d8d8d8; }
.fld { display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; border-right: 1px solid #e0e0e0; }
.fld:last-child { border-right: 0; }
.fld > label { color: #555; white-space: nowrap; }
.fld input[type=text] { border: 1px solid #c9c9c9; border-radius: 3px; padding: 3px 6px; outline: none; background: #fff; }
.fld input[type=text]:focus { border-color: #A259FF; box-shadow: 0 0 0 2px rgba(162,89,255,.15); }
.fld select { border: 1px solid #c9c9c9; border-radius: 3px; padding: 2px 3px; background: #fff; outline: none; max-width: 100%; }
.fld select:focus { border-color: #A259FF; }
.fld input[type=color] { width: 30px; height: 22px; padding: 0; border: 1px solid #c9c9c9; border-radius: 3px; background: #fff; cursor: pointer; }
.fld .u { color: #999; }
.mini { border: 1px solid #c9c9c9; background: #fff; border-radius: 3px; padding: 3px 7px; cursor: pointer; color: #333; }
.mini:hover { background: #f7f4ff; border-color: #b98cff; color: #7c3aed; }
.mini.on { background: #A259FF; border-color: #A259FF; color: #fff; }
.sep { width: 1px; align-self: stretch; background: #e0e0e0; margin: 2px 4px; }
.grp { display: inline-flex; align-items: center; gap: 3px; padding: 2px 6px; border-right: 1px solid #e0e0e0; }
.grp b { color: #036; font-weight: 600; margin-right: 2px; }
.sub { border: 1px dashed #d0d0d0; border-radius: 4px; padding: 4px 6px; background: rgba(255,255,255,.6); }
.hint { color: #999; font-size: 11px; }
.warn { color: #c00; font-size: 11px; }
.bad { color: #b00; background: #fff0f0; border-color: #f3c9c9 !important; }

/* ---------- 按钮 ---------- */
.btn { border: 0; border-radius: 4px; padding: 6px 14px; cursor: pointer; color: #fff; font-size: 12.5px; }
.btn:active { transform: translateY(1px); }
.btn-pri { background-color: #A259FF; }
.btn-pri:hover { background-color: #8f3ff5; }
.btn-sec { background-color: #036; }
.btn-sec:hover { background-color: #024; }
.btn-ghost { background: #fff; border: 1px solid #c9c9c9; color: #333; }
.btn-ghost:hover { border-color: #A259FF; color: #7c3aed; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- 预览台 ---------- */
#stage { max-width: 1320px; margin: 14px auto; padding: 0 10px; }
#sfcon1 {
  background-image: linear-gradient(to top, #F9F9F9, #EEEEEE);
  border: 1px solid #dcdcdc; border-radius: 6px; padding: 16px;
  display: flex; gap: 16px; align-items: flex-start; justify-content: center; flex-wrap: wrap;
}
#sfcon2 { flex: 0 0 auto; }
#sfcanvas-box {
  background: #fff; border: 1px solid #e0e0e0; border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0,0,0,.07); padding: 10px; position: relative;
}
#sfcanvas-box.checker {
  background-color: #fff;
  background-image: linear-gradient(45deg,#eee 25%,transparent 25%),linear-gradient(-45deg,#eee 25%,transparent 25%),
                    linear-gradient(45deg,transparent 75%,#eee 75%),linear-gradient(-45deg,transparent 75%,#eee 75%);
  background-size: 16px 16px; background-position: 0 0,0 8px,8px -8px,-8px 0;
}
#cv { display: block; touch-action: none; }
#side { flex: 1 1 300px; max-width: 460px; min-width: 280px; }
.panel { background: #fff; border: 1px solid #e4e4e4; border-radius: 6px; padding: 12px 14px; margin-bottom: 10px; }
.panel h4 { margin: 0 0 8px; font-size: 13px; color: #036; font-weight: 600; }
.panel .k { color: #888; }
.panel code { background: #f6f6f6; padding: 1px 4px; border-radius: 3px; font-family: Consolas, monospace; color: #555; }
.stat { display: flex; flex-wrap: wrap; gap: 4px 14px; color: #777; font-size: 11.5px; }
.stat b { color: #036; font-weight: 600; }
#drop { border: 2px dashed #cfcfcf; border-radius: 6px; padding: 22px 12px; text-align: center; color: #999; cursor: pointer; background: #fafafa; }
#drop:hover, #drop.on { border-color: #A259FF; background: #faf7ff; color: #7c3aed; }

/* ---------- 弹窗 ---------- */
.jqm { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 100; display: none; align-items: center; justify-content: center; padding: 20px; }
.jqm.open { display: flex; }
.jqm .box { background: #fff; border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,.3); width: 100%; max-width: 720px; max-height: 84vh; display: flex; flex-direction: column; }
.jqm .hd { padding: 11px 14px; border-bottom: 1px solid #eee; display: flex; align-items: center; }
.jqm .hd b { font-size: 14px; color: #036; }
.jqm .hd .x { margin-left: auto; cursor: pointer; color: #999; font-size: 18px; line-height: 1; border: 0; background: none; }
.jqm .hd .x:hover { color: #c00; }
.jqm .bd { padding: 14px; overflow: auto; }
.jqm .ft { padding: 10px 14px; border-top: 1px solid #eee; display: flex; gap: 8px; justify-content: flex-end; }

.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.fitem { border: 1px solid #e0e0e0; border-radius: 4px; padding: 8px 4px; text-align: center; cursor: pointer; background: #fff; }
.fitem:hover { border-color: #A259FF; background: #faf7ff; }
.fitem .nm { font-size: 17px; margin-bottom: 4px; color: #222; }
.fitem .lb { font-size: 11px; color: #777; }
.fitem.na { opacity: .42; cursor: not-allowed; background: #f7f7f7; }
.fitem.na:hover { border-color: #e0e0e0; background: #f7f7f7; }
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; }
.titem { border: 1px solid #e0e0e0; border-radius: 4px; padding: 6px; cursor: pointer; text-align: center; background: #fff; }
.titem:hover { border-color: #A259FF; box-shadow: 0 2px 8px rgba(162,89,255,.2); }
.titem canvas { display: block; width: 100%; height: auto; }
.titem .lb { font-size: 11px; color: #666; margin-top: 4px; }
.saveopt { display: flex; align-items: center; gap: 7px; padding: 7px 0; border-bottom: 1px dashed #eee; }
.saveopt:last-child { border-bottom: 0; }
.saveopt label { flex: 1; }
.frow { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; flex-wrap: wrap; }
.frow > label { width: 62px; color: #555; flex: 0 0 auto; }
.frow input[type=range] { flex: 1 1 120px; }
.toast {
  position: fixed; left: 50%; top: 76px; transform: translateX(-50%);
  background: rgba(30,30,30,.9); color: #fff; padding: 8px 18px; border-radius: 20px;
  font-size: 12.5px; z-index: 200; opacity: 0; transition: opacity .25s; pointer-events: none;
}
.toast.on { opacity: 1; }
footer { text-align: center; color: #aaa; font-size: 11px; padding: 18px 10px 30px; }
@media (max-width: 760px) {
  #header .hd-in { height: auto; padding: 8px 10px; flex-wrap: wrap; gap: 8px; }
  .hd-right { width: 100%; }
  #sfcanvas-box { padding: 6px; }
}
